-
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
feat: Add an existing SQS queue option to SNS event #1231
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 |
@@ -392,17 +392,42 @@ def to_cloudformation(self, **kwargs): | |||
) | |||
return [self._construct_permission(function, source_arn=self.Topic), subscription] | |||
|
|||
# SNS -> SQS -> Lambda | |||
# SNS -> SQS(Create New) -> Lambda | |||
if isinstance(self.SqsSubscription, bool): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if isinstance(self.SqsSubscription, bool)
is True, then self.SqsSubscription
is always True
, because we checked if self.SqsSubscription
is False on L388
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@53ningen Thank you for addressing my comments. This PR looks good to me!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 pr
passesexamples/2016-10-31
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.