feat: Add an existing SQS queue option to SNS event#1231
feat: Add an existing SQS queue option to SNS event#1231praneetap merged 8 commits intoaws:developfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #1231 +/- ##
===========================================
- Coverage 94.61% 94.59% -0.03%
===========================================
Files 78 78
Lines 4252 4271 +19
Branches 844 846 +2
===========================================
+ Hits 4023 4040 +17
- Misses 110 111 +1
- Partials 119 120 +1
Continue to review full report at Codecov.
|
c9f78f0 to
9f7f2c7
Compare
to minimize the diff, refine SNS.to_cloudformation in advance
20a09d8 to
e50de06
Compare
e50de06 to
fd99293
Compare
|
this PR is now ready for review |
|
|
||
| # SNS -> SQS -> Lambda | ||
| # SNS -> SQS(Create New) -> Lambda | ||
| if isinstance(self.SqsSubscription, bool): |
There was a problem hiding this comment.
if isinstance(self.SqsSubscription, bool) is True, then self.SqsSubscription is always True, because we checked if self.SqsSubscription is False on L388
ShreyaGangishetty
left a comment
There was a problem hiding this comment.
@53ningen Thank you for contributing this feature!! This looks great. I have minor comments about adding a unit test and also on throwing errors when QueueArn or QueueUrl are not given.
Could you please add/update any of the existing unit tests for a condition where SqsSubscritption: False.
|
The informations of |
|
@timoschilling Gominingen described why this was sometimes not possible (and why a separate URL can be a feature) back in the original issue. In short, I can imagine that and similar being features of the next round of the, uh, feature:
…which sound like really nice checks, assuming I haven’t forgotten why they’re impossible. |
| self.sns_event_source.SqsSubscription = sqsSubscription | ||
| self.assertRaises(TypeError, self.sns_event_source.to_cloudformation) | ||
|
|
||
| def test_to_cloudformation_when_sqs_subscription_disable(self): |
There was a problem hiding this comment.
Could you please add/update any of the existing unit tests for a condition where SqsSubscritption: False.
I've added on this line.
|
@ShreyaGangishetty Ready for review again. |
ShreyaGangishetty
left a comment
There was a problem hiding this comment.
@53ningen Thank you for addressing my comments. This PR looks good to me!!
praneetap
left a comment
There was a problem hiding this comment.
Thanks a ton for submitting this feature!
|
What's the status on this? It looks like it was included in the v1.20.0 release, but I can't get it working and failing on this line. I've even tried to define both Also, there's no sign of this feature in the documentation. |
It is in the documentation and specification. |
readable diff:
https://github.com/awslabs/serverless-application-model/pull/1231/files?w=1
Issue #, if available:
#854
Description of changes:
Add an existing SQS queue option to SNS event
Description of how you validated changes:
Checklist:
make prpassesexamples/2016-10-31By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.