Skip to content

Conversation

jfuss
Copy link
Contributor

@jfuss jfuss commented Dec 11, 2020

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.

Issue #, if available:

Description of changes:

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.

…ployRoleForLambda

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.
@codecov-io
Copy link

codecov-io commented Dec 11, 2020

Codecov Report

Merging #1858 (d476db5) into develop (6059c19) will increase coverage by 0.07%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1858      +/-   ##
===========================================
+ Coverage    93.97%   94.05%   +0.07%     
===========================================
  Files           89       89              
  Lines         5825     5832       +7     
  Branches      1185     1188       +3     
===========================================
+ Hits          5474     5485      +11     
+ Misses         162      160       -2     
+ Partials       189      187       -2     
Impacted Files Coverage Δ
...el/preferences/deployment_preference_collection.py 91.56% <100.00%> (+0.20%) ⬆️
samtranslator/region_configuration.py 100.00% <100.00%> (ø)
samtranslator/translator/arn_generator.py 93.10% <100.00%> (+5.60%) ⬆️
samtranslator/model/lambda_.py 93.10% <0.00%> (ø)
samtranslator/model/eventsources/pull.py 84.61% <0.00%> (+0.17%) ⬆️
samtranslator/translator/logical_id_generator.py 100.00% <0.00%> (+9.09%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6059c19...d476db5. Read the comment docs.

@qingchm qingchm changed the title fix: Support new CodeDeploy MangedPolicy fix: Support new CodeDeploy ManagedPolicy Dec 11, 2020
"""

return ArnGenerator.get_partition_name() not in [cls.partitions["govcloud"], cls.partitions["china"]]
return ArnGenerator.get_partition_name() not in [
Copy link
Contributor

Choose a reason for hiding this comment

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

minor: Looks like the list can be replaced by cls.partitions.values(), so we don't change two places.

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 for using cls.partitions.values()

it should be cls.partitions.values() instead of cls.partitions.keys(), because for example we are checking whether "aws-iso" is in the list, but not "iso".

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes indeed, I removed my comment :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. Not sure why this is defined this way in general. Will simplify.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There was no need for the dictionary that I could find. So I just pushed everything into the in statement.

@hawflau
Copy link
Contributor

hawflau commented Dec 11, 2020

Do we also need to update tests/translator/test_translator.py and tests/translator/output to test templates for iso regions?

@jfuss
Copy link
Contributor Author

jfuss commented Dec 21, 2020

Do we also need to update tests/translator/test_translator.py and tests/translator/output to test templates for iso regions?

I added unit test around this so we don't need to do the full functional testing. We also have integ tests we run when deploying the service. I would prefer not to keep replicating these tests per region/partition.

Copy link
Contributor

@hawflau hawflau left a comment

Choose a reason for hiding this comment

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

LGTM!

@jfuss jfuss merged commit b5ddd1f into aws:develop Dec 29, 2020
hawflau pushed a commit to hawflau/serverless-application-model that referenced this pull request Jan 15, 2021
* 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 <[email protected]>
hawflau pushed a commit to hawflau/serverless-application-model that referenced this pull request Jan 15, 2021
* 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 <[email protected]>
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 <[email protected]>

* fix: Update Slack invite link (#1877)

Co-authored-by: Jacob Fuss <[email protected]>

* feature: Support for custom checkpointing (#1883)

Co-authored-by: Vinayak <[email protected]>

* 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 <[email protected]>

Co-authored-by: ejafarli <[email protected]>
Co-authored-by: _sam <[email protected]>
Co-authored-by: Jacob Fuss <[email protected]>
Co-authored-by: Jacob Fuss <[email protected]>
Co-authored-by: vinayaksood <[email protected]>
Co-authored-by: Vinayak <[email protected]>
Co-authored-by: Qingchuan Ma <[email protected]>
Co-authored-by: Mufaddal Makati <[email protected]>
Co-authored-by: Mufaddal Makati <[email protected]>
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 <[email protected]>

* fix: Update Slack invite link (#1877)

Co-authored-by: Jacob Fuss <[email protected]>

* feature: Support for custom checkpointing (#1883)

Co-authored-by: Vinayak <[email protected]>

* 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 <[email protected]>

Co-authored-by: ejafarli <[email protected]>
Co-authored-by: _sam <[email protected]>
Co-authored-by: Jacob Fuss <[email protected]>
Co-authored-by: Jacob Fuss <[email protected]>
Co-authored-by: vinayaksood <[email protected]>
Co-authored-by: Vinayak <[email protected]>
Co-authored-by: Qingchuan Ma <[email protected]>
Co-authored-by: Mufaddal Makati <[email protected]>
Co-authored-by: Mufaddal Makati <[email protected]>

Co-authored-by: ejafarli <[email protected]>
Co-authored-by: _sam <[email protected]>
Co-authored-by: Jacob Fuss <[email protected]>
Co-authored-by: Jacob Fuss <[email protected]>
Co-authored-by: vinayaksood <[email protected]>
Co-authored-by: Vinayak <[email protected]>
Co-authored-by: Qingchuan Ma <[email protected]>
Co-authored-by: Mufaddal Makati <[email protected]>
Co-authored-by: Mufaddal Makati <[email protected]>
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