You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When AKS has monitor attached then depends_on field for Monitor is not AKS RES. So failing to apply
resource. "azurerm_monitor_action_group" should depend on AKS, "azurerm_monitor_metric_alert" should depend on "azurerm_monitor_action_group". But when exported its depends on Resource Group only which leads to fail when apply...
The logic of how aztfexport resolve the dependency is that it traverse the properties of each resource. If there is any string property that case sensitively equals to any tracked resource id in TF, then that trakced resource is added as a dependency.
This explains why azurerm_monitor_action_group is just azurerm_resource_group.
Also, as the action_group_id of the azurerm_monitor_metric_alert has the wrong case, e.g. "/subscriptions/ceaa9e66-993b-4b12-b3c2-e13d7ec61e71/resourceGroups/terragen-rg/providers/Microsoft.Insights/ActionGroups/RecommendedAlertRules-AG-1" (should be lower cased a). The dependency on azurerm_monitor_action_group is also not added. This is a provider bug needs to be fixed.
When AKS has monitor attached then depends_on field for Monitor is not AKS RES. So failing to apply
resource. "azurerm_monitor_action_group" should depend on AKS, "azurerm_monitor_metric_alert" should depend on "azurerm_monitor_action_group". But when exported its depends on Resource Group only which leads to fail when apply...
"azurerm_monitor_action_group" "res-12" {
name = "RecommendedAlertRules-AG-1"
resource_group_name = "terragen-rg"
short_name = "recalert1"
email_receiver {
email_address = "soumik.mukherjee@ascendion.com"
name = "Email_-EmailAction-"
use_common_alert_schema = true
}
depends_on = [
azurerm_resource_group.res-0,
]
}
resource "azurerm_monitor_metric_alert" "res-13" {
auto_mitigate = false
frequency = "PT5M"
name = "CPU Usage Percentage - terragen-aks"
resource_group_name = "terragen-rg"
scopes = ["/subscriptions/ceaa9e66-993b-4b12-b3c2-e13d7ec61e71/resourcegroups/terragen-rg/providers/Microsoft.ContainerService/managedClusters/terragen-aks"]
action {
action_group_id = "/subscriptions/ceaa9e66-993b-4b12-b3c2-e13d7ec61e71/resourceGroups/terragen-rg/providers/Microsoft.Insights/ActionGroups/RecommendedAlertRules-AG-1"
}
criteria {
aggregation = "Average"
metric_name = "node_cpu_usage_percentage"
metric_namespace = "Microsoft.ContainerService/managedClusters"
operator = "GreaterThan"
threshold = 95
}
depends_on = [
azurerm_resource_group.res-0,
]
}
resource "azurerm_monitor_metric_alert" "res-14" {
auto_mitigate = false
frequency = "PT5M"
name = "Memory Working Set Percentage - terragen-aks"
resource_group_name = "terragen-rg"
scopes = ["/subscriptions/ceaa9e66-993b-4b12-b3c2-e13d7ec61e71/resourcegroups/terragen-rg/providers/Microsoft.ContainerService/managedClusters/terragen-aks"]
action {
action_group_id = "/subscriptions/ceaa9e66-993b-4b12-b3c2-e13d7ec61e71/resourceGroups/terragen-rg/providers/Microsoft.Insights/ActionGroups/RecommendedAlertRules-AG-1"
}
criteria {
aggregation = "Average"
metric_name = "node_memory_working_set_percentage"
metric_namespace = "Microsoft.ContainerService/managedClusters"
operator = "GreaterThan"
threshold = 100
}
depends_on = [
azurerm_resource_group.res-0,
]
}
The text was updated successfully, but these errors were encountered: