Skip to content

fix(logs): emit canonical root ARN in convertArnPrincipalToAccountId - #38695

Open
rajpreetcodes wants to merge 1 commit into
aws:mainfrom
rajpreetcodes:fix/logs-arn-principal-drift
Open

fix(logs): emit canonical root ARN in convertArnPrincipalToAccountId#38695
rajpreetcodes wants to merge 1 commit into
aws:mainfrom
rajpreetcodes:fix/logs-arn-principal-drift

Conversation

@rajpreetcodes

Copy link
Copy Markdown

Fixes #37797 - CloudFormation normalizes bare account IDs to root ARNs, causing false drift detections on every stack using logGroup.grantRead(crossAccountRole).

This change emits the canonical root ARN format directly to match CloudFormation's normalization.

Changes:

  • Updated convertArnPrincipalToAccountId in packages/aws-cdk-lib/aws-logs/lib/log-group.ts to return full root ARN format (arn:aws:iam:::root) instead of bare account ID
  • Added Aws import from ../../core

Fixes aws#37797 - CloudFormation normalizes bare account IDs to root ARNs,
causing false drift detections on every stack using logGroup.grantRead(crossAccountRole).
This change emits the canonical root ARN format directly to match CloudFormation's normalization.
@aws-cdk-automation
aws-cdk-automation requested a review from a team August 29, 2026 08:29
@github-actions github-actions Bot added beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK bug This issue is a bug. effort/small Small work item – less than a day of effort p2 labels Aug 29, 2026
@mergify

mergify Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🟠 1 of 1 protections blocking · waiting on 🤖 CI

Protection Waiting on
🟠 📃 Configuration Change Requirements 🤖 CI

🟠 📃 Configuration Change Requirements

Waiting for

  • check-success = Configuration changed
Waiting checks: Configuration changed.

Mergify configuration change

  • check-success = Configuration changed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK bug This issue is a bug. effort/small Small work item – less than a day of effort p2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(aws-logs): convertArnPrincipalToAccountId in aws-logs causes false positive CloudFormation stack drift

1 participant