Skip to content

fix(datazone): correct CloudWatch Logs KMS condition operator and scope#49

Open
marcinc wants to merge 2 commits into
aws:mainfrom
marcinc:fix/tooling-kms-cloudwatch-logs-condition
Open

fix(datazone): correct CloudWatch Logs KMS condition operator and scope#49
marcinc wants to merge 2 commits into
aws:mainfrom
marcinc:fix/tooling-kms-cloudwatch-logs-condition

Conversation

@marcinc

@marcinc marcinc commented May 20, 2026

Copy link
Copy Markdown

Issue #, if available: #48

Description of changes:

Two compounding issues caused AmazonBedrockKnowledgeBase environment deployment in SMUS to fail with "The specified KMS key does not exist or is not allowed to be used":

  1. ArnEquals was used instead of ArnLike. ArnEquals treats '*' as a literal character, so the wildcard suffixes in the original two ARN prefixes never matched any real log group ARN.

  2. The two hardcoded prefixes (datazone-*, airflow-*) did not cover Bedrock Lambda log groups created by AmazonBedrockKnowledgeBase (/aws/lambda/amazon-bedrock-ide-kbIngestion--* and opensearchIndex--*).

Fix: switch to ArnLike and add the Bedrock Lambda log group prefix as a third entry alongside the existing datazone-* and airflow-* prefixes. Also adds kms:DescribeKey, which CloudWatch Logs requires to verify the key before use.

Tests:

  • datazone-l3-construct.test.ts: assert CloudWatchLogsEncryption uses ArnLike with all three expected log group prefixes and kms:DescribeKey
  • app.test.ts and sm-studio-domain.test.ts: Lambda/Docker mocks to prevent test failures in environments without a Docker daemon

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

marcinc added 2 commits May 22, 2026 17:12
Two compounding issues caused AmazonBedrockKnowledgeBase environment deployment
to fail with "The specified KMS key does not exist or is not allowed to be used":

1. ArnEquals was used instead of ArnLike. ArnEquals treats '*' as a literal
   character, so the wildcard suffixes in the original two ARN prefixes never
   matched any real log group ARN.

2. The two hardcoded prefixes (datazone-*, airflow-*) did not cover Bedrock
   Lambda log groups created by AmazonBedrockKnowledgeBase
   (/aws/lambda/amazon-bedrock-ide-kbIngestion--* and opensearchIndex--*).

Fix: switch to ArnLike and add the Bedrock Lambda log group prefix as a third
entry alongside the existing datazone-* and airflow-* prefixes. Also adds
kms:DescribeKey, which CloudWatch Logs requires to verify the key before use.

Tests:
- datazone-l3-construct.test.ts: assert CloudWatchLogsEncryption uses ArnLike
  with all three expected log group prefixes and kms:DescribeKey
- app.test.ts and sm-studio-domain.test.ts: Lambda/Docker mocks to prevent test
  failures in environments without a Docker daemon
…ion fix

Regenerated sagemaker app diff baselines to reflect the updated
CloudWatchLogsEncryption statement: ArnEquals replaced with ArnLike,
kms:DescribeKey added to allowed actions, and /aws/lambda/amazon-bedrock-ide-*
added as a third log group prefix.
@marcinc marcinc force-pushed the fix/tooling-kms-cloudwatch-logs-condition branch from 71d82c6 to f0e06ca Compare May 22, 2026 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant