Hi, there,
The scopes in https://www.terraform.io/docs/providers/azurerm/r/monitor_metric_alert.html is supposed to take a list per doc, but it’s not working….
I can create an alert on one VM without the problem, but I can’t create an alert on multiple VMs or all VMs in resource group of networkeast (resource group level), do you have work around?
I heard that AWZ support resource group level creation, but ARM seems not?
…
resource “azurerm_monitor_metric_alert” “vm-cpu” {
name =“vm-cpu-metric-alert”
resource_group_name = azurerm_resource_group.jie-test-terraform.name
#scopes = ["/subscriptions/00c2f406-8a8d-4e76-xxxxxxxxx/resourcegroups/networkeast/providers/microsoft.compute/virtualmachines/jie-test01"]
scopes = ["/subscriptions/00c2f406-8a8d-4e76-b898-xxxxxxxxx/resourcegroups/networkeast"]
description = “Action will be triggered when Transactions count is greater than 90.”
severity = “1”
frequency = “PT5M”
window_size = “PT15M” #
criteria {
metric_namespace = “Microsoft.Compute/virtualMachines”
metric_name = “Percentage CPU”
aggregation = “Average”
operator = “GreaterThan”
threshold = 90
}
}
I can’t even list 2 VMs in the scopes, like:
scopes = ["/subscriptions/00c2f406-8a8d-4e76-b898-xxxxxxxx/resourcegroups/networkeast/providers/microsoft.compute/virtualmachines/jie-test01","/subscriptions/00c2f406-8a8d-4e76-b898-xxxxxxx/resourcegroups/networkeast/providers/microsoft.compute/virtualmachines/jie-test02"]