Skip to content

Commit 6bd16bf

Browse files
committed
don't record CW centrol observability resources in dry-run if deploy is false
1 parent 7b7498d commit 6bd16bf

File tree

1 file changed

+11
-7
lines changed
  • aws_sra_examples/solutions/genai/bedrock_org/lambda/src

1 file changed

+11
-7
lines changed

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

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1455,13 +1455,17 @@ def create_event(event: dict, context: Any) -> str:
14551455
create_sns_messages(accounts, regions, topic_arn, event["ResourceProperties"], "configure")
14561456
LOGGER.info(f"CFN_RESPONSE_DATA POST create_sns_messages: {CFN_RESPONSE_DATA}")
14571457

1458-
# 5) Central CloudWatch Observability (regional)
1459-
deploy_central_cloudwatch_observability(event)
1460-
LOGGER.info(f"CFN_RESPONSE_DATA POST deploy_central_cloudwatch_observability: {CFN_RESPONSE_DATA}")
1461-
1462-
# 6) Cloudwatch dashboard in security account (home region, security account)
1463-
deploy_cloudwatch_dashboard(event)
1464-
LOGGER.info(f"CFN_RESPONSE_DATA POST deploy_cloudwatch_dashboard: {CFN_RESPONSE_DATA}")
1458+
central_observability_params = json.loads(event["ResourceProperties"]["SRA-BEDROCK-CENTRAL-OBSERVABILITY"])
1459+
if central_observability_params["deploy"] is True:
1460+
# 5) Central CloudWatch Observability (regional)
1461+
deploy_central_cloudwatch_observability(event)
1462+
LOGGER.info(f"CFN_RESPONSE_DATA POST deploy_central_cloudwatch_observability: {CFN_RESPONSE_DATA}")
1463+
1464+
# 6) Cloudwatch dashboard in security account (home region, security account)
1465+
deploy_cloudwatch_dashboard(event)
1466+
LOGGER.info(f"CFN_RESPONSE_DATA POST deploy_cloudwatch_dashboard: {CFN_RESPONSE_DATA}")
1467+
else:
1468+
LOGGER.info("CloudWatch observability deploy set to false, skipping deployment...")
14651469

14661470
# End
14671471
if DRY_RUN is False:

0 commit comments

Comments
 (0)