Skip to content

fix: propagate condition to sqs queue policy for sqssubscription - #1798

Merged
hawflau merged 5 commits into
aws:developfrom
hawflau:fix-sqs-subscription-policy-condition
Dec 2, 2020
Merged

fix: propagate condition to sqs queue policy for sqssubscription#1798
hawflau merged 5 commits into
aws:developfrom
hawflau:fix-sqs-subscription-policy-condition

Conversation

@hawflau

@hawflau hawflau commented Nov 14, 2020

Copy link
Copy Markdown
Contributor

Issue #, if available:

Description of changes:

This fixes a bug of not having Condition propagated to the generated AWS::SQS::QueuePolicy resource if a SNS event source is used with SqsSubscription in a AWS::Serverless::Function resource.

Also updated the black commands in Makefile to check only .py files

Description of how you validated changes:

Checklist:

  • Write/update tests
  • make pr passes
  • Update documentation
  • Verify transformed template deploys and application functions as expected

Examples?

Please reach out in the comments, if you want to add an example. Examples will be
added to sam init through https://github.com/awslabs/aws-sam-cli-app-templates/

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@hawflau
hawflau marked this pull request as ready for review November 14, 2020 19:36
@hawflau hawflau changed the title Fix sqs subscription policy condition fix: propagate condition to sqs queue policy for sqssubscription Nov 14, 2020
Comment thread Makefile Outdated
@hawflau
hawflau merged commit 6059c19 into aws:develop Dec 2, 2020
QueueArn: !GetAtt Queue.Arn
QueueUrl: !Ref Queue

AnotherSNSWithSQSSubscription:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer a more descriptive name to immediately figure out what is the difference between this one and the one above, what each of them tests.

hawflau added a commit to hawflau/serverless-application-model that referenced this pull request Jan 15, 2021
…#1798)

* fix: propagate condition to sqs queue policy for sqssubscription

* Update unit test for function_event_conditions

* Update black commands in Makefile to check only .py files

* Update test with one more SNS event source with sqsSubscription set

* Revert "Update black commands in Makefile to check only .py files"

This reverts commit 115ff09.
hawflau added a commit to hawflau/serverless-application-model that referenced this pull request Jan 15, 2021
…#1798)

* fix: propagate condition to sqs queue policy for sqssubscription

* Update unit test for function_event_conditions

* Update black commands in Makefile to check only .py files

* Update test with one more SNS event source with sqsSubscription set

* Revert "Update black commands in Makefile to check only .py files"

This reverts commit 115ff09.
hawflau added a commit that referenced this pull request Jan 15, 2021
* Support DLQ, RetryPolicy properties for EventBridgeRule,Schedule event sources (#1842)

* Add DeadLetterConfig,RetryPolicy properties for EventBridgeRule,Schedule event sources

* Minor fix,rename function argument

* Update test class name

* Combine dlq extraction/generation into the utility class

* Remove unused import

* fix: propagate condition to sqs queue policy for sqssubscription (#1798)

* fix: propagate condition to sqs queue policy for sqssubscription

* Update unit test for function_event_conditions

* Update black commands in Makefile to check only .py files

* Update test with one more SNS event source with sqsSubscription set

* Revert "Update black commands in Makefile to check only .py files"

This reverts commit 115ff09.

* chore: Remove biased language from pylintrc (#1847)

* fix: Support new CodeDeploy ManagedPolicy (#1858)

* fix: Support new CodeDeploy MangedPolicy in regions without AWSCodeDeployRoleForLambda

CodeDeploy is migrating from AWSCodeDeployRoleForLambda to AWSCodeDeployRoleForLambdaLimited.
Some partitions do not support AWSCodeDeployRoleForLambda and therefore we need to use the newer
one in those partitions. We cannot widely update to AWSCodeDeployRoleForLambdaLimited since this
can cause customer's stacks to fail unexpectedly.

* Forgot to commit unit tests

* Handle PR feedback

Co-authored-by: Jacob Fuss <jfuss@users.noreply.github.com>

* fix: Update Slack invite link (#1877)

Co-authored-by: Jacob Fuss <jfuss@users.noreply.github.com>

* feature: Support for custom checkpointing (#1883)

Co-authored-by: Vinayak <vinayaks@amazon.com>

* Fix: Description in AWS::Serverless::HttpApi (#1884)

* Fix: Description in AWS::Serverless::HttpApi

* Update _set to _add

* Update AWS::S3::Bucket properties (#1885)

* Update AWS::S3::Bucket properties

* Fix type checking validators for AWS::S3::Bucket

* Update to use any_type() in favor of supporing ref

* Fix: Replaced invalid AMQ managed policy by providing policy statements (#1891)

* Fix for invalid MQ event source managed policy

* Fix for invalid managed policy for MQ, included support for new MQ event source property, updated test cases

* Black reformatting

* Test case changes

* Changed policy name

* Modified test cases with new policy name

* chore: bump version 1.34.0 (#1892)

* Fix: SAM crashes method_definition for path is invalid (#1802)

* Fix: SAM crashes method_definition for path is invalid

* Fix: SAM crashes whenmappings is null

* Removed print statement in test_translator

* Fix: Swagger security not a dict

Co-authored-by: Mufaddal Makati <mmmakati@amazon.com>

Co-authored-by: ejafarli <54083696+ejafarli@users.noreply.github.com>
Co-authored-by: _sam <3804518+aahung@users.noreply.github.com>
Co-authored-by: Jacob Fuss <32497805+jfuss@users.noreply.github.com>
Co-authored-by: Jacob Fuss <jfuss@users.noreply.github.com>
Co-authored-by: vinayaksood <vinayaksood.282@gmail.com>
Co-authored-by: Vinayak <vinayaks@amazon.com>
Co-authored-by: Qingchuan Ma <69653965+qingchm@users.noreply.github.com>
Co-authored-by: Mufaddal Makati <mufaddal@rawbytes.com>
Co-authored-by: Mufaddal Makati <mmmakati@amazon.com>
hawflau added a commit that referenced this pull request Jan 30, 2021
* Support DLQ, RetryPolicy properties for EventBridgeRule,Schedule event sources (#1842)

* Add DeadLetterConfig,RetryPolicy properties for EventBridgeRule,Schedule event sources

* Minor fix,rename function argument

* Update test class name

* Combine dlq extraction/generation into the utility class

* Remove unused import

* fix: propagate condition to sqs queue policy for sqssubscription (#1798)

* fix: propagate condition to sqs queue policy for sqssubscription

* Update unit test for function_event_conditions

* Update black commands in Makefile to check only .py files

* Update test with one more SNS event source with sqsSubscription set

* Revert "Update black commands in Makefile to check only .py files"

This reverts commit 115ff09.

* chore: Remove biased language from pylintrc (#1847)

* fix: Support new CodeDeploy ManagedPolicy (#1858)

* fix: Support new CodeDeploy MangedPolicy in regions without AWSCodeDeployRoleForLambda

CodeDeploy is migrating from AWSCodeDeployRoleForLambda to AWSCodeDeployRoleForLambdaLimited.
Some partitions do not support AWSCodeDeployRoleForLambda and therefore we need to use the newer
one in those partitions. We cannot widely update to AWSCodeDeployRoleForLambdaLimited since this
can cause customer's stacks to fail unexpectedly.

* Forgot to commit unit tests

* Handle PR feedback

Co-authored-by: Jacob Fuss <jfuss@users.noreply.github.com>

* fix: Update Slack invite link (#1877)

Co-authored-by: Jacob Fuss <jfuss@users.noreply.github.com>

* feature: Support for custom checkpointing (#1883)

Co-authored-by: Vinayak <vinayaks@amazon.com>

* Fix: Description in AWS::Serverless::HttpApi (#1884)

* Fix: Description in AWS::Serverless::HttpApi

* Update _set to _add

* Update AWS::S3::Bucket properties (#1885)

* Update AWS::S3::Bucket properties

* Fix type checking validators for AWS::S3::Bucket

* Update to use any_type() in favor of supporing ref

* Fix: Replaced invalid AMQ managed policy by providing policy statements (#1891)

* Fix for invalid MQ event source managed policy

* Fix for invalid managed policy for MQ, included support for new MQ event source property, updated test cases

* Black reformatting

* Test case changes

* Changed policy name

* Modified test cases with new policy name

* chore: bump version 1.34.0 (#1892)

* Fix: SAM crashes method_definition for path is invalid (#1802)

* Fix: SAM crashes method_definition for path is invalid

* Fix: SAM crashes whenmappings is null

* Removed print statement in test_translator

* Fix: Swagger security not a dict

Co-authored-by: Mufaddal Makati <mmmakati@amazon.com>

Co-authored-by: ejafarli <54083696+ejafarli@users.noreply.github.com>
Co-authored-by: _sam <3804518+aahung@users.noreply.github.com>
Co-authored-by: Jacob Fuss <32497805+jfuss@users.noreply.github.com>
Co-authored-by: Jacob Fuss <jfuss@users.noreply.github.com>
Co-authored-by: vinayaksood <vinayaksood.282@gmail.com>
Co-authored-by: Vinayak <vinayaks@amazon.com>
Co-authored-by: Qingchuan Ma <69653965+qingchm@users.noreply.github.com>
Co-authored-by: Mufaddal Makati <mufaddal@rawbytes.com>
Co-authored-by: Mufaddal Makati <mmmakati@amazon.com>

Co-authored-by: ejafarli <54083696+ejafarli@users.noreply.github.com>
Co-authored-by: _sam <3804518+aahung@users.noreply.github.com>
Co-authored-by: Jacob Fuss <32497805+jfuss@users.noreply.github.com>
Co-authored-by: Jacob Fuss <jfuss@users.noreply.github.com>
Co-authored-by: vinayaksood <vinayaksood.282@gmail.com>
Co-authored-by: Vinayak <vinayaks@amazon.com>
Co-authored-by: Qingchuan Ma <69653965+qingchm@users.noreply.github.com>
Co-authored-by: Mufaddal Makati <mufaddal@rawbytes.com>
Co-authored-by: Mufaddal Makati <mmmakati@amazon.com>
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.85%. Comparing base (bb930cc) to head (da90834).
⚠️ Report is 1337 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1798      +/-   ##
===========================================
+ Coverage    94.04%   94.85%   +0.81%     
===========================================
  Files           87       89       +2     
  Lines         5690     6742    +1052     
  Branches      1151     1529     +378     
===========================================
+ Hits          5351     6395    +1044     
  Misses         156      156              
- Partials       183      191       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants