Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/agentless-scanning/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ locals {

# if only exclude_ouids are provided and as long as it isn't Root OU, fetch all their child accounts to filter exclusions
data "aws_organizations_organizational_unit_descendant_accounts" "ou_accounts_to_exclude" {
for_each = local.org_configuration == "excluded_ous_only" && !contains(var.exclude_ouids, local.root_org_unit[0]) ? var.exclude_ouids : []
for_each = local.org_configuration == "excluded_ous_only" && (length(local.root_org_unit) > 0 ? !contains(var.exclude_ouids, local.root_org_unit[0]) : false) ? var.exclude_ouids : []
parent_id = each.key
}

Expand Down
2 changes: 1 addition & 1 deletion modules/config-posture/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ locals {

# if only exclude_ouids are provided and as long as it isn't Root OU, fetch all their child accounts to filter exclusions
data "aws_organizations_organizational_unit_descendant_accounts" "ou_accounts_to_exclude" {
for_each = local.org_configuration == "excluded_ous_only" && !contains(var.exclude_ouids, local.root_org_unit[0]) ? var.exclude_ouids : []
for_each = local.org_configuration == "excluded_ous_only" && (length(local.root_org_unit) > 0 ? !contains(var.exclude_ouids, local.root_org_unit[0]) : false) ? var.exclude_ouids : []
parent_id = each.key
}

Expand Down
2 changes: 1 addition & 1 deletion modules/integrations/event-bridge/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ locals {

# if only exclude_ouids are provided and as long as it isn't Root OU, fetch all their child accounts to filter exclusions
data "aws_organizations_organizational_unit_descendant_accounts" "ou_accounts_to_exclude" {
for_each = local.org_configuration == "excluded_ous_only" && !contains(var.exclude_ouids, local.root_org_unit[0]) ? var.exclude_ouids : []
for_each = local.org_configuration == "excluded_ous_only" && (length(local.root_org_unit) > 0 ? !contains(var.exclude_ouids, local.root_org_unit[0]) : false) ? var.exclude_ouids : []
parent_id = each.key
}

Expand Down
2 changes: 1 addition & 1 deletion modules/onboarding/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ locals {

# if only exclude_ouids are provided and as long as it isn't Root OU, fetch all their child accounts to filter exclusions
data "aws_organizations_organizational_unit_descendant_accounts" "ou_accounts_to_exclude" {
for_each = local.org_configuration == "excluded_ous_only" && !contains(var.exclude_ouids, local.root_org_unit[0]) ? var.exclude_ouids : []
for_each = local.org_configuration == "excluded_ous_only" && (length(local.root_org_unit) > 0 ? !contains(var.exclude_ouids, local.root_org_unit[0]) : false) ? var.exclude_ouids : []
parent_id = each.key
}

Expand Down
2 changes: 1 addition & 1 deletion modules/vm-workload-scanning/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ locals {

# if only exclude_ouids are provided and as long as it isn't Root OU, fetch all their child accounts to filter exclusions
data "aws_organizations_organizational_unit_descendant_accounts" "ou_accounts_to_exclude" {
for_each = local.org_configuration == "excluded_ous_only" && !contains(var.exclude_ouids, local.root_org_unit[0]) ? var.exclude_ouids : []
for_each = local.org_configuration == "excluded_ous_only" && (length(local.root_org_unit) > 0 ? !contains(var.exclude_ouids, local.root_org_unit[0]) : false) ? var.exclude_ouids : []
parent_id = each.key
}

Expand Down