Skip to content
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

chore: merge master into develop #1594

Merged
merged 3 commits into from
May 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion samtranslator/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Resource(object):
property_types = None
_keywords = ["logical_id", "relative_id", "depends_on", "resource_attributes"]

_supported_resource_attributes = ["DeletionPolicy", "UpdateReplacePolicy", "UpdatePolicy", "Condition"]
_supported_resource_attributes = ["DeletionPolicy", "UpdatePolicy", "Condition"]

# Runtime attributes that can be qureied resource. They are CloudFormation attributes like ARN, Name etc that
# will be resolvable at runtime. This map will be implemented by sub-classes to express list of attributes they
Expand Down
2 changes: 0 additions & 2 deletions samtranslator/model/sam_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,6 @@ def _construct_version(self, function, intrinsics_resolver, code_sha256=None):
if attributes is None:
attributes = {}
attributes["DeletionPolicy"] = "Retain"
attributes["UpdateReplacePolicy"] = "Delete"

lambda_version = LambdaVersion(logical_id=logical_id, attributes=attributes)
lambda_version.FunctionName = function.get_runtime_attr("name")
Expand Down Expand Up @@ -1109,7 +1108,6 @@ def _construct_lambda_layer(self, intrinsics_resolver):
if attributes is None:
attributes = {}
attributes["DeletionPolicy"] = retention_policy_value
attributes["UpdateReplacePolicy"] = "Delete"

old_logical_id = self.logical_id
new_logical_id = logical_id_generator.LogicalIdGenerator(old_logical_id, self.to_dict()).gen()
Expand Down
4 changes: 0 additions & 4 deletions tests/translator/output/aws-cn/basic_layer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"Resources": {
"LayerWithCondition7c655e10ea": {
"DeletionPolicy": "Retain",
"UpdateReplacePolicy": "Delete",
"Type": "AWS::Lambda::LayerVersion",
"Properties": {
"Content": {
Expand All @@ -23,7 +22,6 @@
},
"MinimalLayer0c7f96cce7": {
"DeletionPolicy": "Retain",
"UpdateReplacePolicy": "Delete",
"Type": "AWS::Lambda::LayerVersion",
"Properties": {
"Content": {
Expand All @@ -35,7 +33,6 @@
},
"CompleteLayer5d71a60e81": {
"DeletionPolicy": "Retain",
"UpdateReplacePolicy": "Delete",
"Type": "AWS::Lambda::LayerVersion",
"Properties": {
"Content": {
Expand All @@ -53,7 +50,6 @@
},
"LayerWithContentUriObjectbdbf1b82ac": {
"DeletionPolicy": "Delete",
"UpdateReplacePolicy": "Delete",
"Type": "AWS::Lambda::LayerVersion",
"Properties": {
"Content": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,6 @@
},
"MyAwesomeFunctionVersion640128d35d": {
"DeletionPolicy": "Retain",
"UpdateReplacePolicy": "Delete",
"Type": "AWS::Lambda::Version",
"Condition": "MyCondition",
"Properties": {
Expand Down
1 change: 0 additions & 1 deletion tests/translator/output/aws-cn/function_with_alias.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"Resources": {
"MinimalFunctionVersion640128d35d": {
"DeletionPolicy": "Retain",
"UpdateReplacePolicy": "Delete",
"Type": "AWS::Lambda::Version",
"Properties": {
"Description": "sam-testing",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,6 @@
},
"MyAwesomeFunctionVersion640128d35d": {
"DeletionPolicy": "Retain",
"UpdateReplacePolicy": "Delete",
"Type": "AWS::Lambda::Version",
"Properties": {
"FunctionName": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"Resources": {
"MinimalFunctionVersion640128d35d": {
"DeletionPolicy": "Retain",
"UpdateReplacePolicy": "Delete",
"Type": "AWS::Lambda::Version",
"Properties": {
"FunctionName": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
},
"CustomWithFindInMapVersion640128d35d": {
"DeletionPolicy": "Retain",
"UpdateReplacePolicy": "Delete",
"Type": "AWS::Lambda::Version",
"Properties": {
"FunctionName": {
Expand Down Expand Up @@ -205,7 +204,6 @@
},
"CustomWithConditionVersion640128d35d": {
"DeletionPolicy": "Retain",
"UpdateReplacePolicy": "Delete",
"Type": "AWS::Lambda::Version",
"Properties": {
"FunctionName": {
Expand Down Expand Up @@ -244,7 +242,6 @@
},
"CustomWithCondition2Version640128d35d": {
"DeletionPolicy": "Retain",
"UpdateReplacePolicy": "Delete",
"Type": "AWS::Lambda::Version",
"Properties": {
"FunctionName": {
Expand Down Expand Up @@ -306,7 +303,6 @@
},
"NormalWithRefVersion640128d35d": {
"DeletionPolicy": "Retain",
"UpdateReplacePolicy": "Delete",
"Type": "AWS::Lambda::Version",
"Properties": {
"FunctionName": {
Expand Down Expand Up @@ -433,7 +429,6 @@
},
"CustomWithSubVersion640128d35d": {
"DeletionPolicy": "Retain",
"UpdateReplacePolicy": "Delete",
"Type": "AWS::Lambda::Version",
"Properties": {
"FunctionName": {
Expand Down Expand Up @@ -596,7 +591,6 @@
},
"NormalWithSubVersion640128d35d": {
"DeletionPolicy": "Retain",
"UpdateReplacePolicy": "Delete",
"Type": "AWS::Lambda::Version",
"Properties": {
"FunctionName": {
Expand Down Expand Up @@ -819,7 +813,6 @@
},
"MinimalFunctionVersion640128d35d": {
"DeletionPolicy": "Retain",
"UpdateReplacePolicy": "Delete",
"Type": "AWS::Lambda::Version",
"Properties": {
"FunctionName": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@
},
"HelloWorldFunctionVersionfb53d5c2e6": {
"DeletionPolicy": "Retain",
"UpdateReplacePolicy": "Delete",
"Type": "AWS::Lambda::Version",
"Properties": {
"FunctionName": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@
},
"FunctionWithRoleVersion640128d35d": {
"DeletionPolicy": "Retain",
"UpdateReplacePolicy": "Delete",
"Type": "AWS::Lambda::Version",
"Properties": {
"FunctionName": {
Expand Down Expand Up @@ -210,7 +209,6 @@
},
"MinimalFunctionVersion640128d35d": {
"DeletionPolicy": "Retain",
"UpdateReplacePolicy": "Delete",
"Type": "AWS::Lambda::Version",
"Properties": {
"FunctionName": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@
},
"OtherFunctionVersion640128d35d": {
"DeletionPolicy": "Retain",
"UpdateReplacePolicy": "Delete",
"Type": "AWS::Lambda::Version",
"Properties": {
"FunctionName": {
Expand Down Expand Up @@ -187,7 +186,6 @@
},
"MinimalFunctionVersion640128d35d": {
"DeletionPolicy": "Retain",
"UpdateReplacePolicy": "Delete",
"Type": "AWS::Lambda::Version",
"Properties": {
"FunctionName": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@
},
"MinimalFunctionVersion640128d35d": {
"DeletionPolicy": "Retain",
"UpdateReplacePolicy": "Delete",
"Type": "AWS::Lambda::Version",
"Properties": {
"FunctionName": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@
},
"MinimalFunctionVersion640128d35d": {
"DeletionPolicy": "Retain",
"UpdateReplacePolicy": "Delete",
"Type": "AWS::Lambda::Version",
"Properties": {
"FunctionName": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@
},
"MinimalFunctionVersion640128d35d": {
"DeletionPolicy": "Retain",
"UpdateReplacePolicy": "Delete",
"Type": "AWS::Lambda::Version",
"Properties": {
"FunctionName": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@
},
"MinimalFunctionWithMinimalDeploymentPreferenceVersion640128d35d": {
"DeletionPolicy": "Retain",
"UpdateReplacePolicy": "Delete",
"Type": "AWS::Lambda::Version",
"Properties": {
"FunctionName": {
Expand Down Expand Up @@ -304,7 +303,6 @@
},
"MinimalFunctionWithDeploymentPreferenceWithHooksAndAlarmsVersion640128d35d": {
"DeletionPolicy": "Retain",
"UpdateReplacePolicy": "Delete",
"Type": "AWS::Lambda::Version",
"Properties": {
"FunctionName": {
Expand Down Expand Up @@ -378,7 +376,6 @@
},
"MinimalFunctionVersion640128d35d": {
"DeletionPolicy": "Retain",
"UpdateReplacePolicy": "Delete",
"Type": "AWS::Lambda::Version",
"Properties": {
"FunctionName": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"Resources": {
"MinimalFunctionVersion640128d35d": {
"DeletionPolicy": "Retain",
"UpdateReplacePolicy": "Delete",
"Type": "AWS::Lambda::Version",
"Properties": {
"FunctionName": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@
},
"MyTestFunctionVersiondaf9da458d": {
"DeletionPolicy": "Retain",
"UpdateReplacePolicy": "Delete",
"Type": "AWS::Lambda::Version",
"Properties": {
"FunctionName": {
Expand Down
1 change: 0 additions & 1 deletion tests/translator/output/aws-cn/function_with_layers.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
},
"MyLayera5167acaba": {
"DeletionPolicy": "Retain",
"UpdateReplacePolicy": "Delete",
"Type": "AWS::Lambda::LayerVersion",
"Properties": {
"Content": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"Resources": {
"MyLayera5167acaba": {
"DeletionPolicy": "Retain",
"UpdateReplacePolicy": "Delete",
"Type": "AWS::Lambda::LayerVersion",
"Properties": {
"Content": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@
},
"MinimalFunctionVersion640128d35d": {
"DeletionPolicy": "Retain",
"UpdateReplacePolicy": "Delete",
"Type": "AWS::Lambda::Version",
"Properties": {
"FunctionName": {
Expand Down
2 changes: 0 additions & 2 deletions tests/translator/output/aws-cn/globals_for_function.json
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,6 @@
},
"FunctionWithOverridesVersion096ed3b52b": {
"DeletionPolicy": "Retain",
"UpdateReplacePolicy": "Delete",
"Type": "AWS::Lambda::Version",
"Properties": {
"FunctionName": {
Expand All @@ -233,7 +232,6 @@
},
"MinimalFunctionVersion0a06fc8fb1": {
"DeletionPolicy": "Retain",
"UpdateReplacePolicy": "Delete",
"Type": "AWS::Lambda::Version",
"Properties": {
"FunctionName": {
Expand Down
2 changes: 0 additions & 2 deletions tests/translator/output/aws-cn/layers_all_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
},
"MyLayerd04062b365": {
"DeletionPolicy": "Delete",
"UpdateReplacePolicy": "Delete",
"Type": "AWS::Lambda::LayerVersion",
"Properties": {
"Content": {
Expand All @@ -78,7 +77,6 @@
},
"MyLayerWithANamefda8c9ec8c": {
"DeletionPolicy": "Retain",
"UpdateReplacePolicy": "Delete",
"Type": "AWS::Lambda::LayerVersion",
"Properties": {
"Content": {
Expand Down
6 changes: 0 additions & 6 deletions tests/translator/output/aws-cn/layers_with_intrinsics.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"Resources": {
"LayerWithNameIntrinsiccf8baed8b9": {
"DeletionPolicy": "Retain",
"UpdateReplacePolicy": "Delete",
"Type": "AWS::Lambda::LayerVersion",
"Properties": {
"Content": {
Expand All @@ -27,7 +26,6 @@
},
"LayerWithRefNameIntrinsicRegion186db7e435": {
"DeletionPolicy": "Retain",
"UpdateReplacePolicy": "Delete",
"Type": "AWS::Lambda::LayerVersion",
"Properties": {
"Content": {
Expand All @@ -39,7 +37,6 @@
},
"LayerWithSubNameIntrinsicRegionfbc3f9f13d": {
"DeletionPolicy": "Retain",
"UpdateReplacePolicy": "Delete",
"Type": "AWS::Lambda::LayerVersion",
"Properties": {
"Content": {
Expand All @@ -53,7 +50,6 @@
},
"LayerWithRuntimesIntrinsic1a006faa85": {
"DeletionPolicy": "Retain",
"UpdateReplacePolicy": "Delete",
"Type": "AWS::Lambda::LayerVersion",
"Properties": {
"Content": {
Expand All @@ -68,7 +64,6 @@
},
"LayerWithLicenseIntrinsic965c8d0c9b": {
"DeletionPolicy": "Retain",
"UpdateReplacePolicy": "Delete",
"Type": "AWS::Lambda::LayerVersion",
"Properties": {
"Content": {
Expand All @@ -82,7 +77,6 @@
"LayerWithSubNameIntrinsic6e9b477102": {
"Type": "AWS::Lambda::LayerVersion",
"DeletionPolicy": "Retain",
"UpdateReplacePolicy": "Delete",
"Properties": {
"Content": {
"S3Bucket": "sam-demo-bucket",
Expand Down
4 changes: 0 additions & 4 deletions tests/translator/output/aws-us-gov/basic_layer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"Resources": {
"LayerWithCondition7c655e10ea": {
"DeletionPolicy": "Retain",
"UpdateReplacePolicy": "Delete",
"Type": "AWS::Lambda::LayerVersion",
"Properties": {
"Content": {
Expand All @@ -23,7 +22,6 @@
},
"MinimalLayer0c7f96cce7": {
"DeletionPolicy": "Retain",
"UpdateReplacePolicy": "Delete",
"Type": "AWS::Lambda::LayerVersion",
"Properties": {
"Content": {
Expand All @@ -35,7 +33,6 @@
},
"CompleteLayer5d71a60e81": {
"DeletionPolicy": "Retain",
"UpdateReplacePolicy": "Delete",
"Type": "AWS::Lambda::LayerVersion",
"Properties": {
"Content": {
Expand All @@ -53,7 +50,6 @@
},
"LayerWithContentUriObjectbdbf1b82ac": {
"DeletionPolicy": "Delete",
"UpdateReplacePolicy": "Delete",
"Type": "AWS::Lambda::LayerVersion",
"Properties": {
"Content": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,6 @@
},
"MyAwesomeFunctionVersion640128d35d": {
"DeletionPolicy": "Retain",
"UpdateReplacePolicy": "Delete",
"Type": "AWS::Lambda::Version",
"Condition": "MyCondition",
"Properties": {
Expand Down
Loading