我们正在使用以下代码通过 terraform 创建 azure 监视器警报。azurerm 提供了一个字段来自定义电子邮件主题。但它似乎永远不会奏效。电子邮件主题总是有类似的东西
“解雇:Sev4 Azure Monitor Alert [alert-name] at [time]”
如何通过 terraform 自定义 Azure Monitor 警报的电子邮件主题?
resource "azurerm_monitor_scheduled_query_rules_alert" "example" {
name = format("%s-queryrule", var.prefix)
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
action {
action_group = []
email_subject = "Email Header" // This never works !!!
}
data_source_id = azurerm_application_insights.example.id
description = "Alert when total results cross threshold"
enabled = true
query = <<-QUERY
requests
| where tolong(resultCode) >= 500
| summarize count() by bin(timestamp, 5m)
QUERY
}