-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Race condition between SQS QueuePolicy and SNS Subscription #20665
Comments
Thanks for reporting this @jonnekaunisto! I'll try to look more into this later to see if I can confirm this is happening, and then would provide a fix if possible. But I or someone else on the team may not be able to get to this soon - in that case we accept contributions! |
I would be happy to contribute. But I think there are 2 issues that need to be solved first.
|
Any thoughts on the above @peterwoodworth @kaizencc? |
…cription (#21797) ---- Fixes #20665 by adding a dependency to sqs policy for sns subscriptions. ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [x] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [x] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* This is a follow up to #21259, which got closed for failing for too long
|
…cription (aws#21797) ---- Fixes aws#20665 by adding a dependency to sqs policy for sns subscriptions. ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [x] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [x] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* This is a follow up to aws#21259, which got closed for failing for too long
Describe the bug
For the SqsSubscription currently the QueuePolicy can get deployed before or after the Subscription. If the queue policy deploys afterwards, it will cause failures to send messages from SNS to SQS.
Expected Behavior
QueuePolicy will deploy before Subscription.
Current Behavior
QueuePolicy can sometimes deploy after Subscription.
Reproduction Steps
Create a SqsSubscription and it will generate a template where there is no dependency between the Queue Policy and Subscription.
Possible Solution
Not sure how, the code for this is complicated since the queue is passed into this: https://github.com/aws/aws-cdk/blob/v1.159.0/packages/@aws-cdk/aws-sns-subscriptions/lib/sqs.ts#L35
but the subscription is created here: https://github.com/aws/aws-cdk/blob/v1.159.0/packages/%40aws-cdk/aws-sns/lib/topic-base.ts#L80
Additional Information/Context
No response
CDK CLI Version
3
Framework Version
No response
Node.js Version
16
OS
Mac OS
Language
Typescript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: