Skip to content

Commit

Permalink
Merge pull request #2094 from najvv/fix/duplicate-lz-key
Browse files Browse the repository at this point in the history
fix: duplicate lz key reference
  • Loading branch information
arnaudlh authored Mar 2, 2025
2 parents 7bd5b35 + 7ab5d41 commit e09d494
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/monitoring/monitor_activity_log_alert/module.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ resource "azurerm_monitor_activity_log_alert" "mala" {
resource_group_name = var.resource_group_name
scopes = try(flatten([
for key, value in var.settings.scopes : coalesce(
try(var.remote_objects[value.resource_type][value.lz_key][value.lz_key][value.key].id, null),
try(var.remote_objects[value.resource_type][value.lz_key][value.key].id, null),
try(var.remote_objects[value.resource_type][var.client_config.landingzone_key][value.key].id, null),
try(value.id, null),
[]
Expand All @@ -28,7 +28,7 @@ resource "azurerm_monitor_activity_log_alert" "mala" {
resource_type = try(criteria.value.resource_type, null)
resource_group = try(criteria.value.resource_group, null)
resource_id = try(
var.remote_objects[criteria.value.resource.resource_type][criteria.value.resource.lz_key][criteria.value.resource.lz_key][criteria.value.resource.key].id,
var.remote_objects[criteria.value.resource.resource_type][criteria.value.resource.lz_key][criteria.value.resource.key].id,
var.remote_objects[criteria.value.resource.resource_type][var.client_config.landingzone_key][criteria.value.resource.key].id,
criteria.value.resource.id,
null
Expand Down Expand Up @@ -64,4 +64,4 @@ resource "azurerm_monitor_activity_log_alert" "mala" {
enabled = try(var.settings.enabled, null)
description = try(var.settings.description, null)
tags = local.tags
}
}

0 comments on commit e09d494

Please sign in to comment.