Skip to content

Commit

Permalink
fix null dimension access
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtiomMatiom committed Dec 3, 2024
1 parent 7c9d5e0 commit eacc0e7
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions modules/azure/monitoring_metric_alert/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,13 @@ resource "azurerm_monitor_metric_alert" "metric_alert" {
operator = each.value.operator
threshold = each.value.threshold

dimension {
name = each.value.dimension.name
operator = each.value.dimension.operator
values = each.value.dimension.values
dynamic "dimension" {
for_each = each.value.dimension != null ? [1] : []
content {
name = each.value.dimension.name
operator = each.value.dimension.operator
values = each.value.dimension.values
}
}
}

Expand Down

0 comments on commit eacc0e7

Please sign in to comment.