Skip to content

Commit

Permalink
Use all_subscription_ids flags instead of subscription_ids as this va…
Browse files Browse the repository at this point in the history
…riable is always populated for each management group while the other is not (#54)
  • Loading branch information
miguelpais authored Aug 29, 2024
1 parent 3614fe6 commit fe6b782
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/agentless-scanning/organizational.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ data "azurerm_management_group" "management_groups" {
}

locals {
subscriptions = toset(var.is_organizational && length(var.management_group_ids) == 0 ? data.azurerm_management_group.root_management_group[0].subscription_ids :
flatten([for m in data.azurerm_management_group.management_groups : m.subscription_ids]))
subscriptions = toset(var.is_organizational && length(var.management_group_ids) == 0 ? data.azurerm_management_group.root_management_group[0].all_subscription_ids :
flatten([for m in data.azurerm_management_group.management_groups : m.all_subscription_ids]))
}

resource "azurerm_lighthouse_assignment" "lighthouse_assignment_for_tenant" {
Expand Down

0 comments on commit fe6b782

Please sign in to comment.