We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 9e9e14e + 558516d commit 45fdc75Copy full SHA for 45fdc75
aws_sra_examples/terraform/solutions/terraform_stack.py
@@ -68,7 +68,12 @@ def get_accounts() -> list:
68
organizations = boto3.client("organizations")
69
paginator = organizations.get_paginator("list_accounts")
70
71
- accounts = [account["Id"] for page in paginator.paginate() for account in page["Accounts"]]
+ accounts = []
72
+ for page in paginator.paginate():
73
+ for account in page["Accounts"]:
74
+ if account["Status"] == "ACTIVE":
75
+ accounts.append(account["Id"])
76
+
77
audit_account = get_audit_account()
78
79
# audit account needs to go last
0 commit comments