Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(events): rule cannot have more than 5 targets #30470

Merged
merged 4 commits into from
Jun 6, 2024

Conversation

flexelem
Copy link
Contributor

@flexelem flexelem commented Jun 6, 2024

Issue # (if applicable)

Closes #.

Reason for this change

This is a minor refactor for preventing an Event Rule to have at most 5 associated targets defined during a synth. This is the main limit set by EventBridge https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-quota.html#eb-limits

Description of changes

This is a very simple change in aws-events module to check if the targets array length of an Event is greater than 5. If it is then it throws an Error during build time.

Description of how you validated changes

Added a unit test by in rule.test.ts by verifying an Error is being thrown when a Rule has more than 5 associated targets.

Checklist


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

@github-actions github-actions bot added the beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK label Jun 6, 2024
@aws-cdk-automation aws-cdk-automation requested a review from a team June 6, 2024 12:43
@github-actions github-actions bot added the p2 label Jun 6, 2024
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.

@flexelem flexelem changed the title chore(events): Rule cannot have more than 5 targets chore(events): rule cannot have more than 5 targets Jun 6, 2024
@aws-cdk-automation aws-cdk-automation dismissed their stale review June 6, 2024 12:46

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@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 Jun 6, 2024
Copy link
Contributor

@lpizzinidev lpizzinidev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍 Left a suggestion

packages/aws-cdk-lib/aws-events/lib/rule.ts Outdated Show resolved Hide resolved
@aws-cdk-automation aws-cdk-automation removed pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. labels Jun 6, 2024
Copy link
Contributor

@xazhao xazhao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing. The change looks good to me.

Copy link
Contributor

mergify bot commented Jun 6, 2024

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 61ec528
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit a05591d into aws:main Jun 6, 2024
9 checks passed
Copy link
Contributor

mergify bot commented Jun 6, 2024

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

Leo10Gama pushed a commit to Leo10Gama/aws-cdk that referenced this pull request Jun 11, 2024
### Issue # (if applicable)

Closes #<issue number here>.

### Reason for this change
This is a minor refactor for preventing an Event Rule to have at most 5 associated targets defined during a synth. This is the main limit set by EventBridge https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-quota.html#eb-limits



### Description of changes
This is a very simple change in `aws-events` module to check if the `targets` array length of an `Event` is greater than 5. If it is then it throws an Error during build time.



### Description of how you validated changes
Added a unit test by in `rule.test.ts` by verifying an Error is being thrown when a Rule has more than 5 associated targets.



### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
mazyu36 pushed a commit to mazyu36/aws-cdk that referenced this pull request Jun 22, 2024
### Issue # (if applicable)

Closes #<issue number here>.

### Reason for this change
This is a minor refactor for preventing an Event Rule to have at most 5 associated targets defined during a synth. This is the main limit set by EventBridge https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-quota.html#eb-limits



### Description of changes
This is a very simple change in `aws-events` module to check if the `targets` array length of an `Event` is greater than 5. If it is then it throws an Error during build time.



### Description of how you validated changes
Added a unit test by in `rule.test.ts` by verifying an Error is being thrown when a Rule has more than 5 associated targets.



### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@aws-cdk-automation
Copy link
Collaborator

Comments on closed issues and PRs are hard for our team to see. If you need help, please open a new issue that references this one.

@aws aws locked as resolved and limited conversation to collaborators Jul 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants