【问题标题】:What should be the operation name for creating a monitor alert using terraform使用 terraform 创建监控警报的操作名称应该是什么
【发布时间】:2021-11-21 08:05:26
【问题描述】:

我正在尝试为虚拟机创建 2 个警报

  1. 已删除
  2. 关机

我知道我必须使用下面的代码来创建基于操作的警报,但无法弄清楚操作名称和类别应该是什么:

resource "azurerm_monitor_activity_log_alert" "main" {
  name                = "example-activitylogalert"
  resource_group_name = azurerm_resource_group.main.name
  scopes              = [azurerm_resource_group.main.id]
  description         = "description"

  criteria {
    resource_id    = azurerm_virtual_machine.example.id
    operation_name = "??"
    category= "??"
  }
}

【问题讨论】:

    标签: terraform-provider-azure azure-monitor


    【解决方案1】:

    对于这些操作,类别应始终为Administrative,对于第一个操作名称,您应使用"Microsoft.Compute/virtualMachines/delete",另一个应使用Microsoft.Compute/virtualMachines/PowerOff/Action

    注意:如果您不确定要使用哪些操作,您可以转到活动并从门户创建警报以供参考。

    参考:

    Create, view, and manage activity log alerts in Azure Monitor - Azure Monitor | Microsoft Docs

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-08-08
      • 2021-10-02
      • 2016-10-27
      • 2022-11-10
      • 2021-10-05
      • 2014-11-27
      • 2021-07-11
      • 1970-01-01
      相关资源
      最近更新 更多