Skip to content

feat(events-targets): prevent to create a log group resource policy - #38609

Open
Tietew wants to merge 4 commits into
aws:mainfrom
Tietew:events-prevent-resource-policy
Open

feat(events-targets): prevent to create a log group resource policy#38609
Tietew wants to merge 4 commits into
aws:mainfrom
Tietew:events-prevent-resource-policy

Conversation

@Tietew

@Tietew Tietew commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Issue # (if applicable)

Closes #31404.

Reason for this change

A CloudWatch LogGroup target creates a custom resource to create a LogGroup Resource Policy to permit EventBridge to put log events to the LogGroup. However, there is a strict quota of 10 Resource Policies per account per region. This therefore limits the amount of EventBridge rules targetting to CloudWatch Logs.

Description of changes

An optional prop createLogGroupResourcePolicy has been added to the LogGroupProps. When set to false, creation of LogGroup Resource Policy will be omitted. The default value is true to keep current behavior.

Setting createLogGroupResoucePolicy to false needs user to create a LogGroup Resouce Policy separately. See README for details.

Describe any new or updated permissions being added

N/A

Description of how you validated changes

Added unit tests:

  • assert the custom resource is created by default
  • assert the custom resource is absent when the createLogGroupResourcePolicy is false.

Added a event rule with createLogGroupResourcePolicy set to false to the existing integ test.

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@Tietew
Tietew deployed to automation August 20, 2026 06:57 — with GitHub Actions Active
@Tietew
Tietew deployed to automation August 20, 2026 06:57 — with GitHub Actions Active
@github-actions github-actions Bot added effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2 distinguished-contributor [Pilot] contributed 50+ PRs to the CDK labels Aug 20, 2026
@aws-cdk-automation
aws-cdk-automation requested a review from a team August 20, 2026 06:58
@Tietew
Tietew deployed to automation August 20, 2026 06:58 — with GitHub Actions Active
@Tietew
Tietew deployed to automation August 20, 2026 10:43 — with GitHub Actions Active
@Tietew
Tietew deployed to automation August 20, 2026 10:43 — with GitHub Actions Active
@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

distinguished-contributor [Pilot] contributed 50+ PRs to the CDK effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2 pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

aws-events-target: support adding CloudWatchLogGroup rule target without creation of new Resource Policy

2 participants