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

(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

Closed
2 tasks
danandreicarp opened this issue Dec 15, 2023 · 2 comments
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

Comments

@danandreicarp
Copy link

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:

{
  "Action": "sqs:SendMessage",
  "Condition": {
    "ArnEquals": {
      "aws:SourceArn": "arn:aws:sns:<aws_region>:<account_id>:<common_topic_name>-<unique_topic_suffix>"
    }
  },
  "Effect": "Allow",
  "Principal": {
    "Service": "sns.amazonaws.com"
  },
  "Resource": {
    "Fn::GetAtt": [
      "<sqs_queue_id>",
      "Arn"
    ]
  }
}

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

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.110

Environment details (OS name and version, etc.)

macOS Ventura 13.6.2

@danandreicarp danandreicarp added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Dec 15, 2023
@github-actions github-actions bot added the @aws-cdk/aws-sns Related to Amazon Simple Notification Service label Dec 15, 2023
@pahud
Copy link
Contributor

pahud commented Dec 15, 2023

Closing in favor of #7732

Please help us prioritize by upvotes on #7732

@pahud pahud closed this as completed Dec 15, 2023
@pahud pahud added p2 effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Dec 15, 2023
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

2 participants