-
Notifications
You must be signed in to change notification settings - Fork 2.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
Feature Request: Add SQS option to SNS event #854
Comments
That would be really helpful indeed. |
Happy to work with anyone interested in picking this up! |
@jlhood I would like to work on this issue. |
@Buffer0x7cd Awesome, thank you so much! Before implementing, we need to finalize the SAM spec. The draft I created above just has a simple |
@brettstack @keetonian I've updated the issue description with the proposed SAM spec for this feature. Can you both review? |
Do we have precedent for overriding generated logical resource id like What's a better name than Can we allow an array of queues also? |
Thanks for the feedback, @brettstack!
This would be something new. Maybe this is a little selfish, but in the Event Fork Pipelines apps we just released today, I'm specifying the Queue and QueuePolicy explicitly. Once this SAM feature is released, I'd love to convert over to using it since it makes the template even easier to read. However, without being able to override the logical id, I don't have a way to use the SAM feature while keeping my apps backwards-compatible. 😞 Allowing overrides of logical ids would allow customers to simplify existing templates as new SAM features are added while maintaining backwards-compatibility. However, I won't fight too hard if you really don't want to add it.
Yeah I'm not loving the key name, but I couldn't think of anything better. None of your suggestions are jumping out to me as obviously better. Some others I can think of:
You can already achieve this with multiple Events entries. Accepting a list could make the syntax slightly shorter, but I think it adds complexity since then there'd be two ways of doing this within the same resource. |
Given that use case I'm okay with adding the logical resource id name override. The wording in docs is around "subscribing" an SQS Queue to an SNS Topic, so I'd like to get that word in there to make it clear what it is you achieve by specifying this property. Multiple Event entries wouldn't be as succinct. |
I like |
Thanks. Updated it to |
@Buffer0x7cd I've updated the top-level issue comment with the finalized spec for this feature, so it should be ready to implement once you're finished with your other PR. Let me know if you have any questions. Thanks! |
Closing this issue as v1.15.0 is released |
Hi, @ShreyaGangishetty I implemented only simple boolean SqsSubscription option to SNSEvent at first in PR #1065. Additional options for specifying the queue by
May I reopen this issue for implementing additional options? |
Yes absolutely! Thanks for bringing it to our attention. Reopening.. |
#1209 brings up a good point regarding this feature. Users often want to configure additional properties on the SQS queue like DLQ and visibility timeout. We should keep that in mind while we implement this feature. We could do by allowing for passthrough SQS properties on the SNS event type, but I think it might be simpler to allow users to reference an existing SQS queue and SAM will setup all the necessary subscriptions and permissions on the given queue. |
I'd like the option to pass an existing SQS resource and just let SAM handle the connections between the resources, just like @jlhood mentions above. |
Hi, I'm on the way implement the option to pass an existing queue. Now I'm wondering how to specify the Queue URL of a queue policy. QueuePolicy resource have to specify both QueueARN and QueueUrl: "HogePolicy": {
"Type": "AWS::SQS::QueuePolicy",
"Properties": {
"Queues": [
"https://sqs.ap-northeast-1.amazonaws.com/<aws_account_id>/<queue_name>"
],
"PolicyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Action": "sqs:SendMessage",
"Resource": "arn:aws:sqs:ap-northeast-1:<aws_account_id>:<queue_name>",
"Effect": "Allow",
"Condition": {
"ArnEquals": {
"aws:SourceArn": {
"Ref": "TweetTopic"
}
}
},
"Principal": "*"
}
]
}
}
} The finalized spec for this feature written in the top-level issue comment defines that When a QueueARN parameter is string, I can easily convert to QueueURL like this. But when a QueueARN parameter contains Fn::Ref, Fn::Sub, etc.., it is difficult to convert to QueueURL correctly. In addition, I think users often want to specify a queue using Questions
|
@53ningen Thanks so much for working on this! I agree with your proposal to add a |
I added a QueueUrl parameter to SqsSubscription: #1231 |
Description:
SAM offers simplified syntax for SNS -> Lambda and with #261 supports adding subscription filter policies. However, a common use case is SNS -> SQS -> Lambda. SAM offers simplified syntax for SQS -> Lambda, but you have to use standard CloudFormation to setup the SNS -> SQS connection and subscription filter policy, which can be verbose.
SAM could add a lot of value by adding an option to the existing SNS event type to create an SQS queue.
Here's an example that uses simple default settings for the queue:
Here's an example that specifies additional options for the queue:
Implementation Note: When SAM expands this into CloudFormation, the
AWS::SQS::QueuePolicy
resource should look like this:The text was updated successfully, but these errors were encountered: