Repository navigation
fix(logs): include log group ARN in LogGroup.grant() and grantRead() - #39559
Draft
1992chenlu wants to merge 9 commits into
Draft
1992chenlu wants to merge 9 commits into
1992chenlu wants to merge 9 commits into
Conversation
Include the log group ARN, in addition to the log stream ARN (":*"), in the
resources used by LogGroup.grant().
1992chenlu
had a problem deploying
to
automation
October 29, 2026 21:10 — with
GitHub Actions
Failure
aws-cdk-automation
previously requested changes
Oct 29, 2026
aws-cdk-automation
dismissed
their stale review
October 29, 2026 21:22
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
Include the log group ARN, in addition to the log stream ARN (":*"), in the
resources used by LogGroupGrants.read() and LogGroup.grantRead(), including
for L1 log groups.
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue # (if applicable)
Closes #39561.
Reason for this change
LogGroup.grant()andLogGroup.grantRead()/LogGroupGrants.read()only used the log group ARN ending in:*. Statements created by them should also cover the plain log group ARN.Description of changes
grant()andread()now pass two resource ARNs: the plain log group ARN and the existing:*ARN. The plain ARN is built from the log group name for owned log groups and imported-by-name log groups, and derived from the given ARN for log groups imported by ARN. It also works forLogGroupGrants.fromLogGroup(<CfnLogGroup>). To support this,LogGroupGrantsis now hand-written (aws-logs/lib/log-group-grants.ts) instead of generated fromgrants.json; its public API is unchanged.Describe any new or updated permissions being added
Statements generated by
LogGroup.grant()andLogGroup.grantRead()now list the plain log group ARN in addition to the:*ARN.Description of how you validated changes
fromLogGroupName,fromLogGroupArnand L1 log groups, for bothgrant()andread().aws-stepfunctions-tasksandaws-iot-actions-alphathat assert ongrant()output.yarn buildandyarn compatforaws-cdk-lib.LogGroup.grant()and re-ran and updated the affected integ snapshots (emrcontainers job-submission-workflow, iot cloudwatch-logs-action, loggroup-grantread) with a real deployment.Checklist