Skip to content

Commit 8b0b778

Browse files
committed
modify bedrock accounts variable
1 parent 3bfef81 commit 8b0b778

File tree

1 file changed

+3
-2
lines changed
  • aws_sra_examples/solutions/genai/bedrock_org/lambda/src

1 file changed

+3
-2
lines changed

aws_sra_examples/solutions/genai/bedrock_org/lambda/src/app.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -683,8 +683,9 @@ def create_event(event, context):
683683

684684
# 5c) OAM CloudWatch-CrossAccountSharingRole IAM role
685685
# Add management account to the bedrock accounts list
686-
central_observability_params["bedrock_accounts"].append(sts.MANAGEMENT_ACCOUNT)
687-
for bedrock_account in central_observability_params["bedrock_accounts"]:
686+
bedrock_and_mgmt_accounts = copy.deepcopy(central_observability_params["bedrock_accounts"])
687+
bedrock_and_mgmt_accounts.append(sts.MANAGEMENT_ACCOUNT)
688+
for bedrock_account in bedrock_and_mgmt_accounts:
688689
for bedrock_region in central_observability_params["regions"]:
689690
iam.IAM_CLIENT = sts.assume_role(bedrock_account, sts.CONFIGURATION_ROLE, "iam", iam.get_iam_global_region())
690691
cloudwatch.CROSS_ACCOUNT_TRUST_POLICY = CLOUDWATCH_OAM_TRUST_POLICY[cloudwatch.CROSS_ACCOUNT_ROLE_NAME]

0 commit comments

Comments
 (0)