(aws-sns): AWS::SQS::QueuePolicy created by topic.addSubscription throws "Submitted policy is over max allowed size" if using the same queue for multiple topics #28378
Labels
@aws-cdk/aws-sns
Related to Amazon Simple Notification Service
effort/medium
Medium work item – several days of effort
feature-request
A feature should be added or improved.
p2
Describe the feature
Hello,
I have a SQS queue that I'm trying to subscribe to multiple SNS topics.
The
AWS::SQS::QueuePolicy
generated by the addSubscription method is overly verbose and reaches the maximum allowed size.It creates a separate statement for every topic:
The only thing that's different is the value under
ArnEquals
.The output policy should have a single Statement, with a
ArnLike
condition, with an array of topic ARNs.Alternatively, one should have the option of not having the
AWS::SQS::QueuePolicy
generated automatically, and to create it using addToResourcePolicy instead.Use Case
I don't have a workaround at this time for the scenario where my SQS queue must subscribe to many SNS topics.
Proposed Solution
See description.
Other Information
No response
Acknowledgements
CDK version used
2.110
Environment details (OS name and version, etc.)
macOS Ventura 13.6.2
The text was updated successfully, but these errors were encountered: