-
Notifications
You must be signed in to change notification settings - Fork 4k
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
fix(ecs-patterns): add validation for queue and queue related props #21717
fix(ecs-patterns): add validation for queue and queue related props #21717
Conversation
…riod, visibilityTimeout and maxReceiveCount have no effect when queue is specified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution! We need tests for this change before we can provide a meaningful review.
if (props.queue && (props.retentionPeriod || props.visibilityTimeout || props.maxReceiveCount)) { | ||
throw new Error('retentionPeriod, visibilityTimeout and maxReceiveCount can be set only when queue is not set. Specify them in the QueueProps of the queue'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably have different error messages depending on which prop is provided that shouldn't be. It may be confusing if all are listed and a customer hasn't provided them all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for your quick reviews!
Added some unit tests and fixed the error messages.
Pull request has been modified.
@Mergifyio update |
✅ Branch has been successfully updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thanks!
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
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). |
…ws#21717) ## Problem When queue construct is set, queue related props (maxReceiveCount, visibilityTimeout, retentionPeriod) have no effect to the queue of the `QueueProcessingService`. I think this is a reasonable behavior, but it is difficult to notice when wrongly configured. ## Fix This pull request adds a validation to prevent from setting both queue and queue related props at the same time, and notice users the configuration error. Also, updates the param docs for this behavior. ---- ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Problem
When queue construct is set, queue related props (maxReceiveCount, visibilityTimeout, retentionPeriod) have no effect to the queue of the
QueueProcessingService
. I think this is a reasonable behavior, but it is difficult to notice when wrongly configured.Fix
This pull request adds a validation to prevent from setting both queue and queue related props at the same time, and notice users the configuration error. Also, updates the param docs for this behavior.
All Submissions:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license