Skip to content

Commit 3875465

Browse files
committed
Fix RAM share creation when an OU contains inactive accounts
1 parent 1d1d367 commit 3875465

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/service-deployment/regional.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ module "region" {
5050
ram = {
5151
create_lag_shares = local.create_lag_shares
5252
lag_share_name = local.lag_share_name
53-
target_account_ids = try(flatten(values(data.aws_organizations_organizational_unit_descendant_accounts.target_accounts)[*].accounts[*].id), [])
53+
target_account_ids = try([for i in flatten(values(data.aws_organizations_organizational_unit_descendant_accounts.target_accounts)[*].accounts[*]) : i.id if i.state == "ACTIVE"], [])
5454
}
5555
stepfunctions = {
5656
ingest_state_machine_name = local.ingest_state_machine_name

0 commit comments

Comments
 (0)