I'm trying to use terraform to create resource health alert, it's pretty simple very terraform
resource "azurerm_monitor_activity_log_alert" "resourcehealth" {
name = "${var.client_initial}-MCS Optimise Resource Health"
description = "${var.client_initial}-MCS Optimise Resource Health Alerts"
resource_group_name = var.resource_group_name
scopes = [var.scopes]
criteria {
category = "ResourceHealth"
}
action {
action_group_id = var.action_group_id
}
tags = var.tags
}
However, i found it's lack of ability to further set granual alert condition, like we only want alerted on when current resource status is degraded or unavailable, and reson type is platform initiated. Terraform seems to be giving all to all the conditions.