Skip to content

Commit 83e9284

Browse files
committed
update invoc log check to fix
1 parent 8b0b778 commit 83e9284

File tree

1 file changed

+7
-4
lines changed
  • aws_sra_examples/solutions/genai/bedrock_org/lambda/rules/sra_bedrock_check_invocation_log_cloudwatch

1 file changed

+7
-4
lines changed

aws_sra_examples/solutions/genai/bedrock_org/lambda/rules/sra_bedrock_check_invocation_log_cloudwatch/app.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,16 @@ def evaluate_compliance(rule_parameters):
2727

2828
try:
2929
response = bedrock_client.get_model_invocation_logging_configuration()
30+
LOGGER.info(f"Bedrock get_model_invocation_logging_configuration response: {response}")
3031
logging_config = response.get('loggingConfig', {})
31-
32+
LOGGER.info(f"Bedrock Model Invocation Logging Configuration: {logging_config}")
33+
3234
cloudwatch_config = logging_config.get('cloudWatchConfig', {})
33-
cloudwatch_enabled = cloudwatch_config.get('enabled', False)
34-
log_group_name = cloudwatch_config.get('logGroupName')
35+
LOGGER.info(f"Bedrock Model Invocation config: {cloudwatch_config}")
36+
log_group_name = cloudwatch_config.get('logGroupName', "")
37+
LOGGER.info(f"Bedrock Model Invocation Log Group: {log_group_name}")
3538

36-
if not cloudwatch_enabled or not log_group_name:
39+
if not cloudwatch_config or not log_group_name:
3740
return 'NON_COMPLIANT', "CloudWatch logging is not enabled for Bedrock Model Invocation Logging"
3841

3942
# Check retention and encryption if enabled

0 commit comments

Comments
 (0)