From 3dac29feb4617f9eafeedc51ba30421a1e02c69b Mon Sep 17 00:00:00 2001 From: Qingchuan Ma Date: Fri, 8 Jan 2021 16:11:51 -0800 Subject: [PATCH 01/41] Fix for invalid MQ event source managed policy --- samtranslator/model/eventsources/pull.py | 33 +++++++++++++++++++++--- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/samtranslator/model/eventsources/pull.py b/samtranslator/model/eventsources/pull.py index 7ead57569..f2460c7ed 100644 --- a/samtranslator/model/eventsources/pull.py +++ b/samtranslator/model/eventsources/pull.py @@ -129,8 +129,17 @@ def _link_policy(self, role, destination_config_policy=None): :param model.iam.IAMRole role: the execution role generated for the function """ policy_arn = self.get_policy_arn() - if role is not None and policy_arn not in role.ManagedPolicyArns: - role.ManagedPolicyArns.append(policy_arn) + policy_statements = self.get_policy_statements() + if role is not None: + if policy_arn is not None and policy_arn not in role.ManagedPolicyArns: + role.ManagedPolicyArns.append(policy_arn) + if policy_statements is not None: + if role.Policies is None: + role.Policies = [] + for policy in policy_statements: + if policy not in role.Policies: + if not policy.get("PolicyDocument") in [d["PolicyDocument"] for d in role.Policies]: + role.Policies.append(policy) # add SQS or SNS policy only if role is present in kwargs if role is not None and destination_config_policy is not None and destination_config_policy: if role.Policies is None: @@ -150,6 +159,8 @@ class Kinesis(PullEventSource): def get_policy_arn(self): return ArnGenerator.generate_aws_managed_policy_arn("service-role/AWSLambdaKinesisExecutionRole") + def get_policy_statements(): + return None class DynamoDB(PullEventSource): """DynamoDB Streams event source.""" @@ -159,6 +170,9 @@ class DynamoDB(PullEventSource): def get_policy_arn(self): return ArnGenerator.generate_aws_managed_policy_arn("service-role/AWSLambdaDynamoDBExecutionRole") + def get_policy_statements(): + return None + class SQS(PullEventSource): """SQS Queue event source.""" @@ -167,7 +181,9 @@ class SQS(PullEventSource): def get_policy_arn(self): return ArnGenerator.generate_aws_managed_policy_arn("service-role/AWSLambdaSQSQueueExecutionRole") - + + def get_policy_statements(): + return None class MSK(PullEventSource): """MSK event source.""" @@ -177,6 +193,8 @@ class MSK(PullEventSource): def get_policy_arn(self): return ArnGenerator.generate_aws_managed_policy_arn("service-role/AWSLambdaMSKExecutionRole") + def get_policy_statements(): + return None class MQ(PullEventSource): """MQ event source.""" @@ -184,4 +202,11 @@ class MQ(PullEventSource): resource_type = "MQ" def get_policy_arn(self): - return ArnGenerator.generate_aws_managed_policy_arn("service-role/AWSLambdaAMQExecutionRole") + return None + + def get_policy_statements(): + document = { + "PolicyName": "TestPolicy", + "PolicyDocument": {"Statement": [{"Action": "Test", "Effect": "Allow", "Resource": "Test"}]}, + } + return [document] \ No newline at end of file From 3bd2eb64aae30d7c5204372a71a56c64a8392b5a Mon Sep 17 00:00:00 2001 From: Qingchuan Ma Date: Thu, 14 Jan 2021 11:46:13 -0800 Subject: [PATCH 02/41] Fix for invalid managed policy for MQ, included support for new MQ event source property, updated test cases --- samtranslator/model/eventsources/pull.py | 69 ++++++++++-- tests/translator/input/function_with_amq.yaml | 17 +++ .../input/function_with_amq_kms.yaml | 18 +++ .../output/aws-cn/function_with_amq.json | 98 ++++++++++++++++ .../output/aws-cn/function_with_amq_kms.json | 105 ++++++++++++++++++ .../output/aws-us-gov/function_with_amq.json | 98 ++++++++++++++++ .../aws-us-gov/function_with_amq_kms.json | 105 ++++++++++++++++++ .../translator/output/function_with_amq.json | 98 ++++++++++++++++ .../output/function_with_amq_kms.json | 105 ++++++++++++++++++ tests/translator/test_translator.py | 3 +- 10 files changed, 707 insertions(+), 9 deletions(-) create mode 100644 tests/translator/input/function_with_amq.yaml create mode 100644 tests/translator/input/function_with_amq_kms.yaml create mode 100644 tests/translator/output/aws-cn/function_with_amq.json create mode 100644 tests/translator/output/aws-cn/function_with_amq_kms.json create mode 100644 tests/translator/output/aws-us-gov/function_with_amq.json create mode 100644 tests/translator/output/aws-us-gov/function_with_amq_kms.json create mode 100644 tests/translator/output/function_with_amq.json create mode 100644 tests/translator/output/function_with_amq_kms.json diff --git a/samtranslator/model/eventsources/pull.py b/samtranslator/model/eventsources/pull.py index e67bb8fb5..e401ab04e 100644 --- a/samtranslator/model/eventsources/pull.py +++ b/samtranslator/model/eventsources/pull.py @@ -34,6 +34,7 @@ class PullEventSource(ResourceMacro): "Broker": PropertyType(False, is_str()), "Queues": PropertyType(False, is_type(list)), "SourceAccessConfigurations": PropertyType(False, is_type(list)), + "SecretsManagerKmsKeyId": PropertyType(False, is_str()), "TumblingWindowInSeconds": PropertyType(False, is_type(int)), "FunctionResponseTypes": PropertyType(False, is_type(list)), } @@ -41,6 +42,9 @@ class PullEventSource(ResourceMacro): def get_policy_arn(self): raise NotImplementedError("Subclass must implement this method") + def get_policy_statements(self): + raise NotImplementedError("Subclass must implement this method") + def to_cloudformation(self, **kwargs): """Returns the Lambda EventSourceMapping to which this pull event corresponds. Adds the appropriate managed policy to the function's execution role, if such a role is provided. @@ -163,7 +167,7 @@ class Kinesis(PullEventSource): def get_policy_arn(self): return ArnGenerator.generate_aws_managed_policy_arn("service-role/AWSLambdaKinesisExecutionRole") - def get_policy_statements(): + def get_policy_statements(self): return None class DynamoDB(PullEventSource): @@ -174,7 +178,7 @@ class DynamoDB(PullEventSource): def get_policy_arn(self): return ArnGenerator.generate_aws_managed_policy_arn("service-role/AWSLambdaDynamoDBExecutionRole") - def get_policy_statements(): + def get_policy_statements(self): return None @@ -186,7 +190,7 @@ class SQS(PullEventSource): def get_policy_arn(self): return ArnGenerator.generate_aws_managed_policy_arn("service-role/AWSLambdaSQSQueueExecutionRole") - def get_policy_statements(): + def get_policy_statements(self): return None class MSK(PullEventSource): @@ -197,7 +201,7 @@ class MSK(PullEventSource): def get_policy_arn(self): return ArnGenerator.generate_aws_managed_policy_arn("service-role/AWSLambdaMSKExecutionRole") - def get_policy_statements(): + def get_policy_statements(self): return None class MQ(PullEventSource): @@ -208,9 +212,58 @@ class MQ(PullEventSource): def get_policy_arn(self): return None - def get_policy_statements(): + def get_policy_statements(self): + if not self.SourceAccessConfigurations: + raise InvalidEventException( + self.relative_id, + "No SourceAccessConfigurations for ActiveMQ provided.", + ) + if not type(self.SourceAccessConfigurations) is list: + raise InvalidEventException( + self.relative_id, + "Provided SourceAccessConfigurations cannot be parsed into a list.", + ) + # MQ only supports SourceAccessConfigurations with list size of 1 + if not (len(self.SourceAccessConfigurations) == 1): + raise InvalidEventException( + self.relative_id, + "SourceAccessConfigurations for ActiveMQ only supports single configuration entry.", + ) + if not self.SourceAccessConfigurations[0].get("URI"): + raise InvalidEventException( + self.relative_id, + "No URI property specified in SourceAccessConfigurations for ActiveMQ.", + ) document = { - "PolicyName": "TestPolicy", - "PolicyDocument": {"Statement": [{"Action": "Test", "Effect": "Allow", "Resource": "Test"}]}, + "PolicyName": "AMQPolicy", + "PolicyDocument": + { + "Statement": [ + { + "Action": [ + "secretsmanager:GetSecretValue", + ], + "Effect": "Allow", + "Resource": self.SourceAccessConfigurations[0].get("URI") + }, + { + "Action": [ + "mq:DescribeBroker", + ], + "Effect": "Allow", + "Resource": self.Broker + } + ] + } } - return [document] \ No newline at end of file + if self.SecretsManagerKmsKeyId: + kms_policy = { + "Action": "kms:Decrypt", + "Effect": "Allow", + "Resource": { + "Fn::Sub": + "arn:${AWS::Partition}:kms:${AWS::Region}:${AWS::AccountId}:key/" + self.SecretsManagerKmsKeyId + } + } + document["PolicyDocument"]["Statement"].append(kms_policy) + return [document] diff --git a/tests/translator/input/function_with_amq.yaml b/tests/translator/input/function_with_amq.yaml new file mode 100644 index 000000000..00d28b841 --- /dev/null +++ b/tests/translator/input/function_with_amq.yaml @@ -0,0 +1,17 @@ +Resources: + MQFunction: + Type: 'AWS::Serverless::Function' + Properties: + CodeUri: s3://sam-demo-bucket/queues.zip + Handler: queue.mq_handler + Runtime: python2.7 + Events: + MyMQQueue: + Type: MQ + Properties: + Broker: arn:aws:mq:us-east-2:123456789012:broker:MyBroker:b-1234a5b6-78cd-901e-2fgh-3i45j6k178l9 + Queues: + - "Queue1" + SourceAccessConfigurations: + - Type: BASIC_AUTH + URI: arn:aws:secretsmanager:us-west-2:123456789012:secret:my-path/my-secret-name-1a2b3c \ No newline at end of file diff --git a/tests/translator/input/function_with_amq_kms.yaml b/tests/translator/input/function_with_amq_kms.yaml new file mode 100644 index 000000000..7ea02c2df --- /dev/null +++ b/tests/translator/input/function_with_amq_kms.yaml @@ -0,0 +1,18 @@ +Resources: + MQFunction: + Type: 'AWS::Serverless::Function' + Properties: + CodeUri: s3://sam-demo-bucket/queues.zip + Handler: queue.mq_handler + Runtime: python2.7 + Events: + MyMQQueue: + Type: MQ + Properties: + Broker: arn:aws:mq:us-east-2:123456789012:broker:MyBroker:b-1234a5b6-78cd-901e-2fgh-3i45j6k178l9 + Queues: + - "Queue1" + SourceAccessConfigurations: + - Type: BASIC_AUTH + URI: arn:aws:secretsmanager:us-west-2:123456789012:secret:my-path/my-secret-name-1a2b3c + SecretsManagerKmsKeyId: 1abc23d4-567f-8ab9-cde0-1fab234c5d67 \ No newline at end of file diff --git a/tests/translator/output/aws-cn/function_with_amq.json b/tests/translator/output/aws-cn/function_with_amq.json new file mode 100644 index 000000000..672babec8 --- /dev/null +++ b/tests/translator/output/aws-cn/function_with_amq.json @@ -0,0 +1,98 @@ +{ + "Resources": { + "MQFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "sam-demo-bucket", + "S3Key": "queues.zip" + }, + "Handler": "queue.mq_handler", + "Role": { + "Fn::GetAtt": [ + "MQFunctionRole", + "Arn" + ] + }, + "Runtime": "python2.7", + "Tags": [ + { + "Key": "lambda:createdBy", + "Value": "SAM" + } + ] + } + }, + "MQFunctionRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Action": [ + "sts:AssumeRole" + ], + "Effect": "Allow", + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + } + } + ] + }, + "ManagedPolicyArns": [ + "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ], + "Policies": [ + { + "PolicyName": "AMQPolicy", + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "secretsmanager:GetSecretValue" + ], + "Effect": "Allow", + "Resource": "arn:aws:secretsmanager:us-west-2:123456789012:secret:my-path/my-secret-name-1a2b3c" + }, + { + "Action": [ + "mq:DescribeBroker" + ], + "Effect": "Allow", + "Resource": "arn:aws:mq:us-east-2:123456789012:broker:MyBroker:b-1234a5b6-78cd-901e-2fgh-3i45j6k178l9" + } + ] + } + } + ], + "Tags": [ + { + "Key": "lambda:createdBy", + "Value": "SAM" + } + ] + } + }, + "MQFunctionMyMQQueue": { + "Type": "AWS::Lambda::EventSourceMapping", + "Properties": { + "EventSourceArn": "arn:aws:mq:us-east-2:123456789012:broker:MyBroker:b-1234a5b6-78cd-901e-2fgh-3i45j6k178l9", + "FunctionName": { + "Ref": "MQFunction" + }, + "Queues": [ + "Queue1" + ], + "SourceAccessConfigurations": [ + { + "Type": "BASIC_AUTH", + "URI": "arn:aws:secretsmanager:us-west-2:123456789012:secret:my-path/my-secret-name-1a2b3c" + } + ] + } + } + } +} \ No newline at end of file diff --git a/tests/translator/output/aws-cn/function_with_amq_kms.json b/tests/translator/output/aws-cn/function_with_amq_kms.json new file mode 100644 index 000000000..94aae9f8d --- /dev/null +++ b/tests/translator/output/aws-cn/function_with_amq_kms.json @@ -0,0 +1,105 @@ +{ + "Resources": { + "MQFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "sam-demo-bucket", + "S3Key": "queues.zip" + }, + "Handler": "queue.mq_handler", + "Role": { + "Fn::GetAtt": [ + "MQFunctionRole", + "Arn" + ] + }, + "Runtime": "python2.7", + "Tags": [ + { + "Key": "lambda:createdBy", + "Value": "SAM" + } + ] + } + }, + "MQFunctionRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Action": [ + "sts:AssumeRole" + ], + "Effect": "Allow", + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + } + } + ] + }, + "ManagedPolicyArns": [ + "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ], + "Policies": [ + { + "PolicyName": "AMQPolicy", + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "secretsmanager:GetSecretValue" + ], + "Effect": "Allow", + "Resource": "arn:aws:secretsmanager:us-west-2:123456789012:secret:my-path/my-secret-name-1a2b3c" + }, + { + "Action": [ + "mq:DescribeBroker" + ], + "Effect": "Allow", + "Resource": "arn:aws:mq:us-east-2:123456789012:broker:MyBroker:b-1234a5b6-78cd-901e-2fgh-3i45j6k178l9" + }, + { + "Action": "kms:Decrypt", + "Effect": "Allow", + "Resource": { + "Fn::Sub": "arn:${AWS::Partition}:kms:${AWS::Region}:${AWS::AccountId}:key/1abc23d4-567f-8ab9-cde0-1fab234c5d67" + } + } + ] + } + } + ], + "Tags": [ + { + "Key": "lambda:createdBy", + "Value": "SAM" + } + ] + } + }, + "MQFunctionMyMQQueue": { + "Type": "AWS::Lambda::EventSourceMapping", + "Properties": { + "EventSourceArn": "arn:aws:mq:us-east-2:123456789012:broker:MyBroker:b-1234a5b6-78cd-901e-2fgh-3i45j6k178l9", + "FunctionName": { + "Ref": "MQFunction" + }, + "Queues": [ + "Queue1" + ], + "SourceAccessConfigurations": [ + { + "Type": "BASIC_AUTH", + "URI": "arn:aws:secretsmanager:us-west-2:123456789012:secret:my-path/my-secret-name-1a2b3c" + } + ] + } + } + } + } \ No newline at end of file diff --git a/tests/translator/output/aws-us-gov/function_with_amq.json b/tests/translator/output/aws-us-gov/function_with_amq.json new file mode 100644 index 000000000..672babec8 --- /dev/null +++ b/tests/translator/output/aws-us-gov/function_with_amq.json @@ -0,0 +1,98 @@ +{ + "Resources": { + "MQFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "sam-demo-bucket", + "S3Key": "queues.zip" + }, + "Handler": "queue.mq_handler", + "Role": { + "Fn::GetAtt": [ + "MQFunctionRole", + "Arn" + ] + }, + "Runtime": "python2.7", + "Tags": [ + { + "Key": "lambda:createdBy", + "Value": "SAM" + } + ] + } + }, + "MQFunctionRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Action": [ + "sts:AssumeRole" + ], + "Effect": "Allow", + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + } + } + ] + }, + "ManagedPolicyArns": [ + "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ], + "Policies": [ + { + "PolicyName": "AMQPolicy", + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "secretsmanager:GetSecretValue" + ], + "Effect": "Allow", + "Resource": "arn:aws:secretsmanager:us-west-2:123456789012:secret:my-path/my-secret-name-1a2b3c" + }, + { + "Action": [ + "mq:DescribeBroker" + ], + "Effect": "Allow", + "Resource": "arn:aws:mq:us-east-2:123456789012:broker:MyBroker:b-1234a5b6-78cd-901e-2fgh-3i45j6k178l9" + } + ] + } + } + ], + "Tags": [ + { + "Key": "lambda:createdBy", + "Value": "SAM" + } + ] + } + }, + "MQFunctionMyMQQueue": { + "Type": "AWS::Lambda::EventSourceMapping", + "Properties": { + "EventSourceArn": "arn:aws:mq:us-east-2:123456789012:broker:MyBroker:b-1234a5b6-78cd-901e-2fgh-3i45j6k178l9", + "FunctionName": { + "Ref": "MQFunction" + }, + "Queues": [ + "Queue1" + ], + "SourceAccessConfigurations": [ + { + "Type": "BASIC_AUTH", + "URI": "arn:aws:secretsmanager:us-west-2:123456789012:secret:my-path/my-secret-name-1a2b3c" + } + ] + } + } + } +} \ No newline at end of file diff --git a/tests/translator/output/aws-us-gov/function_with_amq_kms.json b/tests/translator/output/aws-us-gov/function_with_amq_kms.json new file mode 100644 index 000000000..94aae9f8d --- /dev/null +++ b/tests/translator/output/aws-us-gov/function_with_amq_kms.json @@ -0,0 +1,105 @@ +{ + "Resources": { + "MQFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "sam-demo-bucket", + "S3Key": "queues.zip" + }, + "Handler": "queue.mq_handler", + "Role": { + "Fn::GetAtt": [ + "MQFunctionRole", + "Arn" + ] + }, + "Runtime": "python2.7", + "Tags": [ + { + "Key": "lambda:createdBy", + "Value": "SAM" + } + ] + } + }, + "MQFunctionRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Action": [ + "sts:AssumeRole" + ], + "Effect": "Allow", + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + } + } + ] + }, + "ManagedPolicyArns": [ + "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ], + "Policies": [ + { + "PolicyName": "AMQPolicy", + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "secretsmanager:GetSecretValue" + ], + "Effect": "Allow", + "Resource": "arn:aws:secretsmanager:us-west-2:123456789012:secret:my-path/my-secret-name-1a2b3c" + }, + { + "Action": [ + "mq:DescribeBroker" + ], + "Effect": "Allow", + "Resource": "arn:aws:mq:us-east-2:123456789012:broker:MyBroker:b-1234a5b6-78cd-901e-2fgh-3i45j6k178l9" + }, + { + "Action": "kms:Decrypt", + "Effect": "Allow", + "Resource": { + "Fn::Sub": "arn:${AWS::Partition}:kms:${AWS::Region}:${AWS::AccountId}:key/1abc23d4-567f-8ab9-cde0-1fab234c5d67" + } + } + ] + } + } + ], + "Tags": [ + { + "Key": "lambda:createdBy", + "Value": "SAM" + } + ] + } + }, + "MQFunctionMyMQQueue": { + "Type": "AWS::Lambda::EventSourceMapping", + "Properties": { + "EventSourceArn": "arn:aws:mq:us-east-2:123456789012:broker:MyBroker:b-1234a5b6-78cd-901e-2fgh-3i45j6k178l9", + "FunctionName": { + "Ref": "MQFunction" + }, + "Queues": [ + "Queue1" + ], + "SourceAccessConfigurations": [ + { + "Type": "BASIC_AUTH", + "URI": "arn:aws:secretsmanager:us-west-2:123456789012:secret:my-path/my-secret-name-1a2b3c" + } + ] + } + } + } + } \ No newline at end of file diff --git a/tests/translator/output/function_with_amq.json b/tests/translator/output/function_with_amq.json new file mode 100644 index 000000000..672babec8 --- /dev/null +++ b/tests/translator/output/function_with_amq.json @@ -0,0 +1,98 @@ +{ + "Resources": { + "MQFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "sam-demo-bucket", + "S3Key": "queues.zip" + }, + "Handler": "queue.mq_handler", + "Role": { + "Fn::GetAtt": [ + "MQFunctionRole", + "Arn" + ] + }, + "Runtime": "python2.7", + "Tags": [ + { + "Key": "lambda:createdBy", + "Value": "SAM" + } + ] + } + }, + "MQFunctionRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Action": [ + "sts:AssumeRole" + ], + "Effect": "Allow", + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + } + } + ] + }, + "ManagedPolicyArns": [ + "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ], + "Policies": [ + { + "PolicyName": "AMQPolicy", + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "secretsmanager:GetSecretValue" + ], + "Effect": "Allow", + "Resource": "arn:aws:secretsmanager:us-west-2:123456789012:secret:my-path/my-secret-name-1a2b3c" + }, + { + "Action": [ + "mq:DescribeBroker" + ], + "Effect": "Allow", + "Resource": "arn:aws:mq:us-east-2:123456789012:broker:MyBroker:b-1234a5b6-78cd-901e-2fgh-3i45j6k178l9" + } + ] + } + } + ], + "Tags": [ + { + "Key": "lambda:createdBy", + "Value": "SAM" + } + ] + } + }, + "MQFunctionMyMQQueue": { + "Type": "AWS::Lambda::EventSourceMapping", + "Properties": { + "EventSourceArn": "arn:aws:mq:us-east-2:123456789012:broker:MyBroker:b-1234a5b6-78cd-901e-2fgh-3i45j6k178l9", + "FunctionName": { + "Ref": "MQFunction" + }, + "Queues": [ + "Queue1" + ], + "SourceAccessConfigurations": [ + { + "Type": "BASIC_AUTH", + "URI": "arn:aws:secretsmanager:us-west-2:123456789012:secret:my-path/my-secret-name-1a2b3c" + } + ] + } + } + } +} \ No newline at end of file diff --git a/tests/translator/output/function_with_amq_kms.json b/tests/translator/output/function_with_amq_kms.json new file mode 100644 index 000000000..94aae9f8d --- /dev/null +++ b/tests/translator/output/function_with_amq_kms.json @@ -0,0 +1,105 @@ +{ + "Resources": { + "MQFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "sam-demo-bucket", + "S3Key": "queues.zip" + }, + "Handler": "queue.mq_handler", + "Role": { + "Fn::GetAtt": [ + "MQFunctionRole", + "Arn" + ] + }, + "Runtime": "python2.7", + "Tags": [ + { + "Key": "lambda:createdBy", + "Value": "SAM" + } + ] + } + }, + "MQFunctionRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Action": [ + "sts:AssumeRole" + ], + "Effect": "Allow", + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + } + } + ] + }, + "ManagedPolicyArns": [ + "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ], + "Policies": [ + { + "PolicyName": "AMQPolicy", + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "secretsmanager:GetSecretValue" + ], + "Effect": "Allow", + "Resource": "arn:aws:secretsmanager:us-west-2:123456789012:secret:my-path/my-secret-name-1a2b3c" + }, + { + "Action": [ + "mq:DescribeBroker" + ], + "Effect": "Allow", + "Resource": "arn:aws:mq:us-east-2:123456789012:broker:MyBroker:b-1234a5b6-78cd-901e-2fgh-3i45j6k178l9" + }, + { + "Action": "kms:Decrypt", + "Effect": "Allow", + "Resource": { + "Fn::Sub": "arn:${AWS::Partition}:kms:${AWS::Region}:${AWS::AccountId}:key/1abc23d4-567f-8ab9-cde0-1fab234c5d67" + } + } + ] + } + } + ], + "Tags": [ + { + "Key": "lambda:createdBy", + "Value": "SAM" + } + ] + } + }, + "MQFunctionMyMQQueue": { + "Type": "AWS::Lambda::EventSourceMapping", + "Properties": { + "EventSourceArn": "arn:aws:mq:us-east-2:123456789012:broker:MyBroker:b-1234a5b6-78cd-901e-2fgh-3i45j6k178l9", + "FunctionName": { + "Ref": "MQFunction" + }, + "Queues": [ + "Queue1" + ], + "SourceAccessConfigurations": [ + { + "Type": "BASIC_AUTH", + "URI": "arn:aws:secretsmanager:us-west-2:123456789012:secret:my-path/my-secret-name-1a2b3c" + } + ] + } + } + } + } \ No newline at end of file diff --git a/tests/translator/test_translator.py b/tests/translator/test_translator.py index 28dfce246..f380d34c3 100644 --- a/tests/translator/test_translator.py +++ b/tests/translator/test_translator.py @@ -160,7 +160,8 @@ class TestTranslatorEndToEnd(TestCase): "cloudwatchlog", "streams", "sqs", - "amq", + "function_with_amq", + "function_with_amq_kms", "simpletable", "simpletable_with_sse", "implicit_api", From 6417b8dfab900ad92d83c23880590362dd1ee794 Mon Sep 17 00:00:00 2001 From: Qingchuan Ma Date: Thu, 14 Jan 2021 11:51:37 -0800 Subject: [PATCH 03/41] Black reformatting --- samtranslator/model/eventsources/pull.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/samtranslator/model/eventsources/pull.py b/samtranslator/model/eventsources/pull.py index e401ab04e..335381a93 100644 --- a/samtranslator/model/eventsources/pull.py +++ b/samtranslator/model/eventsources/pull.py @@ -170,6 +170,7 @@ def get_policy_arn(self): def get_policy_statements(self): return None + class DynamoDB(PullEventSource): """DynamoDB Streams event source.""" @@ -189,10 +190,11 @@ class SQS(PullEventSource): def get_policy_arn(self): return ArnGenerator.generate_aws_managed_policy_arn("service-role/AWSLambdaSQSQueueExecutionRole") - + def get_policy_statements(self): return None + class MSK(PullEventSource): """MSK event source.""" @@ -204,6 +206,7 @@ def get_policy_arn(self): def get_policy_statements(self): return None + class MQ(PullEventSource): """MQ event source.""" @@ -236,34 +239,33 @@ def get_policy_statements(self): ) document = { "PolicyName": "AMQPolicy", - "PolicyDocument": - { + "PolicyDocument": { "Statement": [ { "Action": [ "secretsmanager:GetSecretValue", ], "Effect": "Allow", - "Resource": self.SourceAccessConfigurations[0].get("URI") + "Resource": self.SourceAccessConfigurations[0].get("URI"), }, { "Action": [ "mq:DescribeBroker", ], "Effect": "Allow", - "Resource": self.Broker - } + "Resource": self.Broker, + }, ] - } + }, } if self.SecretsManagerKmsKeyId: kms_policy = { "Action": "kms:Decrypt", "Effect": "Allow", "Resource": { - "Fn::Sub": - "arn:${AWS::Partition}:kms:${AWS::Region}:${AWS::AccountId}:key/" + self.SecretsManagerKmsKeyId - } + "Fn::Sub": "arn:${AWS::Partition}:kms:${AWS::Region}:${AWS::AccountId}:key/" + + self.SecretsManagerKmsKeyId + }, } document["PolicyDocument"]["Statement"].append(kms_policy) return [document] From e116030f192b25f4bce47e8c808090d75b7fc80f Mon Sep 17 00:00:00 2001 From: Qingchuan Ma Date: Thu, 14 Jan 2021 12:02:16 -0800 Subject: [PATCH 04/41] Test case changes --- tests/translator/input/amq.yaml | 17 ----- tests/translator/output/amq.json | 70 ------------------- tests/translator/output/aws-cn/amq.json | 70 ------------------- .../output/aws-cn/function_with_amq.json | 2 +- .../output/aws-cn/function_with_amq_kms.json | 2 +- tests/translator/output/aws-us-gov/amq.json | 70 ------------------- .../output/aws-us-gov/function_with_amq.json | 2 +- .../aws-us-gov/function_with_amq_kms.json | 2 +- 8 files changed, 4 insertions(+), 231 deletions(-) delete mode 100644 tests/translator/input/amq.yaml delete mode 100644 tests/translator/output/amq.json delete mode 100644 tests/translator/output/aws-cn/amq.json delete mode 100644 tests/translator/output/aws-us-gov/amq.json diff --git a/tests/translator/input/amq.yaml b/tests/translator/input/amq.yaml deleted file mode 100644 index 00d28b841..000000000 --- a/tests/translator/input/amq.yaml +++ /dev/null @@ -1,17 +0,0 @@ -Resources: - MQFunction: - Type: 'AWS::Serverless::Function' - Properties: - CodeUri: s3://sam-demo-bucket/queues.zip - Handler: queue.mq_handler - Runtime: python2.7 - Events: - MyMQQueue: - Type: MQ - Properties: - Broker: arn:aws:mq:us-east-2:123456789012:broker:MyBroker:b-1234a5b6-78cd-901e-2fgh-3i45j6k178l9 - Queues: - - "Queue1" - SourceAccessConfigurations: - - Type: BASIC_AUTH - URI: arn:aws:secretsmanager:us-west-2:123456789012:secret:my-path/my-secret-name-1a2b3c \ No newline at end of file diff --git a/tests/translator/output/amq.json b/tests/translator/output/amq.json deleted file mode 100644 index 796785adc..000000000 --- a/tests/translator/output/amq.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "Resources": { - "MQFunction": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": "sam-demo-bucket", - "S3Key": "queues.zip" - }, - "Handler": "queue.mq_handler", - "Role": { - "Fn::GetAtt": [ - "MQFunctionRole", - "Arn" - ] - }, - "Runtime": "python2.7", - "Tags": [{ - "Value": "SAM", - "Key": "lambda:createdBy" - }] - } - }, - "MQFunctionMyMQQueue": { - "Type": "AWS::Lambda::EventSourceMapping", - "Properties": { - "EventSourceArn": "arn:aws:mq:us-east-2:123456789012:broker:MyBroker:b-1234a5b6-78cd-901e-2fgh-3i45j6k178l9", - "FunctionName": { - "Ref": "MQFunction" - }, - "Queues": ["Queue1"], - "SourceAccessConfigurations": [ - { - "Type": "BASIC_AUTH", - "URI": "arn:aws:secretsmanager:us-west-2:123456789012:secret:my-path/my-secret-name-1a2b3c" - } - ] - } - }, - "MQFunctionRole": { - "Type": "AWS::IAM::Role", - "Properties": { - "ManagedPolicyArns": [ - "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", - "arn:aws:iam::aws:policy/service-role/AWSLambdaAMQExecutionRole" - ], - "Tags": [ - { - "Value": "SAM", - "Key": "lambda:createdBy" - } - ], - "AssumeRolePolicyDocument": { - "Version": "2012-10-17", - "Statement": [{ - "Action": [ - "sts:AssumeRole" - ], - "Effect": "Allow", - "Principal": { - "Service": [ - "lambda.amazonaws.com" - ] - } - }] - } - } - } - } -} \ No newline at end of file diff --git a/tests/translator/output/aws-cn/amq.json b/tests/translator/output/aws-cn/amq.json deleted file mode 100644 index b75267663..000000000 --- a/tests/translator/output/aws-cn/amq.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "Resources": { - "MQFunction": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": "sam-demo-bucket", - "S3Key": "queues.zip" - }, - "Handler": "queue.mq_handler", - "Role": { - "Fn::GetAtt": [ - "MQFunctionRole", - "Arn" - ] - }, - "Runtime": "python2.7", - "Tags": [{ - "Value": "SAM", - "Key": "lambda:createdBy" - }] - } - }, - "MQFunctionMyMQQueue": { - "Type": "AWS::Lambda::EventSourceMapping", - "Properties": { - "EventSourceArn": "arn:aws:mq:us-east-2:123456789012:broker:MyBroker:b-1234a5b6-78cd-901e-2fgh-3i45j6k178l9", - "FunctionName": { - "Ref": "MQFunction" - }, - "Queues": ["Queue1"], - "SourceAccessConfigurations": [ - { - "Type": "BASIC_AUTH", - "URI": "arn:aws:secretsmanager:us-west-2:123456789012:secret:my-path/my-secret-name-1a2b3c" - } - ] - } - }, - "MQFunctionRole": { - "Type": "AWS::IAM::Role", - "Properties": { - "ManagedPolicyArns": [ - "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", - "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaAMQExecutionRole" - ], - "Tags": [ - { - "Value": "SAM", - "Key": "lambda:createdBy" - } - ], - "AssumeRolePolicyDocument": { - "Version": "2012-10-17", - "Statement": [{ - "Action": [ - "sts:AssumeRole" - ], - "Effect": "Allow", - "Principal": { - "Service": [ - "lambda.amazonaws.com" - ] - } - }] - } - } - } - } -} \ No newline at end of file diff --git a/tests/translator/output/aws-cn/function_with_amq.json b/tests/translator/output/aws-cn/function_with_amq.json index 672babec8..53d806be8 100644 --- a/tests/translator/output/aws-cn/function_with_amq.json +++ b/tests/translator/output/aws-cn/function_with_amq.json @@ -43,7 +43,7 @@ ] }, "ManagedPolicyArns": [ - "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" ], "Policies": [ { diff --git a/tests/translator/output/aws-cn/function_with_amq_kms.json b/tests/translator/output/aws-cn/function_with_amq_kms.json index 94aae9f8d..693d64f3b 100644 --- a/tests/translator/output/aws-cn/function_with_amq_kms.json +++ b/tests/translator/output/aws-cn/function_with_amq_kms.json @@ -43,7 +43,7 @@ ] }, "ManagedPolicyArns": [ - "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" ], "Policies": [ { diff --git a/tests/translator/output/aws-us-gov/amq.json b/tests/translator/output/aws-us-gov/amq.json deleted file mode 100644 index 5a42ee959..000000000 --- a/tests/translator/output/aws-us-gov/amq.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "Resources": { - "MQFunction": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": "sam-demo-bucket", - "S3Key": "queues.zip" - }, - "Handler": "queue.mq_handler", - "Role": { - "Fn::GetAtt": [ - "MQFunctionRole", - "Arn" - ] - }, - "Runtime": "python2.7", - "Tags": [{ - "Value": "SAM", - "Key": "lambda:createdBy" - }] - } - }, - "MQFunctionMyMQQueue": { - "Type": "AWS::Lambda::EventSourceMapping", - "Properties": { - "EventSourceArn": "arn:aws:mq:us-east-2:123456789012:broker:MyBroker:b-1234a5b6-78cd-901e-2fgh-3i45j6k178l9", - "FunctionName": { - "Ref": "MQFunction" - }, - "Queues": ["Queue1"], - "SourceAccessConfigurations": [ - { - "Type": "BASIC_AUTH", - "URI": "arn:aws:secretsmanager:us-west-2:123456789012:secret:my-path/my-secret-name-1a2b3c" - } - ] - } - }, - "MQFunctionRole": { - "Type": "AWS::IAM::Role", - "Properties": { - "ManagedPolicyArns": [ - "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", - "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaAMQExecutionRole" - ], - "Tags": [ - { - "Value": "SAM", - "Key": "lambda:createdBy" - } - ], - "AssumeRolePolicyDocument": { - "Version": "2012-10-17", - "Statement": [{ - "Action": [ - "sts:AssumeRole" - ], - "Effect": "Allow", - "Principal": { - "Service": [ - "lambda.amazonaws.com" - ] - } - }] - } - } - } - } -} \ No newline at end of file diff --git a/tests/translator/output/aws-us-gov/function_with_amq.json b/tests/translator/output/aws-us-gov/function_with_amq.json index 672babec8..a0f40d329 100644 --- a/tests/translator/output/aws-us-gov/function_with_amq.json +++ b/tests/translator/output/aws-us-gov/function_with_amq.json @@ -43,7 +43,7 @@ ] }, "ManagedPolicyArns": [ - "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" ], "Policies": [ { diff --git a/tests/translator/output/aws-us-gov/function_with_amq_kms.json b/tests/translator/output/aws-us-gov/function_with_amq_kms.json index 94aae9f8d..a25e99680 100644 --- a/tests/translator/output/aws-us-gov/function_with_amq_kms.json +++ b/tests/translator/output/aws-us-gov/function_with_amq_kms.json @@ -43,7 +43,7 @@ ] }, "ManagedPolicyArns": [ - "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" ], "Policies": [ { From 0827d39ce02ab71394d966e1e27d6e8bce155f3c Mon Sep 17 00:00:00 2001 From: Qingchuan Ma Date: Thu, 14 Jan 2021 13:23:11 -0800 Subject: [PATCH 05/41] Changed policy name --- samtranslator/model/eventsources/pull.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samtranslator/model/eventsources/pull.py b/samtranslator/model/eventsources/pull.py index 335381a93..747968bb9 100644 --- a/samtranslator/model/eventsources/pull.py +++ b/samtranslator/model/eventsources/pull.py @@ -238,7 +238,7 @@ def get_policy_statements(self): "No URI property specified in SourceAccessConfigurations for ActiveMQ.", ) document = { - "PolicyName": "AMQPolicy", + "PolicyName": "SamAutoGeneratedAMQPolicy", "PolicyDocument": { "Statement": [ { From 7f23147830c70feaa00321729f67c35aac39714b Mon Sep 17 00:00:00 2001 From: Qingchuan Ma Date: Thu, 14 Jan 2021 13:30:36 -0800 Subject: [PATCH 06/41] Modified test cases with new policy name --- tests/translator/output/aws-cn/function_with_amq.json | 2 +- tests/translator/output/aws-cn/function_with_amq_kms.json | 2 +- tests/translator/output/aws-us-gov/function_with_amq.json | 2 +- tests/translator/output/aws-us-gov/function_with_amq_kms.json | 2 +- tests/translator/output/function_with_amq.json | 2 +- tests/translator/output/function_with_amq_kms.json | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/translator/output/aws-cn/function_with_amq.json b/tests/translator/output/aws-cn/function_with_amq.json index 53d806be8..6a34ed771 100644 --- a/tests/translator/output/aws-cn/function_with_amq.json +++ b/tests/translator/output/aws-cn/function_with_amq.json @@ -47,7 +47,7 @@ ], "Policies": [ { - "PolicyName": "AMQPolicy", + "PolicyName": "SamAutoGeneratedAMQPolicy", "PolicyDocument": { "Statement": [ { diff --git a/tests/translator/output/aws-cn/function_with_amq_kms.json b/tests/translator/output/aws-cn/function_with_amq_kms.json index 693d64f3b..e79122065 100644 --- a/tests/translator/output/aws-cn/function_with_amq_kms.json +++ b/tests/translator/output/aws-cn/function_with_amq_kms.json @@ -47,7 +47,7 @@ ], "Policies": [ { - "PolicyName": "AMQPolicy", + "PolicyName": "SamAutoGeneratedAMQPolicy", "PolicyDocument": { "Statement": [ { diff --git a/tests/translator/output/aws-us-gov/function_with_amq.json b/tests/translator/output/aws-us-gov/function_with_amq.json index a0f40d329..a8a471c86 100644 --- a/tests/translator/output/aws-us-gov/function_with_amq.json +++ b/tests/translator/output/aws-us-gov/function_with_amq.json @@ -47,7 +47,7 @@ ], "Policies": [ { - "PolicyName": "AMQPolicy", + "PolicyName": "SamAutoGeneratedAMQPolicy", "PolicyDocument": { "Statement": [ { diff --git a/tests/translator/output/aws-us-gov/function_with_amq_kms.json b/tests/translator/output/aws-us-gov/function_with_amq_kms.json index a25e99680..37b991a49 100644 --- a/tests/translator/output/aws-us-gov/function_with_amq_kms.json +++ b/tests/translator/output/aws-us-gov/function_with_amq_kms.json @@ -47,7 +47,7 @@ ], "Policies": [ { - "PolicyName": "AMQPolicy", + "PolicyName": "SamAutoGeneratedAMQPolicy", "PolicyDocument": { "Statement": [ { diff --git a/tests/translator/output/function_with_amq.json b/tests/translator/output/function_with_amq.json index 672babec8..0d35f71c2 100644 --- a/tests/translator/output/function_with_amq.json +++ b/tests/translator/output/function_with_amq.json @@ -47,7 +47,7 @@ ], "Policies": [ { - "PolicyName": "AMQPolicy", + "PolicyName": "SamAutoGeneratedAMQPolicy", "PolicyDocument": { "Statement": [ { diff --git a/tests/translator/output/function_with_amq_kms.json b/tests/translator/output/function_with_amq_kms.json index 94aae9f8d..94ae8666a 100644 --- a/tests/translator/output/function_with_amq_kms.json +++ b/tests/translator/output/function_with_amq_kms.json @@ -47,7 +47,7 @@ ], "Policies": [ { - "PolicyName": "AMQPolicy", + "PolicyName": "SamAutoGeneratedAMQPolicy", "PolicyDocument": { "Statement": [ { From 2fbfdad0f0d59c8fea9b3b532d6dda0b5d09f1a6 Mon Sep 17 00:00:00 2001 From: Qingchuan Ma Date: Thu, 8 Apr 2021 13:40:20 -0700 Subject: [PATCH 07/41] Added resource attributes and unit tests --- samtranslator/model/__init__.py | 2 +- tests/test_model.py | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/samtranslator/model/__init__.py b/samtranslator/model/__init__.py index 150645589..9852cf67d 100644 --- a/samtranslator/model/__init__.py +++ b/samtranslator/model/__init__.py @@ -43,7 +43,7 @@ class Resource(object): property_types = None _keywords = ["logical_id", "relative_id", "depends_on", "resource_attributes"] - _supported_resource_attributes = ["DeletionPolicy", "UpdatePolicy", "Condition"] + _supported_resource_attributes = ["DeletionPolicy", "UpdatePolicy", "Condition", "UpdateReplacePolicy", "Metadata"] # 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 diff --git a/tests/test_model.py b/tests/test_model.py index 84da811b8..9783be7b5 100644 --- a/tests/test_model.py +++ b/tests/test_model.py @@ -107,6 +107,15 @@ def test_to_dict(self): dict_with_attributes = { "id": {"Type": "foo", "Properties": {}, "UpdatePolicy": "update", "DeletionPolicy": {"foo": "bar"}} } + dict_with_attributes2 = { + "id": { + "Type": "foo", + "Properties": {}, + "UpdateReplacePolicy": "update", + "Metadata": {"foo": "bar"}, + "Condition": "con", + } + } r = self.MyResource("id") self.assertEqual(r.to_dict(), empty_resource_dict) @@ -114,6 +123,11 @@ def test_to_dict(self): r = self.MyResource("id", attributes={"UpdatePolicy": "update", "DeletionPolicy": {"foo": "bar"}}) self.assertEqual(r.to_dict(), dict_with_attributes) + r = self.MyResource( + "id", attributes={"UpdateReplacePolicy": "update", "Metadata": {"foo": "bar"}, "Condition": "con"} + ) + self.assertEqual(r.to_dict(), dict_with_attributes2) + def test_invalid_attr(self): with pytest.raises(KeyError) as ex: @@ -140,6 +154,9 @@ def test_from_dict(self): "Properties": {}, "UpdatePolicy": "update", "DeletionPolicy": [1, 2, 3], + "UpdateReplacePolicy": "update", + "Metadata": {"foo": "bar"}, + "Condition": "con", } r = self.MyResource.from_dict("id", resource_dict=no_attribute) @@ -148,6 +165,9 @@ def test_from_dict(self): r = self.MyResource.from_dict("id", resource_dict=all_supported_attributes) self.assertEqual(r.get_resource_attribute("DeletionPolicy"), [1, 2, 3]) self.assertEqual(r.get_resource_attribute("UpdatePolicy"), "update") + self.assertEqual(r.get_resource_attribute("UpdateReplacePolicy"), "update") + self.assertEqual(r.get_resource_attribute("Metadata"), {"foo": "bar"}) + self.assertEqual(r.get_resource_attribute("Condition"), "con") class TestResourceRuntimeAttributes(TestCase): From 196457e0249edb175252d1f060db04b588ccfd89 Mon Sep 17 00:00:00 2001 From: Qingchuan Ma Date: Mon, 12 Apr 2021 14:57:17 -0700 Subject: [PATCH 08/41] Resource attributes initial work --- samtranslator/model/__init__.py | 24 +++++++++++-- .../model/eventsources/cloudwatchlogs.py | 5 ++- samtranslator/model/eventsources/pull.py | 6 ++-- samtranslator/model/eventsources/push.py | 35 +++++++------------ samtranslator/model/sam_resources.py | 14 ++++---- samtranslator/model/stepfunctions/events.py | 8 ++--- samtranslator/plugins/__init__.py | 14 ++++++++ samtranslator/translator/translator.py | 4 +++ .../validator/sam_schema/schema.json | 33 +++++++++-------- tests/translator/test_translator.py | 7 ++-- 10 files changed, 88 insertions(+), 62 deletions(-) diff --git a/samtranslator/model/__init__.py b/samtranslator/model/__init__.py index 9852cf67d..722291d98 100644 --- a/samtranslator/model/__init__.py +++ b/samtranslator/model/__init__.py @@ -44,6 +44,7 @@ class Resource(object): _keywords = ["logical_id", "relative_id", "depends_on", "resource_attributes"] _supported_resource_attributes = ["DeletionPolicy", "UpdatePolicy", "Condition", "UpdateReplacePolicy", "Metadata"] + _pass_through_attributes = ["Condition", "DeletionPolicy", "UpdateReplacePolicy"] # 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 @@ -76,6 +77,22 @@ def __init__(self, logical_id, relative_id=None, depends_on=None, attributes=Non for attr, value in attributes.items(): self.set_resource_attribute(attr, value) + @classmethod + def get_supported_resource_attributes(cls): + """ + A getter method for the supported resource attributes + returns: a tuple that contains the name of all supported resource attributes + """ + return tuple(cls._supported_resource_attributes) + + @classmethod + def get_pass_through_attributes(cls): + """ + A getter method for the resource attributes to be passed to auto-generated resources + returns: a tuple that contains the name of all pass through attributes + """ + return tuple(cls._pass_through_attributes) + @classmethod def from_dict(cls, logical_id, resource_dict, relative_id=None, sam_plugins=None): """Constructs a Resource object with the given logical id, based on the given resource dict. The resource dict @@ -318,9 +335,10 @@ def get_passthrough_resource_attributes(self): :return: Dictionary of resource attributes. """ - attributes = None - if "Condition" in self.resource_attributes: - attributes = {"Condition": self.resource_attributes["Condition"]} + attributes = {} + for resource_attribute in self.get_pass_through_attributes(): + if resource_attribute in self.resource_attributes: + attributes[resource_attribute] = self.resource_attributes.get(resource_attribute) return attributes diff --git a/samtranslator/model/eventsources/cloudwatchlogs.py b/samtranslator/model/eventsources/cloudwatchlogs.py index 8adc32439..d0f4054d5 100644 --- a/samtranslator/model/eventsources/cloudwatchlogs.py +++ b/samtranslator/model/eventsources/cloudwatchlogs.py @@ -43,11 +43,10 @@ def get_source_arn(self): ) def get_subscription_filter(self, function, permission): - subscription_filter = SubscriptionFilter(self.logical_id, depends_on=[permission.logical_id]) + subscription_filter = SubscriptionFilter(self.logical_id, depends_on=[permission.logical_id], + attributes=function.get_passthrough_resource_attributes()) subscription_filter.LogGroupName = self.LogGroupName subscription_filter.FilterPattern = self.FilterPattern subscription_filter.DestinationArn = function.get_runtime_attr("arn") - if "Condition" in function.resource_attributes: - subscription_filter.set_resource_attribute("Condition", function.resource_attributes["Condition"]) return subscription_filter diff --git a/samtranslator/model/eventsources/pull.py b/samtranslator/model/eventsources/pull.py index 747968bb9..3c0a9fc96 100644 --- a/samtranslator/model/eventsources/pull.py +++ b/samtranslator/model/eventsources/pull.py @@ -60,7 +60,8 @@ def to_cloudformation(self, **kwargs): resources = [] - lambda_eventsourcemapping = LambdaEventSourceMapping(self.logical_id) + lambda_eventsourcemapping = LambdaEventSourceMapping(self.logical_id, + attributes=function.get_passthrough_resource_attributes()) resources.append(lambda_eventsourcemapping) try: @@ -122,9 +123,6 @@ def to_cloudformation(self, **kwargs): ) lambda_eventsourcemapping.DestinationConfig = self.DestinationConfig - if "Condition" in function.resource_attributes: - lambda_eventsourcemapping.set_resource_attribute("Condition", function.resource_attributes["Condition"]) - if "role" in kwargs: self._link_policy(kwargs["role"], destination_config_policy) diff --git a/samtranslator/model/eventsources/push.py b/samtranslator/model/eventsources/push.py index d134f1940..f5d6b007c 100644 --- a/samtranslator/model/eventsources/push.py +++ b/samtranslator/model/eventsources/push.py @@ -113,7 +113,7 @@ def to_cloudformation(self, **kwargs): resources = [] - events_rule = EventsRule(self.logical_id) + events_rule = EventsRule(self.logical_id, attributes=function.get_passthrough_resource_attributes()) resources.append(events_rule) events_rule.ScheduleExpression = self.Schedule @@ -131,8 +131,6 @@ def to_cloudformation(self, **kwargs): events_rule.Targets = [self._construct_target(function, dlq_queue_arn)] - if CONDITION in function.resource_attributes: - events_rule.set_resource_attribute(CONDITION, function.resource_attributes[CONDITION]) resources.append(self._construct_permission(function, source_arn=source_arn)) return resources @@ -186,7 +184,7 @@ def to_cloudformation(self, **kwargs): resources = [] - events_rule = EventsRule(self.logical_id) + events_rule = EventsRule(self.logical_id, attributes=function.get_passthrough_resource_attributes()) events_rule.EventBusName = self.EventBusName events_rule.EventPattern = self.Pattern source_arn = events_rule.get_runtime_attr("arn") @@ -198,8 +196,6 @@ def to_cloudformation(self, **kwargs): resources.extend(dlq_resources) events_rule.Targets = [self._construct_target(function, dlq_queue_arn)] - if CONDITION in function.resource_attributes: - events_rule.set_resource_attribute(CONDITION, function.resource_attributes[CONDITION]) resources.append(events_rule) resources.append(self._construct_permission(function, source_arn=source_arn)) @@ -427,7 +423,7 @@ def to_cloudformation(self, **kwargs): self.Topic, self.Region, self.FilterPolicy, - function.resource_attributes, + function, ) return [self._construct_permission(function, source_arn=self.Topic), subscription] @@ -438,9 +434,9 @@ def to_cloudformation(self, **kwargs): queue_arn = queue.get_runtime_attr("arn") queue_url = queue.get_runtime_attr("queue_url") - queue_policy = self._inject_sqs_queue_policy(self.Topic, queue_arn, queue_url, function.resource_attributes) + queue_policy = self._inject_sqs_queue_policy(self.Topic, queue_arn, queue_url, function) subscription = self._inject_subscription( - "sqs", queue_arn, self.Topic, self.Region, self.FilterPolicy, function.resource_attributes + "sqs", queue_arn, self.Topic, self.Region, self.FilterPolicy, function ) event_source = self._inject_sqs_event_source_mapping(function, role, queue_arn) @@ -462,10 +458,10 @@ def to_cloudformation(self, **kwargs): enabled = self.SqsSubscription.get("Enabled", None) queue_policy = self._inject_sqs_queue_policy( - self.Topic, queue_arn, queue_url, function.resource_attributes, queue_policy_logical_id + self.Topic, queue_arn, queue_url, function, queue_policy_logical_id ) subscription = self._inject_subscription( - "sqs", queue_arn, self.Topic, self.Region, self.FilterPolicy, function.resource_attributes + "sqs", queue_arn, self.Topic, self.Region, self.FilterPolicy, function ) event_source = self._inject_sqs_event_source_mapping(function, role, queue_arn, batch_size, enabled) @@ -474,15 +470,14 @@ def to_cloudformation(self, **kwargs): resources.append(subscription) return resources - def _inject_subscription(self, protocol, endpoint, topic, region, filterPolicy, resource_attributes): - subscription = SNSSubscription(self.logical_id) + def _inject_subscription(self, protocol, endpoint, topic, region, filterPolicy, function): + subscription = SNSSubscription(self.logical_id, attributes=function.get_passthrough_resource_attributes()) subscription.Protocol = protocol subscription.Endpoint = endpoint subscription.TopicArn = topic + if region is not None: subscription.Region = region - if CONDITION in resource_attributes: - subscription.set_resource_attribute(CONDITION, resource_attributes[CONDITION]) if filterPolicy is not None: subscription.FilterPolicy = filterPolicy @@ -499,10 +494,8 @@ def _inject_sqs_event_source_mapping(self, function, role, queue_arn, batch_size event_source.Enabled = enabled or True return event_source.to_cloudformation(function=function, role=role) - def _inject_sqs_queue_policy(self, topic_arn, queue_arn, queue_url, resource_attributes, logical_id=None): - policy = SQSQueuePolicy(logical_id or self.logical_id + "QueuePolicy") - if CONDITION in resource_attributes: - policy.set_resource_attribute(CONDITION, resource_attributes[CONDITION]) + def _inject_sqs_queue_policy(self, topic_arn, queue_arn, queue_url, function, logical_id=None): + policy = SQSQueuePolicy(logical_id or self.logical_id + "QueuePolicy", attributes=function.get_passthrough_resource_attributes()) policy.PolicyDocument = SQSQueuePolicies.sns_topic_send_message_role_policy(topic_arn, queue_arn) policy.Queues = [queue_url] @@ -895,7 +888,7 @@ def to_cloudformation(self, **kwargs): return resources def _construct_iot_rule(self, function): - rule = IotTopicRule(self.logical_id) + rule = IotTopicRule(self.logical_id, attributes=function.get_passthrough_resource_attributes()) payload = { "Sql": self.Sql, @@ -907,8 +900,6 @@ def _construct_iot_rule(self, function): payload["AwsIotSqlVersion"] = self.AwsIotSqlVersion rule.TopicRulePayload = payload - if CONDITION in function.resource_attributes: - rule.set_resource_attribute(CONDITION, function.resource_attributes[CONDITION]) return rule diff --git a/samtranslator/model/sam_resources.py b/samtranslator/model/sam_resources.py index a3a9a6d17..917e18044 100644 --- a/samtranslator/model/sam_resources.py +++ b/samtranslator/model/sam_resources.py @@ -279,13 +279,15 @@ def _validate_and_inject_resource(self, dest_config, event, logical_id, conditio ) if dest_config.get("Destination") is None or property_condition is not None: combined_condition = self._make_and_conditions( - self.get_passthrough_resource_attributes(), property_condition, conditions + self.get_passthrough_resource_attributes().get("Condition"), property_condition, conditions ) if dest_config.get("Type") in auto_inject_list: if dest_config.get("Type") == "SQS": - resource = SQSQueue(resource_logical_id + "Queue") + resource = SQSQueue(resource_logical_id + "Queue", + attributes=self.get_passthrough_resource_attributes()) if dest_config.get("Type") == "SNS": - resource = SNSTopic(resource_logical_id + "Topic") + resource = SNSTopic(resource_logical_id + "Topic", + attributes=self.get_passthrough_resource_attributes()) if combined_condition: resource.set_resource_attribute("Condition", combined_condition) if property_condition: @@ -313,11 +315,11 @@ def _make_and_conditions(self, resource_condition, property_condition, condition return property_condition if property_condition is None: - return resource_condition["Condition"] + return resource_condition - and_condition = make_and_condition([resource_condition, {"Condition": property_condition}]) + and_condition = make_and_condition([{"Condition": resource_condition}, {"Condition": property_condition}]) condition_name = self._make_gen_condition_name( - resource_condition.get("Condition") + "AND" + property_condition, self.logical_id + resource_condition + "AND" + property_condition, self.logical_id ) conditions[condition_name] = and_condition diff --git a/samtranslator/model/stepfunctions/events.py b/samtranslator/model/stepfunctions/events.py index 88fe60cfe..ee8997156 100644 --- a/samtranslator/model/stepfunctions/events.py +++ b/samtranslator/model/stepfunctions/events.py @@ -97,7 +97,7 @@ def to_cloudformation(self, resource, **kwargs): permissions_boundary = kwargs.get("permissions_boundary") - events_rule = EventsRule(self.logical_id) + events_rule = EventsRule(self.logical_id, attributes=resource.get_passthrough_resource_attributes()) resources.append(events_rule) events_rule.ScheduleExpression = self.Schedule @@ -105,8 +105,6 @@ def to_cloudformation(self, resource, **kwargs): events_rule.State = "ENABLED" if self.Enabled else "DISABLED" events_rule.Name = self.Name events_rule.Description = self.Description - if CONDITION in resource.resource_attributes: - events_rule.set_resource_attribute(CONDITION, resource.resource_attributes[CONDITION]) role = self._construct_role(resource, permissions_boundary) resources.append(role) @@ -170,11 +168,9 @@ def to_cloudformation(self, resource, **kwargs): permissions_boundary = kwargs.get("permissions_boundary") - events_rule = EventsRule(self.logical_id) + events_rule = EventsRule(self.logical_id, attributes=resource.get_passthrough_resource_attributes()) events_rule.EventBusName = self.EventBusName events_rule.EventPattern = self.Pattern - if CONDITION in resource.resource_attributes: - events_rule.set_resource_attribute(CONDITION, resource.resource_attributes[CONDITION]) resources.append(events_rule) diff --git a/samtranslator/plugins/__init__.py b/samtranslator/plugins/__init__.py index 320910028..6820799fb 100644 --- a/samtranslator/plugins/__init__.py +++ b/samtranslator/plugins/__init__.py @@ -155,6 +155,7 @@ class LifeCycleEvents(Enum): before_transform_template = "before_transform_template" before_transform_resource = "before_transform_resource" after_transform_template = "after_transform_template" + after_transform_resource = "after_transform_resource" class BasePlugin(object): @@ -232,3 +233,16 @@ def on_after_transform_template(self, template): :raises InvalidResourceException: If the hook decides that a SAM resource is invalid. """ pass + + def on_after_transform_resource(self, template, logical_id, transformed_resources): + """ + Hook method to execute on `after_transform_resource` life cycle event. Plugins are free to modify the + whole template or properties of the resource. + + :param string logical_id: LogicalId of the resource that is being processed + :param string resource_type: Type of the resource being processed + :param list transformed_resources: List of the resources being generated. + :return: Nothing + :raises InvalidResourceException: If the hook decides throw this exception on validation failures + """ + pass \ No newline at end of file diff --git a/samtranslator/translator/translator.py b/samtranslator/translator/translator.py index d4ca78068..a6acb4c3a 100644 --- a/samtranslator/translator/translator.py +++ b/samtranslator/translator/translator.py @@ -24,6 +24,7 @@ from samtranslator.plugins.globals.globals_plugin import GlobalsPlugin from samtranslator.plugins.policies.policy_templates_plugin import PolicyTemplatesForResourcePlugin from samtranslator.policy_template_processor.processor import PolicyTemplatesProcessor +from samtranslator.plugins.resource_attributes.resource_attributes_plugin import ResourceAttributesPlugin from samtranslator.sdk.parameter import SamParameterValues from samtranslator.translator.arn_generator import ArnGenerator @@ -132,6 +133,8 @@ def translate(self, sam_template, parameter_values, feature_toggle=None): kwargs["redeploy_restapi_parameters"] = self.redeploy_restapi_parameters translated = macro.to_cloudformation(**kwargs) + # sam_plugins.act(LifeCycleEvents.after_transform_resource, template, macro.logical_id, translated) + supported_resource_refs = macro.get_resource_references(translated, supported_resource_refs) # Some resources mutate their logical ids. Track those to change all references to them: @@ -239,6 +242,7 @@ def prepare_plugins(plugins, parameters={}): make_implicit_http_api_plugin(), GlobalsPlugin(), make_policy_template_for_function_plugin(), + # ResourceAttributesPlugin(), ] plugins = [] if not plugins else plugins diff --git a/samtranslator/validator/sam_schema/schema.json b/samtranslator/validator/sam_schema/schema.json index 72df7539e..4cf7f1f5c 100644 --- a/samtranslator/validator/sam_schema/schema.json +++ b/samtranslator/validator/sam_schema/schema.json @@ -6,11 +6,12 @@ "additionalProperties": false, "properties": { "DeletionPolicy": { - "enum": [ - "Delete", - "Retain", - "Snapshot" - ], + "type": "string" + }, + "UpdateReplacePolicy": { + "type": "string" + }, + "Condition": { "type": "string" }, "DependsOn": { @@ -132,11 +133,12 @@ "additionalProperties": false, "properties": { "DeletionPolicy": { - "enum": [ - "Delete", - "Retain", - "Snapshot" - ], + "type": "string" + }, + "UpdateReplacePolicy": { + "type": "string" + }, + "Condition": { "type": "string" }, "DependsOn": { @@ -838,11 +840,12 @@ "additionalProperties": false, "properties": { "DeletionPolicy": { - "enum": [ - "Delete", - "Retain", - "Snapshot" - ], + "type": "string" + }, + "UpdateReplacePolicy": { + "type": "string" + }, + "Condition": { "type": "string" }, "DependsOn": { diff --git a/tests/translator/test_translator.py b/tests/translator/test_translator.py index 05948913f..85252103c 100644 --- a/tests/translator/test_translator.py +++ b/tests/translator/test_translator.py @@ -368,7 +368,7 @@ def test_transform_success(self, testcase, partition_with_region): self._update_logical_id_hash(expected) self._update_logical_id_hash(output_fragment) - assert deep_sort_lists(output_fragment) == deep_sort_lists(expected) + self.assertEqual(deep_sort_lists(output_fragment), deep_sort_lists(expected)) @parameterized.expand( itertools.product( @@ -451,7 +451,7 @@ def test_transform_success_openapi3(self, testcase, partition_with_region): self._update_logical_id_hash(expected) self._update_logical_id_hash(output_fragment) - assert deep_sort_lists(output_fragment) == deep_sort_lists(expected) + self.assertEqual(deep_sort_lists(output_fragment), deep_sort_lists(expected)) @parameterized.expand( itertools.product( @@ -509,7 +509,8 @@ def test_transform_success_resource_policy(self, testcase, partition_with_region if sys.version_info.major >= 3: self._update_logical_id_hash(expected) self._update_logical_id_hash(output_fragment) - assert deep_sort_lists(output_fragment) == deep_sort_lists(expected) + + self.assertEqual(deep_sort_lists(output_fragment), deep_sort_lists(expected)) def _update_logical_id_hash(self, resources): """ From e1acb5c6a91f5a99ca9a5f0bae36bf8d55b3ec50 Mon Sep 17 00:00:00 2001 From: Qingchuan Ma Date: Tue, 13 Apr 2021 18:05:48 -0700 Subject: [PATCH 09/41] Passthrough attributes for some resources, updated some tests --- samtranslator/model/api/api_generator.py | 20 ++++++++++++++----- samtranslator/model/eventsources/push.py | 18 ++++++++++------- samtranslator/model/sam_resources.py | 13 +++++++++--- samtranslator/translator/translator.py | 1 - .../api_with_usageplans_intrinsics.json | 9 ++++++--- .../api_with_usageplans_intrinsics.json | 9 ++++++--- .../aws-cn/function_event_conditions.json | 1 + .../api_with_usageplans_intrinsics.json | 9 ++++++--- .../aws-us-gov/function_event_conditions.json | 1 + .../output/function_event_conditions.json | 1 + 10 files changed, 57 insertions(+), 25 deletions(-) diff --git a/samtranslator/model/api/api_generator.py b/samtranslator/model/api/api_generator.py index 4ae7c9df6..56cfd92e0 100644 --- a/samtranslator/model/api/api_generator.py +++ b/samtranslator/model/api/api_generator.py @@ -617,7 +617,9 @@ def _construct_usage_plan(self, rest_api_stage=None): # create usage plan for this api only elif usage_plan_properties.get("CreateUsagePlan") == "PER_API": usage_plan_logical_id = self.logical_id + "UsagePlan" - usage_plan = ApiGatewayUsagePlan(logical_id=usage_plan_logical_id, depends_on=[self.logical_id]) + usage_plan = ApiGatewayUsagePlan(logical_id=usage_plan_logical_id, depends_on=[self.logical_id], + attributes=self.passthrough_resource_attributes) + # usage_plan = ApiGatewayUsagePlan(logical_id=usage_plan_logical_id, depends_on=[self.logical_id]) api_stages = list() api_stage = dict() api_stage["ApiId"] = ref(self.logical_id) @@ -634,7 +636,9 @@ def _construct_usage_plan(self, rest_api_stage=None): if self.logical_id not in ApiGenerator.depends_on_shared: ApiGenerator.depends_on_shared.append(self.logical_id) usage_plan = ApiGatewayUsagePlan( - logical_id=usage_plan_logical_id, depends_on=ApiGenerator.depends_on_shared + logical_id=usage_plan_logical_id, + depends_on=ApiGenerator.depends_on_shared, + attributes=self.passthrough_resource_attributes ) api_stage = dict() api_stage["ApiId"] = ref(self.logical_id) @@ -668,7 +672,9 @@ def _construct_api_key(self, usage_plan_logical_id, create_usage_plan, rest_api_ if create_usage_plan == "SHARED": # create an api key resource for all the apis api_key_logical_id = "ServerlessApiKey" - api_key = ApiGatewayApiKey(logical_id=api_key_logical_id, depends_on=[usage_plan_logical_id]) + api_key = ApiGatewayApiKey(logical_id=api_key_logical_id, depends_on=[usage_plan_logical_id], + attributes=self.passthrough_resource_attributes) + # api_key = ApiGatewayApiKey(logical_id=api_key_logical_id, depends_on=[usage_plan_logical_id]) api_key.Enabled = True stage_key = dict() stage_key["RestApiId"] = ref(self.logical_id) @@ -680,7 +686,9 @@ def _construct_api_key(self, usage_plan_logical_id, create_usage_plan, rest_api_ else: # create an api key resource for this api api_key_logical_id = self.logical_id + "ApiKey" - api_key = ApiGatewayApiKey(logical_id=api_key_logical_id, depends_on=[usage_plan_logical_id]) + api_key = ApiGatewayApiKey(logical_id=api_key_logical_id, depends_on=[usage_plan_logical_id], + attributes=self.passthrough_resource_attributes) + # api_key = ApiGatewayApiKey(logical_id=api_key_logical_id, depends_on=[usage_plan_logical_id]) api_key.Enabled = True stage_keys = list() stage_key = dict() @@ -705,7 +713,9 @@ def _construct_usage_plan_key(self, usage_plan_logical_id, create_usage_plan, ap # create a mapping between api key and the usage plan usage_plan_key_logical_id = self.logical_id + "UsagePlanKey" - usage_plan_key = ApiGatewayUsagePlanKey(logical_id=usage_plan_key_logical_id, depends_on=[api_key.logical_id]) + usage_plan_key = ApiGatewayUsagePlanKey(logical_id=usage_plan_key_logical_id, depends_on=[api_key.logical_id], + attributes=self.passthrough_resource_attributes) + # usage_plan_key = ApiGatewayUsagePlanKey(logical_id=usage_plan_key_logical_id, depends_on=[api_key.logical_id]) usage_plan_key.KeyId = ref(api_key.logical_id) usage_plan_key.KeyType = "API_KEY" usage_plan_key.UsagePlanId = ref(usage_plan_logical_id) diff --git a/samtranslator/model/eventsources/push.py b/samtranslator/model/eventsources/push.py index f5d6b007c..dc0371b1a 100644 --- a/samtranslator/model/eventsources/push.py +++ b/samtranslator/model/eventsources/push.py @@ -430,7 +430,7 @@ def to_cloudformation(self, **kwargs): # SNS -> SQS(Create New) -> Lambda if isinstance(self.SqsSubscription, bool): resources = [] - queue = self._inject_sqs_queue() + queue = self._inject_sqs_queue(function) queue_arn = queue.get_runtime_attr("arn") queue_url = queue.get_runtime_attr("queue_url") @@ -484,11 +484,11 @@ def _inject_subscription(self, protocol, endpoint, topic, region, filterPolicy, return subscription - def _inject_sqs_queue(self): - return SQSQueue(self.logical_id + "Queue") + def _inject_sqs_queue(self, function): + return SQSQueue(self.logical_id + "Queue", attributes=function.get_passthrough_resource_attributes()) def _inject_sqs_event_source_mapping(self, function, role, queue_arn, batch_size=None, enabled=None): - event_source = SQS(self.logical_id + "EventSourceMapping") + event_source = SQS(self.logical_id + "EventSourceMapping", attributes=function.get_passthrough_resource_attributes()) event_source.Queue = queue_arn event_source.BatchSize = batch_size or 10 event_source.Enabled = enabled or True @@ -944,11 +944,15 @@ def to_cloudformation(self, **kwargs): resources = [] source_arn = fnGetAtt(userpool_id, "Arn") - resources.append( - self._construct_permission(function, source_arn=source_arn, prefix=function.logical_id + "Cognito") - ) + lambda_permission = self._construct_permission(function, source_arn=source_arn, prefix=function.logical_id + "Cognito") + for attribute, value in function.get_passthrough_resource_attributes().items(): + lambda_permission.set_resource_attribute(attribute, value) + resources.append(lambda_permission) self._inject_lambda_config(function, userpool) + userpool_resource = CognitoUserPool.from_dict(userpool_id, userpool) + for attribute, value in function.get_passthrough_resource_attributes().items(): + userpool_resource.set_resource_attribute(attribute, value) resources.append(CognitoUserPool.from_dict(userpool_id, userpool)) return resources diff --git a/samtranslator/model/sam_resources.py b/samtranslator/model/sam_resources.py index 917e18044..a8c69882d 100644 --- a/samtranslator/model/sam_resources.py +++ b/samtranslator/model/sam_resources.py @@ -734,7 +734,8 @@ def _construct_version(self, function, intrinsics_resolver, code_sha256=None): attributes = self.get_passthrough_resource_attributes() if attributes is None: attributes = {} - attributes["DeletionPolicy"] = "Retain" + if "DeletionPolicy" not in attributes: + attributes["DeletionPolicy"] = "Retain" lambda_version = LambdaVersion(logical_id=logical_id, attributes=attributes) lambda_version.FunctionName = function.get_runtime_attr("name") @@ -1162,12 +1163,16 @@ def _construct_lambda_layer(self, intrinsics_resolver): intrinsics_resolver, self.RetentionPolicy, "RetentionPolicy" ) + # If nothing defined, this will be set to Retain retention_policy_value = self._get_retention_policy_value() attributes = self.get_passthrough_resource_attributes() if attributes is None: attributes = {} - attributes["DeletionPolicy"] = retention_policy_value + if "DeletionPolicy" not in attributes: + attributes["DeletionPolicy"] = self.RETAIN + if retention_policy_value is not None: + attributes["DeletionPolicy"] = retention_policy_value old_logical_id = self.logical_id new_logical_id = logical_id_generator.LogicalIdGenerator(old_logical_id, self.to_dict()).gen() @@ -1202,7 +1207,9 @@ def _get_retention_policy_value(self): :return: value for the DeletionPolicy attribute. """ - if self.RetentionPolicy is None or self.RetentionPolicy.lower() == self.RETAIN.lower(): + if self.RetentionPolicy is None: + return None + elif self.RetentionPolicy.lower() == self.RETAIN.lower(): return self.RETAIN elif self.RetentionPolicy.lower() == self.DELETE.lower(): return self.DELETE diff --git a/samtranslator/translator/translator.py b/samtranslator/translator/translator.py index a6acb4c3a..46dfcd192 100644 --- a/samtranslator/translator/translator.py +++ b/samtranslator/translator/translator.py @@ -24,7 +24,6 @@ from samtranslator.plugins.globals.globals_plugin import GlobalsPlugin from samtranslator.plugins.policies.policy_templates_plugin import PolicyTemplatesForResourcePlugin from samtranslator.policy_template_processor.processor import PolicyTemplatesProcessor -from samtranslator.plugins.resource_attributes.resource_attributes_plugin import ResourceAttributesPlugin from samtranslator.sdk.parameter import SamParameterValues from samtranslator.translator.arn_generator import ArnGenerator diff --git a/tests/translator/output/api_with_usageplans_intrinsics.json b/tests/translator/output/api_with_usageplans_intrinsics.json index 3c43187e7..ce2e5413d 100644 --- a/tests/translator/output/api_with_usageplans_intrinsics.json +++ b/tests/translator/output/api_with_usageplans_intrinsics.json @@ -68,7 +68,8 @@ }, "DependsOn": [ "MyApiOne" - ] + ], + "Condition": "C1" }, "MyApiTwoUsagePlan": { "Type": "AWS::ApiGateway::UsagePlan", @@ -140,7 +141,8 @@ }, "DependsOn": [ "MyApiOneUsagePlan" - ] + ], + "Condition": "C1" }, "MyFunctionTwoRole": { "Type": "AWS::IAM::Role", @@ -185,7 +187,8 @@ }, "DependsOn": [ "MyApiOneApiKey" - ] + ], + "Condition": "C1" }, "MyApiTwoApiKey": { "Type": "AWS::ApiGateway::ApiKey", diff --git a/tests/translator/output/aws-cn/api_with_usageplans_intrinsics.json b/tests/translator/output/aws-cn/api_with_usageplans_intrinsics.json index a4d484013..c9a6c4230 100644 --- a/tests/translator/output/aws-cn/api_with_usageplans_intrinsics.json +++ b/tests/translator/output/aws-cn/api_with_usageplans_intrinsics.json @@ -59,7 +59,8 @@ }, "DependsOn": [ "MyApiOne" - ] + ], + "Condition": "C1" }, "MyApiTwoUsagePlan": { "Type": "AWS::ApiGateway::UsagePlan", @@ -101,7 +102,8 @@ }, "DependsOn": [ "MyApiOneApiKey" - ] + ], + "Condition": "C1" }, "MyApiTwoProdStage": { "Type": "AWS::ApiGateway::Stage", @@ -145,7 +147,8 @@ }, "DependsOn": [ "MyApiOneUsagePlan" - ] + ], + "Condition": "C1" }, "MyFunctionTwoRole": { "Type": "AWS::IAM::Role", diff --git a/tests/translator/output/aws-cn/function_event_conditions.json b/tests/translator/output/aws-cn/function_event_conditions.json index 274bbc538..1e1ee3b38 100644 --- a/tests/translator/output/aws-cn/function_event_conditions.json +++ b/tests/translator/output/aws-cn/function_event_conditions.json @@ -529,6 +529,7 @@ "Condition": "MyCondition" }, "MyAwesomeFunctionAnotherSNSWithSQSSubscriptionQueue": { + "Condition": "MyCondition", "Type": "AWS::SQS::Queue", "Properties": {} }, diff --git a/tests/translator/output/aws-us-gov/api_with_usageplans_intrinsics.json b/tests/translator/output/aws-us-gov/api_with_usageplans_intrinsics.json index 0a60e70b8..0a9355d91 100644 --- a/tests/translator/output/aws-us-gov/api_with_usageplans_intrinsics.json +++ b/tests/translator/output/aws-us-gov/api_with_usageplans_intrinsics.json @@ -68,7 +68,8 @@ }, "DependsOn": [ "MyApiOne" - ] + ], + "Condition": "C1" }, "MyApiOneDeployment8b73115419": { "Type": "AWS::ApiGateway::Deployment", @@ -140,7 +141,8 @@ }, "DependsOn": [ "MyApiOneUsagePlan" - ] + ], + "Condition": "C1" }, "MyFunctionTwoRole": { "Type": "AWS::IAM::Role", @@ -185,7 +187,8 @@ }, "DependsOn": [ "MyApiOneApiKey" - ] + ], + "Condition": "C1" }, "MyApiTwoApiKey": { "Type": "AWS::ApiGateway::ApiKey", diff --git a/tests/translator/output/aws-us-gov/function_event_conditions.json b/tests/translator/output/aws-us-gov/function_event_conditions.json index e22637ef5..d35bfe484 100644 --- a/tests/translator/output/aws-us-gov/function_event_conditions.json +++ b/tests/translator/output/aws-us-gov/function_event_conditions.json @@ -529,6 +529,7 @@ "Condition": "MyCondition" }, "MyAwesomeFunctionAnotherSNSWithSQSSubscriptionQueue": { + "Condition": "MyCondition", "Type": "AWS::SQS::Queue", "Properties": {} }, diff --git a/tests/translator/output/function_event_conditions.json b/tests/translator/output/function_event_conditions.json index c6de70318..4926995a9 100644 --- a/tests/translator/output/function_event_conditions.json +++ b/tests/translator/output/function_event_conditions.json @@ -529,6 +529,7 @@ "Condition": "MyCondition" }, "MyAwesomeFunctionAnotherSNSWithSQSSubscriptionQueue": { + "Condition": "MyCondition", "Type": "AWS::SQS::Queue", "Properties": {} }, From 4db4a15c849e0fbbec0d91be265689b8b9df7899 Mon Sep 17 00:00:00 2001 From: Qingchuan Ma Date: Wed, 14 Apr 2021 10:26:09 -0700 Subject: [PATCH 10/41] Resolve merge conflicts --- samtranslator/model/api/api_generator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samtranslator/model/api/api_generator.py b/samtranslator/model/api/api_generator.py index 24bc2ddd0..be7e492da 100644 --- a/samtranslator/model/api/api_generator.py +++ b/samtranslator/model/api/api_generator.py @@ -652,7 +652,7 @@ def _construct_usage_plan(self, rest_api_stage=None): self.shared_api_usage_plan.depends_on_shared.append(self.logical_id) usage_plan = ApiGatewayUsagePlan( logical_id=usage_plan_logical_id, - depends_on=ApiGenerator.depends_on_shared, + depends_on=self.shared_api_usage_plan.depends_on_shared attributes=self.passthrough_resource_attributes ) api_stage = dict() From 3dabfe907653881334dd90cb7a279f50b0eedaeb Mon Sep 17 00:00:00 2001 From: Qingchuan Ma Date: Wed, 14 Apr 2021 10:29:48 -0700 Subject: [PATCH 11/41] Fixed a typo --- samtranslator/model/api/api_generator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samtranslator/model/api/api_generator.py b/samtranslator/model/api/api_generator.py index be7e492da..1d92e161c 100644 --- a/samtranslator/model/api/api_generator.py +++ b/samtranslator/model/api/api_generator.py @@ -652,7 +652,7 @@ def _construct_usage_plan(self, rest_api_stage=None): self.shared_api_usage_plan.depends_on_shared.append(self.logical_id) usage_plan = ApiGatewayUsagePlan( logical_id=usage_plan_logical_id, - depends_on=self.shared_api_usage_plan.depends_on_shared + depends_on=self.shared_api_usage_plan.depends_on_shared, attributes=self.passthrough_resource_attributes ) api_stage = dict() From 5238c735ed3252cc6ddc37b6309a66aeb4d9fdf9 Mon Sep 17 00:00:00 2001 From: Qingchuan Ma Date: Wed, 14 Apr 2021 18:54:30 -0700 Subject: [PATCH 12/41] Modified implicit api plugin for resource attributes support --- .../plugins/api/implicit_api_plugin.py | 96 ++++++++++++++++++- .../plugins/api/implicit_http_api_plugin.py | 17 +++- .../plugins/api/implicit_rest_api_plugin.py | 15 ++- samtranslator/sdk/resource.py | 12 +++ 4 files changed, 130 insertions(+), 10 deletions(-) diff --git a/samtranslator/plugins/api/implicit_api_plugin.py b/samtranslator/plugins/api/implicit_api_plugin.py index 2ae336103..027b08593 100644 --- a/samtranslator/plugins/api/implicit_api_plugin.py +++ b/samtranslator/plugins/api/implicit_api_plugin.py @@ -39,6 +39,8 @@ def __init__(self, name): # dict containing condition (or None) for each resource path+method for all APIs. dict format: # {api_id: {path: {method: condition_name_or_None}}} self.api_conditions = {} + self.api_deletion_policies = {} + self.api_update_replace_policies = {} self._setup_api_properties() def _setup_api_properties(self): @@ -75,16 +77,22 @@ def on_before_transform_template(self, template_dict): api_events = self._get_api_events(resource) condition = resource.condition + deletion_policy = resource.deletion_policy + update_replace_policy = resource.update_replace_policy if len(api_events) == 0: continue try: - self._process_api_events(resource, api_events, template, condition) + self._process_api_events( + resource, api_events, template, condition, deletion_policy, update_replace_policy + ) except InvalidEventException as ex: errors.append(InvalidResourceException(logicalId, ex.message)) self._maybe_add_condition_to_implicit_api(template_dict) + self._maybe_add_deletion_policy_to_implicit_api(template_dict) + self._maybe_add_update_replace_policy_to_implicit_api(template_dict) self._maybe_add_conditions_to_implicit_api_paths(template) self._maybe_remove_implicit_api(template) @@ -121,7 +129,8 @@ def _get_api_events(self, resource): return api_events - def _process_api_events(self, resource, api_events, template, condition=None): + def _process_api_events(self, resource, api_events, template, condition=None, + deletion_policy=None, update_replace_policy=None): """ Actually process given API events. Iteratively adds the APIs to Swagger JSON in the respective Serverless::Api resource from the template @@ -247,6 +256,89 @@ def _maybe_add_condition_to_implicit_api(self, template_dict): template_dict, self.implicit_api_condition, all_resource_method_conditions ) + def _maybe_add_deletion_policy_to_implicit_api(self, template_dict): + """ + Decides whether to add a deletion policy to the implicit api resource. + :param dict template_dict: SAM template dictionary + """ + # Short-circuit if template doesn't have any functions with implicit API events + if not self.api_deletion_policies.get(self.implicit_api_logical_id, {}): + return + + # Add a deletion policy to the API resource if its resources contains DeletionPolicy. + implicit_api_deletion_policies = self.api_deletion_policies[self.implicit_api_logical_id] + all_resource_method_deletion_policies = set( + [ + deletion_policy + for path, method_deletion_policies in implicit_api_deletion_policies.items() + for method, deletion_policy in method_deletion_policies.items() + ] + ) + at_least_one_resource_method = len(all_resource_method_deletion_policies) > 0 + one_resource_method_contains_deletion_policy = False + contains_retain = False + contains_delete = False + # If multiple functions with multiple different policies reference the Implicit Api, + # we set DeletionPolicy to Retain if Retain is present in one of the functions, + # else Delete if Delete is present + for iterated_policy in all_resource_method_deletion_policies: + if iterated_policy: + one_resource_method_contains_deletion_policy = True + if iterated_policy == "Retain": + contains_retain = True + if iterated_policy == "Delete": + contains_delete = True + if at_least_one_resource_method and one_resource_method_contains_deletion_policy: + implicit_api_resource = template_dict.get("Resources").get(self.implicit_api_logical_id) + if contains_retain: + implicit_api_resource["DeletionPolicy"] = "Retain" + elif contains_delete: + implicit_api_resource["DeletionPolicy"] = "Delete" + + def _maybe_add_update_replace_policy_to_implicit_api(self, template_dict): + """ + Decides whether to add an update replace policy to the implicit api resource. + :param dict template_dict: SAM template dictionary + """ + # Short-circuit if template doesn't have any functions with implicit API events + if not self.api_update_replace_policies.get(self.implicit_api_logical_id, {}): + return + + # Add a update replace policy to the API resource if its resources contains UpdateReplacePolicy. + implicit_api_update_replace_policies = self.api_update_replace_policies[self.implicit_api_logical_id] + all_resource_method_update_replace_policies = set( + [ + update_replace_policy + for path, method_update_replace_policies in implicit_api_update_replace_policies.items() + for method, update_replace_policy in method_update_replace_policies.items() + ] + ) + at_least_one_resource_method = len(all_resource_method_update_replace_policies) > 0 + one_resource_method_contains_update_replace_policy = False + contains_retain = False + contains_snapshot = False + contains_delete = False + # If multiple functions with multiple different policies reference the Implicit Api, + # we set UpdateReplacePolicy to Retain if Retain is present in one of the functions, + # Snapshot if Snapshot is present, else Delete if Delete is present + for iterated_policy in all_resource_method_update_replace_policies: + if iterated_policy: + one_resource_method_contains_update_replace_policy = True + if iterated_policy == "Retain": + contains_retain = True + if iterated_policy == "Snapshot": + contains_snapshot = True + if iterated_policy == "Delete": + contains_delete = True + if at_least_one_resource_method and one_resource_method_contains_update_replace_policy: + implicit_api_resource = template_dict.get("Resources").get(self.implicit_api_logical_id) + if contains_retain: + implicit_api_resource["UpdateReplacePolicy"] = "Retain" + elif contains_snapshot: + implicit_api_resource["UpdateReplacePolicy"] = "Snapshot" + elif contains_delete: + implicit_api_resource["UpdateReplacePolicy"] = "Delete" + def _add_combined_condition_to_template(self, template_dict, condition_name, conditions_to_combine): """ Add top-level template condition that combines the given list of conditions. diff --git a/samtranslator/plugins/api/implicit_http_api_plugin.py b/samtranslator/plugins/api/implicit_http_api_plugin.py index 83c078ea1..01742e1e7 100644 --- a/samtranslator/plugins/api/implicit_http_api_plugin.py +++ b/samtranslator/plugins/api/implicit_http_api_plugin.py @@ -43,7 +43,8 @@ def _setup_api_properties(self): self.api_id_property = "ApiId" self.editor = OpenApiEditor - def _process_api_events(self, function, api_events, template, condition=None): + def _process_api_events(self, function, api_events, template, condition=None, + deletion_policy=None, update_replace_policy=None): """ Actually process given HTTP API events. Iteratively adds the APIs to OpenApi JSON in the respective AWS::Serverless::HttpApi resource from the template @@ -89,11 +90,17 @@ def _process_api_events(self, function, api_events, template, condition=None): if isinstance(api_id, dict): raise InvalidEventException(logicalId, "Api Event must reference an Api in the same template.") - api_dict = self.api_conditions.setdefault(api_id, {}) - method_conditions = api_dict.setdefault(path, {}) + api_dict_condition = self.api_conditions.setdefault(api_id, {}) + method_conditions = api_dict_condition.setdefault(path, {}) + method_conditions[method] = condition - if condition: - method_conditions[method] = condition + api_dict_deletion = self.api_deletion_policies.setdefault(api_id, {}) + method_deletion_policies = api_dict_deletion.setdefault(path, {}) + method_deletion_policies[method] = deletion_policy + + api_dict_update_replace = self.api_update_replace_policies.setdefault(api_id, {}) + method_update_replace_policies = api_dict_update_replace.setdefault(path, {}) + method_update_replace_policies[method] = update_replace_policy self._add_api_to_swagger(logicalId, event_properties, template) if "RouteSettings" in event_properties: diff --git a/samtranslator/plugins/api/implicit_rest_api_plugin.py b/samtranslator/plugins/api/implicit_rest_api_plugin.py index 92ecf8d86..5fac35822 100644 --- a/samtranslator/plugins/api/implicit_rest_api_plugin.py +++ b/samtranslator/plugins/api/implicit_rest_api_plugin.py @@ -46,7 +46,8 @@ def _setup_api_properties(self): self.api_id_property = "RestApiId" self.editor = SwaggerEditor - def _process_api_events(self, function, api_events, template, condition=None): + def _process_api_events(self, function, api_events, template, condition=None, + deletion_policy=None, update_replace_policy=None): """ Actually process given API events. Iteratively adds the APIs to Swagger JSON in the respective Serverless::Api resource from the template @@ -87,9 +88,17 @@ def _process_api_events(self, function, api_events, template, condition=None): if isinstance(api_id, dict): raise InvalidEventException(logicalId, "Api Event must reference an Api in the same template.") - api_dict = self.api_conditions.setdefault(api_id, {}) - method_conditions = api_dict.setdefault(path, {}) + api_dict_condition = self.api_conditions.setdefault(api_id, {}) + method_conditions = api_dict_condition.setdefault(path, {}) method_conditions[method] = condition + + api_dict_deletion = self.api_deletion_policies.setdefault(api_id, {}) + method_deletion_policies = api_dict_deletion.setdefault(path, {}) + method_deletion_policies[method] = deletion_policy + + api_dict_update_replace = self.api_update_replace_policies.setdefault(api_id, {}) + method_update_replace_policies = api_dict_update_replace.setdefault(path, {}) + method_update_replace_policies[method] = update_replace_policy self._add_api_to_swagger(logicalId, event_properties, template) diff --git a/samtranslator/sdk/resource.py b/samtranslator/sdk/resource.py index d430feaa6..e7df71b78 100644 --- a/samtranslator/sdk/resource.py +++ b/samtranslator/sdk/resource.py @@ -23,6 +23,8 @@ def __init__(self, resource_dict): self.resource_dict = resource_dict self.type = resource_dict.get("Type") self.condition = resource_dict.get("Condition", None) + self.deletion_policy = resource_dict.get("DeletionPolicy", None) + self.update_replace_policy = resource_dict.get("UpdateReplacePolicy", None) # Properties is *not* required. Ex: SimpleTable resource has no required properties self.properties = resource_dict.get("Properties", {}) @@ -41,6 +43,16 @@ def valid(self): if not is_str()(self.condition, should_raise=False): raise InvalidDocumentException([InvalidTemplateException("Every Condition member must be a string.")]) + if self.deletion_policy: + + if not is_str()(self.deletion_policy, should_raise=False): + raise InvalidDocumentException([InvalidTemplateException("Every DeletionPolicy member must be a string.")]) + + if self.update_replace_policy: + + if not is_str()(self.update_replace_policy, should_raise=False): + raise InvalidDocumentException([InvalidTemplateException("Every UpdateReplacePolicy member must be a string.")]) + return SamResourceType.has_value(self.type) def to_dict(self): From 04f7f479c9a0c92f7c9eff0dea44723ba9910773 Mon Sep 17 00:00:00 2001 From: Qingchuan Ma Date: Wed, 14 Apr 2021 18:54:49 -0700 Subject: [PATCH 13/41] Partial update of the tests --- tests/plugins/api/test_implicit_api_plugin.py | 12 ++++++------ tests/translator/input/alexa_skill.yaml | 4 +++- .../input/alexa_skill_with_skill_id.yaml | 3 +++ .../translator/input/all_policy_templates.yaml | 3 +++ tests/translator/input/api_cache.yaml | 8 +++++++- tests/translator/input/api_description.yaml | 6 ++++++ .../input/api_endpoint_configuration.yaml | 4 ++++ ...ndpoint_configuration_with_vpcendpoint.yaml | 4 ++++ .../input/api_request_model_openapi_3.yaml | 6 +++++- tests/translator/output/alexa_skill.json | 9 +++++++++ .../output/alexa_skill_with_skill_id.json | 9 +++++++++ .../output/all_policy_templates.json | 6 ++++++ tests/translator/output/api_cache.json | 18 ++++++++++++++++++ tests/translator/output/api_description.json | 18 ++++++++++++++++++ .../output/api_endpoint_configuration.json | 18 ++++++++++++++++++ ...ndpoint_configuration_with_vpcendpoint.json | 18 ++++++++++++++++++ .../output/api_request_model_openapi_3.json | 14 ++++++++++++++ .../translator/output/aws-cn/alexa_skill.json | 9 +++++++++ .../aws-cn/alexa_skill_with_skill_id.json | 9 +++++++++ .../output/aws-cn/all_policy_templates.json | 6 ++++++ tests/translator/output/aws-cn/api_cache.json | 18 ++++++++++++++++++ .../output/aws-cn/api_description.json | 18 ++++++++++++++++++ .../aws-cn/api_endpoint_configuration.json | 18 ++++++++++++++++++ ...ndpoint_configuration_with_vpcendpoint.json | 18 ++++++++++++++++++ .../aws-cn/api_request_model_openapi_3.json | 14 ++++++++++++++ .../output/aws-us-gov/alexa_skill.json | 9 +++++++++ .../aws-us-gov/alexa_skill_with_skill_id.json | 9 +++++++++ .../aws-us-gov/all_policy_templates.json | 6 ++++++ .../output/aws-us-gov/api_cache.json | 18 ++++++++++++++++++ .../output/aws-us-gov/api_description.json | 18 ++++++++++++++++++ .../aws-us-gov/api_endpoint_configuration.json | 18 ++++++++++++++++++ ...ndpoint_configuration_with_vpcendpoint.json | 18 ++++++++++++++++++ .../api_request_model_openapi_3.json | 14 ++++++++++++++ 33 files changed, 371 insertions(+), 9 deletions(-) diff --git a/tests/plugins/api/test_implicit_api_plugin.py b/tests/plugins/api/test_implicit_api_plugin.py index 3181e11bb..8bfd808f9 100644 --- a/tests/plugins/api/test_implicit_api_plugin.py +++ b/tests/plugins/api/test_implicit_api_plugin.py @@ -96,9 +96,9 @@ def test_must_process_functions(self, SamTemplateMock): self.plugin._get_api_events.assert_has_calls([call(function1), call(function2), call(function3)]) self.plugin._process_api_events.assert_has_calls( [ - call(function1, ["event1", "event2"], sam_template, None), - call(function2, ["event1", "event2"], sam_template, None), - call(function3, ["event1", "event2"], sam_template, None), + call(function1, ["event1", "event2"], sam_template, None, None, None), + call(function2, ["event1", "event2"], sam_template, None, None, None), + call(function3, ["event1", "event2"], sam_template, None, None, None), ] ) @@ -133,9 +133,9 @@ def test_must_process_state_machines(self, SamTemplateMock): self.plugin._get_api_events.assert_has_calls([call(statemachine1), call(statemachine2), call(statemachine3)]) self.plugin._process_api_events.assert_has_calls( [ - call(statemachine1, ["event1", "event2"], sam_template, None), - call(statemachine2, ["event1", "event2"], sam_template, None), - call(statemachine3, ["event1", "event2"], sam_template, None), + call(statemachine1, ["event1", "event2"], sam_template, None, None, None), + call(statemachine2, ["event1", "event2"], sam_template, None, None, None), + call(statemachine3, ["event1", "event2"], sam_template, None, None, None), ] ) diff --git a/tests/translator/input/alexa_skill.yaml b/tests/translator/input/alexa_skill.yaml index b161c6281..bdcf82bc3 100644 --- a/tests/translator/input/alexa_skill.yaml +++ b/tests/translator/input/alexa_skill.yaml @@ -16,4 +16,6 @@ Resources: MemorySize: 1024 Runtime: nodejs12.x Timeout: 3 - + DeletionPolicy: Delete + UpdateReplacePolicy: Retain + Condition: Condition1 diff --git a/tests/translator/input/alexa_skill_with_skill_id.yaml b/tests/translator/input/alexa_skill_with_skill_id.yaml index cf6f00889..ba86247df 100644 --- a/tests/translator/input/alexa_skill_with_skill_id.yaml +++ b/tests/translator/input/alexa_skill_with_skill_id.yaml @@ -18,3 +18,6 @@ Resources: MemorySize: 1024 Runtime: nodejs12.x Timeout: 3 + DeletionPolicy: Delete + UpdateReplacePolicy: Retain + Condition: Condition1 diff --git a/tests/translator/input/all_policy_templates.yaml b/tests/translator/input/all_policy_templates.yaml index c46cfaecb..c356a4f12 100644 --- a/tests/translator/input/all_policy_templates.yaml +++ b/tests/translator/input/all_policy_templates.yaml @@ -174,3 +174,6 @@ Resources: - Route53ChangeResourceRecordSetsPolicy: HostedZoneId: test + DeletionPolicy: Delete + UpdateReplacePolicy: Retain + Condition: Condition1 \ No newline at end of file diff --git a/tests/translator/input/api_cache.yaml b/tests/translator/input/api_cache.yaml index d94d72142..ab9d1338e 100644 --- a/tests/translator/input/api_cache.yaml +++ b/tests/translator/input/api_cache.yaml @@ -12,6 +12,9 @@ Resources: RestApiId: HtmlApi Path: / Method: get + DeletionPolicy: Delete + UpdateReplacePolicy: Retain + Condition: Condition1 HtmlApi: Type: AWS::Serverless::Api @@ -19,4 +22,7 @@ Resources: StageName: Prod DefinitionUri: s3://sam-demo-bucket/webpage_swagger.json CacheClusterEnabled: true - CacheClusterSize: "1.6" \ No newline at end of file + CacheClusterSize: "1.6" + DeletionPolicy: Delete + UpdateReplacePolicy: Retain + Condition: Condition1 \ No newline at end of file diff --git a/tests/translator/input/api_description.yaml b/tests/translator/input/api_description.yaml index c660e785e..feff6745d 100644 --- a/tests/translator/input/api_description.yaml +++ b/tests/translator/input/api_description.yaml @@ -12,6 +12,9 @@ Resources: RestApiId: Api Path: / Method: get + DeletionPolicy: Delete + UpdateReplacePolicy: Retain + Condition: Condition1 Api: Type: AWS::Serverless::Api @@ -19,3 +22,6 @@ Resources: StageName: Prod DefinitionUri: s3://sam-demo-bucket/webpage_swagger.json Description: my description + DeletionPolicy: Delete + UpdateReplacePolicy: Retain + Condition: Condition1 diff --git a/tests/translator/input/api_endpoint_configuration.yaml b/tests/translator/input/api_endpoint_configuration.yaml index 67dbbdfdb..9982e15ee 100644 --- a/tests/translator/input/api_endpoint_configuration.yaml +++ b/tests/translator/input/api_endpoint_configuration.yaml @@ -22,6 +22,8 @@ Resources: Properties: Path: / Method: get + DeletionPolicy: Delete + UpdateReplacePolicy: Retain ExplicitApi: Type: AWS::Serverless::Api @@ -29,3 +31,5 @@ Resources: StageName: Prod DefinitionUri: s3://sam-demo-bucket/webpage_swagger.json EndpointConfiguration: SomeValue + DeletionPolicy: Delete + UpdateReplacePolicy: Retain diff --git a/tests/translator/input/api_endpoint_configuration_with_vpcendpoint.yaml b/tests/translator/input/api_endpoint_configuration_with_vpcendpoint.yaml index 66b7ba02d..e7ebb9e7e 100644 --- a/tests/translator/input/api_endpoint_configuration_with_vpcendpoint.yaml +++ b/tests/translator/input/api_endpoint_configuration_with_vpcendpoint.yaml @@ -24,6 +24,8 @@ Resources: Properties: Path: / Method: get + DeletionPolicy: Delete + UpdateReplacePolicy: Retain ExplicitApi: Type: AWS::Serverless::Api @@ -31,3 +33,5 @@ Resources: StageName: Prod DefinitionUri: s3://sam-demo-bucket/webpage_swagger.json EndpointConfiguration: SomeValue + DeletionPolicy: Delete + UpdateReplacePolicy: Retain diff --git a/tests/translator/input/api_request_model_openapi_3.yaml b/tests/translator/input/api_request_model_openapi_3.yaml index 2e9a7d26d..0c3877130 100644 --- a/tests/translator/input/api_request_model_openapi_3.yaml +++ b/tests/translator/input/api_request_model_openapi_3.yaml @@ -27,6 +27,8 @@ Resources: Path: /iam Auth: Authorizer: AWS_IAM + DeletionPolicy: Delete + UpdateReplacePolicy: Retain HtmlApi: @@ -39,4 +41,6 @@ Resources: type: object properties: username: - type: string \ No newline at end of file + type: string + DeletionPolicy: Delete + UpdateReplacePolicy: Retain \ No newline at end of file diff --git a/tests/translator/output/alexa_skill.json b/tests/translator/output/alexa_skill.json index bb86ba2be..b60a78e92 100644 --- a/tests/translator/output/alexa_skill.json +++ b/tests/translator/output/alexa_skill.json @@ -4,6 +4,9 @@ "Resources": { "AlexaSkillFuncRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -34,6 +37,9 @@ }, "AlexaSkillFuncAlexaSkillEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { @@ -44,6 +50,9 @@ }, "AlexaSkillFunc": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/alexa_skill_with_skill_id.json b/tests/translator/output/alexa_skill_with_skill_id.json index a02b881ab..e2320d2cc 100644 --- a/tests/translator/output/alexa_skill_with_skill_id.json +++ b/tests/translator/output/alexa_skill_with_skill_id.json @@ -4,6 +4,9 @@ "Resources": { "AlexaSkillFuncRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -34,6 +37,9 @@ }, "AlexaSkillFuncAlexaSkillEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { @@ -45,6 +51,9 @@ }, "AlexaSkillFunc": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/all_policy_templates.json b/tests/translator/output/all_policy_templates.json index a751bff43..4285b28e9 100644 --- a/tests/translator/output/all_policy_templates.json +++ b/tests/translator/output/all_policy_templates.json @@ -2,6 +2,9 @@ "Resources": { "KitchenSinkFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "Handler": "hello.handler", "Code": { @@ -25,6 +28,9 @@ }, "KitchenSinkFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", diff --git a/tests/translator/output/api_cache.json b/tests/translator/output/api_cache.json index 08bcea21a..62afb0ac4 100644 --- a/tests/translator/output/api_cache.json +++ b/tests/translator/output/api_cache.json @@ -2,6 +2,9 @@ "Resources": { "HtmlFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -32,6 +35,9 @@ }, "HtmlApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "CacheClusterEnabled": true, "DeploymentId": { @@ -46,6 +52,9 @@ }, "HtmlFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -65,6 +74,9 @@ }, "HtmlApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "RestApiId": { "Ref": "HtmlApi" @@ -75,6 +87,9 @@ }, "HtmlApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "BodyS3Location": { "Bucket": "sam-demo-bucket", @@ -84,6 +99,9 @@ }, "HtmlFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/api_description.json b/tests/translator/output/api_description.json index 31cf8ed03..d371f5e78 100644 --- a/tests/translator/output/api_description.json +++ b/tests/translator/output/api_description.json @@ -2,6 +2,9 @@ "Resources": { "FunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -32,6 +35,9 @@ }, "ApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "DeploymentId": { "Ref": "ApiDeploymentf117c932f7" @@ -44,6 +50,9 @@ }, "FunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -63,6 +72,9 @@ }, "ApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "RestApiId": { "Ref": "Api" @@ -73,6 +85,9 @@ }, "Api": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "BodyS3Location": { "Bucket": "sam-demo-bucket", @@ -83,6 +98,9 @@ }, "Function": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/api_endpoint_configuration.json b/tests/translator/output/api_endpoint_configuration.json index 68e3d0828..963f5358a 100644 --- a/tests/translator/output/api_endpoint_configuration.json +++ b/tests/translator/output/api_endpoint_configuration.json @@ -7,6 +7,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -30,6 +32,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -60,6 +64,8 @@ }, "ExplicitApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -70,6 +76,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -91,6 +99,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -108,6 +118,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentf117c932f7" @@ -120,6 +132,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment62b96c1a61" @@ -132,6 +146,8 @@ }, "ServerlessRestApiDeployment62b96c1a61": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -142,6 +158,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_endpoint_configuration_with_vpcendpoint.json b/tests/translator/output/api_endpoint_configuration_with_vpcendpoint.json index 3fd972822..a72dc6efd 100644 --- a/tests/translator/output/api_endpoint_configuration_with_vpcendpoint.json +++ b/tests/translator/output/api_endpoint_configuration_with_vpcendpoint.json @@ -10,6 +10,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -33,6 +35,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -63,6 +67,8 @@ }, "ExplicitApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -73,6 +79,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -94,6 +102,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -111,6 +121,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentf117c932f7" @@ -123,6 +135,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment62b96c1a61" @@ -135,6 +149,8 @@ }, "ServerlessRestApiDeployment62b96c1a61": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -145,6 +161,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_request_model_openapi_3.json b/tests/translator/output/api_request_model_openapi_3.json index 807a0b23a..724e8dcce 100644 --- a/tests/translator/output/api_request_model_openapi_3.json +++ b/tests/translator/output/api_request_model_openapi_3.json @@ -2,6 +2,8 @@ "Resources": { "HtmlFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -32,6 +34,8 @@ }, "HtmlApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "HtmlApiDeployment59eeb787ee" @@ -44,6 +48,8 @@ }, "HtmlFunctionIamPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -65,6 +71,8 @@ }, "HtmlApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -151,6 +159,8 @@ }, "HtmlApiDeployment59eeb787ee": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "HtmlApi" @@ -160,6 +170,8 @@ }, "HtmlFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -179,6 +191,8 @@ }, "HtmlFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { diff --git a/tests/translator/output/aws-cn/alexa_skill.json b/tests/translator/output/aws-cn/alexa_skill.json index 73a380102..77d8f6071 100644 --- a/tests/translator/output/aws-cn/alexa_skill.json +++ b/tests/translator/output/aws-cn/alexa_skill.json @@ -4,6 +4,9 @@ "Resources": { "AlexaSkillFuncRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -34,6 +37,9 @@ }, "AlexaSkillFuncAlexaSkillEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { @@ -44,6 +50,9 @@ }, "AlexaSkillFunc": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-cn/alexa_skill_with_skill_id.json b/tests/translator/output/aws-cn/alexa_skill_with_skill_id.json index c623420fa..41006ae00 100644 --- a/tests/translator/output/aws-cn/alexa_skill_with_skill_id.json +++ b/tests/translator/output/aws-cn/alexa_skill_with_skill_id.json @@ -4,6 +4,9 @@ "Resources": { "AlexaSkillFuncRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -34,6 +37,9 @@ }, "AlexaSkillFuncAlexaSkillEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { @@ -45,6 +51,9 @@ }, "AlexaSkillFunc": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-cn/all_policy_templates.json b/tests/translator/output/aws-cn/all_policy_templates.json index 7ba527e40..4664a956b 100644 --- a/tests/translator/output/aws-cn/all_policy_templates.json +++ b/tests/translator/output/aws-cn/all_policy_templates.json @@ -2,6 +2,9 @@ "Resources": { "KitchenSinkFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "Handler": "hello.handler", "Code": { @@ -25,6 +28,9 @@ }, "KitchenSinkFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", diff --git a/tests/translator/output/aws-cn/api_cache.json b/tests/translator/output/aws-cn/api_cache.json index c087e4721..ff361179b 100644 --- a/tests/translator/output/aws-cn/api_cache.json +++ b/tests/translator/output/aws-cn/api_cache.json @@ -2,6 +2,9 @@ "Resources": { "HtmlFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -32,6 +35,9 @@ }, "HtmlApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "CacheClusterEnabled": true, "DeploymentId": { @@ -46,6 +52,9 @@ }, "HtmlFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -65,6 +74,9 @@ }, "HtmlApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "RestApiId": { "Ref": "HtmlApi" @@ -75,6 +87,9 @@ }, "HtmlApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "EndpointConfiguration": { "Types": [ @@ -92,6 +107,9 @@ }, "HtmlFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-cn/api_description.json b/tests/translator/output/aws-cn/api_description.json index f5277b61d..bc6d6c05c 100644 --- a/tests/translator/output/aws-cn/api_description.json +++ b/tests/translator/output/aws-cn/api_description.json @@ -2,6 +2,9 @@ "Resources": { "FunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -32,6 +35,9 @@ }, "ApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "DeploymentId": { "Ref": "ApiDeploymentf117c932f7" @@ -44,6 +50,9 @@ }, "FunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -63,6 +72,9 @@ }, "ApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "RestApiId": { "Ref": "Api" @@ -73,6 +85,9 @@ }, "Api": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "BodyS3Location": { "Bucket": "sam-demo-bucket", @@ -91,6 +106,9 @@ }, "Function": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-cn/api_endpoint_configuration.json b/tests/translator/output/aws-cn/api_endpoint_configuration.json index 443bee42d..495e7ec23 100644 --- a/tests/translator/output/aws-cn/api_endpoint_configuration.json +++ b/tests/translator/output/aws-cn/api_endpoint_configuration.json @@ -7,6 +7,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -30,6 +32,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -60,6 +64,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -81,6 +87,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -98,6 +106,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentf117c932f7" @@ -110,6 +120,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentcb4fb12558" @@ -122,6 +134,8 @@ }, "ServerlessRestApiDeploymentcb4fb12558": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -132,6 +146,8 @@ }, "ExplicitApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -142,6 +158,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_endpoint_configuration_with_vpcendpoint.json b/tests/translator/output/aws-cn/api_endpoint_configuration_with_vpcendpoint.json index 865c90473..3d81fccc0 100644 --- a/tests/translator/output/aws-cn/api_endpoint_configuration_with_vpcendpoint.json +++ b/tests/translator/output/aws-cn/api_endpoint_configuration_with_vpcendpoint.json @@ -10,6 +10,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -33,6 +35,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -63,6 +67,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -84,6 +90,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -101,6 +109,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentf117c932f7" @@ -113,6 +123,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentcb4fb12558" @@ -125,6 +137,8 @@ }, "ServerlessRestApiDeploymentcb4fb12558": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -135,6 +149,8 @@ }, "ExplicitApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -145,6 +161,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_request_model_openapi_3.json b/tests/translator/output/aws-cn/api_request_model_openapi_3.json index df8c77769..37c03342e 100644 --- a/tests/translator/output/aws-cn/api_request_model_openapi_3.json +++ b/tests/translator/output/aws-cn/api_request_model_openapi_3.json @@ -2,6 +2,8 @@ "Resources": { "HtmlApiDeployment5ae7e42cea": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "HtmlApi" @@ -11,6 +13,8 @@ }, "HtmlFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -41,6 +45,8 @@ }, "HtmlApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "HtmlApiDeployment5ae7e42cea" @@ -53,6 +59,8 @@ }, "HtmlFunctionIamPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -74,6 +82,8 @@ }, "HtmlApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -168,6 +178,8 @@ }, "HtmlFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -187,6 +199,8 @@ }, "HtmlFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { diff --git a/tests/translator/output/aws-us-gov/alexa_skill.json b/tests/translator/output/aws-us-gov/alexa_skill.json index dad934a97..939abffa5 100644 --- a/tests/translator/output/aws-us-gov/alexa_skill.json +++ b/tests/translator/output/aws-us-gov/alexa_skill.json @@ -4,6 +4,9 @@ "Resources": { "AlexaSkillFuncRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -34,6 +37,9 @@ }, "AlexaSkillFuncAlexaSkillEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { @@ -44,6 +50,9 @@ }, "AlexaSkillFunc": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-us-gov/alexa_skill_with_skill_id.json b/tests/translator/output/aws-us-gov/alexa_skill_with_skill_id.json index 391e2fa72..735a70659 100644 --- a/tests/translator/output/aws-us-gov/alexa_skill_with_skill_id.json +++ b/tests/translator/output/aws-us-gov/alexa_skill_with_skill_id.json @@ -4,6 +4,9 @@ "Resources": { "AlexaSkillFuncRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -34,6 +37,9 @@ }, "AlexaSkillFuncAlexaSkillEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { @@ -45,6 +51,9 @@ }, "AlexaSkillFunc": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-us-gov/all_policy_templates.json b/tests/translator/output/aws-us-gov/all_policy_templates.json index 61d463baf..1be9622d2 100644 --- a/tests/translator/output/aws-us-gov/all_policy_templates.json +++ b/tests/translator/output/aws-us-gov/all_policy_templates.json @@ -2,6 +2,9 @@ "Resources": { "KitchenSinkFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "Handler": "hello.handler", "Code": { @@ -25,6 +28,9 @@ }, "KitchenSinkFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", diff --git a/tests/translator/output/aws-us-gov/api_cache.json b/tests/translator/output/aws-us-gov/api_cache.json index 35bdeb080..43c885208 100644 --- a/tests/translator/output/aws-us-gov/api_cache.json +++ b/tests/translator/output/aws-us-gov/api_cache.json @@ -2,6 +2,9 @@ "Resources": { "HtmlFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -32,6 +35,9 @@ }, "HtmlApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "CacheClusterEnabled": true, "DeploymentId": { @@ -46,6 +52,9 @@ }, "HtmlFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -65,6 +74,9 @@ }, "HtmlApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "RestApiId": { "Ref": "HtmlApi" @@ -75,6 +87,9 @@ }, "HtmlApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "EndpointConfiguration": { "Types": [ @@ -92,6 +107,9 @@ }, "HtmlFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-us-gov/api_description.json b/tests/translator/output/aws-us-gov/api_description.json index aef917ae1..a03c66d72 100644 --- a/tests/translator/output/aws-us-gov/api_description.json +++ b/tests/translator/output/aws-us-gov/api_description.json @@ -2,6 +2,9 @@ "Resources": { "FunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -32,6 +35,9 @@ }, "ApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "DeploymentId": { "Ref": "ApiDeploymentf117c932f7" @@ -44,6 +50,9 @@ }, "FunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -63,6 +72,9 @@ }, "ApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "RestApiId": { "Ref": "Api" @@ -73,6 +85,9 @@ }, "Api": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "BodyS3Location": { "Bucket": "sam-demo-bucket", @@ -91,6 +106,9 @@ }, "Function": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", + "Condition": "Condition1", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-us-gov/api_endpoint_configuration.json b/tests/translator/output/aws-us-gov/api_endpoint_configuration.json index f2da8187e..10583c2bb 100644 --- a/tests/translator/output/aws-us-gov/api_endpoint_configuration.json +++ b/tests/translator/output/aws-us-gov/api_endpoint_configuration.json @@ -7,6 +7,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -30,6 +32,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -60,6 +64,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -81,6 +87,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -98,6 +106,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentf117c932f7" @@ -110,6 +120,8 @@ }, "ServerlessRestApiDeployment5b2cb4ba8f": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -120,6 +132,8 @@ }, "ExplicitApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -130,6 +144,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment5b2cb4ba8f" @@ -142,6 +158,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_endpoint_configuration_with_vpcendpoint.json b/tests/translator/output/aws-us-gov/api_endpoint_configuration_with_vpcendpoint.json index 45af2dde5..4a6bacdde 100644 --- a/tests/translator/output/aws-us-gov/api_endpoint_configuration_with_vpcendpoint.json +++ b/tests/translator/output/aws-us-gov/api_endpoint_configuration_with_vpcendpoint.json @@ -10,6 +10,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -33,6 +35,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -63,6 +67,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -84,6 +90,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -101,6 +109,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentf117c932f7" @@ -113,6 +123,8 @@ }, "ServerlessRestApiDeployment5b2cb4ba8f": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -123,6 +135,8 @@ }, "ExplicitApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -133,6 +147,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment5b2cb4ba8f" @@ -145,6 +161,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_request_model_openapi_3.json b/tests/translator/output/aws-us-gov/api_request_model_openapi_3.json index 008a26bc1..9f3abcbea 100644 --- a/tests/translator/output/aws-us-gov/api_request_model_openapi_3.json +++ b/tests/translator/output/aws-us-gov/api_request_model_openapi_3.json @@ -2,6 +2,8 @@ "Resources": { "HtmlFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -32,6 +34,8 @@ }, "HtmlApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "HtmlApiDeploymenta488cfa4f9" @@ -44,6 +48,8 @@ }, "HtmlFunctionIamPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -65,6 +71,8 @@ }, "HtmlApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -159,6 +167,8 @@ }, "HtmlApiDeploymenta488cfa4f9": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "HtmlApi" @@ -168,6 +178,8 @@ }, "HtmlFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -187,6 +199,8 @@ }, "HtmlFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { From 26bb330cf145423e8b5f08b4316ad3930f289c80 Mon Sep 17 00:00:00 2001 From: Qingchuan Ma Date: Thu, 15 Apr 2021 15:51:09 -0700 Subject: [PATCH 14/41] Partially updated test cases, black reformatted --- samtranslator/model/api/api_generator.py | 30 +++++++++++++------ .../model/eventsources/cloudwatchlogs.py | 7 +++-- samtranslator/model/eventsources/pull.py | 5 ++-- samtranslator/model/eventsources/push.py | 16 ++++++---- samtranslator/model/sam_resources.py | 14 ++++----- samtranslator/plugins/__init__.py | 2 +- .../plugins/api/implicit_api_plugin.py | 9 +++--- .../plugins/api/implicit_http_api_plugin.py | 5 ++-- .../plugins/api/implicit_rest_api_plugin.py | 7 +++-- samtranslator/sdk/resource.py | 8 +++-- tests/translator/input/api_request_model.yaml | 4 +++ .../input/api_request_model_openapi_3.yaml | 10 +++---- .../input/api_with_access_log_setting.yaml | 4 +++ .../api_with_apikey_default_override.yaml | 8 +++++ .../api_with_apikey_required_openapi_3.yaml | 4 +++ .../translator/output/api_request_model.json | 12 ++++++++ .../output/api_with_access_log_setting.json | 18 +++++++++++ .../api_with_apikey_default_override.json | 24 +++++++++++++++ .../api_with_apikey_required_openapi_3.json | 12 ++++++++ .../output/aws-cn/api_request_model.json | 12 ++++++++ .../aws-cn/api_with_access_log_setting.json | 18 +++++++++++ .../api_with_apikey_default_override.json | 24 +++++++++++++++ .../api_with_apikey_required_openapi_3.json | 12 ++++++++ .../output/aws-us-gov/api_request_model.json | 12 ++++++++ .../api_with_access_log_setting.json | 18 +++++++++++ .../api_with_apikey_default_override.json | 24 +++++++++++++++ .../api_with_apikey_required_openapi_3.json | 12 ++++++++ 27 files changed, 288 insertions(+), 43 deletions(-) diff --git a/samtranslator/model/api/api_generator.py b/samtranslator/model/api/api_generator.py index 1d92e161c..c6225836c 100644 --- a/samtranslator/model/api/api_generator.py +++ b/samtranslator/model/api/api_generator.py @@ -631,8 +631,11 @@ def _construct_usage_plan(self, rest_api_stage=None): # create usage plan for this api only elif usage_plan_properties.get("CreateUsagePlan") == "PER_API": usage_plan_logical_id = self.logical_id + "UsagePlan" - usage_plan = ApiGatewayUsagePlan(logical_id=usage_plan_logical_id, depends_on=[self.logical_id], - attributes=self.passthrough_resource_attributes) + usage_plan = ApiGatewayUsagePlan( + logical_id=usage_plan_logical_id, + depends_on=[self.logical_id], + attributes=self.passthrough_resource_attributes, + ) # usage_plan = ApiGatewayUsagePlan(logical_id=usage_plan_logical_id, depends_on=[self.logical_id]) api_stages = list() api_stage = dict() @@ -653,7 +656,7 @@ def _construct_usage_plan(self, rest_api_stage=None): usage_plan = ApiGatewayUsagePlan( logical_id=usage_plan_logical_id, depends_on=self.shared_api_usage_plan.depends_on_shared, - attributes=self.passthrough_resource_attributes + attributes=self.passthrough_resource_attributes, ) api_stage = dict() api_stage["ApiId"] = ref(self.logical_id) @@ -688,8 +691,11 @@ def _construct_api_key(self, usage_plan_logical_id, create_usage_plan, rest_api_ # create an api key resource for all the apis LOG.info("Creating api key resource for all the Apis from SHARED usage plan") api_key_logical_id = "ServerlessApiKey" - api_key = ApiGatewayApiKey(logical_id=api_key_logical_id, depends_on=[usage_plan_logical_id], - attributes=self.passthrough_resource_attributes) + api_key = ApiGatewayApiKey( + logical_id=api_key_logical_id, + depends_on=[usage_plan_logical_id], + attributes=self.passthrough_resource_attributes, + ) # api_key = ApiGatewayApiKey(logical_id=api_key_logical_id, depends_on=[usage_plan_logical_id]) api_key.Enabled = True stage_key = dict() @@ -702,8 +708,11 @@ def _construct_api_key(self, usage_plan_logical_id, create_usage_plan, rest_api_ else: # create an api key resource for this api api_key_logical_id = self.logical_id + "ApiKey" - api_key = ApiGatewayApiKey(logical_id=api_key_logical_id, depends_on=[usage_plan_logical_id], - attributes=self.passthrough_resource_attributes) + api_key = ApiGatewayApiKey( + logical_id=api_key_logical_id, + depends_on=[usage_plan_logical_id], + attributes=self.passthrough_resource_attributes, + ) # api_key = ApiGatewayApiKey(logical_id=api_key_logical_id, depends_on=[usage_plan_logical_id]) api_key.Enabled = True stage_keys = list() @@ -729,8 +738,11 @@ def _construct_usage_plan_key(self, usage_plan_logical_id, create_usage_plan, ap # create a mapping between api key and the usage plan usage_plan_key_logical_id = self.logical_id + "UsagePlanKey" - usage_plan_key = ApiGatewayUsagePlanKey(logical_id=usage_plan_key_logical_id, depends_on=[api_key.logical_id], - attributes=self.passthrough_resource_attributes) + usage_plan_key = ApiGatewayUsagePlanKey( + logical_id=usage_plan_key_logical_id, + depends_on=[api_key.logical_id], + attributes=self.passthrough_resource_attributes, + ) # usage_plan_key = ApiGatewayUsagePlanKey(logical_id=usage_plan_key_logical_id, depends_on=[api_key.logical_id]) usage_plan_key.KeyId = ref(api_key.logical_id) usage_plan_key.KeyType = "API_KEY" diff --git a/samtranslator/model/eventsources/cloudwatchlogs.py b/samtranslator/model/eventsources/cloudwatchlogs.py index d0f4054d5..5cce4d0aa 100644 --- a/samtranslator/model/eventsources/cloudwatchlogs.py +++ b/samtranslator/model/eventsources/cloudwatchlogs.py @@ -43,8 +43,11 @@ def get_source_arn(self): ) def get_subscription_filter(self, function, permission): - subscription_filter = SubscriptionFilter(self.logical_id, depends_on=[permission.logical_id], - attributes=function.get_passthrough_resource_attributes()) + subscription_filter = SubscriptionFilter( + self.logical_id, + depends_on=[permission.logical_id], + attributes=function.get_passthrough_resource_attributes(), + ) subscription_filter.LogGroupName = self.LogGroupName subscription_filter.FilterPattern = self.FilterPattern subscription_filter.DestinationArn = function.get_runtime_attr("arn") diff --git a/samtranslator/model/eventsources/pull.py b/samtranslator/model/eventsources/pull.py index 3c0a9fc96..106700d63 100644 --- a/samtranslator/model/eventsources/pull.py +++ b/samtranslator/model/eventsources/pull.py @@ -60,8 +60,9 @@ def to_cloudformation(self, **kwargs): resources = [] - lambda_eventsourcemapping = LambdaEventSourceMapping(self.logical_id, - attributes=function.get_passthrough_resource_attributes()) + lambda_eventsourcemapping = LambdaEventSourceMapping( + self.logical_id, attributes=function.get_passthrough_resource_attributes() + ) resources.append(lambda_eventsourcemapping) try: diff --git a/samtranslator/model/eventsources/push.py b/samtranslator/model/eventsources/push.py index dc0371b1a..d7a85b04a 100644 --- a/samtranslator/model/eventsources/push.py +++ b/samtranslator/model/eventsources/push.py @@ -460,9 +460,7 @@ def to_cloudformation(self, **kwargs): queue_policy = self._inject_sqs_queue_policy( self.Topic, queue_arn, queue_url, function, queue_policy_logical_id ) - subscription = self._inject_subscription( - "sqs", queue_arn, self.Topic, self.Region, self.FilterPolicy, function - ) + subscription = self._inject_subscription("sqs", queue_arn, self.Topic, self.Region, self.FilterPolicy, function) event_source = self._inject_sqs_event_source_mapping(function, role, queue_arn, batch_size, enabled) resources = resources + event_source @@ -488,14 +486,18 @@ def _inject_sqs_queue(self, function): return SQSQueue(self.logical_id + "Queue", attributes=function.get_passthrough_resource_attributes()) def _inject_sqs_event_source_mapping(self, function, role, queue_arn, batch_size=None, enabled=None): - event_source = SQS(self.logical_id + "EventSourceMapping", attributes=function.get_passthrough_resource_attributes()) + event_source = SQS( + self.logical_id + "EventSourceMapping", attributes=function.get_passthrough_resource_attributes() + ) event_source.Queue = queue_arn event_source.BatchSize = batch_size or 10 event_source.Enabled = enabled or True return event_source.to_cloudformation(function=function, role=role) def _inject_sqs_queue_policy(self, topic_arn, queue_arn, queue_url, function, logical_id=None): - policy = SQSQueuePolicy(logical_id or self.logical_id + "QueuePolicy", attributes=function.get_passthrough_resource_attributes()) + policy = SQSQueuePolicy( + logical_id or self.logical_id + "QueuePolicy", attributes=function.get_passthrough_resource_attributes() + ) policy.PolicyDocument = SQSQueuePolicies.sns_topic_send_message_role_policy(topic_arn, queue_arn) policy.Queues = [queue_url] @@ -944,7 +946,9 @@ def to_cloudformation(self, **kwargs): resources = [] source_arn = fnGetAtt(userpool_id, "Arn") - lambda_permission = self._construct_permission(function, source_arn=source_arn, prefix=function.logical_id + "Cognito") + lambda_permission = self._construct_permission( + function, source_arn=source_arn, prefix=function.logical_id + "Cognito" + ) for attribute, value in function.get_passthrough_resource_attributes().items(): lambda_permission.set_resource_attribute(attribute, value) resources.append(lambda_permission) diff --git a/samtranslator/model/sam_resources.py b/samtranslator/model/sam_resources.py index 773397903..d281924c1 100644 --- a/samtranslator/model/sam_resources.py +++ b/samtranslator/model/sam_resources.py @@ -283,11 +283,13 @@ def _validate_and_inject_resource(self, dest_config, event, logical_id, conditio ) if dest_config.get("Type") in auto_inject_list: if dest_config.get("Type") == "SQS": - resource = SQSQueue(resource_logical_id + "Queue", - attributes=self.get_passthrough_resource_attributes()) + resource = SQSQueue( + resource_logical_id + "Queue", attributes=self.get_passthrough_resource_attributes() + ) if dest_config.get("Type") == "SNS": - resource = SNSTopic(resource_logical_id + "Topic", - attributes=self.get_passthrough_resource_attributes()) + resource = SNSTopic( + resource_logical_id + "Topic", attributes=self.get_passthrough_resource_attributes() + ) if combined_condition: resource.set_resource_attribute("Condition", combined_condition) if property_condition: @@ -318,9 +320,7 @@ def _make_and_conditions(self, resource_condition, property_condition, condition return resource_condition and_condition = make_and_condition([{"Condition": resource_condition}, {"Condition": property_condition}]) - condition_name = self._make_gen_condition_name( - resource_condition + "AND" + property_condition, self.logical_id - ) + condition_name = self._make_gen_condition_name(resource_condition + "AND" + property_condition, self.logical_id) conditions[condition_name] = and_condition return condition_name diff --git a/samtranslator/plugins/__init__.py b/samtranslator/plugins/__init__.py index 6820799fb..199baae51 100644 --- a/samtranslator/plugins/__init__.py +++ b/samtranslator/plugins/__init__.py @@ -245,4 +245,4 @@ def on_after_transform_resource(self, template, logical_id, transformed_resource :return: Nothing :raises InvalidResourceException: If the hook decides throw this exception on validation failures """ - pass \ No newline at end of file + pass diff --git a/samtranslator/plugins/api/implicit_api_plugin.py b/samtranslator/plugins/api/implicit_api_plugin.py index 027b08593..af515c2cc 100644 --- a/samtranslator/plugins/api/implicit_api_plugin.py +++ b/samtranslator/plugins/api/implicit_api_plugin.py @@ -129,8 +129,9 @@ def _get_api_events(self, resource): return api_events - def _process_api_events(self, resource, api_events, template, condition=None, - deletion_policy=None, update_replace_policy=None): + def _process_api_events( + self, resource, api_events, template, condition=None, deletion_policy=None, update_replace_policy=None + ): """ Actually process given API events. Iteratively adds the APIs to Swagger JSON in the respective Serverless::Api resource from the template @@ -278,7 +279,7 @@ def _maybe_add_deletion_policy_to_implicit_api(self, template_dict): one_resource_method_contains_deletion_policy = False contains_retain = False contains_delete = False - # If multiple functions with multiple different policies reference the Implicit Api, + # If multiple functions with multiple different policies reference the Implicit Api, # we set DeletionPolicy to Retain if Retain is present in one of the functions, # else Delete if Delete is present for iterated_policy in all_resource_method_deletion_policies: @@ -318,7 +319,7 @@ def _maybe_add_update_replace_policy_to_implicit_api(self, template_dict): contains_retain = False contains_snapshot = False contains_delete = False - # If multiple functions with multiple different policies reference the Implicit Api, + # If multiple functions with multiple different policies reference the Implicit Api, # we set UpdateReplacePolicy to Retain if Retain is present in one of the functions, # Snapshot if Snapshot is present, else Delete if Delete is present for iterated_policy in all_resource_method_update_replace_policies: diff --git a/samtranslator/plugins/api/implicit_http_api_plugin.py b/samtranslator/plugins/api/implicit_http_api_plugin.py index 01742e1e7..922a3d3b2 100644 --- a/samtranslator/plugins/api/implicit_http_api_plugin.py +++ b/samtranslator/plugins/api/implicit_http_api_plugin.py @@ -43,8 +43,9 @@ def _setup_api_properties(self): self.api_id_property = "ApiId" self.editor = OpenApiEditor - def _process_api_events(self, function, api_events, template, condition=None, - deletion_policy=None, update_replace_policy=None): + def _process_api_events( + self, function, api_events, template, condition=None, deletion_policy=None, update_replace_policy=None + ): """ Actually process given HTTP API events. Iteratively adds the APIs to OpenApi JSON in the respective AWS::Serverless::HttpApi resource from the template diff --git a/samtranslator/plugins/api/implicit_rest_api_plugin.py b/samtranslator/plugins/api/implicit_rest_api_plugin.py index 5fac35822..1e005a0cf 100644 --- a/samtranslator/plugins/api/implicit_rest_api_plugin.py +++ b/samtranslator/plugins/api/implicit_rest_api_plugin.py @@ -46,8 +46,9 @@ def _setup_api_properties(self): self.api_id_property = "RestApiId" self.editor = SwaggerEditor - def _process_api_events(self, function, api_events, template, condition=None, - deletion_policy=None, update_replace_policy=None): + def _process_api_events( + self, function, api_events, template, condition=None, deletion_policy=None, update_replace_policy=None + ): """ Actually process given API events. Iteratively adds the APIs to Swagger JSON in the respective Serverless::Api resource from the template @@ -91,7 +92,7 @@ def _process_api_events(self, function, api_events, template, condition=None, api_dict_condition = self.api_conditions.setdefault(api_id, {}) method_conditions = api_dict_condition.setdefault(path, {}) method_conditions[method] = condition - + api_dict_deletion = self.api_deletion_policies.setdefault(api_id, {}) method_deletion_policies = api_dict_deletion.setdefault(path, {}) method_deletion_policies[method] = deletion_policy diff --git a/samtranslator/sdk/resource.py b/samtranslator/sdk/resource.py index e7df71b78..94b310281 100644 --- a/samtranslator/sdk/resource.py +++ b/samtranslator/sdk/resource.py @@ -46,12 +46,16 @@ def valid(self): if self.deletion_policy: if not is_str()(self.deletion_policy, should_raise=False): - raise InvalidDocumentException([InvalidTemplateException("Every DeletionPolicy member must be a string.")]) + raise InvalidDocumentException( + [InvalidTemplateException("Every DeletionPolicy member must be a string.")] + ) if self.update_replace_policy: if not is_str()(self.update_replace_policy, should_raise=False): - raise InvalidDocumentException([InvalidTemplateException("Every UpdateReplacePolicy member must be a string.")]) + raise InvalidDocumentException( + [InvalidTemplateException("Every UpdateReplacePolicy member must be a string.")] + ) return SamResourceType.has_value(self.type) diff --git a/tests/translator/input/api_request_model.yaml b/tests/translator/input/api_request_model.yaml index 4dc0c5f42..7a3513580 100644 --- a/tests/translator/input/api_request_model.yaml +++ b/tests/translator/input/api_request_model.yaml @@ -1,6 +1,8 @@ Resources: HtmlFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -18,6 +20,8 @@ Resources: HtmlApi: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod Models: diff --git a/tests/translator/input/api_request_model_openapi_3.yaml b/tests/translator/input/api_request_model_openapi_3.yaml index 0c3877130..d12a76934 100644 --- a/tests/translator/input/api_request_model_openapi_3.yaml +++ b/tests/translator/input/api_request_model_openapi_3.yaml @@ -1,6 +1,8 @@ Resources: HtmlFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -27,12 +29,12 @@ Resources: Path: /iam Auth: Authorizer: AWS_IAM - DeletionPolicy: Delete - UpdateReplacePolicy: Retain HtmlApi: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod OpenApiVersion: 3.0 @@ -41,6 +43,4 @@ Resources: type: object properties: username: - type: string - DeletionPolicy: Delete - UpdateReplacePolicy: Retain \ No newline at end of file + type: string \ No newline at end of file diff --git a/tests/translator/input/api_with_access_log_setting.yaml b/tests/translator/input/api_with_access_log_setting.yaml index 5dc9b7bdb..9893774dd 100644 --- a/tests/translator/input/api_with_access_log_setting.yaml +++ b/tests/translator/input/api_with_access_log_setting.yaml @@ -7,6 +7,8 @@ Globals: Resources: ImplicitApiFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -20,6 +22,8 @@ Resources: ExplicitApi: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod DefinitionUri: s3://sam-demo-bucket/webpage_swagger.json diff --git a/tests/translator/input/api_with_apikey_default_override.yaml b/tests/translator/input/api_with_apikey_default_override.yaml index 51dd683e0..4d4e93e23 100644 --- a/tests/translator/input/api_with_apikey_default_override.yaml +++ b/tests/translator/input/api_with_apikey_default_override.yaml @@ -1,6 +1,8 @@ Resources: MyApiWithAuth: Type: "AWS::Serverless::Api" + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -8,6 +10,8 @@ Resources: MyFunctionWithApiKeyRequiredDefault: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler @@ -21,6 +25,8 @@ Resources: Method: get MyFunctionWithApiKeyRequiredTrue: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler @@ -36,6 +42,8 @@ Resources: ApiKeyRequired: true MyFunctionWithApiKeyRequiredFalse: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler diff --git a/tests/translator/input/api_with_apikey_required_openapi_3.yaml b/tests/translator/input/api_with_apikey_required_openapi_3.yaml index e3140b594..1f2f27234 100644 --- a/tests/translator/input/api_with_apikey_required_openapi_3.yaml +++ b/tests/translator/input/api_with_apikey_required_openapi_3.yaml @@ -1,12 +1,16 @@ Resources: MyApiWithoutAuth: Type: "AWS::Serverless::Api" + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod OpenApiVersion: '3.0.1' MyFunctionWithApiKeyRequired: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler diff --git a/tests/translator/output/api_request_model.json b/tests/translator/output/api_request_model.json index 681e277e0..563f40a14 100644 --- a/tests/translator/output/api_request_model.json +++ b/tests/translator/output/api_request_model.json @@ -2,6 +2,8 @@ "Resources": { "HtmlFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -32,6 +34,8 @@ }, "HtmlApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "HtmlApiDeploymentdd6198efe6" @@ -44,6 +48,8 @@ }, "HtmlFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -63,6 +69,8 @@ }, "HtmlApiDeploymentdd6198efe6": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "HtmlApi" @@ -73,6 +81,8 @@ }, "HtmlApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -121,6 +131,8 @@ }, "HtmlFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/api_with_access_log_setting.json b/tests/translator/output/api_with_access_log_setting.json index 1b3659eda..fc0ad71d7 100644 --- a/tests/translator/output/api_with_access_log_setting.json +++ b/tests/translator/output/api_with_access_log_setting.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ExplicitApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -65,6 +71,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -86,6 +94,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BodyS3Location": { "Bucket": "sam-demo-bucket", @@ -95,6 +105,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AccessLogSetting": { "DestinationArn": "arn:aws:logs:us-west-2:012345678901/API-Gateway-Execution-Logs_0123456789/prod:log-stream:12345678910", @@ -111,6 +123,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AccessLogSetting": { "DestinationArn": "arn:aws:logs:us-west-2:012345678901/API-Gateway-Execution-Logs_0123456789/prod:log-stream:12345678910", @@ -127,6 +141,8 @@ }, "ServerlessRestApiDeployment62b96c1a61": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -137,6 +153,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_with_apikey_default_override.json b/tests/translator/output/api_with_apikey_default_override.json index 7152b7c9a..e600c039d 100644 --- a/tests/translator/output/api_with_apikey_default_override.json +++ b/tests/translator/output/api_with_apikey_default_override.json @@ -2,6 +2,8 @@ "Resources": { "MyApiWithAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithAuthDeployment054e605502" @@ -14,6 +16,8 @@ }, "MyFunctionWithApiKeyRequiredTrueMyApiWithApiKeyRequiredTruePermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -35,6 +39,8 @@ }, "MyFunctionWithApiKeyRequiredFalseMyApiWithApiKeyRequiredFalsePermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -56,6 +62,8 @@ }, "MyFunctionWithApiKeyRequiredTrue": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -79,6 +87,8 @@ }, "MyFunctionWithApiKeyRequiredDefault": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -102,6 +112,8 @@ }, "MyFunctionWithApiKeyRequiredDefaultMyApiWithApiKeyRequiredDefaultPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -123,6 +135,8 @@ }, "MyApiWithAuthDeployment054e605502": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithAuth" @@ -133,6 +147,8 @@ }, "MyFunctionWithApiKeyRequiredFalse": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -156,6 +172,8 @@ }, "MyFunctionWithApiKeyRequiredFalseRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -186,6 +204,8 @@ }, "MyFunctionWithApiKeyRequiredDefaultRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -216,6 +236,8 @@ }, "MyFunctionWithApiKeyRequiredTrueRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -246,6 +268,8 @@ }, "MyApiWithAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_with_apikey_required_openapi_3.json b/tests/translator/output/api_with_apikey_required_openapi_3.json index 119728b18..8411653cd 100644 --- a/tests/translator/output/api_with_apikey_required_openapi_3.json +++ b/tests/translator/output/api_with_apikey_required_openapi_3.json @@ -2,6 +2,8 @@ "Resources": { "MyFunctionWithApiKeyRequiredRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -32,6 +34,8 @@ }, "MyApiWithoutAuthDeployment8770e31c42": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithoutAuth" @@ -41,6 +45,8 @@ }, "MyApiWithoutAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -83,6 +89,8 @@ }, "MyApiWithoutAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithoutAuthDeployment8770e31c42" @@ -95,6 +103,8 @@ }, "MyFunctionWithApiKeyRequiredMyApiWithApiKeyRequiredPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -116,6 +126,8 @@ }, "MyFunctionWithApiKeyRequired": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { diff --git a/tests/translator/output/aws-cn/api_request_model.json b/tests/translator/output/aws-cn/api_request_model.json index 1e9c27cef..caf9a0b47 100644 --- a/tests/translator/output/aws-cn/api_request_model.json +++ b/tests/translator/output/aws-cn/api_request_model.json @@ -2,6 +2,8 @@ "Resources": { "HtmlFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -32,6 +34,8 @@ }, "HtmlApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "HtmlApiDeploymentd7bcfbe715" @@ -44,6 +48,8 @@ }, "HtmlFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -63,6 +69,8 @@ }, "HtmlApiDeploymentd7bcfbe715": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "HtmlApi" @@ -73,6 +81,8 @@ }, "HtmlApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -129,6 +139,8 @@ }, "HtmlFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-cn/api_with_access_log_setting.json b/tests/translator/output/aws-cn/api_with_access_log_setting.json index 06436e91f..7aecf82b6 100644 --- a/tests/translator/output/aws-cn/api_with_access_log_setting.json +++ b/tests/translator/output/aws-cn/api_with_access_log_setting.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -76,6 +82,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -93,6 +101,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AccessLogSetting": { "DestinationArn": "arn:aws:logs:us-west-2:012345678901/API-Gateway-Execution-Logs_0123456789/prod:log-stream:12345678910", @@ -109,6 +119,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AccessLogSetting": { "DestinationArn": "arn:aws:logs:us-west-2:012345678901/API-Gateway-Execution-Logs_0123456789/prod:log-stream:12345678910", @@ -125,6 +137,8 @@ }, "ServerlessRestApiDeploymentcb4fb12558": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -135,6 +149,8 @@ }, "ExplicitApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -145,6 +161,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_apikey_default_override.json b/tests/translator/output/aws-cn/api_with_apikey_default_override.json index 3369f0776..e8409b139 100644 --- a/tests/translator/output/aws-cn/api_with_apikey_default_override.json +++ b/tests/translator/output/aws-cn/api_with_apikey_default_override.json @@ -2,6 +2,8 @@ "Resources": { "MyApiWithAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithAuthDeployment12e3363002" @@ -14,6 +16,8 @@ }, "MyFunctionWithApiKeyRequiredTrueMyApiWithApiKeyRequiredTruePermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -35,6 +39,8 @@ }, "MyFunctionWithApiKeyRequiredFalseMyApiWithApiKeyRequiredFalsePermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -56,6 +62,8 @@ }, "MyFunctionWithApiKeyRequiredTrue": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -79,6 +87,8 @@ }, "MyFunctionWithApiKeyRequiredDefault": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -102,6 +112,8 @@ }, "MyFunctionWithApiKeyRequiredDefaultMyApiWithApiKeyRequiredDefaultPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -123,6 +135,8 @@ }, "MyApiWithAuthDeployment12e3363002": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithAuth" @@ -133,6 +147,8 @@ }, "MyFunctionWithApiKeyRequiredFalse": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -156,6 +172,8 @@ }, "MyFunctionWithApiKeyRequiredFalseRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -186,6 +204,8 @@ }, "MyFunctionWithApiKeyRequiredDefaultRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -216,6 +236,8 @@ }, "MyFunctionWithApiKeyRequiredTrueRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -246,6 +268,8 @@ }, "MyApiWithAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_apikey_required_openapi_3.json b/tests/translator/output/aws-cn/api_with_apikey_required_openapi_3.json index 0d683135f..afc396801 100644 --- a/tests/translator/output/aws-cn/api_with_apikey_required_openapi_3.json +++ b/tests/translator/output/aws-cn/api_with_apikey_required_openapi_3.json @@ -2,6 +2,8 @@ "Resources": { "MyFunctionWithApiKeyRequiredRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -32,6 +34,8 @@ }, "MyApiWithoutAuthDeployment44fb9ac597": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithoutAuth" @@ -41,6 +45,8 @@ }, "MyApiWithoutAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -91,6 +97,8 @@ }, "MyApiWithoutAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithoutAuthDeployment44fb9ac597" @@ -103,6 +111,8 @@ }, "MyFunctionWithApiKeyRequiredMyApiWithApiKeyRequiredPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -124,6 +134,8 @@ }, "MyFunctionWithApiKeyRequired": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { diff --git a/tests/translator/output/aws-us-gov/api_request_model.json b/tests/translator/output/aws-us-gov/api_request_model.json index fd5005a28..c50e61fb1 100644 --- a/tests/translator/output/aws-us-gov/api_request_model.json +++ b/tests/translator/output/aws-us-gov/api_request_model.json @@ -2,6 +2,8 @@ "Resources": { "HtmlFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -32,6 +34,8 @@ }, "HtmlApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "HtmlApiDeployment3744537077" @@ -44,6 +48,8 @@ }, "HtmlFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -63,6 +69,8 @@ }, "HtmlApiDeployment3744537077": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "HtmlApi" @@ -73,6 +81,8 @@ }, "HtmlApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -129,6 +139,8 @@ }, "HtmlFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-us-gov/api_with_access_log_setting.json b/tests/translator/output/aws-us-gov/api_with_access_log_setting.json index 0c0a9d676..5bc849737 100644 --- a/tests/translator/output/aws-us-gov/api_with_access_log_setting.json +++ b/tests/translator/output/aws-us-gov/api_with_access_log_setting.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -76,6 +82,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -93,6 +101,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AccessLogSetting": { "DestinationArn": "arn:aws:logs:us-west-2:012345678901/API-Gateway-Execution-Logs_0123456789/prod:log-stream:12345678910", @@ -109,6 +119,8 @@ }, "ServerlessRestApiDeployment5b2cb4ba8f": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -119,6 +131,8 @@ }, "ExplicitApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -129,6 +143,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AccessLogSetting": { "DestinationArn": "arn:aws:logs:us-west-2:012345678901/API-Gateway-Execution-Logs_0123456789/prod:log-stream:12345678910", @@ -145,6 +161,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_with_apikey_default_override.json b/tests/translator/output/aws-us-gov/api_with_apikey_default_override.json index cdab211aa..7d37f5677 100644 --- a/tests/translator/output/aws-us-gov/api_with_apikey_default_override.json +++ b/tests/translator/output/aws-us-gov/api_with_apikey_default_override.json @@ -2,6 +2,8 @@ "Resources": { "MyApiWithAuthDeployment084855ab6d": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithAuth" @@ -12,6 +14,8 @@ }, "MyFunctionWithApiKeyRequiredTrueMyApiWithApiKeyRequiredTruePermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -33,6 +37,8 @@ }, "MyFunctionWithApiKeyRequiredFalseMyApiWithApiKeyRequiredFalsePermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -54,6 +60,8 @@ }, "MyApiWithAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithAuthDeployment084855ab6d" @@ -66,6 +74,8 @@ }, "MyFunctionWithApiKeyRequiredTrue": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -89,6 +99,8 @@ }, "MyFunctionWithApiKeyRequiredDefault": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -112,6 +124,8 @@ }, "MyFunctionWithApiKeyRequiredDefaultMyApiWithApiKeyRequiredDefaultPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -133,6 +147,8 @@ }, "MyFunctionWithApiKeyRequiredFalse": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -156,6 +172,8 @@ }, "MyFunctionWithApiKeyRequiredFalseRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -186,6 +204,8 @@ }, "MyFunctionWithApiKeyRequiredDefaultRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -216,6 +236,8 @@ }, "MyFunctionWithApiKeyRequiredTrueRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -246,6 +268,8 @@ }, "MyApiWithAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_with_apikey_required_openapi_3.json b/tests/translator/output/aws-us-gov/api_with_apikey_required_openapi_3.json index c6dc6a9ca..a9500984f 100644 --- a/tests/translator/output/aws-us-gov/api_with_apikey_required_openapi_3.json +++ b/tests/translator/output/aws-us-gov/api_with_apikey_required_openapi_3.json @@ -2,6 +2,8 @@ "Resources": { "MyFunctionWithApiKeyRequiredRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -32,6 +34,8 @@ }, "MyApiWithoutAuthDeployment36e0aae784": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithoutAuth" @@ -41,6 +45,8 @@ }, "MyApiWithoutAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -91,6 +97,8 @@ }, "MyApiWithoutAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithoutAuthDeployment36e0aae784" @@ -103,6 +111,8 @@ }, "MyFunctionWithApiKeyRequiredMyApiWithApiKeyRequiredPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -124,6 +134,8 @@ }, "MyFunctionWithApiKeyRequired": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { From 83b005f6df2213f7c126b5b5956abe5a96515ced Mon Sep 17 00:00:00 2001 From: Qingchuan Ma Date: Thu, 15 Apr 2021 20:49:29 -0700 Subject: [PATCH 15/41] Partially updated test templates --- .../input/api_with_apikey_required.yaml | 4 ++ .../input/api_with_auth_all_maximum.yaml | 4 ++ .../api_with_auth_all_maximum_openapi_3.yaml | 4 ++ .../input/api_with_auth_all_minimum.yaml | 14 ++++ .../api_with_auth_all_minimum_openapi.yaml | 12 ++++ .../api_with_auth_and_conditions_all_max.yaml | 6 ++ .../input/api_with_auth_no_default.yaml | 12 ++++ .../api_with_auth_with_default_scopes.yaml | 4 ++ ...with_auth_with_default_scopes_openapi.yaml | 4 ++ .../input/api_with_aws_account_blacklist.yaml | 2 + .../input/api_with_aws_account_whitelist.yaml | 2 + .../api_with_aws_iam_auth_overrides.yaml | 22 +++++++ .../input/api_with_basic_custom_domain.yaml | 6 ++ .../api_with_basic_custom_domain_http.yaml | 4 ++ ...i_with_basic_custom_domain_intrinsics.yaml | 4 ++ ...h_basic_custom_domain_intrinsics_http.yaml | 4 ++ .../input/api_with_binary_media_types.yaml | 4 ++ ...th_binary_media_types_definition_body.yaml | 4 ++ .../output/api_with_apikey_required.json | 12 ++++ .../output/api_with_auth_all_maximum.json | 26 ++++++++ .../api_with_auth_all_maximum_openapi_3.json | 26 ++++++++ .../output/api_with_auth_all_minimum.json | 48 ++++++++++++++ .../api_with_auth_all_minimum_openapi.json | 38 +++++++++++ .../api_with_auth_and_conditions_all_max.json | 32 +++++++++ .../output/api_with_auth_no_default.json | 38 +++++++++++ .../api_with_auth_with_default_scopes.json | 24 +++++++ ...with_auth_with_default_scopes_openapi.json | 24 +++++++ .../api_with_aws_account_blacklist.json | 12 ++++ .../api_with_aws_account_whitelist.json | 12 ++++ .../api_with_aws_iam_auth_overrides.json | 66 +++++++++++++++++++ .../output/api_with_basic_custom_domain.json | 42 ++++++++++++ .../api_with_basic_custom_domain_http.json | 18 +++++ ...i_with_basic_custom_domain_intrinsics.json | 26 ++++++++ ...h_basic_custom_domain_intrinsics_http.json | 22 +++++++ .../output/api_with_binary_media_types.json | 18 +++++ ...th_binary_media_types_definition_body.json | 12 ++++ .../aws-cn/api_with_apikey_required.json | 12 ++++ .../aws-cn/api_with_auth_all_maximum.json | 26 ++++++++ .../api_with_auth_all_maximum_openapi_3.json | 26 ++++++++ .../aws-cn/api_with_auth_all_minimum.json | 48 ++++++++++++++ .../api_with_auth_all_minimum_openapi.json | 38 +++++++++++ .../api_with_auth_and_conditions_all_max.json | 32 +++++++++ .../aws-cn/api_with_auth_no_default.json | 38 +++++++++++ .../api_with_auth_with_default_scopes.json | 24 +++++++ ...with_auth_with_default_scopes_openapi.json | 24 +++++++ .../api_with_aws_account_blacklist.json | 12 ++++ .../api_with_aws_account_whitelist.json | 12 ++++ .../api_with_aws_iam_auth_overrides.json | 66 +++++++++++++++++++ .../aws-cn/api_with_basic_custom_domain.json | 42 ++++++++++++ .../api_with_basic_custom_domain_http.json | 18 +++++ ...i_with_basic_custom_domain_intrinsics.json | 26 ++++++++ ...h_basic_custom_domain_intrinsics_http.json | 22 +++++++ .../aws-cn/api_with_binary_media_types.json | 18 +++++ ...th_binary_media_types_definition_body.json | 12 ++++ .../aws-us-gov/api_with_apikey_required.json | 12 ++++ .../aws-us-gov/api_with_auth_all_maximum.json | 26 ++++++++ .../api_with_auth_all_maximum_openapi_3.json | 26 ++++++++ .../aws-us-gov/api_with_auth_all_minimum.json | 48 ++++++++++++++ .../api_with_auth_all_minimum_openapi.json | 38 +++++++++++ .../api_with_auth_and_conditions_all_max.json | 32 +++++++++ .../aws-us-gov/api_with_auth_no_default.json | 38 +++++++++++ .../api_with_auth_with_default_scopes.json | 24 +++++++ ...with_auth_with_default_scopes_openapi.json | 24 +++++++ .../api_with_aws_account_blacklist.json | 12 ++++ .../api_with_aws_account_whitelist.json | 12 ++++ .../api_with_aws_iam_auth_overrides.json | 66 +++++++++++++++++++ .../api_with_basic_custom_domain.json | 42 ++++++++++++ .../api_with_basic_custom_domain_http.json | 18 +++++ ...i_with_basic_custom_domain_intrinsics.json | 26 ++++++++ ...h_basic_custom_domain_intrinsics_http.json | 22 +++++++ .../api_with_binary_media_types.json | 18 +++++ ...th_binary_media_types_definition_body.json | 12 ++++ 72 files changed, 1604 insertions(+) diff --git a/tests/translator/input/api_with_apikey_required.yaml b/tests/translator/input/api_with_apikey_required.yaml index 4ae8e5268..18685ec8b 100644 --- a/tests/translator/input/api_with_apikey_required.yaml +++ b/tests/translator/input/api_with_apikey_required.yaml @@ -1,11 +1,15 @@ Resources: MyApiWithoutAuth: Type: "AWS::Serverless::Api" + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod MyFunctionWithApiKeyRequired: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler diff --git a/tests/translator/input/api_with_auth_all_maximum.yaml b/tests/translator/input/api_with_auth_all_maximum.yaml index 831425e6d..344eca619 100644 --- a/tests/translator/input/api_with_auth_all_maximum.yaml +++ b/tests/translator/input/api_with_auth_all_maximum.yaml @@ -1,6 +1,8 @@ Resources: MyApi: Type: "AWS::Serverless::Api" + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -53,6 +55,8 @@ Resources: MyFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/thumbnails.zip Handler: index.handler diff --git a/tests/translator/input/api_with_auth_all_maximum_openapi_3.yaml b/tests/translator/input/api_with_auth_all_maximum_openapi_3.yaml index 0012f8bc1..7d3b843ca 100644 --- a/tests/translator/input/api_with_auth_all_maximum_openapi_3.yaml +++ b/tests/translator/input/api_with_auth_all_maximum_openapi_3.yaml @@ -1,6 +1,8 @@ Resources: MyApi: Type: "AWS::Serverless::Api" + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod OpenApiVersion: '3.0.1' @@ -54,6 +56,8 @@ Resources: MyFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/thumbnails.zip Handler: index.handler diff --git a/tests/translator/input/api_with_auth_all_minimum.yaml b/tests/translator/input/api_with_auth_all_minimum.yaml index b89479219..1f6d7523e 100644 --- a/tests/translator/input/api_with_auth_all_minimum.yaml +++ b/tests/translator/input/api_with_auth_all_minimum.yaml @@ -1,6 +1,8 @@ Resources: MyApiWithCognitoAuth: Type: "AWS::Serverless::Api" + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -11,6 +13,8 @@ Resources: MyApiWithLambdaTokenAuth: Type: "AWS::Serverless::Api" + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -21,6 +25,8 @@ Resources: MyApiWithLambdaRequestAuth: Type: "AWS::Serverless::Api" + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -35,6 +41,8 @@ Resources: MyApiWithNotCachedLambdaRequestAuth: Type: "AWS::Serverless::Api" + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -48,12 +56,16 @@ Resources: MyAuthFn: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler Runtime: nodejs12.x MyFn: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler @@ -85,6 +97,8 @@ Resources: Path: /not-cached-lambda-request MyUserPool: Type: AWS::Cognito::UserPool + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: UserPoolName: UserPoolName Policies: diff --git a/tests/translator/input/api_with_auth_all_minimum_openapi.yaml b/tests/translator/input/api_with_auth_all_minimum_openapi.yaml index 486bd1250..c9f490f2d 100644 --- a/tests/translator/input/api_with_auth_all_minimum_openapi.yaml +++ b/tests/translator/input/api_with_auth_all_minimum_openapi.yaml @@ -4,6 +4,8 @@ Globals: Resources: MyApiWithCognitoAuth: Type: "AWS::Serverless::Api" + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -14,6 +16,8 @@ Resources: MyApiWithLambdaTokenAuth: Type: "AWS::Serverless::Api" + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -24,6 +28,8 @@ Resources: MyApiWithLambdaRequestAuth: Type: "AWS::Serverless::Api" + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -37,12 +43,16 @@ Resources: - Authorization1 MyAuthFn: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucketname/thumbnails.zip Handler: index.handler Runtime: nodejs12.x MyFn: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucketname/thumbnails.zip Handler: index.handler @@ -68,6 +78,8 @@ Resources: Path: /lambda-request MyUserPool: Type: AWS::Cognito::UserPool + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: UserPoolName: UserPoolName Policies: diff --git a/tests/translator/input/api_with_auth_and_conditions_all_max.yaml b/tests/translator/input/api_with_auth_and_conditions_all_max.yaml index a2e5e12b4..59f200434 100644 --- a/tests/translator/input/api_with_auth_and_conditions_all_max.yaml +++ b/tests/translator/input/api_with_auth_and_conditions_all_max.yaml @@ -6,6 +6,8 @@ Conditions: Resources: MyApi: Type: "AWS::Serverless::Api" + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -57,6 +59,8 @@ Resources: MyFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/thumbnails.zip Handler: index.handler @@ -89,6 +93,8 @@ Resources: MyFunctionWithConditional: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Condition: PathCondition Properties: CodeUri: s3://sam-demo-bucket/thumbnails.zip diff --git a/tests/translator/input/api_with_auth_no_default.yaml b/tests/translator/input/api_with_auth_no_default.yaml index 85d591b06..59ae8b9d8 100644 --- a/tests/translator/input/api_with_auth_no_default.yaml +++ b/tests/translator/input/api_with_auth_no_default.yaml @@ -1,6 +1,8 @@ Resources: MyApiWithCognitoAuth: Type: "AWS::Serverless::Api" + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -10,6 +12,8 @@ Resources: MyApiWithLambdaTokenAuth: Type: "AWS::Serverless::Api" + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -19,6 +23,8 @@ Resources: MyApiWithLambdaRequestAuth: Type: "AWS::Serverless::Api" + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -31,12 +37,16 @@ Resources: - Authorization1 MyAuthFn: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler Runtime: nodejs12.x MyFn: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler @@ -62,6 +72,8 @@ Resources: Path: /lambda-request MyUserPool: Type: AWS::Cognito::UserPool + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: UserPoolName: UserPoolName Policies: diff --git a/tests/translator/input/api_with_auth_with_default_scopes.yaml b/tests/translator/input/api_with_auth_with_default_scopes.yaml index cd093a462..51673fad9 100644 --- a/tests/translator/input/api_with_auth_with_default_scopes.yaml +++ b/tests/translator/input/api_with_auth_with_default_scopes.yaml @@ -1,6 +1,8 @@ Resources: MyApiWithCognitoAuth: Type: "AWS::Serverless::Api" + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -19,6 +21,8 @@ Resources: MyFn: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler diff --git a/tests/translator/input/api_with_auth_with_default_scopes_openapi.yaml b/tests/translator/input/api_with_auth_with_default_scopes_openapi.yaml index 09031af77..8cf25d5e3 100644 --- a/tests/translator/input/api_with_auth_with_default_scopes_openapi.yaml +++ b/tests/translator/input/api_with_auth_with_default_scopes_openapi.yaml @@ -1,6 +1,8 @@ Resources: MyApiWithCognitoAuth: Type: "AWS::Serverless::Api" + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod OpenApiVersion: '3.0.1' @@ -20,6 +22,8 @@ Resources: MyFn: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler diff --git a/tests/translator/input/api_with_aws_account_blacklist.yaml b/tests/translator/input/api_with_aws_account_blacklist.yaml index b93e63d9b..a394e5ef7 100644 --- a/tests/translator/input/api_with_aws_account_blacklist.yaml +++ b/tests/translator/input/api_with_aws_account_blacklist.yaml @@ -6,6 +6,8 @@ Globals: Resources: MyFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: InlineCode: | exports.handler = async (event) => { diff --git a/tests/translator/input/api_with_aws_account_whitelist.yaml b/tests/translator/input/api_with_aws_account_whitelist.yaml index c69a9b64f..cacaa1a5d 100644 --- a/tests/translator/input/api_with_aws_account_whitelist.yaml +++ b/tests/translator/input/api_with_aws_account_whitelist.yaml @@ -1,6 +1,8 @@ Resources: MyFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: InlineCode: | exports.handler = async (event) => { diff --git a/tests/translator/input/api_with_aws_iam_auth_overrides.yaml b/tests/translator/input/api_with_aws_iam_auth_overrides.yaml index c988dd0e3..74450fbc0 100644 --- a/tests/translator/input/api_with_aws_iam_auth_overrides.yaml +++ b/tests/translator/input/api_with_aws_iam_auth_overrides.yaml @@ -1,6 +1,8 @@ Resources: MyApiWithAwsIamAuthNoCallerCredentials: Type: "AWS::Serverless::Api" + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -8,6 +10,8 @@ Resources: InvokeRole: NONE MyApiWithAwsIamAuth: Type: "AWS::Serverless::Api" + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -18,6 +22,8 @@ Resources: InvokeRole: arn:aws:iam::123:role/AUTH_AWS_IAM MyFunctionMyCognitoAuth: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler @@ -33,6 +39,8 @@ Resources: Authorizer: MyCognitoAuth MyFunctionWithoutAuth: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler @@ -46,6 +54,8 @@ Resources: Path: /MyFunctionWithoutAuth MyFunctionNoneAuth: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler @@ -61,6 +71,8 @@ Resources: Authorizer: NONE MyFunctionDefaultInvokeRole: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler @@ -77,6 +89,8 @@ Resources: InvokeRole: CALLER_CREDENTIALS MyFunctionCustomInvokeRole: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler @@ -93,6 +107,8 @@ Resources: InvokeRole: arn:aws:iam::456::role/something-else MyFunctionNONEInvokeRole: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler @@ -109,6 +125,8 @@ Resources: InvokeRole: NONE MyFunctionNullInvokeRole: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler @@ -125,6 +143,8 @@ Resources: InvokeRole: null MyFunctionCallerCredentialsOverride: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler @@ -141,6 +161,8 @@ Resources: InvokeRole: CALLER_CREDENTIALS MyFunctionNoCallerCredentials: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler diff --git a/tests/translator/input/api_with_basic_custom_domain.yaml b/tests/translator/input/api_with_basic_custom_domain.yaml index 2d8c915b0..40b31f4bf 100644 --- a/tests/translator/input/api_with_basic_custom_domain.yaml +++ b/tests/translator/input/api_with_basic_custom_domain.yaml @@ -16,6 +16,8 @@ Globals: Resources: MyFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: InlineCode: | exports.handler = async (event) => { @@ -54,6 +56,8 @@ Resources: MyApi: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: OpenApiVersion: 3.0.1 StageName: Prod @@ -70,6 +74,8 @@ Resources: MyAnotherApi: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: OpenApiVersion: 3.0.1 StageName: Prod diff --git a/tests/translator/input/api_with_basic_custom_domain_http.yaml b/tests/translator/input/api_with_basic_custom_domain_http.yaml index 9172c00c1..ff44f731a 100644 --- a/tests/translator/input/api_with_basic_custom_domain_http.yaml +++ b/tests/translator/input/api_with_basic_custom_domain_http.yaml @@ -25,6 +25,8 @@ Globals: Resources: HttpApiFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: InlineCode: | exports.handler = async (event) => { @@ -50,6 +52,8 @@ Resources: MyApi: Type: AWS::Serverless::HttpApi + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: DisableExecuteApiEndpoint: true StageName: Prod \ No newline at end of file diff --git a/tests/translator/input/api_with_basic_custom_domain_intrinsics.yaml b/tests/translator/input/api_with_basic_custom_domain_intrinsics.yaml index b1d642754..99fa2c245 100644 --- a/tests/translator/input/api_with_basic_custom_domain_intrinsics.yaml +++ b/tests/translator/input/api_with_basic_custom_domain_intrinsics.yaml @@ -24,6 +24,8 @@ Resources: MyFunction: Condition: C1 Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: InlineCode: | exports.handler = async (event) => { @@ -51,6 +53,8 @@ Resources: MyApi: Condition: C1 Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: OpenApiVersion: 3.0.1 StageName: Prod diff --git a/tests/translator/input/api_with_basic_custom_domain_intrinsics_http.yaml b/tests/translator/input/api_with_basic_custom_domain_intrinsics_http.yaml index b445a3bbb..6a34af94b 100644 --- a/tests/translator/input/api_with_basic_custom_domain_intrinsics_http.yaml +++ b/tests/translator/input/api_with_basic_custom_domain_intrinsics_http.yaml @@ -24,6 +24,8 @@ Resources: MyFunction: Condition: C1 Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: InlineCode: | exports.handler = async (event) => { @@ -51,6 +53,8 @@ Resources: MyApi: Condition: C1 Type: AWS::Serverless::HttpApi + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod DisableExecuteApiEndpoint: False diff --git a/tests/translator/input/api_with_binary_media_types.yaml b/tests/translator/input/api_with_binary_media_types.yaml index 2a10a2aa1..f06af1993 100644 --- a/tests/translator/input/api_with_binary_media_types.yaml +++ b/tests/translator/input/api_with_binary_media_types.yaml @@ -11,6 +11,8 @@ Globals: Resources: ImplicitApiFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -24,6 +26,8 @@ Resources: ExplicitApi: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod DefinitionUri: s3://sam-demo-bucket/webpage_swagger.json diff --git a/tests/translator/input/api_with_binary_media_types_definition_body.yaml b/tests/translator/input/api_with_binary_media_types_definition_body.yaml index 6730419d4..1e1ef66d6 100644 --- a/tests/translator/input/api_with_binary_media_types_definition_body.yaml +++ b/tests/translator/input/api_with_binary_media_types_definition_body.yaml @@ -12,6 +12,8 @@ Globals: Resources: ExplicitApiManagedSwagger: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod BinaryMediaTypes: @@ -19,6 +21,8 @@ Resources: ExplicitApiDefinitionBody: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod BinaryMediaTypes: diff --git a/tests/translator/output/api_with_apikey_required.json b/tests/translator/output/api_with_apikey_required.json index 94759d029..f4e49654d 100644 --- a/tests/translator/output/api_with_apikey_required.json +++ b/tests/translator/output/api_with_apikey_required.json @@ -2,6 +2,8 @@ "Resources": { "MyFunctionWithApiKeyRequiredRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -32,6 +34,8 @@ }, "MyApiWithoutAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -72,6 +76,8 @@ }, "MyApiWithoutAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithoutAuthDeployment3ab9d13134" @@ -84,6 +90,8 @@ }, "MyFunctionWithApiKeyRequiredMyApiWithApiKeyRequiredPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -105,6 +113,8 @@ }, "MyFunctionWithApiKeyRequired": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -128,6 +138,8 @@ }, "MyApiWithoutAuthDeployment3ab9d13134": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithoutAuth" diff --git a/tests/translator/output/api_with_auth_all_maximum.json b/tests/translator/output/api_with_auth_all_maximum.json index 9615a989f..29e601382 100644 --- a/tests/translator/output/api_with_auth_all_maximum.json +++ b/tests/translator/output/api_with_auth_all_maximum.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -25,6 +27,8 @@ }, "MyFunctionWithLambdaTokenAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -46,6 +50,8 @@ }, "MyApiMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -64,6 +70,8 @@ }, "MyFunctionWithCognitoMultipleUserPoolsAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -85,6 +93,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -115,6 +125,8 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -317,6 +329,8 @@ }, "MyApiMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -335,6 +349,8 @@ }, "MyFunctionWithLambdaRequestAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -356,6 +372,8 @@ }, "MyApiDeployment0cec4886a5": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -366,6 +384,8 @@ }, "MyApiMyLambdaTokenAuthNoneFunctionInvokeRoleAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -384,6 +404,8 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment0cec4886a5" @@ -396,6 +418,8 @@ }, "MyFunctionWithNoAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -417,6 +441,8 @@ }, "MyFunctionWithDefaultAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/api_with_auth_all_maximum_openapi_3.json b/tests/translator/output/api_with_auth_all_maximum_openapi_3.json index 2a80fd35f..11956d39f 100644 --- a/tests/translator/output/api_with_auth_all_maximum_openapi_3.json +++ b/tests/translator/output/api_with_auth_all_maximum_openapi_3.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -25,6 +27,8 @@ }, "MyFunctionWithLambdaTokenAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -46,6 +50,8 @@ }, "MyApiMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -64,6 +70,8 @@ }, "MyFunctionWithCognitoMultipleUserPoolsAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -85,6 +93,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -115,6 +125,8 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -319,6 +331,8 @@ }, "MyApiMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -337,6 +351,8 @@ }, "MyFunctionWithLambdaRequestAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -358,6 +374,8 @@ }, "MyApiMyLambdaTokenAuthNoneFunctionInvokeRoleAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -376,6 +394,8 @@ }, "MyApiDeployment98ad824f7d": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -385,6 +405,8 @@ }, "MyFunctionWithNoAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -406,6 +428,8 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment98ad824f7d" @@ -418,6 +442,8 @@ }, "MyFunctionWithDefaultAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/api_with_auth_all_minimum.json b/tests/translator/output/api_with_auth_all_minimum.json index 4a4dbe937..3f1c65c9c 100644 --- a/tests/translator/output/api_with_auth_all_minimum.json +++ b/tests/translator/output/api_with_auth_all_minimum.json @@ -2,6 +2,8 @@ "Resources": { "MyApiWithCognitoAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -54,6 +56,8 @@ }, "MyApiWithLambdaRequestAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithLambdaRequestAuthDeployment6e52add211" @@ -66,6 +70,8 @@ }, "MyApiWithNotCachedLambdaRequestAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithNotCachedLambdaRequestAuthDeployment444f67cd7c" @@ -78,6 +84,8 @@ }, "MyApiWithLambdaTokenAuthMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -101,6 +109,8 @@ }, "MyApiWithCognitoAuthDeployment62312fa971": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithCognitoAuth" @@ -111,6 +121,8 @@ }, "MyAuthFn": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -134,6 +146,8 @@ }, "MyFnRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -164,6 +178,8 @@ }, "MyApiWithCognitoAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithCognitoAuthDeployment62312fa971" @@ -176,6 +192,8 @@ }, "MyFnCognitoPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -197,6 +215,8 @@ }, "MyApiWithLambdaRequestAuthMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -220,6 +240,8 @@ }, "MyApiWithNotCachedLambdaRequestAuthMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -243,6 +265,8 @@ }, "MyFnLambdaTokenPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -264,6 +288,8 @@ }, "MyApiWithLambdaRequestAuthDeployment6e52add211": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithLambdaRequestAuth" @@ -274,6 +300,8 @@ }, "MyApiWithNotCachedLambdaRequestAuthDeployment444f67cd7c": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithNotCachedLambdaRequestAuth" @@ -284,6 +312,8 @@ }, "MyFnLambdaRequestPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -305,6 +335,8 @@ }, "MyFnLambdaNotCachedRequestPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -326,6 +358,8 @@ }, "MyApiWithLambdaTokenAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -383,6 +417,8 @@ }, "MyUserPool": { "Type": "AWS::Cognito::UserPool", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "UsernameAttributes": [ "email" @@ -404,6 +440,8 @@ }, "MyFn": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -427,6 +465,8 @@ }, "MyApiWithLambdaTokenAuthDeployment445c6c96e7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithLambdaTokenAuth" @@ -437,6 +477,8 @@ }, "MyAuthFnRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -467,6 +509,8 @@ }, "MyApiWithLambdaTokenAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithLambdaTokenAuthDeployment445c6c96e7" @@ -479,6 +523,8 @@ }, "MyApiWithLambdaRequestAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -537,6 +583,8 @@ }, "MyApiWithNotCachedLambdaRequestAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_with_auth_all_minimum_openapi.json b/tests/translator/output/api_with_auth_all_minimum_openapi.json index ecee37eda..4eef9c9bd 100644 --- a/tests/translator/output/api_with_auth_all_minimum_openapi.json +++ b/tests/translator/output/api_with_auth_all_minimum_openapi.json @@ -2,6 +2,8 @@ "Resources": { "MyApiWithCognitoAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -56,6 +58,8 @@ }, "MyApiWithLambdaRequestAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithLambdaRequestAuthDeployment14ab3ddf12" @@ -68,6 +72,8 @@ }, "MyApiWithLambdaTokenAuthMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -91,6 +97,8 @@ }, "MyAuthFn": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -114,6 +122,8 @@ }, "MyFnRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -144,6 +154,8 @@ }, "MyApiWithLambdaRequestAuthDeployment14ab3ddf12": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithLambdaRequestAuth" @@ -153,6 +165,8 @@ }, "MyApiWithCognitoAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithCognitoAuthDeployment87cdbda651" @@ -165,6 +179,8 @@ }, "MyFnCognitoPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -186,6 +202,8 @@ }, "MyApiWithLambdaRequestAuthMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -209,6 +227,8 @@ }, "MyFnLambdaTokenPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -230,6 +250,8 @@ }, "MyFnLambdaRequestPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -251,6 +273,8 @@ }, "MyApiWithLambdaTokenAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -310,6 +334,8 @@ }, "MyUserPool": { "Type": "AWS::Cognito::UserPool", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "UsernameAttributes": [ "email" @@ -331,6 +357,8 @@ }, "MyFn": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -354,6 +382,8 @@ }, "MyAuthFnRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -384,6 +414,8 @@ }, "MyApiWithLambdaTokenAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithLambdaTokenAuthDeployment4fdb5f4e3c" @@ -396,6 +428,8 @@ }, "MyApiWithCognitoAuthDeployment87cdbda651": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithCognitoAuth" @@ -405,6 +439,8 @@ }, "MyApiWithLambdaRequestAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -465,6 +501,8 @@ }, "MyApiWithLambdaTokenAuthDeployment4fdb5f4e3c": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithLambdaTokenAuth" diff --git a/tests/translator/output/api_with_auth_and_conditions_all_max.json b/tests/translator/output/api_with_auth_and_conditions_all_max.json index 06f9a6434..719892634 100644 --- a/tests/translator/output/api_with_auth_and_conditions_all_max.json +++ b/tests/translator/output/api_with_auth_and_conditions_all_max.json @@ -10,6 +10,8 @@ "Resources": { "MyFunctionWithLambdaTokenAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -31,6 +33,8 @@ }, "MyApiMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -49,6 +53,8 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeploymentf5a2efce75" @@ -61,6 +67,8 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -306,6 +314,8 @@ }, "MyApiMyLambdaTokenAuthNoneFunctionInvokeRoleAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -324,6 +334,8 @@ }, "MyFunctionWithNoAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -345,6 +357,8 @@ }, "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -368,6 +382,8 @@ }, "MyFunctionWithCognitoMultipleUserPoolsAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -389,6 +405,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -419,6 +437,8 @@ }, "MyFunctionWithConditionalWithLambdaTokenAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -441,6 +461,8 @@ }, "MyFunctionWithConditionalWithLambdaRequestAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -463,6 +485,8 @@ }, "MyApiMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -481,6 +505,8 @@ }, "MyFunctionWithConditional": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -505,6 +531,8 @@ }, "MyApiDeploymentf5a2efce75": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -515,6 +543,8 @@ }, "MyFunctionWithConditionalWithDefaultAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -537,6 +567,8 @@ }, "MyFunctionWithConditionalRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/api_with_auth_no_default.json b/tests/translator/output/api_with_auth_no_default.json index 48d756acc..1fab38c04 100644 --- a/tests/translator/output/api_with_auth_no_default.json +++ b/tests/translator/output/api_with_auth_no_default.json @@ -2,6 +2,8 @@ "Resources": { "MyApiWithCognitoAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -49,6 +51,8 @@ }, "MyApiWithLambdaRequestAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithLambdaRequestAuthDeployment7d0d103fdf" @@ -61,6 +65,8 @@ }, "MyApiWithLambdaTokenAuthMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -84,6 +90,8 @@ }, "MyAuthFn": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -107,6 +115,8 @@ }, "MyFnRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -137,6 +147,8 @@ }, "MyApiWithCognitoAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithCognitoAuthDeployment039b508d89" @@ -149,6 +161,8 @@ }, "MyFnCognitoPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -170,6 +184,8 @@ }, "MyApiWithCognitoAuthDeployment039b508d89": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithCognitoAuth" @@ -180,6 +196,8 @@ }, "MyApiWithLambdaRequestAuthMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -203,6 +221,8 @@ }, "MyApiWithLambdaRequestAuthDeployment7d0d103fdf": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithLambdaRequestAuth" @@ -213,6 +233,8 @@ }, "MyFnLambdaTokenPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -234,6 +256,8 @@ }, "MyFnLambdaRequestPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -255,6 +279,8 @@ }, "MyApiWithLambdaTokenAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -307,6 +333,8 @@ }, "MyApiWithLambdaTokenAuthDeployment50695ee60b": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithLambdaTokenAuth" @@ -317,6 +345,8 @@ }, "MyUserPool": { "Type": "AWS::Cognito::UserPool", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "UsernameAttributes": [ "email" @@ -338,6 +368,8 @@ }, "MyFn": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -361,6 +393,8 @@ }, "MyAuthFnRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -391,6 +425,8 @@ }, "MyApiWithLambdaTokenAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithLambdaTokenAuthDeployment50695ee60b" @@ -403,6 +439,8 @@ }, "MyApiWithLambdaRequestAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_with_auth_with_default_scopes.json b/tests/translator/output/api_with_auth_with_default_scopes.json index ba1c3d108..c0374a394 100644 --- a/tests/translator/output/api_with_auth_with_default_scopes.json +++ b/tests/translator/output/api_with_auth_with_default_scopes.json @@ -2,6 +2,8 @@ "Resources": { "MyApiWithCognitoAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -175,6 +177,8 @@ }, "MyFnCognitoDefaultScopesNonePermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -196,6 +200,8 @@ }, "MyApiWithCognitoAuthDeployment442cfe5207": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithCognitoAuth" @@ -206,6 +212,8 @@ }, "MyFnCognitoDefaultAuthDefaultScopesNonePermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -227,6 +235,8 @@ }, "MyFnCognitoAuthorizerWithDefaultScopesPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -248,6 +258,8 @@ }, "MyFnCognitoDefaultScopesDefaultAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -269,6 +281,8 @@ }, "MyFnCognitoAuthorizerScopesOverwrittenPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -290,6 +304,8 @@ }, "MyFnRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -320,6 +336,8 @@ }, "MyFnCognitoWithAuthNonePermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -341,6 +359,8 @@ }, "MyApiWithCognitoAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithCognitoAuthDeployment442cfe5207" @@ -353,6 +373,8 @@ }, "MyFn": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -376,6 +398,8 @@ }, "MyFnCognitoDefaultScopesWithOverwrittenPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/api_with_auth_with_default_scopes_openapi.json b/tests/translator/output/api_with_auth_with_default_scopes_openapi.json index a70e837e6..4f7b7460e 100644 --- a/tests/translator/output/api_with_auth_with_default_scopes_openapi.json +++ b/tests/translator/output/api_with_auth_with_default_scopes_openapi.json @@ -2,6 +2,8 @@ "Resources": { "MyApiWithCognitoAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -177,6 +179,8 @@ }, "MyFnCognitoDefaultScopesNonePermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -198,6 +202,8 @@ }, "MyFnCognitoDefaultAuthDefaultScopesNonePermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -219,6 +225,8 @@ }, "MyFnCognitoAuthorizerWithDefaultScopesPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -240,6 +248,8 @@ }, "MyFnCognitoDefaultScopesDefaultAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -261,6 +271,8 @@ }, "MyFnCognitoAuthorizerScopesOverwrittenPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -282,6 +294,8 @@ }, "MyApiWithCognitoAuthDeployment85cd9eefb8": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithCognitoAuth" @@ -291,6 +305,8 @@ }, "MyFnRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -321,6 +337,8 @@ }, "MyFnCognitoWithAuthNonePermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -342,6 +360,8 @@ }, "MyApiWithCognitoAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithCognitoAuthDeployment85cd9eefb8" @@ -354,6 +374,8 @@ }, "MyFn": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -377,6 +399,8 @@ }, "MyFnCognitoDefaultScopesWithOverwrittenPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/api_with_aws_account_blacklist.json b/tests/translator/output/api_with_aws_account_blacklist.json index 41e8598c6..64182585f 100644 --- a/tests/translator/output/api_with_aws_account_blacklist.json +++ b/tests/translator/output/api_with_aws_account_blacklist.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -24,6 +26,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment58caafe4ca" @@ -36,6 +40,8 @@ }, "ServerlessRestApiDeployment58caafe4ca": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -46,6 +52,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -76,6 +84,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -126,6 +136,8 @@ }, "MyFunctionApiPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/api_with_aws_account_whitelist.json b/tests/translator/output/api_with_aws_account_whitelist.json index 3972c4599..4b47755e7 100644 --- a/tests/translator/output/api_with_aws_account_whitelist.json +++ b/tests/translator/output/api_with_aws_account_whitelist.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -24,6 +26,8 @@ }, "ServerlessRestApiDeployment3727797069": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -34,6 +38,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment3727797069" @@ -46,6 +52,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -76,6 +84,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -147,6 +157,8 @@ }, "MyFunctionApiPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/api_with_aws_iam_auth_overrides.json b/tests/translator/output/api_with_aws_iam_auth_overrides.json index 59174643a..40fad853b 100644 --- a/tests/translator/output/api_with_aws_iam_auth_overrides.json +++ b/tests/translator/output/api_with_aws_iam_auth_overrides.json @@ -2,6 +2,8 @@ "Resources": { "MyFunctionCustomInvokeRole": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -25,6 +27,8 @@ }, "MyFunctionNoneAuth": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -48,6 +52,8 @@ }, "MyFunctionNullInvokeRole": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -71,6 +77,8 @@ }, "MyApiWithAwsIamAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithAwsIamAuthDeployment3bec5f30f2" @@ -83,6 +91,8 @@ }, "MyFunctionWithoutAuthRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -113,6 +123,8 @@ }, "MyFunctionCustomInvokeRoleAPI3PermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -134,6 +146,8 @@ }, "MyFunctionMyCognitoAuthAPI1PermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -155,6 +169,8 @@ }, "MyApiWithAwsIamAuthNoCallerCredentials": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -212,6 +228,8 @@ }, "MyFunctionWithoutAuthAPI2PermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -233,6 +251,8 @@ }, "MyFunctionDefaultInvokeRoleAPI3PermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -254,6 +274,8 @@ }, "MyFunctionMyCognitoAuth": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -277,6 +299,8 @@ }, "MyFunctionNullInvokeRoleRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -307,6 +331,8 @@ }, "MyFunctionNONEInvokeRole": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -330,6 +356,8 @@ }, "MyFunctionNoCallerCredentialsAPI3PermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -351,6 +379,8 @@ }, "MyFunctionNoneAuthRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -381,6 +411,8 @@ }, "MyFunctionCustomInvokeRoleRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -411,6 +443,8 @@ }, "MyApiWithAwsIamAuthDeployment3bec5f30f2": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithAwsIamAuth" @@ -421,6 +455,8 @@ }, "MyApiWithAwsIamAuthNoCallerCredentialsDeployment38c75afec1": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithAwsIamAuthNoCallerCredentials" @@ -431,6 +467,8 @@ }, "MyFunctionCallerCredentialsOverrideAPI3PermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -452,6 +490,8 @@ }, "MyFunctionCallerCredentialsOverride": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -475,6 +515,8 @@ }, "MyFunctionWithoutAuth": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -498,6 +540,8 @@ }, "MyFunctionNullInvokeRoleAPI3PermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -519,6 +563,8 @@ }, "MyFunctionNONEInvokeRoleAPI3PermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -540,6 +586,8 @@ }, "MyFunctionNoCallerCredentialsRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -570,6 +618,8 @@ }, "MyFunctionDefaultInvokeRoleRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -600,6 +650,8 @@ }, "MyFunctionCallerCredentialsOverrideRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -630,6 +682,8 @@ }, "MyFunctionMyCognitoAuthRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -660,6 +714,8 @@ }, "MyApiWithAwsIamAuthNoCallerCredentialsProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithAwsIamAuthNoCallerCredentialsDeployment38c75afec1" @@ -672,6 +728,8 @@ }, "MyFunctionDefaultInvokeRole": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -695,6 +753,8 @@ }, "MyFunctionNoCallerCredentials": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -718,6 +778,8 @@ }, "MyApiWithAwsIamAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -876,6 +938,8 @@ }, "MyFunctionNoneAuthAPI3PermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -897,6 +961,8 @@ }, "MyFunctionNONEInvokeRoleRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/api_with_basic_custom_domain.json b/tests/translator/output/api_with_basic_custom_domain.json index 4ed229a5a..7a913b1fd 100644 --- a/tests/translator/output/api_with_basic_custom_domain.json +++ b/tests/translator/output/api_with_basic_custom_domain.json @@ -12,6 +12,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -34,6 +36,8 @@ }, "MyFunctionAnotherGetPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -55,6 +59,8 @@ }, "ApiGatewayDomainName23cdccdf9c": { "Type": "AWS::ApiGateway::DomainName", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "CertificateArn": "my-api-cert-arn", "EndpointConfiguration": { @@ -72,6 +78,8 @@ }, "MyFunctionImplicitGetPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -93,6 +101,8 @@ }, "MyAnotherApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyAnotherApiDeployment48a61be119" @@ -105,6 +115,8 @@ }, "MyFunctionFetchPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -126,6 +138,8 @@ }, "MyAnotherApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -154,6 +168,8 @@ }, "MyApifetchBasePathMapping": { "Type": "AWS::ApiGateway::BasePathMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BasePath": "fetch", "DomainName": { @@ -169,6 +185,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -199,6 +217,8 @@ }, "MyApigetBasePathMapping": { "Type": "AWS::ApiGateway::BasePathMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BasePath": "get", "DomainName": { @@ -214,6 +234,8 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -254,6 +276,8 @@ }, "MyAnotherApiBasePathMapping": { "Type": "AWS::ApiGateway::BasePathMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DomainName": { "Ref": "ApiGatewayDomainNameeab65c1531" @@ -268,6 +292,8 @@ }, "ApiGatewayDomainNameeab65c1531": { "Type": "AWS::ApiGateway::DomainName", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -280,6 +306,8 @@ }, "ServerlessRestApiDeployment3c44da8ffd": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -290,6 +318,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment3c44da8ffd" @@ -302,6 +332,8 @@ }, "MyApiDeployment347043ff9e": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -311,6 +343,8 @@ }, "ServerlessRestApiBasePathMapping": { "Type": "AWS::ApiGateway::BasePathMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DomainName": { "Ref": "ApiGatewayDomainNameeab65c1531" @@ -325,6 +359,8 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment347043ff9e" @@ -337,6 +373,8 @@ }, "MyAnotherApiDeployment48a61be119": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyAnotherApi" @@ -346,6 +384,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -374,6 +414,8 @@ }, "MyFunctionApiPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/api_with_basic_custom_domain_http.json b/tests/translator/output/api_with_basic_custom_domain_http.json index f99b2c682..e5ddd8ec3 100644 --- a/tests/translator/output/api_with_basic_custom_domain_http.json +++ b/tests/translator/output/api_with_basic_custom_domain_http.json @@ -12,6 +12,8 @@ "Resources": { "MyApibasicApiMapping": { "Type": "AWS::ApiGatewayV2::ApiMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -27,6 +29,8 @@ }, "ApiGatewayDomainNameV22dbf35af54": { "Type": "AWS::ApiGatewayV2::DomainName", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DomainName": "sam-example.com", "DomainNameConfigurations": [ @@ -47,6 +51,8 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -60,6 +66,8 @@ }, "HttpApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -82,6 +90,8 @@ }, "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -103,6 +113,8 @@ }, "MyApibeginhereApiMapping": { "Type": "AWS::ApiGatewayV2::ApiMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -118,6 +130,8 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -148,6 +162,8 @@ }, "RecordSetGroup1f4f569a7e": { "Type": "AWS::Route53::RecordSetGroup", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "HostedZoneName": "sam-example.com.", "RecordSets": [ @@ -174,6 +190,8 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_with_basic_custom_domain_intrinsics.json b/tests/translator/output/api_with_basic_custom_domain_intrinsics.json index 09d694c4e..257412734 100644 --- a/tests/translator/output/api_with_basic_custom_domain_intrinsics.json +++ b/tests/translator/output/api_with_basic_custom_domain_intrinsics.json @@ -28,6 +28,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -51,6 +53,8 @@ }, "MyFunctionImplicitGetPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -73,6 +77,8 @@ }, "ApiGatewayDomainNamec0ed6fae34": { "Type": "AWS::ApiGateway::DomainName", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -93,6 +99,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment43c34b4e46" @@ -106,6 +114,8 @@ }, "MyApifetchBasePathMapping": { "Type": "AWS::ApiGateway::BasePathMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BasePath": "fetch", "DomainName": { @@ -122,6 +132,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -153,6 +165,8 @@ }, "MyApigetBasePathMapping": { "Type": "AWS::ApiGateway::BasePathMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BasePath": "get", "DomainName": { @@ -169,6 +183,8 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -222,6 +238,8 @@ }, "ServerlessRestApiDeployment43c34b4e46": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -233,6 +251,8 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment19c8cf5c63" @@ -246,6 +266,8 @@ }, "MyApiDeployment19c8cf5c63": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -256,6 +278,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -309,6 +333,8 @@ }, "MyFunctionApiPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/api_with_basic_custom_domain_intrinsics_http.json b/tests/translator/output/api_with_basic_custom_domain_intrinsics_http.json index 8bc0ecf8b..3ef74b787 100644 --- a/tests/translator/output/api_with_basic_custom_domain_intrinsics_http.json +++ b/tests/translator/output/api_with_basic_custom_domain_intrinsics_http.json @@ -28,6 +28,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -51,6 +53,8 @@ }, "ServerlessHttpApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -111,6 +115,8 @@ }, "MyFunctionImplicitGetPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -133,6 +139,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -164,6 +172,8 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -231,6 +241,8 @@ }, "MyFunctionApiPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -253,6 +265,8 @@ }, "MyApigetApiMapping": { "Type": "AWS::ApiGatewayV2::ApiMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -269,6 +283,8 @@ }, "ApiGatewayDomainNameV2c0ed6fae34": { "Type": "AWS::ApiGatewayV2::DomainName", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DomainName": { "Fn::Sub": "example-ap-southeast-1.com" @@ -292,6 +308,8 @@ }, "ServerlessHttpApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "ServerlessHttpApi" @@ -306,6 +324,8 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -320,6 +340,8 @@ }, "MyApifetchApiMapping": { "Type": "AWS::ApiGatewayV2::ApiMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" diff --git a/tests/translator/output/api_with_binary_media_types.json b/tests/translator/output/api_with_binary_media_types.json index 54540a60e..91fa959c5 100644 --- a/tests/translator/output/api_with_binary_media_types.json +++ b/tests/translator/output/api_with_binary_media_types.json @@ -8,6 +8,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -31,6 +33,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -61,6 +65,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -82,6 +88,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BinaryMediaTypes": [ "image~1gif", @@ -105,6 +113,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentf117c932f7" @@ -117,6 +127,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment4f3fcf6bd1" @@ -129,6 +141,8 @@ }, "ExplicitApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -139,6 +153,8 @@ }, "ServerlessRestApiDeployment4f3fcf6bd1": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -149,6 +165,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_with_binary_media_types_definition_body.json b/tests/translator/output/api_with_binary_media_types_definition_body.json index 6a9e500f8..f3d2e11ff 100644 --- a/tests/translator/output/api_with_binary_media_types_definition_body.json +++ b/tests/translator/output/api_with_binary_media_types_definition_body.json @@ -8,6 +8,8 @@ "Resources": { "ExplicitApiManagedSwaggerProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiManagedSwaggerDeploymentfe9c2c09a2" @@ -20,6 +22,8 @@ }, "ExplicitApiManagedSwaggerDeploymentfe9c2c09a2": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApiManagedSwagger" @@ -30,6 +34,8 @@ }, "ExplicitApiDefinitionBody": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "paths": {}, @@ -67,6 +73,8 @@ }, "ExplicitApiDefinitionBodyDeployment1f26996adb": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApiDefinitionBody" @@ -77,6 +85,8 @@ }, "ExplicitApiDefinitionBodyProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDefinitionBodyDeployment1f26996adb" @@ -89,6 +99,8 @@ }, "ExplicitApiManagedSwagger": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_apikey_required.json b/tests/translator/output/aws-cn/api_with_apikey_required.json index 3738c9ec9..f141b004e 100644 --- a/tests/translator/output/aws-cn/api_with_apikey_required.json +++ b/tests/translator/output/aws-cn/api_with_apikey_required.json @@ -2,6 +2,8 @@ "Resources": { "MyFunctionWithApiKeyRequiredRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -32,6 +34,8 @@ }, "MyApiWithoutAuthDeploymentcc6d6fc40a": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithoutAuth" @@ -42,6 +46,8 @@ }, "MyApiWithoutAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -90,6 +96,8 @@ }, "MyApiWithoutAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithoutAuthDeploymentcc6d6fc40a" @@ -102,6 +110,8 @@ }, "MyFunctionWithApiKeyRequiredMyApiWithApiKeyRequiredPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -123,6 +133,8 @@ }, "MyFunctionWithApiKeyRequired": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { diff --git a/tests/translator/output/aws-cn/api_with_auth_all_maximum.json b/tests/translator/output/aws-cn/api_with_auth_all_maximum.json index 8ecb38ec8..9b26fa4fc 100644 --- a/tests/translator/output/aws-cn/api_with_auth_all_maximum.json +++ b/tests/translator/output/aws-cn/api_with_auth_all_maximum.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -25,6 +27,8 @@ }, "MyFunctionWithLambdaTokenAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -46,6 +50,8 @@ }, "MyApiMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -64,6 +70,8 @@ }, "MyFunctionWithCognitoMultipleUserPoolsAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -85,6 +93,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -115,6 +125,8 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -325,6 +337,8 @@ }, "MyApiMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -343,6 +357,8 @@ }, "MyFunctionWithLambdaRequestAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -364,6 +380,8 @@ }, "MyApiMyLambdaTokenAuthNoneFunctionInvokeRoleAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -382,6 +400,8 @@ }, "MyApiDeployment2b4f028142": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -392,6 +412,8 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment2b4f028142" @@ -404,6 +426,8 @@ }, "MyFunctionWithNoAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -425,6 +449,8 @@ }, "MyFunctionWithDefaultAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-cn/api_with_auth_all_maximum_openapi_3.json b/tests/translator/output/aws-cn/api_with_auth_all_maximum_openapi_3.json index b170e1769..dbe85ae8a 100644 --- a/tests/translator/output/aws-cn/api_with_auth_all_maximum_openapi_3.json +++ b/tests/translator/output/aws-cn/api_with_auth_all_maximum_openapi_3.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -25,6 +27,8 @@ }, "MyFunctionWithLambdaTokenAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -46,6 +50,8 @@ }, "MyApiMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -64,6 +70,8 @@ }, "MyFunctionWithCognitoMultipleUserPoolsAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -85,6 +93,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -115,6 +125,8 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -327,6 +339,8 @@ }, "MyApiMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -345,6 +359,8 @@ }, "MyFunctionWithLambdaRequestAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -366,6 +382,8 @@ }, "MyApiDeploymentcc3ee70601": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -375,6 +393,8 @@ }, "MyApiMyLambdaTokenAuthNoneFunctionInvokeRoleAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -393,6 +413,8 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeploymentcc3ee70601" @@ -405,6 +427,8 @@ }, "MyFunctionWithNoAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -426,6 +450,8 @@ }, "MyFunctionWithDefaultAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-cn/api_with_auth_all_minimum.json b/tests/translator/output/aws-cn/api_with_auth_all_minimum.json index c072d8df8..60328a6a3 100644 --- a/tests/translator/output/aws-cn/api_with_auth_all_minimum.json +++ b/tests/translator/output/aws-cn/api_with_auth_all_minimum.json @@ -2,6 +2,8 @@ "Resources": { "MyApiWithCognitoAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -62,6 +64,8 @@ }, "MyApiWithLambdaRequestAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithLambdaRequestAuthDeploymentd3ee2721bc" @@ -74,6 +78,8 @@ }, "MyApiWithNotCachedLambdaRequestAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithNotCachedLambdaRequestAuthDeployment234e92eab4" @@ -86,6 +92,8 @@ }, "MyApiWithLambdaTokenAuthMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -109,6 +117,8 @@ }, "MyAuthFn": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -132,6 +142,8 @@ }, "MyFnRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -162,6 +174,8 @@ }, "MyApiWithCognitoAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithCognitoAuthDeploymenta9cf768eaa" @@ -174,6 +188,8 @@ }, "MyFnCognitoPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -195,6 +211,8 @@ }, "MyApiWithLambdaRequestAuthMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -218,6 +236,8 @@ }, "MyApiWithNotCachedLambdaRequestAuthMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -241,6 +261,8 @@ }, "MyApiWithLambdaTokenAuthDeploymenta48b731095": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithLambdaTokenAuth" @@ -251,6 +273,8 @@ }, "MyApiWithNotCachedLambdaRequestAuthDeployment234e92eab4": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithNotCachedLambdaRequestAuth" @@ -261,6 +285,8 @@ }, "MyFnLambdaTokenPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -282,6 +308,8 @@ }, "MyFnLambdaRequestPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -303,6 +331,8 @@ }, "MyFnLambdaNotCachedRequestPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -324,6 +354,8 @@ }, "MyApiWithLambdaTokenAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -389,6 +421,8 @@ }, "MyApiWithCognitoAuthDeploymenta9cf768eaa": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithCognitoAuth" @@ -399,6 +433,8 @@ }, "MyApiWithLambdaRequestAuthDeploymentd3ee2721bc": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithLambdaRequestAuth" @@ -409,6 +445,8 @@ }, "MyUserPool": { "Type": "AWS::Cognito::UserPool", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "UsernameAttributes": [ "email" @@ -430,6 +468,8 @@ }, "MyFn": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -453,6 +493,8 @@ }, "MyAuthFnRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -483,6 +525,8 @@ }, "MyApiWithLambdaTokenAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithLambdaTokenAuthDeploymenta48b731095" @@ -495,6 +539,8 @@ }, "MyApiWithLambdaRequestAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -561,6 +607,8 @@ }, "MyApiWithNotCachedLambdaRequestAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_auth_all_minimum_openapi.json b/tests/translator/output/aws-cn/api_with_auth_all_minimum_openapi.json index 1dcfe3d15..5d23af2f0 100644 --- a/tests/translator/output/aws-cn/api_with_auth_all_minimum_openapi.json +++ b/tests/translator/output/aws-cn/api_with_auth_all_minimum_openapi.json @@ -2,6 +2,8 @@ "Resources": { "MyApiWithCognitoAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -64,6 +66,8 @@ }, "MyApiWithCognitoAuthDeployment1ecccf8f28": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithCognitoAuth" @@ -73,6 +77,8 @@ }, "MyApiWithLambdaRequestAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithLambdaRequestAuthDeployment81b8e9784c" @@ -85,6 +91,8 @@ }, "MyApiWithLambdaTokenAuthMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -108,6 +116,8 @@ }, "MyAuthFn": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -131,6 +141,8 @@ }, "MyFnRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -161,6 +173,8 @@ }, "MyApiWithCognitoAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithCognitoAuthDeployment1ecccf8f28" @@ -173,6 +187,8 @@ }, "MyApiWithLambdaRequestAuthMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -196,6 +212,8 @@ }, "MyFnCognitoPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -217,6 +235,8 @@ }, "MyApiWithLambdaRequestAuthDeployment81b8e9784c": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithLambdaRequestAuth" @@ -226,6 +246,8 @@ }, "MyApiWithLambdaTokenAuthDeployment53baac2c0b": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithLambdaTokenAuth" @@ -235,6 +257,8 @@ }, "MyFnLambdaTokenPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -256,6 +280,8 @@ }, "MyFnLambdaRequestPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -277,6 +303,8 @@ }, "MyApiWithLambdaTokenAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -344,6 +372,8 @@ }, "MyUserPool": { "Type": "AWS::Cognito::UserPool", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "UsernameAttributes": [ "email" @@ -365,6 +395,8 @@ }, "MyFn": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -388,6 +420,8 @@ }, "MyAuthFnRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -418,6 +452,8 @@ }, "MyApiWithLambdaTokenAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithLambdaTokenAuthDeployment53baac2c0b" @@ -430,6 +466,8 @@ }, "MyApiWithLambdaRequestAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_auth_and_conditions_all_max.json b/tests/translator/output/aws-cn/api_with_auth_and_conditions_all_max.json index 2e0e8352d..5213fa2b3 100644 --- a/tests/translator/output/aws-cn/api_with_auth_and_conditions_all_max.json +++ b/tests/translator/output/aws-cn/api_with_auth_and_conditions_all_max.json @@ -10,6 +10,8 @@ "Resources": { "MyFunctionWithLambdaTokenAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -31,6 +33,8 @@ }, "MyApiMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -49,6 +53,8 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeploymentfcb8b173a9" @@ -61,6 +67,8 @@ }, "MyApiDeploymentfcb8b173a9": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -71,6 +79,8 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -324,6 +334,8 @@ }, "MyApiMyLambdaTokenAuthNoneFunctionInvokeRoleAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -342,6 +354,8 @@ }, "MyFunctionWithNoAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -363,6 +377,8 @@ }, "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -386,6 +402,8 @@ }, "MyFunctionWithCognitoMultipleUserPoolsAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -407,6 +425,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -437,6 +457,8 @@ }, "MyFunctionWithConditionalWithLambdaTokenAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -459,6 +481,8 @@ }, "MyFunctionWithConditionalWithLambdaRequestAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -481,6 +505,8 @@ }, "MyApiMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -499,6 +525,8 @@ }, "MyFunctionWithConditionalWithDefaultAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -521,6 +549,8 @@ }, "MyFunctionWithConditionalRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -552,6 +582,8 @@ }, "MyFunctionWithConditional": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { diff --git a/tests/translator/output/aws-cn/api_with_auth_no_default.json b/tests/translator/output/aws-cn/api_with_auth_no_default.json index 727875379..f21111cb7 100644 --- a/tests/translator/output/aws-cn/api_with_auth_no_default.json +++ b/tests/translator/output/aws-cn/api_with_auth_no_default.json @@ -2,6 +2,8 @@ "Resources": { "MyApiWithCognitoAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -57,6 +59,8 @@ }, "MyFnLambdaRequestPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -78,6 +82,8 @@ }, "MyApiWithCognitoAuthDeployment6a169547ee": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithCognitoAuth" @@ -88,6 +94,8 @@ }, "MyApiWithLambdaRequestAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithLambdaRequestAuthDeployment93e0147508" @@ -100,6 +108,8 @@ }, "MyApiWithLambdaTokenAuthMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -123,6 +133,8 @@ }, "MyAuthFn": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -146,6 +158,8 @@ }, "MyFnRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -176,6 +190,8 @@ }, "MyApiWithCognitoAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithCognitoAuthDeployment6a169547ee" @@ -188,6 +204,8 @@ }, "MyApiWithLambdaTokenAuthDeploymente838608f2f": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithLambdaTokenAuth" @@ -198,6 +216,8 @@ }, "MyFnCognitoPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -219,6 +239,8 @@ }, "MyApiWithLambdaRequestAuthMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -242,6 +264,8 @@ }, "MyFnLambdaTokenPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -263,6 +287,8 @@ }, "MyApiWithLambdaRequestAuthDeployment93e0147508": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithLambdaRequestAuth" @@ -273,6 +299,8 @@ }, "MyApiWithLambdaTokenAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -333,6 +361,8 @@ }, "MyUserPool": { "Type": "AWS::Cognito::UserPool", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "UsernameAttributes": [ "email" @@ -354,6 +384,8 @@ }, "MyFn": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -377,6 +409,8 @@ }, "MyAuthFnRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -407,6 +441,8 @@ }, "MyApiWithLambdaTokenAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithLambdaTokenAuthDeploymente838608f2f" @@ -419,6 +455,8 @@ }, "MyApiWithLambdaRequestAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_auth_with_default_scopes.json b/tests/translator/output/aws-cn/api_with_auth_with_default_scopes.json index 71565997a..a7ca562e6 100644 --- a/tests/translator/output/aws-cn/api_with_auth_with_default_scopes.json +++ b/tests/translator/output/aws-cn/api_with_auth_with_default_scopes.json @@ -2,6 +2,8 @@ "Resources": { "MyApiWithCognitoAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -183,6 +185,8 @@ }, "MyFnCognitoDefaultScopesNonePermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -204,6 +208,8 @@ }, "MyFnCognitoDefaultAuthDefaultScopesNonePermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -225,6 +231,8 @@ }, "MyFnCognitoAuthorizerWithDefaultScopesPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -246,6 +254,8 @@ }, "MyApiWithCognitoAuthDeploymentcddf4840d1": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithCognitoAuth" @@ -256,6 +266,8 @@ }, "MyFnCognitoDefaultScopesDefaultAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -277,6 +289,8 @@ }, "MyFnCognitoAuthorizerScopesOverwrittenPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -298,6 +312,8 @@ }, "MyFnRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -328,6 +344,8 @@ }, "MyFnCognitoWithAuthNonePermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -349,6 +367,8 @@ }, "MyApiWithCognitoAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithCognitoAuthDeploymentcddf4840d1" @@ -361,6 +381,8 @@ }, "MyFn": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -384,6 +406,8 @@ }, "MyFnCognitoDefaultScopesWithOverwrittenPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-cn/api_with_auth_with_default_scopes_openapi.json b/tests/translator/output/aws-cn/api_with_auth_with_default_scopes_openapi.json index 29382f090..69cfcda6d 100644 --- a/tests/translator/output/aws-cn/api_with_auth_with_default_scopes_openapi.json +++ b/tests/translator/output/aws-cn/api_with_auth_with_default_scopes_openapi.json @@ -2,6 +2,8 @@ "Resources": { "MyApiWithCognitoAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -185,6 +187,8 @@ }, "MyFnCognitoDefaultScopesNonePermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -206,6 +210,8 @@ }, "MyFnCognitoDefaultAuthDefaultScopesNonePermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -227,6 +233,8 @@ }, "MyFnCognitoAuthorizerWithDefaultScopesPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -248,6 +256,8 @@ }, "MyFnCognitoDefaultScopesDefaultAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -269,6 +279,8 @@ }, "MyFnCognitoAuthorizerScopesOverwrittenPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -290,6 +302,8 @@ }, "MyApiWithCognitoAuthDeployment815f0fba0e": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithCognitoAuth" @@ -299,6 +313,8 @@ }, "MyFnRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -329,6 +345,8 @@ }, "MyFnCognitoWithAuthNonePermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -350,6 +368,8 @@ }, "MyApiWithCognitoAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithCognitoAuthDeployment815f0fba0e" @@ -362,6 +382,8 @@ }, "MyFn": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -385,6 +407,8 @@ }, "MyFnCognitoDefaultScopesWithOverwrittenPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-cn/api_with_aws_account_blacklist.json b/tests/translator/output/aws-cn/api_with_aws_account_blacklist.json index 54412b7fe..15c819e80 100644 --- a/tests/translator/output/aws-cn/api_with_aws_account_blacklist.json +++ b/tests/translator/output/aws-cn/api_with_aws_account_blacklist.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -24,6 +26,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentc4450d906c" @@ -36,6 +40,8 @@ }, "ServerlessRestApiDeploymentc4450d906c": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -46,6 +52,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -76,6 +84,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -134,6 +144,8 @@ }, "MyFunctionApiPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-cn/api_with_aws_account_whitelist.json b/tests/translator/output/aws-cn/api_with_aws_account_whitelist.json index fc12df61c..ffc66eb5b 100644 --- a/tests/translator/output/aws-cn/api_with_aws_account_whitelist.json +++ b/tests/translator/output/aws-cn/api_with_aws_account_whitelist.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -24,6 +26,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment441a70783b" @@ -36,6 +40,8 @@ }, "MyFunctionApiPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -57,6 +63,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -87,6 +95,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -166,6 +176,8 @@ }, "ServerlessRestApiDeployment441a70783b": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" diff --git a/tests/translator/output/aws-cn/api_with_aws_iam_auth_overrides.json b/tests/translator/output/aws-cn/api_with_aws_iam_auth_overrides.json index 4636278e7..d47bc9b78 100644 --- a/tests/translator/output/aws-cn/api_with_aws_iam_auth_overrides.json +++ b/tests/translator/output/aws-cn/api_with_aws_iam_auth_overrides.json @@ -2,6 +2,8 @@ "Resources": { "MyFunctionCustomInvokeRole": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -25,6 +27,8 @@ }, "MyFunctionNoneAuth": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -48,6 +52,8 @@ }, "MyFunctionNullInvokeRole": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -71,6 +77,8 @@ }, "MyApiWithAwsIamAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithAwsIamAuthDeployment4253f994cd" @@ -83,6 +91,8 @@ }, "MyApiWithAwsIamAuthDeployment4253f994cd": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithAwsIamAuth" @@ -93,6 +103,8 @@ }, "MyFunctionWithoutAuthRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -123,6 +135,8 @@ }, "MyFunctionCustomInvokeRoleAPI3PermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -144,6 +158,8 @@ }, "MyFunctionMyCognitoAuthAPI1PermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -165,6 +181,8 @@ }, "MyApiWithAwsIamAuthNoCallerCredentialsDeployment07ee28f86e": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithAwsIamAuthNoCallerCredentials" @@ -175,6 +193,8 @@ }, "MyApiWithAwsIamAuthNoCallerCredentials": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -240,6 +260,8 @@ }, "MyFunctionWithoutAuthAPI2PermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -261,6 +283,8 @@ }, "MyFunctionDefaultInvokeRoleAPI3PermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -282,6 +306,8 @@ }, "MyFunctionMyCognitoAuth": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -305,6 +331,8 @@ }, "MyFunctionNullInvokeRoleRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -335,6 +363,8 @@ }, "MyFunctionNONEInvokeRole": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -358,6 +388,8 @@ }, "MyFunctionNoCallerCredentialsAPI3PermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -379,6 +411,8 @@ }, "MyFunctionNoneAuthRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -409,6 +443,8 @@ }, "MyFunctionCustomInvokeRoleRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -439,6 +475,8 @@ }, "MyFunctionCallerCredentialsOverrideAPI3PermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -460,6 +498,8 @@ }, "MyFunctionCallerCredentialsOverride": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -483,6 +523,8 @@ }, "MyFunctionWithoutAuth": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -506,6 +548,8 @@ }, "MyFunctionNullInvokeRoleAPI3PermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -527,6 +571,8 @@ }, "MyFunctionNONEInvokeRoleAPI3PermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -548,6 +594,8 @@ }, "MyFunctionNoCallerCredentialsRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -578,6 +626,8 @@ }, "MyFunctionDefaultInvokeRoleRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -608,6 +658,8 @@ }, "MyFunctionCallerCredentialsOverrideRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -638,6 +690,8 @@ }, "MyFunctionMyCognitoAuthRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -668,6 +722,8 @@ }, "MyApiWithAwsIamAuthNoCallerCredentialsProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithAwsIamAuthNoCallerCredentialsDeployment07ee28f86e" @@ -680,6 +736,8 @@ }, "MyFunctionDefaultInvokeRole": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -703,6 +761,8 @@ }, "MyFunctionNoCallerCredentials": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -726,6 +786,8 @@ }, "MyApiWithAwsIamAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -892,6 +954,8 @@ }, "MyFunctionNoneAuthAPI3PermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -913,6 +977,8 @@ }, "MyFunctionNONEInvokeRoleRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-cn/api_with_basic_custom_domain.json b/tests/translator/output/aws-cn/api_with_basic_custom_domain.json index 88e64e6a8..769577d2e 100644 --- a/tests/translator/output/aws-cn/api_with_basic_custom_domain.json +++ b/tests/translator/output/aws-cn/api_with_basic_custom_domain.json @@ -12,6 +12,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -34,6 +36,8 @@ }, "MyFunctionAnotherGetPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -55,6 +59,8 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment92d6d51a5e" @@ -67,6 +73,8 @@ }, "MyFunctionImplicitGetPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -88,6 +96,8 @@ }, "MyAnotherApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyAnotherApiDeployment989ae20f23" @@ -100,6 +110,8 @@ }, "MyFunctionFetchPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -121,6 +133,8 @@ }, "MyAnotherApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -157,6 +171,8 @@ }, "MyApifetchBasePathMapping": { "Type": "AWS::ApiGateway::BasePathMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BasePath": "fetch", "DomainName": { @@ -172,6 +188,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -202,6 +220,8 @@ }, "MyApigetBasePathMapping": { "Type": "AWS::ApiGateway::BasePathMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BasePath": "get", "DomainName": { @@ -217,6 +237,8 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -265,6 +287,8 @@ }, "MyAnotherApiBasePathMapping": { "Type": "AWS::ApiGateway::BasePathMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DomainName": { "Ref": "ApiGatewayDomainNameeab65c1531" @@ -279,6 +303,8 @@ }, "ApiGatewayDomainNameeab65c1531": { "Type": "AWS::ApiGateway::DomainName", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -291,6 +317,8 @@ }, "ApiGatewayDomainName23cdccdf9c": { "Type": "AWS::ApiGateway::DomainName", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "CertificateArn": "my-api-cert-arn", "EndpointConfiguration": { @@ -308,6 +336,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment6aef2b756e" @@ -320,6 +350,8 @@ }, "MyApiDeployment92d6d51a5e": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -329,6 +361,8 @@ }, "ServerlessRestApiBasePathMapping": { "Type": "AWS::ApiGateway::BasePathMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DomainName": { "Ref": "ApiGatewayDomainNameeab65c1531" @@ -343,6 +377,8 @@ }, "ServerlessRestApiDeployment6aef2b756e": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -353,6 +389,8 @@ }, "MyAnotherApiDeployment989ae20f23": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyAnotherApi" @@ -362,6 +400,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -398,6 +438,8 @@ }, "MyFunctionApiPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-cn/api_with_basic_custom_domain_http.json b/tests/translator/output/aws-cn/api_with_basic_custom_domain_http.json index 72b8198b2..bb11197a8 100644 --- a/tests/translator/output/aws-cn/api_with_basic_custom_domain_http.json +++ b/tests/translator/output/aws-cn/api_with_basic_custom_domain_http.json @@ -12,6 +12,8 @@ "Resources": { "MyApibasicApiMapping": { "Type": "AWS::ApiGatewayV2::ApiMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -27,6 +29,8 @@ }, "ApiGatewayDomainNameV22dbf35af54": { "Type": "AWS::ApiGatewayV2::DomainName", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DomainName": "sam-example.com", "DomainNameConfigurations": [ @@ -47,6 +51,8 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -60,6 +66,8 @@ }, "HttpApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -82,6 +90,8 @@ }, "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -103,6 +113,8 @@ }, "MyApibeginhereApiMapping": { "Type": "AWS::ApiGatewayV2::ApiMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -118,6 +130,8 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -148,6 +162,8 @@ }, "RecordSetGroup1f4f569a7e": { "Type": "AWS::Route53::RecordSetGroup", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "HostedZoneName": "sam-example.com.", "RecordSets": [ @@ -174,6 +190,8 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_basic_custom_domain_intrinsics.json b/tests/translator/output/aws-cn/api_with_basic_custom_domain_intrinsics.json index a7c6e267e..54118259d 100644 --- a/tests/translator/output/aws-cn/api_with_basic_custom_domain_intrinsics.json +++ b/tests/translator/output/aws-cn/api_with_basic_custom_domain_intrinsics.json @@ -28,6 +28,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -51,6 +53,8 @@ }, "MyFunctionImplicitGetPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -73,6 +77,8 @@ }, "MyApifetchBasePathMapping": { "Type": "AWS::ApiGateway::BasePathMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BasePath": "fetch", "DomainName": { @@ -89,6 +95,8 @@ }, "MyApiDeployment4f2c19d290": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -99,6 +107,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment599c0b434d" @@ -112,6 +122,8 @@ }, "ServerlessRestApiDeployment599c0b434d": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -123,6 +135,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -154,6 +168,8 @@ }, "MyApigetBasePathMapping": { "Type": "AWS::ApiGateway::BasePathMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BasePath": "get", "DomainName": { @@ -170,6 +186,8 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -231,6 +249,8 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment4f2c19d290" @@ -244,6 +264,8 @@ }, "ApiGatewayDomainNamec0cd2d9dfc": { "Type": "AWS::ApiGateway::DomainName", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -264,6 +286,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -325,6 +349,8 @@ }, "MyFunctionApiPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-cn/api_with_basic_custom_domain_intrinsics_http.json b/tests/translator/output/aws-cn/api_with_basic_custom_domain_intrinsics_http.json index c0df26d42..0cbac3f19 100644 --- a/tests/translator/output/aws-cn/api_with_basic_custom_domain_intrinsics_http.json +++ b/tests/translator/output/aws-cn/api_with_basic_custom_domain_intrinsics_http.json @@ -28,6 +28,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -51,6 +53,8 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -65,6 +69,8 @@ }, "ServerlessHttpApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -125,6 +131,8 @@ }, "MyFunctionImplicitGetPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -147,6 +155,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -178,6 +188,8 @@ }, "ApiGatewayDomainNameV2c0cd2d9dfc": { "Type": "AWS::ApiGatewayV2::DomainName", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DomainNameConfigurations": [ { @@ -201,6 +213,8 @@ }, "MyFunctionApiPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -223,6 +237,8 @@ }, "MyApigetApiMapping": { "Type": "AWS::ApiGatewayV2::ApiMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -239,6 +255,8 @@ }, "ServerlessHttpApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "ServerlessHttpApi" @@ -253,6 +271,8 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -320,6 +340,8 @@ }, "MyApifetchApiMapping": { "Type": "AWS::ApiGatewayV2::ApiMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" diff --git a/tests/translator/output/aws-cn/api_with_binary_media_types.json b/tests/translator/output/aws-cn/api_with_binary_media_types.json index d9703bd9e..182075cb8 100644 --- a/tests/translator/output/aws-cn/api_with_binary_media_types.json +++ b/tests/translator/output/aws-cn/api_with_binary_media_types.json @@ -8,6 +8,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -31,6 +33,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -61,6 +65,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -82,6 +88,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BinaryMediaTypes": [ "image~1gif", @@ -113,6 +121,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentf117c932f7" @@ -125,6 +135,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentcc75b253a7" @@ -137,6 +149,8 @@ }, "ServerlessRestApiDeploymentcc75b253a7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -147,6 +161,8 @@ }, "ExplicitApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -157,6 +173,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_binary_media_types_definition_body.json b/tests/translator/output/aws-cn/api_with_binary_media_types_definition_body.json index 75b031c54..1b308c002 100644 --- a/tests/translator/output/aws-cn/api_with_binary_media_types_definition_body.json +++ b/tests/translator/output/aws-cn/api_with_binary_media_types_definition_body.json @@ -8,6 +8,8 @@ "Resources": { "ExplicitApiManagedSwaggerProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiManagedSwaggerDeploymentfe9c2c09a2" @@ -20,6 +22,8 @@ }, "ExplicitApiManagedSwaggerDeploymentfe9c2c09a2": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApiManagedSwagger" @@ -30,6 +34,8 @@ }, "ExplicitApiDefinitionBody": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "paths": {}, @@ -75,6 +81,8 @@ }, "ExplicitApiDefinitionBodyDeployment1f26996adb": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApiDefinitionBody" @@ -85,6 +93,8 @@ }, "ExplicitApiDefinitionBodyProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDefinitionBodyDeployment1f26996adb" @@ -97,6 +107,8 @@ }, "ExplicitApiManagedSwagger": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_with_apikey_required.json b/tests/translator/output/aws-us-gov/api_with_apikey_required.json index b18a21e4a..cd61e002d 100644 --- a/tests/translator/output/aws-us-gov/api_with_apikey_required.json +++ b/tests/translator/output/aws-us-gov/api_with_apikey_required.json @@ -2,6 +2,8 @@ "Resources": { "MyFunctionWithApiKeyRequiredRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -32,6 +34,8 @@ }, "MyApiWithoutAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -80,6 +84,8 @@ }, "MyApiWithoutAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithoutAuthDeployment1f6bf4c0d5" @@ -92,6 +98,8 @@ }, "MyFunctionWithApiKeyRequiredMyApiWithApiKeyRequiredPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -113,6 +121,8 @@ }, "MyFunctionWithApiKeyRequired": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -136,6 +146,8 @@ }, "MyApiWithoutAuthDeployment1f6bf4c0d5": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithoutAuth" diff --git a/tests/translator/output/aws-us-gov/api_with_auth_all_maximum.json b/tests/translator/output/aws-us-gov/api_with_auth_all_maximum.json index d2731e6dc..2d71c9727 100644 --- a/tests/translator/output/aws-us-gov/api_with_auth_all_maximum.json +++ b/tests/translator/output/aws-us-gov/api_with_auth_all_maximum.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -25,6 +27,8 @@ }, "MyFunctionWithLambdaTokenAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -46,6 +50,8 @@ }, "MyApiMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -64,6 +70,8 @@ }, "MyFunctionWithCognitoMultipleUserPoolsAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -85,6 +93,8 @@ }, "MyApiDeployment7939ed72e3": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -95,6 +105,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -125,6 +137,8 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -335,6 +349,8 @@ }, "MyApiMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -353,6 +369,8 @@ }, "MyFunctionWithLambdaRequestAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -374,6 +392,8 @@ }, "MyApiMyLambdaTokenAuthNoneFunctionInvokeRoleAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -392,6 +412,8 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment7939ed72e3" @@ -404,6 +426,8 @@ }, "MyFunctionWithNoAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -425,6 +449,8 @@ }, "MyFunctionWithDefaultAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/api_with_auth_all_maximum_openapi_3.json b/tests/translator/output/aws-us-gov/api_with_auth_all_maximum_openapi_3.json index 3195b25b9..927c04166 100644 --- a/tests/translator/output/aws-us-gov/api_with_auth_all_maximum_openapi_3.json +++ b/tests/translator/output/aws-us-gov/api_with_auth_all_maximum_openapi_3.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -25,6 +27,8 @@ }, "MyFunctionWithLambdaTokenAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -46,6 +50,8 @@ }, "MyApiMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -64,6 +70,8 @@ }, "MyFunctionWithCognitoMultipleUserPoolsAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -85,6 +93,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -115,6 +125,8 @@ }, "MyApiDeployment57e8e73ac5": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -124,6 +136,8 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -336,6 +350,8 @@ }, "MyApiMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -354,6 +370,8 @@ }, "MyFunctionWithLambdaRequestAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -375,6 +393,8 @@ }, "MyApiMyLambdaTokenAuthNoneFunctionInvokeRoleAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -393,6 +413,8 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment57e8e73ac5" @@ -405,6 +427,8 @@ }, "MyFunctionWithNoAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -426,6 +450,8 @@ }, "MyFunctionWithDefaultAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/api_with_auth_all_minimum.json b/tests/translator/output/aws-us-gov/api_with_auth_all_minimum.json index 7ab9dea6e..7ee4c5a12 100644 --- a/tests/translator/output/aws-us-gov/api_with_auth_all_minimum.json +++ b/tests/translator/output/aws-us-gov/api_with_auth_all_minimum.json @@ -2,6 +2,8 @@ "Resources": { "MyApiWithCognitoAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -62,6 +64,8 @@ }, "MyApiWithLambdaRequestAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithLambdaRequestAuthDeploymentca86749bcd" @@ -74,6 +78,8 @@ }, "MyApiWithNotCachedLambdaRequestAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithNotCachedLambdaRequestAuthDeploymentd3b8858811" @@ -86,6 +92,8 @@ }, "MyApiWithLambdaTokenAuthMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -109,6 +117,8 @@ }, "MyAuthFn": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -132,6 +142,8 @@ }, "MyApiWithLambdaTokenAuthDeployment5192789870": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithLambdaTokenAuth" @@ -142,6 +154,8 @@ }, "MyFnRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -172,6 +186,8 @@ }, "MyApiWithCognitoAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithCognitoAuthDeployment9b695a6dd5" @@ -184,6 +200,8 @@ }, "MyFnCognitoPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -205,6 +223,8 @@ }, "MyApiWithLambdaRequestAuthMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -228,6 +248,8 @@ }, "MyApiWithNotCachedLambdaRequestAuthMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -251,6 +273,8 @@ }, "MyFnLambdaTokenPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -272,6 +296,8 @@ }, "MyApiWithNotCachedLambdaRequestAuthDeploymentd3b8858811": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithNotCachedLambdaRequestAuth" @@ -282,6 +308,8 @@ }, "MyFnLambdaRequestPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -303,6 +331,8 @@ }, "MyFnLambdaNotCachedRequestPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -324,6 +354,8 @@ }, "MyApiWithLambdaTokenAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -389,6 +421,8 @@ }, "MyApiWithLambdaRequestAuthDeploymentca86749bcd": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithLambdaRequestAuth" @@ -399,6 +433,8 @@ }, "MyUserPool": { "Type": "AWS::Cognito::UserPool", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "UsernameAttributes": [ "email" @@ -420,6 +456,8 @@ }, "MyFn": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -443,6 +481,8 @@ }, "MyAuthFnRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -473,6 +513,8 @@ }, "MyApiWithLambdaTokenAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithLambdaTokenAuthDeployment5192789870" @@ -485,6 +527,8 @@ }, "MyApiWithCognitoAuthDeployment9b695a6dd5": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithCognitoAuth" @@ -495,6 +539,8 @@ }, "MyApiWithLambdaRequestAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -561,6 +607,8 @@ }, "MyApiWithNotCachedLambdaRequestAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_with_auth_all_minimum_openapi.json b/tests/translator/output/aws-us-gov/api_with_auth_all_minimum_openapi.json index d64968c4e..b18c185bb 100644 --- a/tests/translator/output/aws-us-gov/api_with_auth_all_minimum_openapi.json +++ b/tests/translator/output/aws-us-gov/api_with_auth_all_minimum_openapi.json @@ -2,6 +2,8 @@ "Resources": { "MyApiWithCognitoAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -64,6 +66,8 @@ }, "MyApiWithLambdaRequestAuthDeployment7c3972b020": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithLambdaRequestAuth" @@ -73,6 +77,8 @@ }, "MyApiWithCognitoAuthDeploymente1765ad6c1": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithCognitoAuth" @@ -82,6 +88,8 @@ }, "MyApiWithLambdaRequestAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithLambdaRequestAuthDeployment7c3972b020" @@ -94,6 +102,8 @@ }, "MyApiWithLambdaTokenAuthMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -117,6 +127,8 @@ }, "MyApiWithLambdaTokenAuthDeploymentfc5424e34c": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithLambdaTokenAuth" @@ -126,6 +138,8 @@ }, "MyAuthFn": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -149,6 +163,8 @@ }, "MyFnRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -179,6 +195,8 @@ }, "MyApiWithCognitoAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithCognitoAuthDeploymente1765ad6c1" @@ -191,6 +209,8 @@ }, "MyFnCognitoPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -212,6 +232,8 @@ }, "MyApiWithLambdaRequestAuthMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -235,6 +257,8 @@ }, "MyFnLambdaTokenPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -256,6 +280,8 @@ }, "MyFnLambdaRequestPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -277,6 +303,8 @@ }, "MyApiWithLambdaTokenAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -344,6 +372,8 @@ }, "MyUserPool": { "Type": "AWS::Cognito::UserPool", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "UsernameAttributes": [ "email" @@ -365,6 +395,8 @@ }, "MyFn": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -388,6 +420,8 @@ }, "MyAuthFnRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -418,6 +452,8 @@ }, "MyApiWithLambdaTokenAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithLambdaTokenAuthDeploymentfc5424e34c" @@ -430,6 +466,8 @@ }, "MyApiWithLambdaRequestAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_with_auth_and_conditions_all_max.json b/tests/translator/output/aws-us-gov/api_with_auth_and_conditions_all_max.json index 75a72a5d6..788a76db4 100644 --- a/tests/translator/output/aws-us-gov/api_with_auth_and_conditions_all_max.json +++ b/tests/translator/output/aws-us-gov/api_with_auth_and_conditions_all_max.json @@ -10,6 +10,8 @@ "Resources": { "MyFunctionWithLambdaTokenAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -31,6 +33,8 @@ }, "MyApiMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -49,6 +53,8 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment5d64bc1235" @@ -61,6 +67,8 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -314,6 +322,8 @@ }, "MyApiMyLambdaTokenAuthNoneFunctionInvokeRoleAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -332,6 +342,8 @@ }, "MyFunctionWithNoAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -353,6 +365,8 @@ }, "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -376,6 +390,8 @@ }, "MyFunctionWithCognitoMultipleUserPoolsAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -397,6 +413,8 @@ }, "MyApiDeployment5d64bc1235": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -407,6 +425,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -437,6 +457,8 @@ }, "MyFunctionWithConditionalWithLambdaTokenAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -459,6 +481,8 @@ }, "MyFunctionWithConditionalWithLambdaRequestAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -481,6 +505,8 @@ }, "MyApiMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -499,6 +525,8 @@ }, "MyFunctionWithConditionalWithDefaultAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -521,6 +549,8 @@ }, "MyFunctionWithConditionalRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -552,6 +582,8 @@ }, "MyFunctionWithConditional": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { diff --git a/tests/translator/output/aws-us-gov/api_with_auth_no_default.json b/tests/translator/output/aws-us-gov/api_with_auth_no_default.json index 06783f5d9..730bc6147 100644 --- a/tests/translator/output/aws-us-gov/api_with_auth_no_default.json +++ b/tests/translator/output/aws-us-gov/api_with_auth_no_default.json @@ -2,6 +2,8 @@ "Resources": { "MyApiWithCognitoAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -57,6 +59,8 @@ }, "MyApiWithLambdaRequestAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithLambdaRequestAuthDeployment9a21d88fe2" @@ -69,6 +73,8 @@ }, "MyApiWithLambdaTokenAuthMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -92,6 +98,8 @@ }, "MyAuthFn": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -115,6 +123,8 @@ }, "MyFnRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -145,6 +155,8 @@ }, "MyApiWithCognitoAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithCognitoAuthDeployment2da3114321" @@ -157,6 +169,8 @@ }, "MyFnCognitoPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -178,6 +192,8 @@ }, "MyApiWithCognitoAuthDeployment2da3114321": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithCognitoAuth" @@ -188,6 +204,8 @@ }, "MyApiWithLambdaRequestAuthMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -211,6 +229,8 @@ }, "MyApiWithLambdaTokenAuthDeployment613e605d96": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithLambdaTokenAuth" @@ -221,6 +241,8 @@ }, "MyFnLambdaTokenPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -242,6 +264,8 @@ }, "MyFnLambdaRequestPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -263,6 +287,8 @@ }, "MyApiWithLambdaTokenAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -323,6 +349,8 @@ }, "MyUserPool": { "Type": "AWS::Cognito::UserPool", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "UsernameAttributes": [ "email" @@ -344,6 +372,8 @@ }, "MyFn": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -367,6 +397,8 @@ }, "MyAuthFnRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -397,6 +429,8 @@ }, "MyApiWithLambdaRequestAuthDeployment9a21d88fe2": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithLambdaRequestAuth" @@ -407,6 +441,8 @@ }, "MyApiWithLambdaTokenAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithLambdaTokenAuthDeployment613e605d96" @@ -419,6 +455,8 @@ }, "MyApiWithLambdaRequestAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_with_auth_with_default_scopes.json b/tests/translator/output/aws-us-gov/api_with_auth_with_default_scopes.json index 1e0140f17..bdda69853 100644 --- a/tests/translator/output/aws-us-gov/api_with_auth_with_default_scopes.json +++ b/tests/translator/output/aws-us-gov/api_with_auth_with_default_scopes.json @@ -2,6 +2,8 @@ "Resources": { "MyApiWithCognitoAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -183,6 +185,8 @@ }, "MyFnCognitoDefaultScopesNonePermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -204,6 +208,8 @@ }, "MyFnCognitoDefaultAuthDefaultScopesNonePermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -225,6 +231,8 @@ }, "MyFnCognitoAuthorizerWithDefaultScopesPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -246,6 +254,8 @@ }, "MyFnCognitoDefaultScopesDefaultAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -267,6 +277,8 @@ }, "MyFnCognitoAuthorizerScopesOverwrittenPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -288,6 +300,8 @@ }, "MyApiWithCognitoAuthDeploymentba9bfa6490": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithCognitoAuth" @@ -298,6 +312,8 @@ }, "MyFnRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -328,6 +344,8 @@ }, "MyFnCognitoWithAuthNonePermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -349,6 +367,8 @@ }, "MyApiWithCognitoAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithCognitoAuthDeploymentba9bfa6490" @@ -361,6 +381,8 @@ }, "MyFn": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -384,6 +406,8 @@ }, "MyFnCognitoDefaultScopesWithOverwrittenPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/api_with_auth_with_default_scopes_openapi.json b/tests/translator/output/aws-us-gov/api_with_auth_with_default_scopes_openapi.json index f1ed483fa..738c877ad 100644 --- a/tests/translator/output/aws-us-gov/api_with_auth_with_default_scopes_openapi.json +++ b/tests/translator/output/aws-us-gov/api_with_auth_with_default_scopes_openapi.json @@ -2,6 +2,8 @@ "Resources": { "MyApiWithCognitoAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -185,6 +187,8 @@ }, "MyFnCognitoDefaultScopesNonePermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -206,6 +210,8 @@ }, "MyFnCognitoDefaultAuthDefaultScopesNonePermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -227,6 +233,8 @@ }, "MyFnCognitoAuthorizerWithDefaultScopesPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -248,6 +256,8 @@ }, "MyApiWithCognitoAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithCognitoAuthDeploymentddb4f4405b" @@ -260,6 +270,8 @@ }, "MyFnCognitoDefaultScopesDefaultAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -281,6 +293,8 @@ }, "MyFnCognitoAuthorizerScopesOverwrittenPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -302,6 +316,8 @@ }, "MyFnRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -332,6 +348,8 @@ }, "MyFnCognitoWithAuthNonePermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -353,6 +371,8 @@ }, "MyApiWithCognitoAuthDeploymentddb4f4405b": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithCognitoAuth" @@ -362,6 +382,8 @@ }, "MyFn": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -385,6 +407,8 @@ }, "MyFnCognitoDefaultScopesWithOverwrittenPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/api_with_aws_account_blacklist.json b/tests/translator/output/aws-us-gov/api_with_aws_account_blacklist.json index 317b6255e..7d43d68d6 100644 --- a/tests/translator/output/aws-us-gov/api_with_aws_account_blacklist.json +++ b/tests/translator/output/aws-us-gov/api_with_aws_account_blacklist.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -24,6 +26,8 @@ }, "ServerlessRestApiDeployment589bc02957": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -34,6 +38,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment589bc02957" @@ -46,6 +52,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -76,6 +84,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -134,6 +144,8 @@ }, "MyFunctionApiPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/api_with_aws_account_whitelist.json b/tests/translator/output/aws-us-gov/api_with_aws_account_whitelist.json index 2b0dfff75..813c98fa2 100644 --- a/tests/translator/output/aws-us-gov/api_with_aws_account_whitelist.json +++ b/tests/translator/output/aws-us-gov/api_with_aws_account_whitelist.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -24,6 +26,8 @@ }, "ServerlessRestApiDeployment1455f86734": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -34,6 +38,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment1455f86734" @@ -46,6 +52,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -76,6 +84,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -155,6 +165,8 @@ }, "MyFunctionApiPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/api_with_aws_iam_auth_overrides.json b/tests/translator/output/aws-us-gov/api_with_aws_iam_auth_overrides.json index 9ff1fa9ee..3d3524455 100644 --- a/tests/translator/output/aws-us-gov/api_with_aws_iam_auth_overrides.json +++ b/tests/translator/output/aws-us-gov/api_with_aws_iam_auth_overrides.json @@ -2,6 +2,8 @@ "Resources": { "MyFunctionCustomInvokeRole": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -25,6 +27,8 @@ }, "MyFunctionNoneAuth": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -48,6 +52,8 @@ }, "MyFunctionNullInvokeRole": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -71,6 +77,8 @@ }, "MyApiWithAwsIamAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithAwsIamAuthDeploymentc7d4214444" @@ -83,6 +91,8 @@ }, "MyFunctionWithoutAuthRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -113,6 +123,8 @@ }, "MyFunctionCustomInvokeRoleAPI3PermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -134,6 +146,8 @@ }, "MyFunctionMyCognitoAuthAPI1PermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -155,6 +169,8 @@ }, "MyApiWithAwsIamAuthDeploymentc7d4214444": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithAwsIamAuth" @@ -165,6 +181,8 @@ }, "MyApiWithAwsIamAuthNoCallerCredentials": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -230,6 +248,8 @@ }, "MyFunctionWithoutAuthAPI2PermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -251,6 +271,8 @@ }, "MyFunctionDefaultInvokeRoleAPI3PermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -272,6 +294,8 @@ }, "MyFunctionMyCognitoAuth": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -295,6 +319,8 @@ }, "MyFunctionNullInvokeRoleRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -325,6 +351,8 @@ }, "MyFunctionNONEInvokeRole": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -348,6 +376,8 @@ }, "MyFunctionNoCallerCredentialsAPI3PermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -369,6 +399,8 @@ }, "MyFunctionNoneAuthRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -399,6 +431,8 @@ }, "MyFunctionCustomInvokeRoleRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -429,6 +463,8 @@ }, "MyFunctionCallerCredentialsOverrideAPI3PermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -450,6 +486,8 @@ }, "MyFunctionCallerCredentialsOverride": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -473,6 +511,8 @@ }, "MyFunctionWithoutAuth": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -496,6 +536,8 @@ }, "MyFunctionNullInvokeRoleAPI3PermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -517,6 +559,8 @@ }, "MyFunctionNONEInvokeRoleAPI3PermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -538,6 +582,8 @@ }, "MyFunctionNoCallerCredentialsRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -568,6 +614,8 @@ }, "MyFunctionDefaultInvokeRoleRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -598,6 +646,8 @@ }, "MyFunctionCallerCredentialsOverrideRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -628,6 +678,8 @@ }, "MyFunctionMyCognitoAuthRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -658,6 +710,8 @@ }, "MyApiWithAwsIamAuthNoCallerCredentialsProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithAwsIamAuthNoCallerCredentialsDeployment673da6c5e9" @@ -670,6 +724,8 @@ }, "MyFunctionDefaultInvokeRole": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -693,6 +749,8 @@ }, "MyFunctionNoCallerCredentials": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -716,6 +774,8 @@ }, "MyApiWithAwsIamAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -882,6 +942,8 @@ }, "MyFunctionNoneAuthAPI3PermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -903,6 +965,8 @@ }, "MyApiWithAwsIamAuthNoCallerCredentialsDeployment673da6c5e9": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithAwsIamAuthNoCallerCredentials" @@ -913,6 +977,8 @@ }, "MyFunctionNONEInvokeRoleRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-us-gov/api_with_basic_custom_domain.json b/tests/translator/output/aws-us-gov/api_with_basic_custom_domain.json index 8d04935fe..8b056dcf4 100644 --- a/tests/translator/output/aws-us-gov/api_with_basic_custom_domain.json +++ b/tests/translator/output/aws-us-gov/api_with_basic_custom_domain.json @@ -12,6 +12,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -34,6 +36,8 @@ }, "MyFunctionAnotherGetPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -55,6 +59,8 @@ }, "ApiGatewayDomainName23cdccdf9c": { "Type": "AWS::ApiGateway::DomainName", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "CertificateArn": "my-api-cert-arn", "EndpointConfiguration": { @@ -72,6 +78,8 @@ }, "MyFunctionImplicitGetPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -93,6 +101,8 @@ }, "MyAnotherApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyAnotherApiDeploymenteb8302ec1b" @@ -105,6 +115,8 @@ }, "ServerlessRestApiDeployment790a4e6aa6": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -115,6 +127,8 @@ }, "MyFunctionFetchPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -136,6 +150,8 @@ }, "MyAnotherApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -172,6 +188,8 @@ }, "MyApigetBasePathMapping": { "Type": "AWS::ApiGateway::BasePathMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BasePath": "get", "DomainName": { @@ -187,6 +205,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -217,6 +237,8 @@ }, "MyApiDeploymentb34773e43a": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -226,6 +248,8 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -274,6 +298,8 @@ }, "MyAnotherApiBasePathMapping": { "Type": "AWS::ApiGateway::BasePathMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DomainName": { "Ref": "ApiGatewayDomainNameeab65c1531" @@ -288,6 +314,8 @@ }, "ApiGatewayDomainNameeab65c1531": { "Type": "AWS::ApiGateway::DomainName", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -300,6 +328,8 @@ }, "MyApifetchBasePathMapping": { "Type": "AWS::ApiGateway::BasePathMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BasePath": "fetch", "DomainName": { @@ -315,6 +345,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment790a4e6aa6" @@ -327,6 +359,8 @@ }, "MyAnotherApiDeploymenteb8302ec1b": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyAnotherApi" @@ -336,6 +370,8 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeploymentb34773e43a" @@ -348,6 +384,8 @@ }, "ServerlessRestApiBasePathMapping": { "Type": "AWS::ApiGateway::BasePathMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DomainName": { "Ref": "ApiGatewayDomainNameeab65c1531" @@ -362,6 +400,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -398,6 +438,8 @@ }, "MyFunctionApiPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/api_with_basic_custom_domain_http.json b/tests/translator/output/aws-us-gov/api_with_basic_custom_domain_http.json index dff06df86..482f92789 100644 --- a/tests/translator/output/aws-us-gov/api_with_basic_custom_domain_http.json +++ b/tests/translator/output/aws-us-gov/api_with_basic_custom_domain_http.json @@ -12,6 +12,8 @@ "Resources": { "MyApibasicApiMapping": { "Type": "AWS::ApiGatewayV2::ApiMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -27,6 +29,8 @@ }, "ApiGatewayDomainNameV22dbf35af54": { "Type": "AWS::ApiGatewayV2::DomainName", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DomainName": "sam-example.com", "DomainNameConfigurations": [ @@ -47,6 +51,8 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -60,6 +66,8 @@ }, "HttpApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -82,6 +90,8 @@ }, "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -103,6 +113,8 @@ }, "MyApibeginhereApiMapping": { "Type": "AWS::ApiGatewayV2::ApiMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -118,6 +130,8 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -148,6 +162,8 @@ }, "RecordSetGroup1f4f569a7e": { "Type": "AWS::Route53::RecordSetGroup", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "HostedZoneName": "sam-example.com.", "RecordSets": [ @@ -174,6 +190,8 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_with_basic_custom_domain_intrinsics.json b/tests/translator/output/aws-us-gov/api_with_basic_custom_domain_intrinsics.json index 8d1fbf5bb..f6b86bf2d 100644 --- a/tests/translator/output/aws-us-gov/api_with_basic_custom_domain_intrinsics.json +++ b/tests/translator/output/aws-us-gov/api_with_basic_custom_domain_intrinsics.json @@ -28,6 +28,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -51,6 +53,8 @@ }, "MyFunctionImplicitGetPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -73,6 +77,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment0294e6b48a" @@ -86,6 +92,8 @@ }, "MyApifetchBasePathMapping": { "Type": "AWS::ApiGateway::BasePathMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BasePath": "fetch", "DomainName": { @@ -102,6 +110,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -133,6 +143,8 @@ }, "MyApigetBasePathMapping": { "Type": "AWS::ApiGateway::BasePathMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BasePath": "get", "DomainName": { @@ -149,6 +161,8 @@ }, "ServerlessRestApiDeployment0294e6b48a": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -160,6 +174,8 @@ }, "MyApiDeployment32e59613e2": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -170,6 +186,8 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -231,6 +249,8 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment32e59613e2" @@ -244,6 +264,8 @@ }, "ApiGatewayDomainName9c93aac102": { "Type": "AWS::ApiGateway::DomainName", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -264,6 +286,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -325,6 +349,8 @@ }, "MyFunctionApiPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/api_with_basic_custom_domain_intrinsics_http.json b/tests/translator/output/aws-us-gov/api_with_basic_custom_domain_intrinsics_http.json index a54589ced..89b3c2171 100644 --- a/tests/translator/output/aws-us-gov/api_with_basic_custom_domain_intrinsics_http.json +++ b/tests/translator/output/aws-us-gov/api_with_basic_custom_domain_intrinsics_http.json @@ -28,6 +28,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -51,6 +53,8 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -65,6 +69,8 @@ }, "ServerlessHttpApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -125,6 +131,8 @@ }, "MyFunctionImplicitGetPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -147,6 +155,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -178,6 +188,8 @@ }, "ApiGatewayDomainNameV29c93aac102": { "Type": "AWS::ApiGatewayV2::DomainName", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DomainName": { "Fn::Sub": "example-us-gov-west-1.com" @@ -201,6 +213,8 @@ }, "MyFunctionApiPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -223,6 +237,8 @@ }, "MyApigetApiMapping": { "Type": "AWS::ApiGatewayV2::ApiMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -239,6 +255,8 @@ }, "ServerlessHttpApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "ServerlessHttpApi" @@ -253,6 +271,8 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -320,6 +340,8 @@ }, "MyApifetchApiMapping": { "Type": "AWS::ApiGatewayV2::ApiMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" diff --git a/tests/translator/output/aws-us-gov/api_with_binary_media_types.json b/tests/translator/output/aws-us-gov/api_with_binary_media_types.json index 3e2dc7c19..b5d89c272 100644 --- a/tests/translator/output/aws-us-gov/api_with_binary_media_types.json +++ b/tests/translator/output/aws-us-gov/api_with_binary_media_types.json @@ -8,6 +8,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -31,6 +33,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -61,6 +65,8 @@ }, "ExplicitApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -71,6 +77,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -92,6 +100,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BinaryMediaTypes": [ "image~1gif", @@ -123,6 +133,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentf117c932f7" @@ -135,6 +147,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment9746c8328e" @@ -147,6 +161,8 @@ }, "ServerlessRestApiDeployment9746c8328e": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -157,6 +173,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_with_binary_media_types_definition_body.json b/tests/translator/output/aws-us-gov/api_with_binary_media_types_definition_body.json index 75b031c54..1b308c002 100644 --- a/tests/translator/output/aws-us-gov/api_with_binary_media_types_definition_body.json +++ b/tests/translator/output/aws-us-gov/api_with_binary_media_types_definition_body.json @@ -8,6 +8,8 @@ "Resources": { "ExplicitApiManagedSwaggerProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiManagedSwaggerDeploymentfe9c2c09a2" @@ -20,6 +22,8 @@ }, "ExplicitApiManagedSwaggerDeploymentfe9c2c09a2": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApiManagedSwagger" @@ -30,6 +34,8 @@ }, "ExplicitApiDefinitionBody": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "paths": {}, @@ -75,6 +81,8 @@ }, "ExplicitApiDefinitionBodyDeployment1f26996adb": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApiDefinitionBody" @@ -85,6 +93,8 @@ }, "ExplicitApiDefinitionBodyProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDefinitionBodyDeployment1f26996adb" @@ -97,6 +107,8 @@ }, "ExplicitApiManagedSwagger": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { From d2b5d7659555649286c80f9d92f10d543a62bd67 Mon Sep 17 00:00:00 2001 From: Qingchuan Ma Date: Thu, 15 Apr 2021 21:25:03 -0700 Subject: [PATCH 16/41] Partially updated test templates --- .../input/api_with_canary_setting.yaml | 4 ++++ ..._with_cors_and_auth_no_preflight_auth.yaml | 6 ++++++ ...api_with_cors_and_auth_preflight_auth.yaml | 6 ++++++ ...cors_and_conditions_no_definitionbody.yaml | 6 ++++++ ..._with_cors_and_only_credentials_false.yaml | 4 ++++ .../input/api_with_cors_and_only_headers.yaml | 4 ++++ .../input/api_with_cors_and_only_maxage.yaml | 4 ++++ .../input/api_with_cors_and_only_methods.yaml | 2 ++ .../input/api_with_cors_and_only_origins.yaml | 4 ++++ .../api_with_cors_no_definitionbody.yaml | 4 ++++ .../output/api_with_canary_setting.json | 18 +++++++++++++++++ ..._with_cors_and_auth_no_preflight_auth.json | 20 +++++++++++++++++++ ...api_with_cors_and_auth_preflight_auth.json | 20 +++++++++++++++++++ ...cors_and_conditions_no_definitionbody.json | 20 +++++++++++++++++++ ..._with_cors_and_only_credentials_false.json | 10 ++++++++++ .../api_with_cors_and_only_headers.json | 20 +++++++++++++++++++ .../output/api_with_cors_and_only_maxage.json | 10 ++++++++++ .../api_with_cors_and_only_methods.json | 12 +++++++++++ .../api_with_cors_and_only_origins.json | 20 +++++++++++++++++++ .../api_with_cors_no_definitionbody.json | 14 +++++++++++++ .../aws-cn/api_with_canary_setting.json | 18 +++++++++++++++++ ..._with_cors_and_auth_no_preflight_auth.json | 20 +++++++++++++++++++ ...api_with_cors_and_auth_preflight_auth.json | 20 +++++++++++++++++++ ...cors_and_conditions_no_definitionbody.json | 20 +++++++++++++++++++ ..._with_cors_and_only_credentials_false.json | 10 ++++++++++ .../api_with_cors_and_only_headers.json | 20 +++++++++++++++++++ .../aws-cn/api_with_cors_and_only_maxage.json | 10 ++++++++++ .../api_with_cors_and_only_methods.json | 12 +++++++++++ .../api_with_cors_and_only_origins.json | 20 +++++++++++++++++++ .../api_with_cors_no_definitionbody.json | 14 +++++++++++++ .../aws-us-gov/api_with_canary_setting.json | 18 +++++++++++++++++ ..._with_cors_and_auth_no_preflight_auth.json | 20 +++++++++++++++++++ ...api_with_cors_and_auth_preflight_auth.json | 20 +++++++++++++++++++ ...cors_and_conditions_no_definitionbody.json | 20 +++++++++++++++++++ ..._with_cors_and_only_credentials_false.json | 10 ++++++++++ .../api_with_cors_and_only_headers.json | 20 +++++++++++++++++++ .../api_with_cors_and_only_maxage.json | 10 ++++++++++ .../api_with_cors_and_only_methods.json | 12 +++++++++++ .../api_with_cors_and_only_origins.json | 20 +++++++++++++++++++ .../api_with_cors_no_definitionbody.json | 14 +++++++++++++ 40 files changed, 536 insertions(+) diff --git a/tests/translator/input/api_with_canary_setting.yaml b/tests/translator/input/api_with_canary_setting.yaml index 4503274c9..a319aa1d4 100644 --- a/tests/translator/input/api_with_canary_setting.yaml +++ b/tests/translator/input/api_with_canary_setting.yaml @@ -10,6 +10,8 @@ Globals: Resources: ImplicitApiFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -23,6 +25,8 @@ Resources: ExplicitApi: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod DefinitionUri: s3://sam-demo-bucket/webpage_swagger.json diff --git a/tests/translator/input/api_with_cors_and_auth_no_preflight_auth.yaml b/tests/translator/input/api_with_cors_and_auth_no_preflight_auth.yaml index e4e494082..da1603ca1 100644 --- a/tests/translator/input/api_with_cors_and_auth_no_preflight_auth.yaml +++ b/tests/translator/input/api_with_cors_and_auth_no_preflight_auth.yaml @@ -5,6 +5,8 @@ Globals: Resources: ApiFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -27,6 +29,8 @@ Resources: ServerlessApi: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -42,6 +46,8 @@ Resources: MyAuthFn: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler diff --git a/tests/translator/input/api_with_cors_and_auth_preflight_auth.yaml b/tests/translator/input/api_with_cors_and_auth_preflight_auth.yaml index e984428c1..47f7c200d 100644 --- a/tests/translator/input/api_with_cors_and_auth_preflight_auth.yaml +++ b/tests/translator/input/api_with_cors_and_auth_preflight_auth.yaml @@ -5,6 +5,8 @@ Globals: Resources: ApiFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -27,6 +29,8 @@ Resources: ServerlessApi: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -41,6 +45,8 @@ Resources: MyAuthFn: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler diff --git a/tests/translator/input/api_with_cors_and_conditions_no_definitionbody.yaml b/tests/translator/input/api_with_cors_and_conditions_no_definitionbody.yaml index 6070b112d..e9054eeab 100644 --- a/tests/translator/input/api_with_cors_and_conditions_no_definitionbody.yaml +++ b/tests/translator/input/api_with_cors_and_conditions_no_definitionbody.yaml @@ -14,6 +14,8 @@ Globals: Resources: ImplicitApiFunction2: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -28,6 +30,8 @@ Resources: ImplicitApiFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Condition: MyCondition Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip @@ -51,5 +55,7 @@ Resources: ExplicitApi: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod \ No newline at end of file diff --git a/tests/translator/input/api_with_cors_and_only_credentials_false.yaml b/tests/translator/input/api_with_cors_and_only_credentials_false.yaml index f5fd65d0b..aad04493f 100644 --- a/tests/translator/input/api_with_cors_and_only_credentials_false.yaml +++ b/tests/translator/input/api_with_cors_and_only_credentials_false.yaml @@ -6,12 +6,16 @@ Globals: Resources: ImplicitApiFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml Runtime: nodejs12.x ExplicitApi: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod DefinitionBody: { diff --git a/tests/translator/input/api_with_cors_and_only_headers.yaml b/tests/translator/input/api_with_cors_and_only_headers.yaml index 4619d39b9..b067bbac7 100644 --- a/tests/translator/input/api_with_cors_and_only_headers.yaml +++ b/tests/translator/input/api_with_cors_and_only_headers.yaml @@ -8,6 +8,8 @@ Globals: Resources: ImplicitApiFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -28,6 +30,8 @@ Resources: ExplicitApi: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod DefinitionBody: { diff --git a/tests/translator/input/api_with_cors_and_only_maxage.yaml b/tests/translator/input/api_with_cors_and_only_maxage.yaml index 2e1ed30a3..8ce9d10f5 100644 --- a/tests/translator/input/api_with_cors_and_only_maxage.yaml +++ b/tests/translator/input/api_with_cors_and_only_maxage.yaml @@ -7,12 +7,16 @@ Globals: Resources: ImplicitApiFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml Runtime: nodejs12.x ExplicitApi: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod DefinitionBody: { diff --git a/tests/translator/input/api_with_cors_and_only_methods.yaml b/tests/translator/input/api_with_cors_and_only_methods.yaml index 1ee2d9288..80f3d21dc 100644 --- a/tests/translator/input/api_with_cors_and_only_methods.yaml +++ b/tests/translator/input/api_with_cors_and_only_methods.yaml @@ -6,6 +6,8 @@ Globals: Resources: ImplicitApiFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml diff --git a/tests/translator/input/api_with_cors_and_only_origins.yaml b/tests/translator/input/api_with_cors_and_only_origins.yaml index b8083247e..8f45272be 100644 --- a/tests/translator/input/api_with_cors_and_only_origins.yaml +++ b/tests/translator/input/api_with_cors_and_only_origins.yaml @@ -6,6 +6,8 @@ Globals: Resources: ImplicitApiFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -26,6 +28,8 @@ Resources: ExplicitApi: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod DefinitionBody: { diff --git a/tests/translator/input/api_with_cors_no_definitionbody.yaml b/tests/translator/input/api_with_cors_no_definitionbody.yaml index f8b7bcd52..1ff2faabe 100644 --- a/tests/translator/input/api_with_cors_no_definitionbody.yaml +++ b/tests/translator/input/api_with_cors_no_definitionbody.yaml @@ -8,6 +8,8 @@ Globals: Resources: ImplicitApiFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -30,5 +32,7 @@ Resources: ExplicitApi: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod \ No newline at end of file diff --git a/tests/translator/output/api_with_canary_setting.json b/tests/translator/output/api_with_canary_setting.json index 34a785874..97c219fdd 100644 --- a/tests/translator/output/api_with_canary_setting.json +++ b/tests/translator/output/api_with_canary_setting.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ExplicitApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -65,6 +71,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -86,6 +94,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BodyS3Location": { "Bucket": "sam-demo-bucket", @@ -95,6 +105,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "CanarySetting": { "PercentTraffic": 100, @@ -115,6 +127,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "CanarySetting": { "PercentTraffic": 100, @@ -135,6 +149,8 @@ }, "ServerlessRestApiDeployment62b96c1a61": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -145,6 +161,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_with_cors_and_auth_no_preflight_auth.json b/tests/translator/output/api_with_cors_and_auth_no_preflight_auth.json index 678e33d5d..90393f242 100644 --- a/tests/translator/output/api_with_cors_and_auth_no_preflight_auth.json +++ b/tests/translator/output/api_with_cors_and_auth_no_preflight_auth.json @@ -2,6 +2,8 @@ "Resources": { "ServerlessApiDeploymente70e322247": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessApi" @@ -12,6 +14,8 @@ }, "ServerlessApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -125,6 +129,8 @@ }, "ApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -155,6 +161,8 @@ }, "ApiFunctionPostHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -176,6 +184,8 @@ }, "ServerlessApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessApiDeploymente70e322247" @@ -188,6 +198,8 @@ }, "ApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -209,6 +221,8 @@ }, "ApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -232,6 +246,8 @@ }, "MyAuthFn": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -255,6 +271,8 @@ }, "MyAuthFnRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -285,6 +303,8 @@ }, "ServerlessApiMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/api_with_cors_and_auth_preflight_auth.json b/tests/translator/output/api_with_cors_and_auth_preflight_auth.json index 9dc875a08..4db7fa6ff 100644 --- a/tests/translator/output/api_with_cors_and_auth_preflight_auth.json +++ b/tests/translator/output/api_with_cors_and_auth_preflight_auth.json @@ -2,6 +2,8 @@ "Resources": { "ServerlessApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -120,6 +122,8 @@ }, "ServerlessApiDeployment5355b9449d": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessApi" @@ -130,6 +134,8 @@ }, "ApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -160,6 +166,8 @@ }, "ApiFunctionPostHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -181,6 +189,8 @@ }, "ServerlessApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessApiDeployment5355b9449d" @@ -193,6 +203,8 @@ }, "ApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -214,6 +226,8 @@ }, "ApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -237,6 +251,8 @@ }, "MyAuthFn": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -260,6 +276,8 @@ }, "MyAuthFnRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -290,6 +308,8 @@ }, "ServerlessApiMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/api_with_cors_and_conditions_no_definitionbody.json b/tests/translator/output/api_with_cors_and_conditions_no_definitionbody.json index 432861ca3..9126c33c3 100644 --- a/tests/translator/output/api_with_cors_and_conditions_no_definitionbody.json +++ b/tests/translator/output/api_with_cors_and_conditions_no_definitionbody.json @@ -11,6 +11,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -35,6 +37,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -66,6 +70,8 @@ }, "ImplicitApiFunctionPostHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -88,6 +94,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentae0b2acf4c" @@ -100,6 +108,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -220,6 +230,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -242,6 +254,8 @@ }, "ExplicitApiDeploymentae0b2acf4c": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -252,6 +266,8 @@ }, "ImplicitApiFunction2Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -282,6 +298,8 @@ }, "ImplicitApiFunction2DeleteHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -303,6 +321,8 @@ }, "ImplicitApiFunction2": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { diff --git a/tests/translator/output/api_with_cors_and_only_credentials_false.json b/tests/translator/output/api_with_cors_and_only_credentials_false.json index f7ba8c842..5c49334b5 100644 --- a/tests/translator/output/api_with_cors_and_only_credentials_false.json +++ b/tests/translator/output/api_with_cors_and_only_credentials_false.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment398246867a" @@ -67,6 +73,8 @@ }, "ExplicitApiDeployment398246867a": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -77,6 +85,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_with_cors_and_only_headers.json b/tests/translator/output/api_with_cors_and_only_headers.json index ff15ff8ee..ff2dafb0c 100644 --- a/tests/translator/output/api_with_cors_and_only_headers.json +++ b/tests/translator/output/api_with_cors_and_only_headers.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ImplicitApiFunctionPostHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -76,6 +82,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment03e65d7ea2" @@ -88,6 +96,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment602730b2df" @@ -100,6 +110,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -228,6 +240,8 @@ }, "ExplicitApiDeployment03e65d7ea2": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -238,6 +252,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -259,6 +275,8 @@ }, "ServerlessRestApiDeployment602730b2df": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -269,6 +287,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_with_cors_and_only_maxage.json b/tests/translator/output/api_with_cors_and_only_maxage.json index 24d3d89f7..cb0f054de 100644 --- a/tests/translator/output/api_with_cors_and_only_maxage.json +++ b/tests/translator/output/api_with_cors_and_only_maxage.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ExplicitApiDeploymentb61cfb7d60": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -65,6 +71,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentb61cfb7d60" @@ -77,6 +85,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_with_cors_and_only_methods.json b/tests/translator/output/api_with_cors_and_only_methods.json index 860e79702..dc070b52a 100644 --- a/tests/translator/output/api_with_cors_and_only_methods.json +++ b/tests/translator/output/api_with_cors_and_only_methods.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -76,6 +82,8 @@ }, "ServerlessRestApiDeploymentfd83ca0941": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -86,6 +94,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentfd83ca0941" @@ -98,6 +108,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_with_cors_and_only_origins.json b/tests/translator/output/api_with_cors_and_only_origins.json index c3bd97b70..42bbe195a 100644 --- a/tests/translator/output/api_with_cors_and_only_origins.json +++ b/tests/translator/output/api_with_cors_and_only_origins.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ExplicitApiDeploymenta7a992bbb6": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -65,6 +71,8 @@ }, "ImplicitApiFunctionPostHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -86,6 +94,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymenta7a992bbb6" @@ -98,6 +108,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment4be3cdc28b" @@ -110,6 +122,8 @@ }, "ServerlessRestApiDeployment4be3cdc28b": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -120,6 +134,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -240,6 +256,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -261,6 +279,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_with_cors_no_definitionbody.json b/tests/translator/output/api_with_cors_no_definitionbody.json index 4adbce835..4e46c096d 100644 --- a/tests/translator/output/api_with_cors_no_definitionbody.json +++ b/tests/translator/output/api_with_cors_no_definitionbody.json @@ -3,6 +3,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -24,6 +26,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -52,6 +56,8 @@ }, "ImplicitApiFunctionPostHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -73,6 +79,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -94,6 +102,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -172,6 +182,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment4be3cdc28b" @@ -184,6 +196,8 @@ }, "ExplicitApiDeployment4be3cdc28b": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" diff --git a/tests/translator/output/aws-cn/api_with_canary_setting.json b/tests/translator/output/aws-cn/api_with_canary_setting.json index 412da24e1..5364aadf4 100644 --- a/tests/translator/output/aws-cn/api_with_canary_setting.json +++ b/tests/translator/output/aws-cn/api_with_canary_setting.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -76,6 +82,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -93,6 +101,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "CanarySetting": { "PercentTraffic": 100, @@ -113,6 +123,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "CanarySetting": { "PercentTraffic": 100, @@ -133,6 +145,8 @@ }, "ServerlessRestApiDeploymentcb4fb12558": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -143,6 +157,8 @@ }, "ExplicitApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -153,6 +169,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_cors_and_auth_no_preflight_auth.json b/tests/translator/output/aws-cn/api_with_cors_and_auth_no_preflight_auth.json index 7c24e8b01..2960d274f 100644 --- a/tests/translator/output/aws-cn/api_with_cors_and_auth_no_preflight_auth.json +++ b/tests/translator/output/aws-cn/api_with_cors_and_auth_no_preflight_auth.json @@ -2,6 +2,8 @@ "Resources": { "ServerlessApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -123,6 +125,8 @@ }, "ServerlessApiDeployment6050a96a0f": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessApi" @@ -133,6 +137,8 @@ }, "ApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -163,6 +169,8 @@ }, "ApiFunctionPostHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -184,6 +192,8 @@ }, "ServerlessApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessApiDeployment6050a96a0f" @@ -196,6 +206,8 @@ }, "ApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -217,6 +229,8 @@ }, "ApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -240,6 +254,8 @@ }, "MyAuthFn": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -263,6 +279,8 @@ }, "MyAuthFnRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -293,6 +311,8 @@ }, "ServerlessApiMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-cn/api_with_cors_and_auth_preflight_auth.json b/tests/translator/output/aws-cn/api_with_cors_and_auth_preflight_auth.json index a6f758d87..09ecf35b9 100644 --- a/tests/translator/output/aws-cn/api_with_cors_and_auth_preflight_auth.json +++ b/tests/translator/output/aws-cn/api_with_cors_and_auth_preflight_auth.json @@ -2,6 +2,8 @@ "Resources": { "ServerlessApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -128,6 +130,8 @@ }, "ApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -158,6 +162,8 @@ }, "ServerlessApiDeployment25b7a1be29": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessApi" @@ -168,6 +174,8 @@ }, "ApiFunctionPostHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -189,6 +197,8 @@ }, "ServerlessApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessApiDeployment25b7a1be29" @@ -201,6 +211,8 @@ }, "ApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -222,6 +234,8 @@ }, "ApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -245,6 +259,8 @@ }, "MyAuthFn": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -268,6 +284,8 @@ }, "MyAuthFnRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -298,6 +316,8 @@ }, "ServerlessApiMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-cn/api_with_cors_and_conditions_no_definitionbody.json b/tests/translator/output/aws-cn/api_with_cors_and_conditions_no_definitionbody.json index 7ecad73f6..25e1ec642 100644 --- a/tests/translator/output/aws-cn/api_with_cors_and_conditions_no_definitionbody.json +++ b/tests/translator/output/aws-cn/api_with_cors_and_conditions_no_definitionbody.json @@ -11,6 +11,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -35,6 +37,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -66,6 +70,8 @@ }, "ImplicitApiFunctionPostHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -88,6 +94,8 @@ }, "ExplicitApiDeployment7ad5aed108": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -98,6 +106,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -226,6 +236,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -248,6 +260,8 @@ }, "ImplicitApiFunction2Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -278,6 +292,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment7ad5aed108" @@ -290,6 +306,8 @@ }, "ImplicitApiFunction2DeleteHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -311,6 +329,8 @@ }, "ImplicitApiFunction2": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { diff --git a/tests/translator/output/aws-cn/api_with_cors_and_only_credentials_false.json b/tests/translator/output/aws-cn/api_with_cors_and_only_credentials_false.json index 81a665c79..92b5c6d3d 100644 --- a/tests/translator/output/aws-cn/api_with_cors_and_only_credentials_false.json +++ b/tests/translator/output/aws-cn/api_with_cors_and_only_credentials_false.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment398246867a" @@ -67,6 +73,8 @@ }, "ExplicitApiDeployment398246867a": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -77,6 +85,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_cors_and_only_headers.json b/tests/translator/output/aws-cn/api_with_cors_and_only_headers.json index 2512bfc95..fbdc9ab07 100644 --- a/tests/translator/output/aws-cn/api_with_cors_and_only_headers.json +++ b/tests/translator/output/aws-cn/api_with_cors_and_only_headers.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ImplicitApiFunctionPostHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -76,6 +82,8 @@ }, "ServerlessRestApiDeployment9467cf1cd5": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -86,6 +94,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment9467cf1cd5" @@ -98,6 +108,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -234,6 +246,8 @@ }, "ExplicitApiDeployment03e65d7ea2": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -244,6 +258,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -265,6 +281,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment03e65d7ea2" @@ -277,6 +295,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_cors_and_only_maxage.json b/tests/translator/output/aws-cn/api_with_cors_and_only_maxage.json index d778140c0..79593d466 100644 --- a/tests/translator/output/aws-cn/api_with_cors_and_only_maxage.json +++ b/tests/translator/output/aws-cn/api_with_cors_and_only_maxage.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ExplicitApiDeploymentb61cfb7d60": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -65,6 +71,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentb61cfb7d60" @@ -77,6 +85,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_cors_and_only_methods.json b/tests/translator/output/aws-cn/api_with_cors_and_only_methods.json index 1d5a9b27d..590412ab7 100644 --- a/tests/translator/output/aws-cn/api_with_cors_and_only_methods.json +++ b/tests/translator/output/aws-cn/api_with_cors_and_only_methods.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -76,6 +82,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment06ae8f0cfb" @@ -88,6 +96,8 @@ }, "ServerlessRestApiDeployment06ae8f0cfb": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -98,6 +108,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_cors_and_only_origins.json b/tests/translator/output/aws-cn/api_with_cors_and_only_origins.json index 3e9e0a4ab..e8af91349 100644 --- a/tests/translator/output/aws-cn/api_with_cors_and_only_origins.json +++ b/tests/translator/output/aws-cn/api_with_cors_and_only_origins.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ExplicitApiDeploymenta7a992bbb6": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -65,6 +71,8 @@ }, "ImplicitApiFunctionPostHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -86,6 +94,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymenta7a992bbb6" @@ -98,6 +108,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentb4ba0b8ae8" @@ -110,6 +122,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -238,6 +252,8 @@ }, "ServerlessRestApiDeploymentb4ba0b8ae8": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -248,6 +264,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -269,6 +287,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_cors_no_definitionbody.json b/tests/translator/output/aws-cn/api_with_cors_no_definitionbody.json index 978abf900..673769189 100644 --- a/tests/translator/output/aws-cn/api_with_cors_no_definitionbody.json +++ b/tests/translator/output/aws-cn/api_with_cors_no_definitionbody.json @@ -3,6 +3,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -24,6 +26,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -52,6 +56,8 @@ }, "ImplicitApiFunctionPostHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -73,6 +79,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -94,6 +102,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -180,6 +190,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentb4ba0b8ae8" @@ -192,6 +204,8 @@ }, "ExplicitApiDeploymentb4ba0b8ae8": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" diff --git a/tests/translator/output/aws-us-gov/api_with_canary_setting.json b/tests/translator/output/aws-us-gov/api_with_canary_setting.json index d33fda88e..208d558b6 100644 --- a/tests/translator/output/aws-us-gov/api_with_canary_setting.json +++ b/tests/translator/output/aws-us-gov/api_with_canary_setting.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -76,6 +82,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -93,6 +101,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "CanarySetting": { "PercentTraffic": 100, @@ -113,6 +123,8 @@ }, "ServerlessRestApiDeployment5b2cb4ba8f": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -123,6 +135,8 @@ }, "ExplicitApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -133,6 +147,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "CanarySetting": { "PercentTraffic": 100, @@ -153,6 +169,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_with_cors_and_auth_no_preflight_auth.json b/tests/translator/output/aws-us-gov/api_with_cors_and_auth_no_preflight_auth.json index 9492ea146..bd5d23304 100644 --- a/tests/translator/output/aws-us-gov/api_with_cors_and_auth_no_preflight_auth.json +++ b/tests/translator/output/aws-us-gov/api_with_cors_and_auth_no_preflight_auth.json @@ -2,6 +2,8 @@ "Resources": { "ServerlessApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -123,6 +125,8 @@ }, "ApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -153,6 +157,8 @@ }, "ServerlessApiDeployment0aae939ae6": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessApi" @@ -163,6 +169,8 @@ }, "ServerlessApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessApiDeployment0aae939ae6" @@ -175,6 +183,8 @@ }, "ApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -196,6 +206,8 @@ }, "ApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -219,6 +231,8 @@ }, "MyAuthFn": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -242,6 +256,8 @@ }, "ApiFunctionPostHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -263,6 +279,8 @@ }, "MyAuthFnRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -293,6 +311,8 @@ }, "ServerlessApiMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/api_with_cors_and_auth_preflight_auth.json b/tests/translator/output/aws-us-gov/api_with_cors_and_auth_preflight_auth.json index 8130f7908..ead4ea685 100644 --- a/tests/translator/output/aws-us-gov/api_with_cors_and_auth_preflight_auth.json +++ b/tests/translator/output/aws-us-gov/api_with_cors_and_auth_preflight_auth.json @@ -2,6 +2,8 @@ "Resources": { "ServerlessApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -128,6 +130,8 @@ }, "ApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -158,6 +162,8 @@ }, "ServerlessApiDeployment1aab931299": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessApi" @@ -168,6 +174,8 @@ }, "ApiFunctionPostHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -189,6 +197,8 @@ }, "ApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -210,6 +220,8 @@ }, "ApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -233,6 +245,8 @@ }, "MyAuthFn": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -256,6 +270,8 @@ }, "MyAuthFnRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -286,6 +302,8 @@ }, "ServerlessApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessApiDeployment1aab931299" @@ -298,6 +316,8 @@ }, "ServerlessApiMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/api_with_cors_and_conditions_no_definitionbody.json b/tests/translator/output/aws-us-gov/api_with_cors_and_conditions_no_definitionbody.json index 035b35918..fde7ba7b5 100644 --- a/tests/translator/output/aws-us-gov/api_with_cors_and_conditions_no_definitionbody.json +++ b/tests/translator/output/aws-us-gov/api_with_cors_and_conditions_no_definitionbody.json @@ -11,6 +11,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -35,6 +37,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -66,6 +70,8 @@ }, "ImplicitApiFunctionPostHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -88,6 +94,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentc140480269" @@ -100,6 +108,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -228,6 +238,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -250,6 +262,8 @@ }, "ExplicitApiDeploymentc140480269": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -260,6 +274,8 @@ }, "ImplicitApiFunction2Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -290,6 +306,8 @@ }, "ImplicitApiFunction2DeleteHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -311,6 +329,8 @@ }, "ImplicitApiFunction2": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { diff --git a/tests/translator/output/aws-us-gov/api_with_cors_and_only_credentials_false.json b/tests/translator/output/aws-us-gov/api_with_cors_and_only_credentials_false.json index 13650f845..0453c8073 100644 --- a/tests/translator/output/aws-us-gov/api_with_cors_and_only_credentials_false.json +++ b/tests/translator/output/aws-us-gov/api_with_cors_and_only_credentials_false.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment398246867a" @@ -67,6 +73,8 @@ }, "ExplicitApiDeployment398246867a": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -77,6 +85,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_with_cors_and_only_headers.json b/tests/translator/output/aws-us-gov/api_with_cors_and_only_headers.json index cbdf27d25..6201d9d4d 100644 --- a/tests/translator/output/aws-us-gov/api_with_cors_and_only_headers.json +++ b/tests/translator/output/aws-us-gov/api_with_cors_and_only_headers.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ServerlessRestApiDeployment8e16bddf6b": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -65,6 +71,8 @@ }, "ImplicitApiFunctionPostHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -86,6 +94,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment03e65d7ea2" @@ -98,6 +108,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment8e16bddf6b" @@ -110,6 +122,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -246,6 +260,8 @@ }, "ExplicitApiDeployment03e65d7ea2": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -256,6 +272,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -277,6 +295,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_with_cors_and_only_maxage.json b/tests/translator/output/aws-us-gov/api_with_cors_and_only_maxage.json index bd02c3bea..9dfe45d26 100644 --- a/tests/translator/output/aws-us-gov/api_with_cors_and_only_maxage.json +++ b/tests/translator/output/aws-us-gov/api_with_cors_and_only_maxage.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ExplicitApiDeploymentb61cfb7d60": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -65,6 +71,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentb61cfb7d60" @@ -77,6 +85,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_with_cors_and_only_methods.json b/tests/translator/output/aws-us-gov/api_with_cors_and_only_methods.json index 1955ea1fe..6eb351bf1 100644 --- a/tests/translator/output/aws-us-gov/api_with_cors_and_only_methods.json +++ b/tests/translator/output/aws-us-gov/api_with_cors_and_only_methods.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -76,6 +82,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment50aa0cc33c" @@ -88,6 +96,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -164,6 +174,8 @@ }, "ServerlessRestApiDeployment50aa0cc33c": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" diff --git a/tests/translator/output/aws-us-gov/api_with_cors_and_only_origins.json b/tests/translator/output/aws-us-gov/api_with_cors_and_only_origins.json index 8ab271326..61351a75d 100644 --- a/tests/translator/output/aws-us-gov/api_with_cors_and_only_origins.json +++ b/tests/translator/output/aws-us-gov/api_with_cors_and_only_origins.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ExplicitApiDeploymenta7a992bbb6": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -65,6 +71,8 @@ }, "ImplicitApiFunctionPostHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -86,6 +94,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymenta7a992bbb6" @@ -98,6 +108,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentc934a493f3" @@ -110,6 +122,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -238,6 +252,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -259,6 +275,8 @@ }, "ServerlessRestApiDeploymentc934a493f3": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -269,6 +287,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_with_cors_no_definitionbody.json b/tests/translator/output/aws-us-gov/api_with_cors_no_definitionbody.json index e384a6395..29a23cac9 100644 --- a/tests/translator/output/aws-us-gov/api_with_cors_no_definitionbody.json +++ b/tests/translator/output/aws-us-gov/api_with_cors_no_definitionbody.json @@ -3,6 +3,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -24,6 +26,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -52,6 +56,8 @@ }, "ImplicitApiFunctionPostHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -73,6 +79,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -94,6 +102,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -180,6 +190,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentc934a493f3" @@ -192,6 +204,8 @@ }, "ExplicitApiDeploymentc934a493f3": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" From de2904fceb44dc7b024a4c3c82d32d7d7a8015db Mon Sep 17 00:00:00 2001 From: Qingchuan Ma Date: Tue, 20 Apr 2021 03:28:07 -0700 Subject: [PATCH 17/41] Partially updated test templates --- tests/translator/input/api_with_cors.yaml | 8 ++++++ .../input/api_with_cors_openapi_3.yaml | 8 ++++++ .../input/api_with_custom_domain_route53.yaml | 4 +++ ...ustom_domain_route53_hosted_zone_name.yaml | 4 +++ ..._domain_route53_hosted_zone_name_http.yaml | 4 +++ .../api_with_custom_domain_route53_http.yaml | 4 +++ .../input/api_with_default_aws_iam_auth.yaml | 8 ++++++ ...efault_aws_iam_auth_and_no_auth_route.yaml | 4 +++ .../input/api_with_gateway_responses.yaml | 4 +++ .../input/api_with_gateway_responses_all.yaml | 4 +++ ..._with_gateway_responses_all_openapi_3.yaml | 4 +++ .../api_with_gateway_responses_implicit.yaml | 2 ++ .../api_with_gateway_responses_minimal.yaml | 4 +++ ..._gateway_responses_string_status_code.yaml | 4 +++ ...h_if_conditional_with_resource_policy.yaml | 4 +++ .../api_with_incompatible_stage_name.yaml | 8 ++++++ .../input/api_with_ip_range_blacklist.yaml | 2 ++ .../input/api_with_ip_range_whitelist.yaml | 2 ++ .../input/api_with_method_aws_iam_auth.yaml | 4 +++ .../input/api_with_method_settings.yaml | 4 +++ .../api_with_minimum_compression_size.yaml | 4 +++ .../input/api_with_open_api_version.yaml | 4 +++ .../input/api_with_open_api_version_2.yaml | 4 +++ ..._with_openapi_definition_body_no_flag.yaml | 6 ++++ .../input/api_with_path_parameters.yaml | 4 +++ .../input/api_with_resource_policy.yaml | 4 +++ .../api_with_resource_policy_global.yaml | 6 ++++ ..._with_resource_policy_global_implicit.yaml | 2 ++ .../input/api_with_resource_refs.yaml | 4 +++ .../input/api_with_source_vpc_blacklist.yaml | 2 ++ tests/translator/output/api_with_cors.json | 28 +++++++++++++++++++ .../output/api_with_cors_openapi_3.json | 28 +++++++++++++++++++ .../api_with_custom_domain_route53.json | 18 ++++++++++++ ...ustom_domain_route53_hosted_zone_name.json | 18 ++++++++++++ ..._domain_route53_hosted_zone_name_http.json | 16 +++++++++++ .../api_with_custom_domain_route53_http.json | 16 +++++++++++ .../output/api_with_default_aws_iam_auth.json | 28 +++++++++++++++++++ ...efault_aws_iam_auth_and_no_auth_route.json | 14 ++++++++++ .../output/api_with_gateway_responses.json | 12 ++++++++ .../api_with_gateway_responses_all.json | 12 ++++++++ ..._with_gateway_responses_all_openapi_3.json | 12 ++++++++ .../api_with_gateway_responses_implicit.json | 12 ++++++++ .../api_with_gateway_responses_minimal.json | 12 ++++++++ ..._gateway_responses_string_status_code.json | 12 ++++++++ ...h_if_conditional_with_resource_policy.json | 16 +++++++++++ .../api_with_incompatible_stage_name.json | 24 ++++++++++++++++ .../output/api_with_ip_range_blacklist.json | 12 ++++++++ .../output/api_with_ip_range_whitelist.json | 12 ++++++++ .../output/api_with_method_aws_iam_auth.json | 16 +++++++++++ .../output/api_with_method_settings.json | 18 ++++++++++++ .../api_with_minimum_compression_size.json | 18 ++++++++++++ .../output/api_with_open_api_version.json | 18 ++++++++++++ .../output/api_with_open_api_version_2.json | 18 ++++++++++++ ..._with_openapi_definition_body_no_flag.json | 20 +++++++++++++ .../output/api_with_path_parameters.json | 12 ++++++++ .../output/api_with_resource_policy.json | 16 +++++++++++ .../api_with_resource_policy_global.json | 18 ++++++++++++ ..._with_resource_policy_global_implicit.json | 12 ++++++++ .../output/api_with_resource_refs.json | 18 ++++++++++++ .../output/api_with_source_vpc_blacklist.json | 12 ++++++++ .../output/aws-cn/api_with_cors.json | 28 +++++++++++++++++++ .../aws-cn/api_with_cors_openapi_3.json | 28 +++++++++++++++++++ .../api_with_custom_domain_route53.json | 18 ++++++++++++ ...ustom_domain_route53_hosted_zone_name.json | 18 ++++++++++++ ..._domain_route53_hosted_zone_name_http.json | 16 +++++++++++ .../api_with_custom_domain_route53_http.json | 16 +++++++++++ .../aws-cn/api_with_default_aws_iam_auth.json | 28 +++++++++++++++++++ ...efault_aws_iam_auth_and_no_auth_route.json | 14 ++++++++++ .../aws-cn/api_with_gateway_responses.json | 12 ++++++++ .../api_with_gateway_responses_all.json | 12 ++++++++ ..._with_gateway_responses_all_openapi_3.json | 12 ++++++++ .../api_with_gateway_responses_implicit.json | 12 ++++++++ .../api_with_gateway_responses_minimal.json | 12 ++++++++ ..._gateway_responses_string_status_code.json | 12 ++++++++ ...h_if_conditional_with_resource_policy.json | 16 +++++++++++ .../api_with_incompatible_stage_name.json | 24 ++++++++++++++++ .../aws-cn/api_with_ip_range_blacklist.json | 12 ++++++++ .../aws-cn/api_with_ip_range_whitelist.json | 12 ++++++++ .../aws-cn/api_with_method_aws_iam_auth.json | 16 +++++++++++ .../aws-cn/api_with_method_settings.json | 18 ++++++++++++ .../api_with_minimum_compression_size.json | 18 ++++++++++++ .../aws-cn/api_with_open_api_version.json | 18 ++++++++++++ .../aws-cn/api_with_open_api_version_2.json | 18 ++++++++++++ ..._with_openapi_definition_body_no_flag.json | 20 +++++++++++++ .../aws-cn/api_with_path_parameters.json | 12 ++++++++ .../aws-cn/api_with_resource_policy.json | 16 +++++++++++ .../api_with_resource_policy_global.json | 18 ++++++++++++ ..._with_resource_policy_global_implicit.json | 12 ++++++++ .../output/aws-cn/api_with_resource_refs.json | 18 ++++++++++++ .../aws-cn/api_with_source_vpc_blacklist.json | 12 ++++++++ .../output/aws-us-gov/api_with_cors.json | 28 +++++++++++++++++++ .../aws-us-gov/api_with_cors_openapi_3.json | 28 +++++++++++++++++++ .../api_with_custom_domain_route53.json | 18 ++++++++++++ ...ustom_domain_route53_hosted_zone_name.json | 18 ++++++++++++ ..._domain_route53_hosted_zone_name_http.json | 16 +++++++++++ .../api_with_custom_domain_route53_http.json | 16 +++++++++++ .../api_with_default_aws_iam_auth.json | 28 +++++++++++++++++++ ...efault_aws_iam_auth_and_no_auth_route.json | 14 ++++++++++ .../api_with_gateway_responses.json | 12 ++++++++ .../api_with_gateway_responses_all.json | 12 ++++++++ ..._with_gateway_responses_all_openapi_3.json | 12 ++++++++ .../api_with_gateway_responses_implicit.json | 12 ++++++++ .../api_with_gateway_responses_minimal.json | 12 ++++++++ ..._gateway_responses_string_status_code.json | 12 ++++++++ ...h_if_conditional_with_resource_policy.json | 16 +++++++++++ .../api_with_incompatible_stage_name.json | 24 ++++++++++++++++ .../api_with_ip_range_blacklist.json | 12 ++++++++ .../api_with_ip_range_whitelist.json | 12 ++++++++ .../api_with_method_aws_iam_auth.json | 16 +++++++++++ .../aws-us-gov/api_with_method_settings.json | 18 ++++++++++++ .../api_with_minimum_compression_size.json | 18 ++++++++++++ .../aws-us-gov/api_with_open_api_version.json | 18 ++++++++++++ .../api_with_open_api_version_2.json | 18 ++++++++++++ ..._with_openapi_definition_body_no_flag.json | 20 +++++++++++++ .../aws-us-gov/api_with_path_parameters.json | 12 ++++++++ .../aws-us-gov/api_with_resource_policy.json | 16 +++++++++++ .../api_with_resource_policy_global.json | 18 ++++++++++++ ..._with_resource_policy_global_implicit.json | 12 ++++++++ .../aws-us-gov/api_with_resource_refs.json | 18 ++++++++++++ .../api_with_source_vpc_blacklist.json | 12 ++++++++ 120 files changed, 1624 insertions(+) diff --git a/tests/translator/input/api_with_cors.yaml b/tests/translator/input/api_with_cors.yaml index 56b1c0e80..866b2ecbc 100644 --- a/tests/translator/input/api_with_cors.yaml +++ b/tests/translator/input/api_with_cors.yaml @@ -7,6 +7,8 @@ Globals: Resources: ImplicitApiFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -24,18 +26,24 @@ Resources: Method: any RestApiFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.handler Runtime: nodejs12.x GetHtmlFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.handler Runtime: nodejs12.x ExplicitApi: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod DefinitionBody: { diff --git a/tests/translator/input/api_with_cors_openapi_3.yaml b/tests/translator/input/api_with_cors_openapi_3.yaml index 31ff41b12..636338b51 100644 --- a/tests/translator/input/api_with_cors_openapi_3.yaml +++ b/tests/translator/input/api_with_cors_openapi_3.yaml @@ -9,6 +9,8 @@ Globals: Resources: ImplicitApiFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -26,18 +28,24 @@ Resources: Method: any RestApiFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.handler Runtime: nodejs12.x GetHtmlFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.handler Runtime: nodejs12.x ExplicitApi: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod DefinitionBody: { diff --git a/tests/translator/input/api_with_custom_domain_route53.yaml b/tests/translator/input/api_with_custom_domain_route53.yaml index 1d61f37b1..9f198e351 100644 --- a/tests/translator/input/api_with_custom_domain_route53.yaml +++ b/tests/translator/input/api_with_custom_domain_route53.yaml @@ -8,6 +8,8 @@ Parameters: Resources: MyFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: InlineCode: | exports.handler = async (event) => { @@ -29,6 +31,8 @@ Resources: MyApi: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: OpenApiVersion: 3.0.1 StageName: Prod diff --git a/tests/translator/input/api_with_custom_domain_route53_hosted_zone_name.yaml b/tests/translator/input/api_with_custom_domain_route53_hosted_zone_name.yaml index 36120739b..90084e719 100644 --- a/tests/translator/input/api_with_custom_domain_route53_hosted_zone_name.yaml +++ b/tests/translator/input/api_with_custom_domain_route53_hosted_zone_name.yaml @@ -8,6 +8,8 @@ Parameters: Resources: MyFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: InlineCode: | exports.handler = async (event) => { @@ -29,6 +31,8 @@ Resources: MyApi: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: OpenApiVersion: 3.0.1 StageName: Prod diff --git a/tests/translator/input/api_with_custom_domain_route53_hosted_zone_name_http.yaml b/tests/translator/input/api_with_custom_domain_route53_hosted_zone_name_http.yaml index 9fbc632a8..0f3a8b423 100644 --- a/tests/translator/input/api_with_custom_domain_route53_hosted_zone_name_http.yaml +++ b/tests/translator/input/api_with_custom_domain_route53_hosted_zone_name_http.yaml @@ -18,6 +18,8 @@ Globals: Resources: MyFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: InlineCode: | exports.handler = async (event) => { @@ -39,5 +41,7 @@ Resources: MyApi: Type: AWS::Serverless::HttpApi + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod diff --git a/tests/translator/input/api_with_custom_domain_route53_http.yaml b/tests/translator/input/api_with_custom_domain_route53_http.yaml index f3e91b05d..b63e412f4 100644 --- a/tests/translator/input/api_with_custom_domain_route53_http.yaml +++ b/tests/translator/input/api_with_custom_domain_route53_http.yaml @@ -8,6 +8,8 @@ Parameters: Resources: MyFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: InlineCode: | exports.handler = async (event) => { @@ -29,6 +31,8 @@ Resources: MyApi: Type: AWS::Serverless::HttpApi + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod Domain: diff --git a/tests/translator/input/api_with_default_aws_iam_auth.yaml b/tests/translator/input/api_with_default_aws_iam_auth.yaml index 2c32c89fd..0a4d14db4 100644 --- a/tests/translator/input/api_with_default_aws_iam_auth.yaml +++ b/tests/translator/input/api_with_default_aws_iam_auth.yaml @@ -1,6 +1,8 @@ Resources: MyApiWithAwsIamAuthAndDefaultInvokeRole: Type: "AWS::Serverless::Api" + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -8,6 +10,8 @@ Resources: InvokeRole: CALLER_CREDENTIALS MyApiWithAwsIamAuthAndCustomInvokeRole: Type: "AWS::Serverless::Api" + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -15,6 +19,8 @@ Resources: InvokeRole: rn:aws:iam::123:role/AUTH_AWS_IAM MyApiWithAwsIamAuth: Type: "AWS::Serverless::Api" + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -22,6 +28,8 @@ Resources: MyFunctionWithAwsIamAuth: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler diff --git a/tests/translator/input/api_with_default_aws_iam_auth_and_no_auth_route.yaml b/tests/translator/input/api_with_default_aws_iam_auth_and_no_auth_route.yaml index 8bad58788..ab5d05435 100644 --- a/tests/translator/input/api_with_default_aws_iam_auth_and_no_auth_route.yaml +++ b/tests/translator/input/api_with_default_aws_iam_auth_and_no_auth_route.yaml @@ -1,6 +1,8 @@ Resources: MyApiWithAwsIamAuth: Type: "AWS::Serverless::Api" + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -8,6 +10,8 @@ Resources: MyFunctionWithAwsIamAuth: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler diff --git a/tests/translator/input/api_with_gateway_responses.yaml b/tests/translator/input/api_with_gateway_responses.yaml index fe90cfaa3..6c5d1634e 100644 --- a/tests/translator/input/api_with_gateway_responses.yaml +++ b/tests/translator/input/api_with_gateway_responses.yaml @@ -1,6 +1,8 @@ Resources: Function: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -15,6 +17,8 @@ Resources: ExplicitApi: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod GatewayResponses: diff --git a/tests/translator/input/api_with_gateway_responses_all.yaml b/tests/translator/input/api_with_gateway_responses_all.yaml index 1ae216968..6de930637 100644 --- a/tests/translator/input/api_with_gateway_responses_all.yaml +++ b/tests/translator/input/api_with_gateway_responses_all.yaml @@ -1,6 +1,8 @@ Resources: Function: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -15,6 +17,8 @@ Resources: ExplicitApi: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod GatewayResponses: diff --git a/tests/translator/input/api_with_gateway_responses_all_openapi_3.yaml b/tests/translator/input/api_with_gateway_responses_all_openapi_3.yaml index 9b32bf2d9..9d964e7b1 100644 --- a/tests/translator/input/api_with_gateway_responses_all_openapi_3.yaml +++ b/tests/translator/input/api_with_gateway_responses_all_openapi_3.yaml @@ -1,6 +1,8 @@ Resources: Function: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -15,6 +17,8 @@ Resources: ExplicitApi: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod OpenApiVersion: '3.0' diff --git a/tests/translator/input/api_with_gateway_responses_implicit.yaml b/tests/translator/input/api_with_gateway_responses_implicit.yaml index 4c6cdfd24..5139530dc 100644 --- a/tests/translator/input/api_with_gateway_responses_implicit.yaml +++ b/tests/translator/input/api_with_gateway_responses_implicit.yaml @@ -15,6 +15,8 @@ Globals: Resources: Function: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml diff --git a/tests/translator/input/api_with_gateway_responses_minimal.yaml b/tests/translator/input/api_with_gateway_responses_minimal.yaml index 77879bf42..43dba5b67 100644 --- a/tests/translator/input/api_with_gateway_responses_minimal.yaml +++ b/tests/translator/input/api_with_gateway_responses_minimal.yaml @@ -1,6 +1,8 @@ Resources: Function: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -15,6 +17,8 @@ Resources: ExplicitApi: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod GatewayResponses: diff --git a/tests/translator/input/api_with_gateway_responses_string_status_code.yaml b/tests/translator/input/api_with_gateway_responses_string_status_code.yaml index b37f6d446..cc624dd1f 100644 --- a/tests/translator/input/api_with_gateway_responses_string_status_code.yaml +++ b/tests/translator/input/api_with_gateway_responses_string_status_code.yaml @@ -1,6 +1,8 @@ Resources: Function: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -15,6 +17,8 @@ Resources: ExplicitApi: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod GatewayResponses: diff --git a/tests/translator/input/api_with_if_conditional_with_resource_policy.yaml b/tests/translator/input/api_with_if_conditional_with_resource_policy.yaml index 3ffecb9b7..304950b0d 100644 --- a/tests/translator/input/api_with_if_conditional_with_resource_policy.yaml +++ b/tests/translator/input/api_with_if_conditional_with_resource_policy.yaml @@ -6,6 +6,8 @@ Conditions: Resources: ExplicitApi: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -24,6 +26,8 @@ Resources: ExplicitApiFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml diff --git a/tests/translator/input/api_with_incompatible_stage_name.yaml b/tests/translator/input/api_with_incompatible_stage_name.yaml index d9bb9032f..bc15d4785 100644 --- a/tests/translator/input/api_with_incompatible_stage_name.yaml +++ b/tests/translator/input/api_with_incompatible_stage_name.yaml @@ -1,6 +1,8 @@ Resources: HyphenFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -18,6 +20,8 @@ Resources: HyphenApi: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: hoge-fuga Models: @@ -29,6 +33,8 @@ Resources: UnderscoreFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -46,6 +52,8 @@ Resources: UnderscoreApi: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: hoge_fuga Models: diff --git a/tests/translator/input/api_with_ip_range_blacklist.yaml b/tests/translator/input/api_with_ip_range_blacklist.yaml index cc8650fc5..638a4a0e4 100644 --- a/tests/translator/input/api_with_ip_range_blacklist.yaml +++ b/tests/translator/input/api_with_ip_range_blacklist.yaml @@ -7,6 +7,8 @@ Globals: Resources: MyFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: InlineCode: | exports.handler = async (event) => { diff --git a/tests/translator/input/api_with_ip_range_whitelist.yaml b/tests/translator/input/api_with_ip_range_whitelist.yaml index a33b0b982..876146ab7 100644 --- a/tests/translator/input/api_with_ip_range_whitelist.yaml +++ b/tests/translator/input/api_with_ip_range_whitelist.yaml @@ -7,6 +7,8 @@ Globals: Resources: MyFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: InlineCode: | exports.handler = async (event) => { diff --git a/tests/translator/input/api_with_method_aws_iam_auth.yaml b/tests/translator/input/api_with_method_aws_iam_auth.yaml index 8a1c8c6da..35f3b5816 100644 --- a/tests/translator/input/api_with_method_aws_iam_auth.yaml +++ b/tests/translator/input/api_with_method_aws_iam_auth.yaml @@ -1,11 +1,15 @@ Resources: MyApiWithoutAuth: Type: "AWS::Serverless::Api" + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod MyFunctionWithAwsIamAuth: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler diff --git a/tests/translator/input/api_with_method_settings.yaml b/tests/translator/input/api_with_method_settings.yaml index 251b70c83..fca9d6a5c 100644 --- a/tests/translator/input/api_with_method_settings.yaml +++ b/tests/translator/input/api_with_method_settings.yaml @@ -18,6 +18,8 @@ Globals: Resources: ImplicitApiFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -31,6 +33,8 @@ Resources: ExplicitApi: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod DefinitionUri: s3://sam-demo-bucket/webpage_swagger.json diff --git a/tests/translator/input/api_with_minimum_compression_size.yaml b/tests/translator/input/api_with_minimum_compression_size.yaml index cb2ea975c..f98ac34d7 100644 --- a/tests/translator/input/api_with_minimum_compression_size.yaml +++ b/tests/translator/input/api_with_minimum_compression_size.yaml @@ -5,6 +5,8 @@ Globals: Resources: ImplicitApiFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -18,6 +20,8 @@ Resources: ExplicitApi: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod DefinitionUri: s3://sam-demo-bucket/webpage_swagger.json diff --git a/tests/translator/input/api_with_open_api_version.yaml b/tests/translator/input/api_with_open_api_version.yaml index 1ffd32bd6..504675f4f 100644 --- a/tests/translator/input/api_with_open_api_version.yaml +++ b/tests/translator/input/api_with_open_api_version.yaml @@ -6,6 +6,8 @@ Globals: Resources: ImplicitApiFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -18,5 +20,7 @@ Resources: Method: get ExplicitApi: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod diff --git a/tests/translator/input/api_with_open_api_version_2.yaml b/tests/translator/input/api_with_open_api_version_2.yaml index 688344e03..1b0daf36d 100644 --- a/tests/translator/input/api_with_open_api_version_2.yaml +++ b/tests/translator/input/api_with_open_api_version_2.yaml @@ -6,6 +6,8 @@ Globals: Resources: ImplicitApiFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -18,5 +20,7 @@ Resources: Method: get ExplicitApi: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod diff --git a/tests/translator/input/api_with_openapi_definition_body_no_flag.yaml b/tests/translator/input/api_with_openapi_definition_body_no_flag.yaml index d8ee227be..0bf5ba102 100644 --- a/tests/translator/input/api_with_openapi_definition_body_no_flag.yaml +++ b/tests/translator/input/api_with_openapi_definition_body_no_flag.yaml @@ -14,6 +14,8 @@ Globals: Resources: ImplicitApiFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -27,6 +29,8 @@ Resources: ExplicitApi: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: SomeStage DefinitionBody: @@ -45,6 +49,8 @@ Resources: MyUserPool: Type: AWS::Cognito::UserPool + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: UserPoolName: UserPoolName Policies: diff --git a/tests/translator/input/api_with_path_parameters.yaml b/tests/translator/input/api_with_path_parameters.yaml index ac79e312c..0189171e3 100644 --- a/tests/translator/input/api_with_path_parameters.yaml +++ b/tests/translator/input/api_with_path_parameters.yaml @@ -1,6 +1,8 @@ Resources: HtmlFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -15,6 +17,8 @@ Resources: HtmlApi: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod DefinitionUri: s3://sam-demo-bucket/webpage_swagger.json diff --git a/tests/translator/input/api_with_resource_policy.yaml b/tests/translator/input/api_with_resource_policy.yaml index fb9071db2..43ad70d72 100644 --- a/tests/translator/input/api_with_resource_policy.yaml +++ b/tests/translator/input/api_with_resource_policy.yaml @@ -1,6 +1,8 @@ Resources: ExplicitApi: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -11,6 +13,8 @@ Resources: } ExplicitApiFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml diff --git a/tests/translator/input/api_with_resource_policy_global.yaml b/tests/translator/input/api_with_resource_policy_global.yaml index 3bb00a4ef..7a7932dec 100644 --- a/tests/translator/input/api_with_resource_policy_global.yaml +++ b/tests/translator/input/api_with_resource_policy_global.yaml @@ -23,6 +23,8 @@ Globals: Resources: ExplicitApiFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -38,6 +40,8 @@ Resources: ExplicitApi: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: !Ref StageName DefinitionBody: @@ -62,6 +66,8 @@ Resources: Service: 'lambda.amazonaws.com' AnotherApi: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: !Ref StageName Auth: diff --git a/tests/translator/input/api_with_resource_policy_global_implicit.yaml b/tests/translator/input/api_with_resource_policy_global_implicit.yaml index d3599c73c..7bc19c8f1 100644 --- a/tests/translator/input/api_with_resource_policy_global_implicit.yaml +++ b/tests/translator/input/api_with_resource_policy_global_implicit.yaml @@ -1,6 +1,8 @@ Resources: MinimalFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler diff --git a/tests/translator/input/api_with_resource_refs.yaml b/tests/translator/input/api_with_resource_refs.yaml index 3381677ef..19ffa2d75 100644 --- a/tests/translator/input/api_with_resource_refs.yaml +++ b/tests/translator/input/api_with_resource_refs.yaml @@ -3,6 +3,8 @@ Resources: MyApi: Type: 'AWS::Serverless::Api' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: foo DefinitionBody: @@ -11,6 +13,8 @@ Resources: MyFunction: Type: "AWS::Serverless::Function" + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler diff --git a/tests/translator/input/api_with_source_vpc_blacklist.yaml b/tests/translator/input/api_with_source_vpc_blacklist.yaml index 65073bded..82623df15 100644 --- a/tests/translator/input/api_with_source_vpc_blacklist.yaml +++ b/tests/translator/input/api_with_source_vpc_blacklist.yaml @@ -6,6 +6,8 @@ Globals: Resources: MyFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: InlineCode: | exports.handler = async (event) => { diff --git a/tests/translator/output/api_with_cors.json b/tests/translator/output/api_with_cors.json index cfba9bdc4..4ffa1323b 100644 --- a/tests/translator/output/api_with_cors.json +++ b/tests/translator/output/api_with_cors.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ImplicitApiFunctionAnyApiPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -76,6 +82,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -212,6 +220,8 @@ }, "GetHtmlFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -242,6 +252,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymente13d39e2d1" @@ -254,6 +266,8 @@ }, "ServerlessRestApiDeploymente13d39e2d1": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -264,6 +278,8 @@ }, "RestApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -294,6 +310,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -315,6 +333,8 @@ }, "ExplicitApiDeployment3a5a78688c": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -325,6 +345,8 @@ }, "RestApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -348,6 +370,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment3a5a78688c" @@ -360,6 +384,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -496,6 +522,8 @@ }, "GetHtmlFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { diff --git a/tests/translator/output/api_with_cors_openapi_3.json b/tests/translator/output/api_with_cors_openapi_3.json index c23c96f36..df0e2b17e 100644 --- a/tests/translator/output/api_with_cors_openapi_3.json +++ b/tests/translator/output/api_with_cors_openapi_3.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ImplicitApiFunctionAnyApiPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -76,6 +82,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -212,6 +220,8 @@ }, "GetHtmlFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -242,6 +252,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymente3fd36e910" @@ -254,6 +266,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment8cc53ffaa5" @@ -266,6 +280,8 @@ }, "RestApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -296,6 +312,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -317,6 +335,8 @@ }, "ExplicitApiDeployment8cc53ffaa5": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -326,6 +346,8 @@ }, "ServerlessRestApiDeploymente3fd36e910": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -335,6 +357,8 @@ }, "RestApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -358,6 +382,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -490,6 +516,8 @@ }, "GetHtmlFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { diff --git a/tests/translator/output/api_with_custom_domain_route53.json b/tests/translator/output/api_with_custom_domain_route53.json index 6dc75456e..f2efcd556 100644 --- a/tests/translator/output/api_with_custom_domain_route53.json +++ b/tests/translator/output/api_with_custom_domain_route53.json @@ -12,6 +12,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -34,6 +36,8 @@ }, "MyFunctionFetchPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -55,6 +59,8 @@ }, "ApiGatewayDomainName0caaf24ab1": { "Type": "AWS::ApiGateway::DomainName", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "CertificateArn": "cert-arn-in-us-east-1", "EndpointConfiguration": { @@ -67,6 +73,8 @@ }, "RecordSetGroupbd00d962a4": { "Type": "AWS::Route53::RecordSetGroup", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "HostedZoneId": "ZQ1UAL4EFZVME", "RecordSets": [ @@ -101,6 +109,8 @@ }, "MyApiDeploymentf643ef7f59": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -110,6 +120,8 @@ }, "MyApioneBasePathMapping": { "Type": "AWS::ApiGateway::BasePathMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BasePath": "one", "DomainName": { @@ -125,6 +137,8 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeploymentf643ef7f59" @@ -137,6 +151,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -167,6 +183,8 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_with_custom_domain_route53_hosted_zone_name.json b/tests/translator/output/api_with_custom_domain_route53_hosted_zone_name.json index 85799af33..9d12c5440 100644 --- a/tests/translator/output/api_with_custom_domain_route53_hosted_zone_name.json +++ b/tests/translator/output/api_with_custom_domain_route53_hosted_zone_name.json @@ -12,6 +12,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -34,6 +36,8 @@ }, "MyFunctionFetchPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -55,6 +59,8 @@ }, "ApiGatewayDomainName0caaf24ab1": { "Type": "AWS::ApiGateway::DomainName", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "CertificateArn": "cert-arn-in-us-east-1", "EndpointConfiguration": { @@ -67,6 +73,8 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeploymenteb58d7577a" @@ -79,6 +87,8 @@ }, "MyApioneBasePathMapping": { "Type": "AWS::ApiGateway::BasePathMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BasePath": "one", "DomainName": { @@ -94,6 +104,8 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -122,6 +134,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -152,6 +166,8 @@ }, "RecordSetGroup456ebaf280": { "Type": "AWS::Route53::RecordSetGroup", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "HostedZoneName": "www.my-domain.com.", "RecordSets": [ @@ -186,6 +202,8 @@ }, "MyApiDeploymenteb58d7577a": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" diff --git a/tests/translator/output/api_with_custom_domain_route53_hosted_zone_name_http.json b/tests/translator/output/api_with_custom_domain_route53_hosted_zone_name_http.json index d9ffc5aac..710fd4c78 100644 --- a/tests/translator/output/api_with_custom_domain_route53_hosted_zone_name_http.json +++ b/tests/translator/output/api_with_custom_domain_route53_hosted_zone_name_http.json @@ -12,6 +12,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -34,6 +36,8 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -47,6 +51,8 @@ }, "MyApioneApiMapping": { "Type": "AWS::ApiGatewayV2::ApiMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -62,6 +68,8 @@ }, "ApiGatewayDomainNameV20caaf24ab1": { "Type": "AWS::ApiGatewayV2::DomainName", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DomainName": "example.com", "DomainNameConfigurations": [ @@ -77,6 +85,8 @@ }, "RecordSetGroup456ebaf280": { "Type": "AWS::Route53::RecordSetGroup", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "HostedZoneName": "www.my-domain.com.", "RecordSets": [ @@ -103,6 +113,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -133,6 +145,8 @@ }, "MyFunctionFetchPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -154,6 +168,8 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_with_custom_domain_route53_http.json b/tests/translator/output/api_with_custom_domain_route53_http.json index 54e445611..d30fd6cce 100644 --- a/tests/translator/output/api_with_custom_domain_route53_http.json +++ b/tests/translator/output/api_with_custom_domain_route53_http.json @@ -12,6 +12,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -34,6 +36,8 @@ }, "MyApioneApiMapping": { "Type": "AWS::ApiGatewayV2::ApiMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -49,6 +53,8 @@ }, "RecordSetGroupbd00d962a4": { "Type": "AWS::Route53::RecordSetGroup", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "HostedZoneId": "ZQ1UAL4EFZVME", "RecordSets": [ @@ -93,6 +99,8 @@ }, "ApiGatewayDomainNameV20caaf24ab1": { "Type": "AWS::ApiGatewayV2::DomainName", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DomainName": "example.com", "DomainNameConfigurations": [ @@ -108,6 +116,8 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -121,6 +131,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -151,6 +163,8 @@ }, "MyFunctionFetchPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -172,6 +186,8 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_with_default_aws_iam_auth.json b/tests/translator/output/api_with_default_aws_iam_auth.json index 2e805e8af..1c013d873 100644 --- a/tests/translator/output/api_with_default_aws_iam_auth.json +++ b/tests/translator/output/api_with_default_aws_iam_auth.json @@ -2,6 +2,8 @@ "Resources": { "MyApiWithAwsIamAuthDeployment3364487a57": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithAwsIamAuth" @@ -12,6 +14,8 @@ }, "MyFunctionWithAwsIamAuth": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -35,6 +39,8 @@ }, "MyFunctionWithAwsIamAuthMyApiWithAwsIamAuthPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -56,6 +62,8 @@ }, "MyApiWithAwsIamAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithAwsIamAuthDeployment3364487a57" @@ -68,6 +76,8 @@ }, "MyApiWithAwsIamAuthAndDefaultInvokeRoleDeployment1edb95497c": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithAwsIamAuthAndDefaultInvokeRole" @@ -78,6 +88,8 @@ }, "MyFunctionWithAwsIamAuthMyApiWithAwsIamAuthAndDefaultInvokeRolePermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -99,6 +111,8 @@ }, "MyApiWithAwsIamAuthAndCustomInvokeRoleDeployment61108120cf": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithAwsIamAuthAndCustomInvokeRole" @@ -109,6 +123,8 @@ }, "MyApiWithAwsIamAuthAndCustomInvokeRole": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -151,6 +167,8 @@ }, "MyApiWithAwsIamAuthAndDefaultInvokeRoleProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithAwsIamAuthAndDefaultInvokeRoleDeployment1edb95497c" @@ -163,6 +181,8 @@ }, "MyApiWithAwsIamAuthAndCustomInvokeRoleProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithAwsIamAuthAndCustomInvokeRoleDeployment61108120cf" @@ -175,6 +195,8 @@ }, "MyApiWithAwsIamAuthAndDefaultInvokeRole": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -217,6 +239,8 @@ }, "MyApiWithAwsIamAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -259,6 +283,8 @@ }, "MyFunctionWithAwsIamAuthMyApiWithAwsIamAuthAndCustomInvokeRolePermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -280,6 +306,8 @@ }, "MyFunctionWithAwsIamAuthRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/api_with_default_aws_iam_auth_and_no_auth_route.json b/tests/translator/output/api_with_default_aws_iam_auth_and_no_auth_route.json index 0f4214ea7..a9a72ad91 100644 --- a/tests/translator/output/api_with_default_aws_iam_auth_and_no_auth_route.json +++ b/tests/translator/output/api_with_default_aws_iam_auth_and_no_auth_route.json @@ -2,6 +2,8 @@ "Resources": { "MyFunctionWithAwsIamAuth": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -25,6 +27,8 @@ }, "MyFunctionWithAwsIamAuthMyApiWithNoAuthPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -46,6 +50,8 @@ }, "MyFunctionWithAwsIamAuthMyApiWithAwsIamAuthPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -67,6 +73,8 @@ }, "MyApiWithAwsIamAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -124,6 +132,8 @@ }, "MyApiWithAwsIamAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithAwsIamAuthDeploymentd4892df344" @@ -136,6 +146,8 @@ }, "MyApiWithAwsIamAuthDeploymentd4892df344": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithAwsIamAuth" @@ -146,6 +158,8 @@ }, "MyFunctionWithAwsIamAuthRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/api_with_gateway_responses.json b/tests/translator/output/api_with_gateway_responses.json index 21cec903c..d6ae20c93 100644 --- a/tests/translator/output/api_with_gateway_responses.json +++ b/tests/translator/output/api_with_gateway_responses.json @@ -2,6 +2,8 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -94,6 +100,8 @@ }, "ExplicitApiDeploymentf63e40e7e8": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -104,6 +112,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentf63e40e7e8" @@ -116,6 +126,8 @@ }, "FunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/api_with_gateway_responses_all.json b/tests/translator/output/api_with_gateway_responses_all.json index 2df229446..39b8a8bd4 100644 --- a/tests/translator/output/api_with_gateway_responses_all.json +++ b/tests/translator/output/api_with_gateway_responses_all.json @@ -2,6 +2,8 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -103,6 +109,8 @@ }, "ExplicitApiDeploymentedbd8aa001": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -113,6 +121,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentedbd8aa001" @@ -125,6 +135,8 @@ }, "FunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/api_with_gateway_responses_all_openapi_3.json b/tests/translator/output/api_with_gateway_responses_all_openapi_3.json index 3b90ab13e..c267080d5 100644 --- a/tests/translator/output/api_with_gateway_responses_all_openapi_3.json +++ b/tests/translator/output/api_with_gateway_responses_all_openapi_3.json @@ -2,6 +2,8 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ExplicitApiDeploymenta8fcf1dd74": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -64,6 +70,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -112,6 +120,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymenta8fcf1dd74" @@ -124,6 +134,8 @@ }, "FunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/api_with_gateway_responses_implicit.json b/tests/translator/output/api_with_gateway_responses_implicit.json index f2ac689f1..0035e8470 100644 --- a/tests/translator/output/api_with_gateway_responses_implicit.json +++ b/tests/translator/output/api_with_gateway_responses_implicit.json @@ -2,6 +2,8 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "ServerlessRestApiDeploymentf63e40e7e8": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -35,6 +39,8 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -65,6 +71,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentf63e40e7e8" @@ -77,6 +85,8 @@ }, "FunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -98,6 +108,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_with_gateway_responses_minimal.json b/tests/translator/output/api_with_gateway_responses_minimal.json index 7ce2bfc30..eabdaae88 100644 --- a/tests/translator/output/api_with_gateway_responses_minimal.json +++ b/tests/translator/output/api_with_gateway_responses_minimal.json @@ -2,6 +2,8 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -89,6 +95,8 @@ }, "ExplicitApiDeployment43cede1065": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -99,6 +107,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment43cede1065" @@ -111,6 +121,8 @@ }, "FunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/api_with_gateway_responses_string_status_code.json b/tests/translator/output/api_with_gateway_responses_string_status_code.json index 21cec903c..d6ae20c93 100644 --- a/tests/translator/output/api_with_gateway_responses_string_status_code.json +++ b/tests/translator/output/api_with_gateway_responses_string_status_code.json @@ -2,6 +2,8 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -94,6 +100,8 @@ }, "ExplicitApiDeploymentf63e40e7e8": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -104,6 +112,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentf63e40e7e8" @@ -116,6 +126,8 @@ }, "FunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/api_with_if_conditional_with_resource_policy.json b/tests/translator/output/api_with_if_conditional_with_resource_policy.json index 74572a17f..685b59d75 100644 --- a/tests/translator/output/api_with_if_conditional_with_resource_policy.json +++ b/tests/translator/output/api_with_if_conditional_with_resource_policy.json @@ -10,6 +10,8 @@ "Resources": { "ExplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -33,6 +35,8 @@ }, "ExplicitApiFunctionPutHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -54,6 +58,8 @@ }, "ExplicitApiDeploymenta1d4cfbf94": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -64,6 +70,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -133,6 +141,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymenta1d4cfbf94" @@ -145,6 +155,8 @@ }, "ExplicitApiFunctionPostHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -166,6 +178,8 @@ }, "ExplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -196,6 +210,8 @@ }, "ExplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/api_with_incompatible_stage_name.json b/tests/translator/output/api_with_incompatible_stage_name.json index 892f19474..cec8421f0 100644 --- a/tests/translator/output/api_with_incompatible_stage_name.json +++ b/tests/translator/output/api_with_incompatible_stage_name.json @@ -2,6 +2,8 @@ "Resources": { "HyphenApiDeployment19b8787883": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "HyphenApi" @@ -12,6 +14,8 @@ }, "UnderscoreApiStageb34d3ad84e": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "UnderscoreApiDeploymentc6c2bbcee6" @@ -24,6 +28,8 @@ }, "UnderscoreApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -72,6 +78,8 @@ }, "UnderscoreFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -102,6 +110,8 @@ }, "UnderscoreApiDeploymentc6c2bbcee6": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "UnderscoreApi" @@ -112,6 +122,8 @@ }, "HyphenFunctionGetHtmlPermission0c8ecc62cb": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -131,6 +143,8 @@ }, "HyphenApiStage0c8ecc62cb": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "HyphenApiDeployment19b8787883" @@ -143,6 +157,8 @@ }, "UnderscoreFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -166,6 +182,8 @@ }, "UnderscoreFunctionGetHtmlPermissionb34d3ad84e": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -185,6 +203,8 @@ }, "HyphenFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -208,6 +228,8 @@ }, "HyphenApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -256,6 +278,8 @@ }, "HyphenFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/api_with_ip_range_blacklist.json b/tests/translator/output/api_with_ip_range_blacklist.json index ae55e7870..c211c3bfd 100644 --- a/tests/translator/output/api_with_ip_range_blacklist.json +++ b/tests/translator/output/api_with_ip_range_blacklist.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -24,6 +26,8 @@ }, "ServerlessRestApiDeploymentd123ec976c": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -34,6 +38,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentd123ec976c" @@ -46,6 +52,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -76,6 +84,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -165,6 +175,8 @@ }, "MyFunctionApiPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/api_with_ip_range_whitelist.json b/tests/translator/output/api_with_ip_range_whitelist.json index 3093550ef..fe8670a50 100644 --- a/tests/translator/output/api_with_ip_range_whitelist.json +++ b/tests/translator/output/api_with_ip_range_whitelist.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -24,6 +26,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment864f081ed8" @@ -36,6 +40,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -66,6 +72,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -158,6 +166,8 @@ }, "ServerlessRestApiDeployment864f081ed8": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -168,6 +178,8 @@ }, "MyFunctionApiPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/api_with_method_aws_iam_auth.json b/tests/translator/output/api_with_method_aws_iam_auth.json index 09de6a24d..d93e19f93 100644 --- a/tests/translator/output/api_with_method_aws_iam_auth.json +++ b/tests/translator/output/api_with_method_aws_iam_auth.json @@ -2,6 +2,8 @@ "Resources": { "MyFunctionWithAwsIamAuthMyApiWithAwsIamAuthPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -23,6 +25,8 @@ }, "MyFunctionWithAwsIamAuthMyApiWithAwsIamAuthAndCustomInvokeRolePermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -44,6 +48,8 @@ }, "MyApiWithoutAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -118,6 +124,8 @@ }, "MyFunctionWithAwsIamAuthMyApiWithAwsIamAuthAndDefaultInvokeRolePermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -139,6 +147,8 @@ }, "MyFunctionWithAwsIamAuth": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -162,6 +172,8 @@ }, "MyApiWithoutAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithoutAuthDeployment0cf1ab8c4c" @@ -174,6 +186,8 @@ }, "MyApiWithoutAuthDeployment0cf1ab8c4c": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithoutAuth" @@ -184,6 +198,8 @@ }, "MyFunctionWithAwsIamAuthRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/api_with_method_settings.json b/tests/translator/output/api_with_method_settings.json index 4f6c874ed..750d5f1c3 100644 --- a/tests/translator/output/api_with_method_settings.json +++ b/tests/translator/output/api_with_method_settings.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ExplicitApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -65,6 +71,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -86,6 +94,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BodyS3Location": { "Bucket": "sam-demo-bucket", @@ -95,6 +105,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "MethodSettings": [ { @@ -116,6 +128,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "MethodSettings": [ { @@ -137,6 +151,8 @@ }, "ServerlessRestApiDeployment62b96c1a61": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -147,6 +163,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_with_minimum_compression_size.json b/tests/translator/output/api_with_minimum_compression_size.json index dba335192..cb966a430 100644 --- a/tests/translator/output/api_with_minimum_compression_size.json +++ b/tests/translator/output/api_with_minimum_compression_size.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ExplicitApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -65,6 +71,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -86,6 +94,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "MinimumCompressionSize": 256, "BodyS3Location": { @@ -96,6 +106,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentf117c932f7" @@ -108,6 +120,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment62b96c1a61" @@ -120,6 +134,8 @@ }, "ServerlessRestApiDeployment62b96c1a61": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -130,6 +146,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_with_open_api_version.json b/tests/translator/output/api_with_open_api_version.json index 165c18aa8..da99127d6 100644 --- a/tests/translator/output/api_with_open_api_version.json +++ b/tests/translator/output/api_with_open_api_version.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ServerlessRestApiDeployment1471b71104": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -64,6 +70,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -85,6 +93,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -100,6 +110,8 @@ }, "ExplicitApiDeploymentd9a0f2ae4f": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -109,6 +121,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment1471b71104" @@ -121,6 +135,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentd9a0f2ae4f" @@ -133,6 +149,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_with_open_api_version_2.json b/tests/translator/output/api_with_open_api_version_2.json index b357135d6..ab9fbd285 100644 --- a/tests/translator/output/api_with_open_api_version_2.json +++ b/tests/translator/output/api_with_open_api_version_2.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -76,6 +82,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -91,6 +99,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment4154e1c30c" @@ -103,6 +113,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment32f05a472e" @@ -115,6 +127,8 @@ }, "ServerlessRestApiDeployment32f05a472e": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -124,6 +138,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -192,6 +208,8 @@ }, "ExplicitApiDeployment4154e1c30c": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" diff --git a/tests/translator/output/api_with_openapi_definition_body_no_flag.json b/tests/translator/output/api_with_openapi_definition_body_no_flag.json index 2cf200b3b..e4da950ae 100644 --- a/tests/translator/output/api_with_openapi_definition_body_no_flag.json +++ b/tests/translator/output/api_with_openapi_definition_body_no_flag.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ExplicitApiDeployment9252467a1e": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -65,6 +71,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -120,6 +128,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -137,6 +147,8 @@ }, "ServerlessRestApiDeploymentdb4b9da82a": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -147,6 +159,8 @@ }, "ExplicitApiSomeStageStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -164,6 +178,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -185,6 +201,8 @@ }, "MyUserPool": { "Type": "AWS::Cognito::UserPool", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "UsernameAttributes": [ "email" @@ -206,6 +224,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_with_path_parameters.json b/tests/translator/output/api_with_path_parameters.json index 7415250d2..1fd1507c5 100644 --- a/tests/translator/output/api_with_path_parameters.json +++ b/tests/translator/output/api_with_path_parameters.json @@ -2,6 +2,8 @@ "Resources": { "HtmlFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -32,6 +34,8 @@ }, "HtmlApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "HtmlApiDeploymentf117c932f7" @@ -44,6 +48,8 @@ }, "HtmlFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -63,6 +69,8 @@ }, "HtmlApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "HtmlApi" @@ -73,6 +81,8 @@ }, "HtmlApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BodyS3Location": { "Bucket": "sam-demo-bucket", @@ -82,6 +92,8 @@ }, "HtmlFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/api_with_resource_policy.json b/tests/translator/output/api_with_resource_policy.json index 4fd6e00f6..e93a78e9e 100644 --- a/tests/translator/output/api_with_resource_policy.json +++ b/tests/translator/output/api_with_resource_policy.json @@ -2,6 +2,8 @@ "Resources": { "ExplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "ExplicitApiFunctionPutHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -46,6 +50,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -107,6 +113,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment215ee6137d" @@ -119,6 +127,8 @@ }, "ExplicitApiFunctionPostHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -140,6 +150,8 @@ }, "ExplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -170,6 +182,8 @@ }, "ExplicitApiDeployment215ee6137d": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -180,6 +194,8 @@ }, "ExplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/api_with_resource_policy_global.json b/tests/translator/output/api_with_resource_policy_global.json index 15b8d9910..666d7f525 100644 --- a/tests/translator/output/api_with_resource_policy_global.json +++ b/tests/translator/output/api_with_resource_policy_global.json @@ -16,6 +16,8 @@ "Resources": { "AnotherApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -51,6 +53,8 @@ }, "ExplicitApiDeploymenta5a5c4e3ff": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -61,6 +65,8 @@ }, "ExplicitApiStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymenta5a5c4e3ff" @@ -75,6 +81,8 @@ }, "ExplicitApiFunctionGetHtmlPermissionStage": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -96,6 +104,8 @@ }, "AnotherApiDeploymentfdf1387e0a": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "AnotherApi" @@ -106,6 +116,8 @@ }, "ExplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -129,6 +141,8 @@ }, "ExplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -159,6 +173,8 @@ }, "AnotherApiStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "AnotherApiDeploymentfdf1387e0a" @@ -173,6 +189,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_with_resource_policy_global_implicit.json b/tests/translator/output/api_with_resource_policy_global_implicit.json index b8a576235..991838ecb 100644 --- a/tests/translator/output/api_with_resource_policy_global_implicit.json +++ b/tests/translator/output/api_with_resource_policy_global_implicit.json @@ -2,6 +2,8 @@ "Resources": { "MinimalFunctionAddItemPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -23,6 +25,8 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -53,6 +57,8 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -76,6 +82,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment1ecad21e32" @@ -88,6 +96,8 @@ }, "ServerlessRestApiDeployment1ecad21e32": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -98,6 +108,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_with_resource_refs.json b/tests/translator/output/api_with_resource_refs.json index 2765deb4e..73bcfea74 100644 --- a/tests/translator/output/api_with_resource_refs.json +++ b/tests/translator/output/api_with_resource_refs.json @@ -24,6 +24,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -47,6 +49,8 @@ }, "MyApiDeployment359f256a3b": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -57,6 +61,8 @@ }, "MyApifooStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment359f256a3b" @@ -69,6 +75,8 @@ }, "ServerlessRestApiDeploymente468b80e17": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -79,6 +87,8 @@ }, "MyFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -100,6 +110,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymente468b80e17" @@ -112,6 +124,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -142,6 +156,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -170,6 +186,8 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "this": "is", diff --git a/tests/translator/output/api_with_source_vpc_blacklist.json b/tests/translator/output/api_with_source_vpc_blacklist.json index 3923d1d60..39b9a5406 100644 --- a/tests/translator/output/api_with_source_vpc_blacklist.json +++ b/tests/translator/output/api_with_source_vpc_blacklist.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -24,6 +26,8 @@ }, "ServerlessRestApiDeployment0e25d06cd3": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -34,6 +38,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment0e25d06cd3" @@ -46,6 +52,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -76,6 +84,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -146,6 +156,8 @@ }, "MyFunctionApiPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-cn/api_with_cors.json b/tests/translator/output/aws-cn/api_with_cors.json index 0abca4a3b..6d1d75eeb 100644 --- a/tests/translator/output/aws-cn/api_with_cors.json +++ b/tests/translator/output/aws-cn/api_with_cors.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ImplicitApiFunctionAnyApiPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -76,6 +82,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -220,6 +228,8 @@ }, "GetHtmlFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -250,6 +260,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentdb43b8746d" @@ -262,6 +274,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment3a5a78688c" @@ -274,6 +288,8 @@ }, "RestApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -304,6 +320,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -325,6 +343,8 @@ }, "ExplicitApiDeployment3a5a78688c": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -335,6 +355,8 @@ }, "RestApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -358,6 +380,8 @@ }, "ServerlessRestApiDeploymentdb43b8746d": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -368,6 +392,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -512,6 +538,8 @@ }, "GetHtmlFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { diff --git a/tests/translator/output/aws-cn/api_with_cors_openapi_3.json b/tests/translator/output/aws-cn/api_with_cors_openapi_3.json index e814d0d1c..18d2c7665 100644 --- a/tests/translator/output/aws-cn/api_with_cors_openapi_3.json +++ b/tests/translator/output/aws-cn/api_with_cors_openapi_3.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ServerlessRestApiDeployment147347629d": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -64,6 +70,8 @@ }, "ImplicitApiFunctionAnyApiPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -85,6 +93,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -229,6 +239,8 @@ }, "GetHtmlFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -259,6 +271,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment147347629d" @@ -271,6 +285,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment8cc53ffaa5" @@ -283,6 +299,8 @@ }, "RestApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -313,6 +331,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -334,6 +354,8 @@ }, "ExplicitApiDeployment8cc53ffaa5": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -343,6 +365,8 @@ }, "RestApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -366,6 +390,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -506,6 +532,8 @@ }, "GetHtmlFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { diff --git a/tests/translator/output/aws-cn/api_with_custom_domain_route53.json b/tests/translator/output/aws-cn/api_with_custom_domain_route53.json index 8637e03b3..e74aee747 100644 --- a/tests/translator/output/aws-cn/api_with_custom_domain_route53.json +++ b/tests/translator/output/aws-cn/api_with_custom_domain_route53.json @@ -12,6 +12,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -34,6 +36,8 @@ }, "MyFunctionFetchPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -55,6 +59,8 @@ }, "ApiGatewayDomainName0caaf24ab1": { "Type": "AWS::ApiGateway::DomainName", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "CertificateArn": "cert-arn-in-us-east-1", "EndpointConfiguration": { @@ -67,6 +73,8 @@ }, "RecordSetGroupbd00d962a4": { "Type": "AWS::Route53::RecordSetGroup", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "HostedZoneId": "ZQ1UAL4EFZVME", "RecordSets": [ @@ -101,6 +109,8 @@ }, "MyApioneBasePathMapping": { "Type": "AWS::ApiGateway::BasePathMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BasePath": "one", "DomainName": { @@ -116,6 +126,8 @@ }, "MyApiDeploymentfb330328f1": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -125,6 +137,8 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeploymentfb330328f1" @@ -137,6 +151,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -167,6 +183,8 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_custom_domain_route53_hosted_zone_name.json b/tests/translator/output/aws-cn/api_with_custom_domain_route53_hosted_zone_name.json index 98a21b9e2..9179107a3 100644 --- a/tests/translator/output/aws-cn/api_with_custom_domain_route53_hosted_zone_name.json +++ b/tests/translator/output/aws-cn/api_with_custom_domain_route53_hosted_zone_name.json @@ -12,6 +12,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -34,6 +36,8 @@ }, "MyFunctionFetchPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -55,6 +59,8 @@ }, "ApiGatewayDomainName0caaf24ab1": { "Type": "AWS::ApiGateway::DomainName", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "CertificateArn": "cert-arn-in-us-east-1", "EndpointConfiguration": { @@ -67,6 +73,8 @@ }, "MyApiDeployment9239fa9a13": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -76,6 +84,8 @@ }, "MyApioneBasePathMapping": { "Type": "AWS::ApiGateway::BasePathMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BasePath": "one", "DomainName": { @@ -91,6 +101,8 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment9239fa9a13" @@ -103,6 +115,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -133,6 +147,8 @@ }, "RecordSetGroup456ebaf280": { "Type": "AWS::Route53::RecordSetGroup", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "HostedZoneName": "www.my-domain.com.", "RecordSets": [ @@ -167,6 +183,8 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_custom_domain_route53_hosted_zone_name_http.json b/tests/translator/output/aws-cn/api_with_custom_domain_route53_hosted_zone_name_http.json index 351eeedb8..5c1103f7a 100644 --- a/tests/translator/output/aws-cn/api_with_custom_domain_route53_hosted_zone_name_http.json +++ b/tests/translator/output/aws-cn/api_with_custom_domain_route53_hosted_zone_name_http.json @@ -12,6 +12,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -34,6 +36,8 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -47,6 +51,8 @@ }, "MyApioneApiMapping": { "Type": "AWS::ApiGatewayV2::ApiMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -62,6 +68,8 @@ }, "ApiGatewayDomainNameV20caaf24ab1": { "Type": "AWS::ApiGatewayV2::DomainName", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DomainName": "example.com", "DomainNameConfigurations": [ @@ -77,6 +85,8 @@ }, "RecordSetGroup456ebaf280": { "Type": "AWS::Route53::RecordSetGroup", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "HostedZoneName": "www.my-domain.com.", "RecordSets": [ @@ -103,6 +113,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -133,6 +145,8 @@ }, "MyFunctionFetchPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -154,6 +168,8 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_custom_domain_route53_http.json b/tests/translator/output/aws-cn/api_with_custom_domain_route53_http.json index 34e7a8e9d..5207014f2 100644 --- a/tests/translator/output/aws-cn/api_with_custom_domain_route53_http.json +++ b/tests/translator/output/aws-cn/api_with_custom_domain_route53_http.json @@ -12,6 +12,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -34,6 +36,8 @@ }, "MyApioneApiMapping": { "Type": "AWS::ApiGatewayV2::ApiMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -49,6 +53,8 @@ }, "RecordSetGroupbd00d962a4": { "Type": "AWS::Route53::RecordSetGroup", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "HostedZoneId": "ZQ1UAL4EFZVME", "RecordSets": [ @@ -93,6 +99,8 @@ }, "ApiGatewayDomainNameV20caaf24ab1": { "Type": "AWS::ApiGatewayV2::DomainName", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DomainName": "example.com", "DomainNameConfigurations": [ @@ -108,6 +116,8 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -121,6 +131,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -151,6 +163,8 @@ }, "MyFunctionFetchPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -172,6 +186,8 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_default_aws_iam_auth.json b/tests/translator/output/aws-cn/api_with_default_aws_iam_auth.json index 4173a6f21..dbdcae116 100644 --- a/tests/translator/output/aws-cn/api_with_default_aws_iam_auth.json +++ b/tests/translator/output/aws-cn/api_with_default_aws_iam_auth.json @@ -2,6 +2,8 @@ "Resources": { "MyFunctionWithAwsIamAuth": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -25,6 +27,8 @@ }, "MyApiWithAwsIamAuthAndDefaultInvokeRoleDeploymentd0103947f7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithAwsIamAuthAndDefaultInvokeRole" @@ -35,6 +39,8 @@ }, "MyFunctionWithAwsIamAuthMyApiWithAwsIamAuthPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -56,6 +62,8 @@ }, "MyApiWithAwsIamAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithAwsIamAuthDeploymentc8adfb74cf" @@ -68,6 +76,8 @@ }, "MyApiWithAwsIamAuthAndDefaultInvokeRoleProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithAwsIamAuthAndDefaultInvokeRoleDeploymentd0103947f7" @@ -80,6 +90,8 @@ }, "MyFunctionWithAwsIamAuthMyApiWithAwsIamAuthAndDefaultInvokeRolePermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -101,6 +113,8 @@ }, "MyApiWithAwsIamAuthDeploymentc8adfb74cf": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithAwsIamAuth" @@ -111,6 +125,8 @@ }, "MyApiWithAwsIamAuthAndCustomInvokeRole": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -161,6 +177,8 @@ }, "MyApiWithAwsIamAuthAndCustomInvokeRoleProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithAwsIamAuthAndCustomInvokeRoleDeployment2a6ecd9264" @@ -173,6 +191,8 @@ }, "MyApiWithAwsIamAuthAndDefaultInvokeRole": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -223,6 +243,8 @@ }, "MyApiWithAwsIamAuthAndCustomInvokeRoleDeployment2a6ecd9264": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithAwsIamAuthAndCustomInvokeRole" @@ -233,6 +255,8 @@ }, "MyApiWithAwsIamAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -283,6 +307,8 @@ }, "MyFunctionWithAwsIamAuthMyApiWithAwsIamAuthAndCustomInvokeRolePermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -304,6 +330,8 @@ }, "MyFunctionWithAwsIamAuthRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-cn/api_with_default_aws_iam_auth_and_no_auth_route.json b/tests/translator/output/aws-cn/api_with_default_aws_iam_auth_and_no_auth_route.json index 23ee4b243..d15921d08 100644 --- a/tests/translator/output/aws-cn/api_with_default_aws_iam_auth_and_no_auth_route.json +++ b/tests/translator/output/aws-cn/api_with_default_aws_iam_auth_and_no_auth_route.json @@ -2,6 +2,8 @@ "Resources": { "MyApiWithAwsIamAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithAwsIamAuthDeployment0c9ba99bc2" @@ -14,6 +16,8 @@ }, "MyFunctionWithAwsIamAuth": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -37,6 +41,8 @@ }, "MyFunctionWithAwsIamAuthMyApiWithNoAuthPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -58,6 +64,8 @@ }, "MyFunctionWithAwsIamAuthMyApiWithAwsIamAuthPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -79,6 +87,8 @@ }, "MyApiWithAwsIamAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -144,6 +154,8 @@ }, "MyApiWithAwsIamAuthDeployment0c9ba99bc2": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithAwsIamAuth" @@ -154,6 +166,8 @@ }, "MyFunctionWithAwsIamAuthRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-cn/api_with_gateway_responses.json b/tests/translator/output/aws-cn/api_with_gateway_responses.json index a0eb308b6..068865b87 100644 --- a/tests/translator/output/aws-cn/api_with_gateway_responses.json +++ b/tests/translator/output/aws-cn/api_with_gateway_responses.json @@ -2,6 +2,8 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "ExplicitApiDeployment9196b651da": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -35,6 +39,8 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -65,6 +71,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -112,6 +120,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment9196b651da" @@ -124,6 +134,8 @@ }, "FunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-cn/api_with_gateway_responses_all.json b/tests/translator/output/aws-cn/api_with_gateway_responses_all.json index 3605cc0c2..3cbc34659 100644 --- a/tests/translator/output/aws-cn/api_with_gateway_responses_all.json +++ b/tests/translator/output/aws-cn/api_with_gateway_responses_all.json @@ -2,6 +2,8 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ExplicitApiDeploymenta27cf1b1d7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -65,6 +71,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -121,6 +129,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymenta27cf1b1d7" @@ -133,6 +143,8 @@ }, "FunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-cn/api_with_gateway_responses_all_openapi_3.json b/tests/translator/output/aws-cn/api_with_gateway_responses_all_openapi_3.json index 140250a6b..e3e6abb81 100644 --- a/tests/translator/output/aws-cn/api_with_gateway_responses_all_openapi_3.json +++ b/tests/translator/output/aws-cn/api_with_gateway_responses_all_openapi_3.json @@ -2,6 +2,8 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "ExplicitApiDeploymenta2f31986fe": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -34,6 +38,8 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -64,6 +70,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -120,6 +128,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymenta2f31986fe" @@ -132,6 +142,8 @@ }, "FunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-cn/api_with_gateway_responses_implicit.json b/tests/translator/output/aws-cn/api_with_gateway_responses_implicit.json index cb116f10e..6f9ccf99a 100644 --- a/tests/translator/output/aws-cn/api_with_gateway_responses_implicit.json +++ b/tests/translator/output/aws-cn/api_with_gateway_responses_implicit.json @@ -2,6 +2,8 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ServerlessRestApiDeployment9196b651da": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -65,6 +71,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment9196b651da" @@ -77,6 +85,8 @@ }, "FunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -98,6 +108,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_gateway_responses_minimal.json b/tests/translator/output/aws-cn/api_with_gateway_responses_minimal.json index fdc244668..ca11e8c89 100644 --- a/tests/translator/output/aws-cn/api_with_gateway_responses_minimal.json +++ b/tests/translator/output/aws-cn/api_with_gateway_responses_minimal.json @@ -2,6 +2,8 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -97,6 +103,8 @@ }, "ExplicitApiDeployment8f2919f3e3": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -107,6 +115,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment8f2919f3e3" @@ -119,6 +129,8 @@ }, "FunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-cn/api_with_gateway_responses_string_status_code.json b/tests/translator/output/aws-cn/api_with_gateway_responses_string_status_code.json index a0eb308b6..068865b87 100644 --- a/tests/translator/output/aws-cn/api_with_gateway_responses_string_status_code.json +++ b/tests/translator/output/aws-cn/api_with_gateway_responses_string_status_code.json @@ -2,6 +2,8 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "ExplicitApiDeployment9196b651da": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -35,6 +39,8 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -65,6 +71,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -112,6 +120,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment9196b651da" @@ -124,6 +134,8 @@ }, "FunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-cn/api_with_if_conditional_with_resource_policy.json b/tests/translator/output/aws-cn/api_with_if_conditional_with_resource_policy.json index a5ab0daf8..c9e919ab2 100644 --- a/tests/translator/output/aws-cn/api_with_if_conditional_with_resource_policy.json +++ b/tests/translator/output/aws-cn/api_with_if_conditional_with_resource_policy.json @@ -10,6 +10,8 @@ "Resources": { "ExplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -33,6 +35,8 @@ }, "ExplicitApiFunctionPutHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -54,6 +58,8 @@ }, "ExplicitApiDeployment1864127303": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -64,6 +70,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -141,6 +149,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment1864127303" @@ -153,6 +163,8 @@ }, "ExplicitApiFunctionPostHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -174,6 +186,8 @@ }, "ExplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -204,6 +218,8 @@ }, "ExplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-cn/api_with_incompatible_stage_name.json b/tests/translator/output/aws-cn/api_with_incompatible_stage_name.json index 0cf9ef165..fd1c1c849 100644 --- a/tests/translator/output/aws-cn/api_with_incompatible_stage_name.json +++ b/tests/translator/output/aws-cn/api_with_incompatible_stage_name.json @@ -2,6 +2,8 @@ "Resources": { "UnderscoreApiStageb34d3ad84e": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "UnderscoreApiDeploymentd4074182ff" @@ -14,6 +16,8 @@ }, "UnderscoreApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -70,6 +74,8 @@ }, "UnderscoreFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -100,6 +106,8 @@ }, "UnderscoreApiDeploymentd4074182ff": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "UnderscoreApi" @@ -110,6 +118,8 @@ }, "HyphenFunctionGetHtmlPermission0c8ecc62cb": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -129,6 +139,8 @@ }, "HyphenApiStage0c8ecc62cb": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "HyphenApiDeployment52a312db45" @@ -141,6 +153,8 @@ }, "UnderscoreFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -164,6 +178,8 @@ }, "UnderscoreFunctionGetHtmlPermissionb34d3ad84e": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -183,6 +199,8 @@ }, "HyphenFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -206,6 +224,8 @@ }, "HyphenApiDeployment52a312db45": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "HyphenApi" @@ -216,6 +236,8 @@ }, "HyphenApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -272,6 +294,8 @@ }, "HyphenFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-cn/api_with_ip_range_blacklist.json b/tests/translator/output/aws-cn/api_with_ip_range_blacklist.json index f876a1bd8..cf6023d58 100644 --- a/tests/translator/output/aws-cn/api_with_ip_range_blacklist.json +++ b/tests/translator/output/aws-cn/api_with_ip_range_blacklist.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -24,6 +26,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment5e467ed97e" @@ -36,6 +40,8 @@ }, "MyFunctionApiPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -57,6 +63,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -87,6 +95,8 @@ }, "ServerlessRestApiDeployment5e467ed97e": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -97,6 +107,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_ip_range_whitelist.json b/tests/translator/output/aws-cn/api_with_ip_range_whitelist.json index a9d254e50..6cc214e08 100644 --- a/tests/translator/output/aws-cn/api_with_ip_range_whitelist.json +++ b/tests/translator/output/aws-cn/api_with_ip_range_whitelist.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -24,6 +26,8 @@ }, "ServerlessRestApiDeployment4dbd43b8e2": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -34,6 +38,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment4dbd43b8e2" @@ -46,6 +52,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -76,6 +84,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -176,6 +186,8 @@ }, "MyFunctionApiPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-cn/api_with_method_aws_iam_auth.json b/tests/translator/output/aws-cn/api_with_method_aws_iam_auth.json index cb9023e9e..58c9ff8a9 100644 --- a/tests/translator/output/aws-cn/api_with_method_aws_iam_auth.json +++ b/tests/translator/output/aws-cn/api_with_method_aws_iam_auth.json @@ -2,6 +2,8 @@ "Resources": { "MyFunctionWithAwsIamAuthMyApiWithAwsIamAuthPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -23,6 +25,8 @@ }, "MyApiWithoutAuthDeployment82d56c6578": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithoutAuth" @@ -33,6 +37,8 @@ }, "MyApiWithoutAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -115,6 +121,8 @@ }, "MyFunctionWithAwsIamAuthMyApiWithAwsIamAuthAndDefaultInvokeRolePermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -136,6 +144,8 @@ }, "MyFunctionWithAwsIamAuth": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -159,6 +169,8 @@ }, "MyApiWithoutAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithoutAuthDeployment82d56c6578" @@ -171,6 +183,8 @@ }, "MyFunctionWithAwsIamAuthMyApiWithAwsIamAuthAndCustomInvokeRolePermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -192,6 +206,8 @@ }, "MyFunctionWithAwsIamAuthRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-cn/api_with_method_settings.json b/tests/translator/output/aws-cn/api_with_method_settings.json index 5e09017cd..d487578ad 100644 --- a/tests/translator/output/aws-cn/api_with_method_settings.json +++ b/tests/translator/output/aws-cn/api_with_method_settings.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -76,6 +82,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -93,6 +101,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "MethodSettings": [ { @@ -114,6 +124,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "MethodSettings": [ { @@ -135,6 +147,8 @@ }, "ServerlessRestApiDeploymentcb4fb12558": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -145,6 +159,8 @@ }, "ExplicitApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -155,6 +171,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_minimum_compression_size.json b/tests/translator/output/aws-cn/api_with_minimum_compression_size.json index ce1ad07b6..80b064dfc 100644 --- a/tests/translator/output/aws-cn/api_with_minimum_compression_size.json +++ b/tests/translator/output/aws-cn/api_with_minimum_compression_size.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -76,6 +82,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "MinimumCompressionSize": 256, "EndpointConfiguration": { @@ -94,6 +102,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentf117c932f7" @@ -106,6 +116,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentcb4fb12558" @@ -118,6 +130,8 @@ }, "ServerlessRestApiDeploymentcb4fb12558": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -128,6 +142,8 @@ }, "ExplicitApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -138,6 +154,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_open_api_version.json b/tests/translator/output/aws-cn/api_with_open_api_version.json index 5a8bc7db5..5fbf5383b 100644 --- a/tests/translator/output/aws-cn/api_with_open_api_version.json +++ b/tests/translator/output/aws-cn/api_with_open_api_version.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -76,6 +82,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -99,6 +107,8 @@ }, "ExplicitApiDeploymentd9a0f2ae4f": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -108,6 +118,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment75f93f5c08" @@ -120,6 +132,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentd9a0f2ae4f" @@ -132,6 +146,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -206,6 +222,8 @@ }, "ServerlessRestApiDeployment75f93f5c08": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" diff --git a/tests/translator/output/aws-cn/api_with_open_api_version_2.json b/tests/translator/output/aws-cn/api_with_open_api_version_2.json index c86109c06..cee6fa433 100644 --- a/tests/translator/output/aws-cn/api_with_open_api_version_2.json +++ b/tests/translator/output/aws-cn/api_with_open_api_version_2.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -76,6 +82,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -99,6 +107,8 @@ }, "ServerlessRestApiDeployment3146d7e6fb": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -108,6 +118,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment3146d7e6fb" @@ -120,6 +132,8 @@ }, "ExplicitApiDeployment4154e1c30c": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -129,6 +143,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -205,6 +221,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment4154e1c30c" diff --git a/tests/translator/output/aws-cn/api_with_openapi_definition_body_no_flag.json b/tests/translator/output/aws-cn/api_with_openapi_definition_body_no_flag.json index 23804071b..b870549a8 100644 --- a/tests/translator/output/aws-cn/api_with_openapi_definition_body_no_flag.json +++ b/tests/translator/output/aws-cn/api_with_openapi_definition_body_no_flag.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ExplicitApiDeployment9252467a1e": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -65,6 +71,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -128,6 +136,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -145,6 +155,8 @@ }, "ServerlessRestApiDeploymente1212668e0": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -155,6 +167,8 @@ }, "ExplicitApiSomeStageStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -172,6 +186,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -193,6 +209,8 @@ }, "MyUserPool": { "Type": "AWS::Cognito::UserPool", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "UsernameAttributes": [ "email" @@ -214,6 +232,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_path_parameters.json b/tests/translator/output/aws-cn/api_with_path_parameters.json index 89289052b..1616543c8 100644 --- a/tests/translator/output/aws-cn/api_with_path_parameters.json +++ b/tests/translator/output/aws-cn/api_with_path_parameters.json @@ -2,6 +2,8 @@ "Resources": { "HtmlFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -32,6 +34,8 @@ }, "HtmlApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "HtmlApiDeploymentf117c932f7" @@ -44,6 +48,8 @@ }, "HtmlFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -63,6 +69,8 @@ }, "HtmlApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "HtmlApi" @@ -73,6 +81,8 @@ }, "HtmlApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -90,6 +100,8 @@ }, "HtmlFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-cn/api_with_resource_policy.json b/tests/translator/output/aws-cn/api_with_resource_policy.json index b7299850f..11a3af857 100644 --- a/tests/translator/output/aws-cn/api_with_resource_policy.json +++ b/tests/translator/output/aws-cn/api_with_resource_policy.json @@ -2,6 +2,8 @@ "Resources": { "ExplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "ExplicitApiFunctionPutHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -46,6 +50,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -115,6 +121,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment39d7eca1e3" @@ -127,6 +135,8 @@ }, "ExplicitApiFunctionPostHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -148,6 +158,8 @@ }, "ExplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -178,6 +190,8 @@ }, "ExplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -199,6 +213,8 @@ }, "ExplicitApiDeployment39d7eca1e3": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" diff --git a/tests/translator/output/aws-cn/api_with_resource_policy_global.json b/tests/translator/output/aws-cn/api_with_resource_policy_global.json index 0d7c8c732..2a6f60c1b 100644 --- a/tests/translator/output/aws-cn/api_with_resource_policy_global.json +++ b/tests/translator/output/aws-cn/api_with_resource_policy_global.json @@ -16,6 +16,8 @@ "Resources": { "AnotherApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -59,6 +61,8 @@ }, "ExplicitApiDeploymenta5a5c4e3ff": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -69,6 +73,8 @@ }, "ExplicitApiStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymenta5a5c4e3ff" @@ -83,6 +89,8 @@ }, "ExplicitApiFunctionGetHtmlPermissionStage": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -104,6 +112,8 @@ }, "AnotherApiDeploymentfdf1387e0a": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "AnotherApi" @@ -114,6 +124,8 @@ }, "ExplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -137,6 +149,8 @@ }, "ExplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -167,6 +181,8 @@ }, "AnotherApiStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "AnotherApiDeploymentfdf1387e0a" @@ -181,6 +197,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_resource_policy_global_implicit.json b/tests/translator/output/aws-cn/api_with_resource_policy_global_implicit.json index d693a4805..f50769759 100644 --- a/tests/translator/output/aws-cn/api_with_resource_policy_global_implicit.json +++ b/tests/translator/output/aws-cn/api_with_resource_policy_global_implicit.json @@ -2,6 +2,8 @@ "Resources": { "MinimalFunctionAddItemPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -23,6 +25,8 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -53,6 +57,8 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -76,6 +82,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment0ff9f5a989" @@ -88,6 +96,8 @@ }, "ServerlessRestApiDeployment0ff9f5a989": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -98,6 +108,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_resource_refs.json b/tests/translator/output/aws-cn/api_with_resource_refs.json index 78488a30b..799d54379 100644 --- a/tests/translator/output/aws-cn/api_with_resource_refs.json +++ b/tests/translator/output/aws-cn/api_with_resource_refs.json @@ -24,6 +24,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -47,6 +49,8 @@ }, "MyApiDeployment359f256a3b": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -57,6 +61,8 @@ }, "MyApifooStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment359f256a3b" @@ -69,6 +75,8 @@ }, "ServerlessRestApiDeployment8b5ecabf9b": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -79,6 +87,8 @@ }, "MyFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -100,6 +110,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment8b5ecabf9b" @@ -112,6 +124,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -142,6 +156,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -178,6 +194,8 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "this": "is", diff --git a/tests/translator/output/aws-cn/api_with_source_vpc_blacklist.json b/tests/translator/output/aws-cn/api_with_source_vpc_blacklist.json index 6dfbef3fa..61e8a6bbf 100644 --- a/tests/translator/output/aws-cn/api_with_source_vpc_blacklist.json +++ b/tests/translator/output/aws-cn/api_with_source_vpc_blacklist.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -24,6 +26,8 @@ }, "ServerlessRestApiDeploymentb8219b2586": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -34,6 +38,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentb8219b2586" @@ -46,6 +52,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -76,6 +84,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -154,6 +164,8 @@ }, "MyFunctionApiPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/api_with_cors.json b/tests/translator/output/aws-us-gov/api_with_cors.json index 369d19951..04e531295 100644 --- a/tests/translator/output/aws-us-gov/api_with_cors.json +++ b/tests/translator/output/aws-us-gov/api_with_cors.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ImplicitApiFunctionAnyApiPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -76,6 +82,8 @@ }, "ServerlessRestApiDeployment1754a26207": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -86,6 +94,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -230,6 +240,8 @@ }, "GetHtmlFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -260,6 +272,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment1754a26207" @@ -272,6 +286,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment3a5a78688c" @@ -284,6 +300,8 @@ }, "RestApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -314,6 +332,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -335,6 +355,8 @@ }, "ExplicitApiDeployment3a5a78688c": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -345,6 +367,8 @@ }, "RestApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -368,6 +392,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -512,6 +538,8 @@ }, "GetHtmlFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { diff --git a/tests/translator/output/aws-us-gov/api_with_cors_openapi_3.json b/tests/translator/output/aws-us-gov/api_with_cors_openapi_3.json index a4451857f..ba8c6ed60 100644 --- a/tests/translator/output/aws-us-gov/api_with_cors_openapi_3.json +++ b/tests/translator/output/aws-us-gov/api_with_cors_openapi_3.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ImplicitApiFunctionAnyApiPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -76,6 +82,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -220,6 +228,8 @@ }, "GetHtmlFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -250,6 +260,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment8493e7adfe" @@ -262,6 +274,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment8cc53ffaa5" @@ -274,6 +288,8 @@ }, "RestApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -304,6 +320,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -325,6 +343,8 @@ }, "ExplicitApiDeployment8cc53ffaa5": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -334,6 +354,8 @@ }, "RestApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -357,6 +379,8 @@ }, "ServerlessRestApiDeployment8493e7adfe": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -366,6 +390,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -506,6 +532,8 @@ }, "GetHtmlFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { diff --git a/tests/translator/output/aws-us-gov/api_with_custom_domain_route53.json b/tests/translator/output/aws-us-gov/api_with_custom_domain_route53.json index 362045c0b..aebd2aafd 100644 --- a/tests/translator/output/aws-us-gov/api_with_custom_domain_route53.json +++ b/tests/translator/output/aws-us-gov/api_with_custom_domain_route53.json @@ -12,6 +12,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -34,6 +36,8 @@ }, "MyFunctionFetchPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -55,6 +59,8 @@ }, "MyApiDeployment1deeaff693": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -64,6 +70,8 @@ }, "RecordSetGroupbd00d962a4": { "Type": "AWS::Route53::RecordSetGroup", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "HostedZoneId": "ZQ1UAL4EFZVME", "RecordSets": [ @@ -98,6 +106,8 @@ }, "MyApioneBasePathMapping": { "Type": "AWS::ApiGateway::BasePathMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BasePath": "one", "DomainName": { @@ -113,6 +123,8 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment1deeaff693" @@ -125,6 +137,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -155,6 +169,8 @@ }, "ApiGatewayDomainName0caaf24ab1": { "Type": "AWS::ApiGateway::DomainName", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "CertificateArn": "cert-arn-in-us-east-1", "EndpointConfiguration": { @@ -167,6 +183,8 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_with_custom_domain_route53_hosted_zone_name.json b/tests/translator/output/aws-us-gov/api_with_custom_domain_route53_hosted_zone_name.json index 5445e4f69..906499d04 100644 --- a/tests/translator/output/aws-us-gov/api_with_custom_domain_route53_hosted_zone_name.json +++ b/tests/translator/output/aws-us-gov/api_with_custom_domain_route53_hosted_zone_name.json @@ -12,6 +12,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -34,6 +36,8 @@ }, "MyFunctionFetchPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -55,6 +59,8 @@ }, "MyApiDeployment501f2306c4": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -64,6 +70,8 @@ }, "MyApioneBasePathMapping": { "Type": "AWS::ApiGateway::BasePathMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BasePath": "one", "DomainName": { @@ -79,6 +87,8 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment501f2306c4" @@ -91,6 +101,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -121,6 +133,8 @@ }, "ApiGatewayDomainName0caaf24ab1": { "Type": "AWS::ApiGateway::DomainName", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "CertificateArn": "cert-arn-in-us-east-1", "EndpointConfiguration": { @@ -133,6 +147,8 @@ }, "RecordSetGroup456ebaf280": { "Type": "AWS::Route53::RecordSetGroup", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "HostedZoneName": "www.my-domain.com.", "RecordSets": [ @@ -167,6 +183,8 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_with_custom_domain_route53_hosted_zone_name_http.json b/tests/translator/output/aws-us-gov/api_with_custom_domain_route53_hosted_zone_name_http.json index f952f03ad..0c052cd00 100644 --- a/tests/translator/output/aws-us-gov/api_with_custom_domain_route53_hosted_zone_name_http.json +++ b/tests/translator/output/aws-us-gov/api_with_custom_domain_route53_hosted_zone_name_http.json @@ -12,6 +12,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -34,6 +36,8 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -47,6 +51,8 @@ }, "MyApioneApiMapping": { "Type": "AWS::ApiGatewayV2::ApiMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -62,6 +68,8 @@ }, "ApiGatewayDomainNameV20caaf24ab1": { "Type": "AWS::ApiGatewayV2::DomainName", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DomainName": "example.com", "DomainNameConfigurations": [ @@ -77,6 +85,8 @@ }, "RecordSetGroup456ebaf280": { "Type": "AWS::Route53::RecordSetGroup", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "HostedZoneName": "www.my-domain.com.", "RecordSets": [ @@ -103,6 +113,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -133,6 +145,8 @@ }, "MyFunctionFetchPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -154,6 +168,8 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_with_custom_domain_route53_http.json b/tests/translator/output/aws-us-gov/api_with_custom_domain_route53_http.json index c92bc2242..0fb60f59e 100644 --- a/tests/translator/output/aws-us-gov/api_with_custom_domain_route53_http.json +++ b/tests/translator/output/aws-us-gov/api_with_custom_domain_route53_http.json @@ -12,6 +12,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -34,6 +36,8 @@ }, "MyApioneApiMapping": { "Type": "AWS::ApiGatewayV2::ApiMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -49,6 +53,8 @@ }, "RecordSetGroupbd00d962a4": { "Type": "AWS::Route53::RecordSetGroup", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "HostedZoneId": "ZQ1UAL4EFZVME", "RecordSets": [ @@ -93,6 +99,8 @@ }, "ApiGatewayDomainNameV20caaf24ab1": { "Type": "AWS::ApiGatewayV2::DomainName", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DomainName": "example.com", "DomainNameConfigurations": [ @@ -108,6 +116,8 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -121,6 +131,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -151,6 +163,8 @@ }, "MyFunctionFetchPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -172,6 +186,8 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_with_default_aws_iam_auth.json b/tests/translator/output/aws-us-gov/api_with_default_aws_iam_auth.json index 9d43ce2ae..4a84bfebc 100644 --- a/tests/translator/output/aws-us-gov/api_with_default_aws_iam_auth.json +++ b/tests/translator/output/aws-us-gov/api_with_default_aws_iam_auth.json @@ -2,6 +2,8 @@ "Resources": { "MyFunctionWithAwsIamAuth": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -25,6 +27,8 @@ }, "MyApiWithAwsIamAuthDeploymentf9a4964a7d": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithAwsIamAuth" @@ -35,6 +39,8 @@ }, "MyFunctionWithAwsIamAuthMyApiWithAwsIamAuthPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -56,6 +62,8 @@ }, "MyApiWithAwsIamAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithAwsIamAuthDeploymentf9a4964a7d" @@ -68,6 +76,8 @@ }, "MyApiWithAwsIamAuthAndDefaultInvokeRoleProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithAwsIamAuthAndDefaultInvokeRoleDeploymentce2dead7de" @@ -80,6 +90,8 @@ }, "MyFunctionWithAwsIamAuthMyApiWithAwsIamAuthAndDefaultInvokeRolePermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -101,6 +113,8 @@ }, "MyApiWithAwsIamAuthAndDefaultInvokeRoleDeploymentce2dead7de": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithAwsIamAuthAndDefaultInvokeRole" @@ -111,6 +125,8 @@ }, "MyApiWithAwsIamAuthAndCustomInvokeRoleDeploymentb31aa75bb2": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithAwsIamAuthAndCustomInvokeRole" @@ -121,6 +137,8 @@ }, "MyApiWithAwsIamAuthAndCustomInvokeRole": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -171,6 +189,8 @@ }, "MyApiWithAwsIamAuthAndCustomInvokeRoleProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithAwsIamAuthAndCustomInvokeRoleDeploymentb31aa75bb2" @@ -183,6 +203,8 @@ }, "MyApiWithAwsIamAuthAndDefaultInvokeRole": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -233,6 +255,8 @@ }, "MyApiWithAwsIamAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -283,6 +307,8 @@ }, "MyFunctionWithAwsIamAuthMyApiWithAwsIamAuthAndCustomInvokeRolePermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -304,6 +330,8 @@ }, "MyFunctionWithAwsIamAuthRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-us-gov/api_with_default_aws_iam_auth_and_no_auth_route.json b/tests/translator/output/aws-us-gov/api_with_default_aws_iam_auth_and_no_auth_route.json index 0b0daf61f..b03b3b2cc 100644 --- a/tests/translator/output/aws-us-gov/api_with_default_aws_iam_auth_and_no_auth_route.json +++ b/tests/translator/output/aws-us-gov/api_with_default_aws_iam_auth_and_no_auth_route.json @@ -2,6 +2,8 @@ "Resources": { "MyFunctionWithAwsIamAuth": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -25,6 +27,8 @@ }, "MyFunctionWithAwsIamAuthMyApiWithNoAuthPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -46,6 +50,8 @@ }, "MyFunctionWithAwsIamAuthMyApiWithAwsIamAuthPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -67,6 +73,8 @@ }, "MyApiWithAwsIamAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -132,6 +140,8 @@ }, "MyApiWithAwsIamAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithAwsIamAuthDeploymentce96ce9f89" @@ -144,6 +154,8 @@ }, "MyApiWithAwsIamAuthDeploymentce96ce9f89": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithAwsIamAuth" @@ -154,6 +166,8 @@ }, "MyFunctionWithAwsIamAuthRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-us-gov/api_with_gateway_responses.json b/tests/translator/output/aws-us-gov/api_with_gateway_responses.json index 936b9c68c..9df713cd8 100644 --- a/tests/translator/output/aws-us-gov/api_with_gateway_responses.json +++ b/tests/translator/output/aws-us-gov/api_with_gateway_responses.json @@ -2,6 +2,8 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "ExplicitApiDeployment929d2126a7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -35,6 +39,8 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -65,6 +71,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -112,6 +120,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment929d2126a7" @@ -124,6 +134,8 @@ }, "FunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/api_with_gateway_responses_all.json b/tests/translator/output/aws-us-gov/api_with_gateway_responses_all.json index 599af342c..e5f0ea5e6 100644 --- a/tests/translator/output/aws-us-gov/api_with_gateway_responses_all.json +++ b/tests/translator/output/aws-us-gov/api_with_gateway_responses_all.json @@ -2,6 +2,8 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "ExplicitApiDeployment42329c77b0": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -35,6 +39,8 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -65,6 +71,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -121,6 +129,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment42329c77b0" @@ -133,6 +143,8 @@ }, "FunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/api_with_gateway_responses_all_openapi_3.json b/tests/translator/output/aws-us-gov/api_with_gateway_responses_all_openapi_3.json index 67623b474..e587bf33d 100644 --- a/tests/translator/output/aws-us-gov/api_with_gateway_responses_all_openapi_3.json +++ b/tests/translator/output/aws-us-gov/api_with_gateway_responses_all_openapi_3.json @@ -2,6 +2,8 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -111,6 +117,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment0f8408588e" @@ -123,6 +131,8 @@ }, "FunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -144,6 +154,8 @@ }, "ExplicitApiDeployment0f8408588e": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" diff --git a/tests/translator/output/aws-us-gov/api_with_gateway_responses_implicit.json b/tests/translator/output/aws-us-gov/api_with_gateway_responses_implicit.json index 8ba952ee4..c3743dba2 100644 --- a/tests/translator/output/aws-us-gov/api_with_gateway_responses_implicit.json +++ b/tests/translator/output/aws-us-gov/api_with_gateway_responses_implicit.json @@ -2,6 +2,8 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment929d2126a7" @@ -67,6 +73,8 @@ }, "ServerlessRestApiDeployment929d2126a7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -77,6 +85,8 @@ }, "FunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -98,6 +108,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_with_gateway_responses_minimal.json b/tests/translator/output/aws-us-gov/api_with_gateway_responses_minimal.json index ea9059e27..4d610155f 100644 --- a/tests/translator/output/aws-us-gov/api_with_gateway_responses_minimal.json +++ b/tests/translator/output/aws-us-gov/api_with_gateway_responses_minimal.json @@ -2,6 +2,8 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -97,6 +103,8 @@ }, "ExplicitApiDeployment40cf320ad7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -107,6 +115,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment40cf320ad7" @@ -119,6 +129,8 @@ }, "FunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/api_with_gateway_responses_string_status_code.json b/tests/translator/output/aws-us-gov/api_with_gateway_responses_string_status_code.json index 936b9c68c..9df713cd8 100644 --- a/tests/translator/output/aws-us-gov/api_with_gateway_responses_string_status_code.json +++ b/tests/translator/output/aws-us-gov/api_with_gateway_responses_string_status_code.json @@ -2,6 +2,8 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "ExplicitApiDeployment929d2126a7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -35,6 +39,8 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -65,6 +71,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -112,6 +120,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment929d2126a7" @@ -124,6 +134,8 @@ }, "FunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/api_with_if_conditional_with_resource_policy.json b/tests/translator/output/aws-us-gov/api_with_if_conditional_with_resource_policy.json index b0bd1013b..c2fda349f 100644 --- a/tests/translator/output/aws-us-gov/api_with_if_conditional_with_resource_policy.json +++ b/tests/translator/output/aws-us-gov/api_with_if_conditional_with_resource_policy.json @@ -10,6 +10,8 @@ "Resources": { "ExplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -33,6 +35,8 @@ }, "ExplicitApiFunctionPutHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -54,6 +58,8 @@ }, "ExplicitApiDeploymente252ad8b51": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -64,6 +70,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -141,6 +149,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymente252ad8b51" @@ -153,6 +163,8 @@ }, "ExplicitApiFunctionPostHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -174,6 +186,8 @@ }, "ExplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -204,6 +218,8 @@ }, "ExplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/api_with_incompatible_stage_name.json b/tests/translator/output/aws-us-gov/api_with_incompatible_stage_name.json index 4f1c1e6b3..e78c45228 100644 --- a/tests/translator/output/aws-us-gov/api_with_incompatible_stage_name.json +++ b/tests/translator/output/aws-us-gov/api_with_incompatible_stage_name.json @@ -2,6 +2,8 @@ "Resources": { "UnderscoreApiStageb34d3ad84e": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "UnderscoreApiDeployment94459366c6" @@ -14,6 +16,8 @@ }, "UnderscoreApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -70,6 +74,8 @@ }, "UnderscoreFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -100,6 +106,8 @@ }, "HyphenFunctionGetHtmlPermission0c8ecc62cb": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -119,6 +127,8 @@ }, "HyphenApiStage0c8ecc62cb": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "HyphenApiDeploymente60ebb9f56" @@ -131,6 +141,8 @@ }, "UnderscoreFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -154,6 +166,8 @@ }, "UnderscoreFunctionGetHtmlPermissionb34d3ad84e": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -173,6 +187,8 @@ }, "HyphenFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -196,6 +212,8 @@ }, "HyphenApiDeploymente60ebb9f56": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "HyphenApi" @@ -206,6 +224,8 @@ }, "UnderscoreApiDeployment94459366c6": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "UnderscoreApi" @@ -216,6 +236,8 @@ }, "HyphenApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -272,6 +294,8 @@ }, "HyphenFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-us-gov/api_with_ip_range_blacklist.json b/tests/translator/output/aws-us-gov/api_with_ip_range_blacklist.json index d89da5b7f..095a84f0c 100644 --- a/tests/translator/output/aws-us-gov/api_with_ip_range_blacklist.json +++ b/tests/translator/output/aws-us-gov/api_with_ip_range_blacklist.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -24,6 +26,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment7a90608509" @@ -36,6 +40,8 @@ }, "ServerlessRestApiDeployment7a90608509": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -46,6 +52,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -76,6 +84,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -173,6 +183,8 @@ }, "MyFunctionApiPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/api_with_ip_range_whitelist.json b/tests/translator/output/aws-us-gov/api_with_ip_range_whitelist.json index 5750d7cf7..9c4d1f10c 100644 --- a/tests/translator/output/aws-us-gov/api_with_ip_range_whitelist.json +++ b/tests/translator/output/aws-us-gov/api_with_ip_range_whitelist.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -24,6 +26,8 @@ }, "ServerlessRestApiDeployment05e180d91b": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -34,6 +38,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment05e180d91b" @@ -46,6 +52,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -76,6 +84,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -176,6 +186,8 @@ }, "MyFunctionApiPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/api_with_method_aws_iam_auth.json b/tests/translator/output/aws-us-gov/api_with_method_aws_iam_auth.json index 730d83d09..2fe14ee94 100644 --- a/tests/translator/output/aws-us-gov/api_with_method_aws_iam_auth.json +++ b/tests/translator/output/aws-us-gov/api_with_method_aws_iam_auth.json @@ -2,6 +2,8 @@ "Resources": { "MyFunctionWithAwsIamAuthMyApiWithAwsIamAuthPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -23,6 +25,8 @@ }, "MyApiWithoutAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -105,6 +109,8 @@ }, "MyFunctionWithAwsIamAuthMyApiWithAwsIamAuthAndDefaultInvokeRolePermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -126,6 +132,8 @@ }, "MyFunctionWithAwsIamAuth": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -149,6 +157,8 @@ }, "MyApiWithoutAuthDeploymentd7b0de15e2": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithoutAuth" @@ -159,6 +169,8 @@ }, "MyApiWithoutAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithoutAuthDeploymentd7b0de15e2" @@ -171,6 +183,8 @@ }, "MyFunctionWithAwsIamAuthMyApiWithAwsIamAuthAndCustomInvokeRolePermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -192,6 +206,8 @@ }, "MyFunctionWithAwsIamAuthRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-us-gov/api_with_method_settings.json b/tests/translator/output/aws-us-gov/api_with_method_settings.json index 58f29e309..f288864e9 100644 --- a/tests/translator/output/aws-us-gov/api_with_method_settings.json +++ b/tests/translator/output/aws-us-gov/api_with_method_settings.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -76,6 +82,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -93,6 +101,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "MethodSettings": [ { @@ -114,6 +124,8 @@ }, "ServerlessRestApiDeployment5b2cb4ba8f": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -124,6 +136,8 @@ }, "ExplicitApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -134,6 +148,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "MethodSettings": [ { @@ -155,6 +171,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_with_minimum_compression_size.json b/tests/translator/output/aws-us-gov/api_with_minimum_compression_size.json index 5dc49fdfe..cffb43bcc 100644 --- a/tests/translator/output/aws-us-gov/api_with_minimum_compression_size.json +++ b/tests/translator/output/aws-us-gov/api_with_minimum_compression_size.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -76,6 +82,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "MinimumCompressionSize": 256, "EndpointConfiguration": { @@ -94,6 +102,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentf117c932f7" @@ -106,6 +116,8 @@ }, "ServerlessRestApiDeployment5b2cb4ba8f": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -116,6 +128,8 @@ }, "ExplicitApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -126,6 +140,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment5b2cb4ba8f" @@ -138,6 +154,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_with_open_api_version.json b/tests/translator/output/aws-us-gov/api_with_open_api_version.json index 1ddc31fc3..23ebe2f86 100644 --- a/tests/translator/output/aws-us-gov/api_with_open_api_version.json +++ b/tests/translator/output/aws-us-gov/api_with_open_api_version.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -76,6 +82,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -99,6 +107,8 @@ }, "ExplicitApiDeploymentd9a0f2ae4f": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -108,6 +118,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymenta4ffcdf019" @@ -120,6 +132,8 @@ }, "ServerlessRestApiDeploymenta4ffcdf019": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -129,6 +143,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -203,6 +219,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentd9a0f2ae4f" diff --git a/tests/translator/output/aws-us-gov/api_with_open_api_version_2.json b/tests/translator/output/aws-us-gov/api_with_open_api_version_2.json index 49655c0d2..ce4b2d798 100644 --- a/tests/translator/output/aws-us-gov/api_with_open_api_version_2.json +++ b/tests/translator/output/aws-us-gov/api_with_open_api_version_2.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -76,6 +82,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -99,6 +107,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment4154e1c30c" @@ -111,6 +121,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment2ce765616b" @@ -123,6 +135,8 @@ }, "ExplicitApiDeployment4154e1c30c": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -132,6 +146,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -208,6 +224,8 @@ }, "ServerlessRestApiDeployment2ce765616b": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" diff --git a/tests/translator/output/aws-us-gov/api_with_openapi_definition_body_no_flag.json b/tests/translator/output/aws-us-gov/api_with_openapi_definition_body_no_flag.json index ac3cc1ea5..2c8b50f08 100644 --- a/tests/translator/output/aws-us-gov/api_with_openapi_definition_body_no_flag.json +++ b/tests/translator/output/aws-us-gov/api_with_openapi_definition_body_no_flag.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ExplicitApiDeployment9252467a1e": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -65,6 +71,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -128,6 +136,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -145,6 +155,8 @@ }, "ExplicitApiSomeStageStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -162,6 +174,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -183,6 +197,8 @@ }, "ServerlessRestApiDeploymentc969c99f9d": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -193,6 +209,8 @@ }, "MyUserPool": { "Type": "AWS::Cognito::UserPool", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "UsernameAttributes": [ "email" @@ -214,6 +232,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_with_path_parameters.json b/tests/translator/output/aws-us-gov/api_with_path_parameters.json index da74d7fc9..b89ecce01 100644 --- a/tests/translator/output/aws-us-gov/api_with_path_parameters.json +++ b/tests/translator/output/aws-us-gov/api_with_path_parameters.json @@ -2,6 +2,8 @@ "Resources": { "HtmlFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -32,6 +34,8 @@ }, "HtmlApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "HtmlApiDeploymentf117c932f7" @@ -44,6 +48,8 @@ }, "HtmlFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -63,6 +69,8 @@ }, "HtmlApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "HtmlApi" @@ -73,6 +81,8 @@ }, "HtmlApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -90,6 +100,8 @@ }, "HtmlFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-us-gov/api_with_resource_policy.json b/tests/translator/output/aws-us-gov/api_with_resource_policy.json index 086f0655d..fd3c9425d 100644 --- a/tests/translator/output/aws-us-gov/api_with_resource_policy.json +++ b/tests/translator/output/aws-us-gov/api_with_resource_policy.json @@ -2,6 +2,8 @@ "Resources": { "ExplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "ExplicitApiFunctionPutHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -46,6 +50,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -115,6 +121,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentb5a112ecdf" @@ -127,6 +135,8 @@ }, "ExplicitApiFunctionPostHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -148,6 +158,8 @@ }, "ExplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -178,6 +190,8 @@ }, "ExplicitApiDeploymentb5a112ecdf": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -188,6 +202,8 @@ }, "ExplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/api_with_resource_policy_global.json b/tests/translator/output/aws-us-gov/api_with_resource_policy_global.json index b690b0271..2ecfb4342 100644 --- a/tests/translator/output/aws-us-gov/api_with_resource_policy_global.json +++ b/tests/translator/output/aws-us-gov/api_with_resource_policy_global.json @@ -16,6 +16,8 @@ "Resources": { "AnotherApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -59,6 +61,8 @@ }, "ExplicitApiDeploymenta5a5c4e3ff": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -69,6 +73,8 @@ }, "ExplicitApiStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymenta5a5c4e3ff" @@ -83,6 +89,8 @@ }, "ExplicitApiFunctionGetHtmlPermissionStage": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -104,6 +112,8 @@ }, "AnotherApiDeploymentfdf1387e0a": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "AnotherApi" @@ -114,6 +124,8 @@ }, "ExplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -137,6 +149,8 @@ }, "ExplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -167,6 +181,8 @@ }, "AnotherApiStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "AnotherApiDeploymentfdf1387e0a" @@ -181,6 +197,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_with_resource_policy_global_implicit.json b/tests/translator/output/aws-us-gov/api_with_resource_policy_global_implicit.json index fcfb7e108..46c1cda89 100644 --- a/tests/translator/output/aws-us-gov/api_with_resource_policy_global_implicit.json +++ b/tests/translator/output/aws-us-gov/api_with_resource_policy_global_implicit.json @@ -2,6 +2,8 @@ "Resources": { "MinimalFunctionAddItemPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -23,6 +25,8 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -53,6 +57,8 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -76,6 +82,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment9558094c1e" @@ -88,6 +96,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -141,6 +151,8 @@ }, "ServerlessRestApiDeployment9558094c1e": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" diff --git a/tests/translator/output/aws-us-gov/api_with_resource_refs.json b/tests/translator/output/aws-us-gov/api_with_resource_refs.json index f54274e54..efc84bc20 100644 --- a/tests/translator/output/aws-us-gov/api_with_resource_refs.json +++ b/tests/translator/output/aws-us-gov/api_with_resource_refs.json @@ -24,6 +24,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -47,6 +49,8 @@ }, "MyApiDeployment359f256a3b": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -57,6 +61,8 @@ }, "MyApifooStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment359f256a3b" @@ -69,6 +75,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment2657ea030d" @@ -81,6 +89,8 @@ }, "MyFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -102,6 +112,8 @@ }, "ServerlessRestApiDeployment2657ea030d": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -112,6 +124,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -142,6 +156,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -178,6 +194,8 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "this": "is", diff --git a/tests/translator/output/aws-us-gov/api_with_source_vpc_blacklist.json b/tests/translator/output/aws-us-gov/api_with_source_vpc_blacklist.json index 349d33670..d6091c730 100644 --- a/tests/translator/output/aws-us-gov/api_with_source_vpc_blacklist.json +++ b/tests/translator/output/aws-us-gov/api_with_source_vpc_blacklist.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -24,6 +26,8 @@ }, "ServerlessRestApiDeployment8123e1b4d0": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -34,6 +38,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment8123e1b4d0" @@ -46,6 +52,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -76,6 +84,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -154,6 +164,8 @@ }, "MyFunctionApiPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", From 5ee7fb771889981cb4728961d8057f9d32acbb5d Mon Sep 17 00:00:00 2001 From: Qingchuan Ma Date: Tue, 20 Apr 2021 20:07:44 -0700 Subject: [PATCH 18/41] Added event bridge support for passthrough resource attributes --- samtranslator/model/eventbridge_utils.py | 10 +++++----- samtranslator/model/eventsources/push.py | 14 ++++++++++---- samtranslator/model/stepfunctions/events.py | 14 ++++++++++---- 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/samtranslator/model/eventbridge_utils.py b/samtranslator/model/eventbridge_utils.py index 39bf40745..bb407cd84 100644 --- a/samtranslator/model/eventbridge_utils.py +++ b/samtranslator/model/eventbridge_utils.py @@ -4,15 +4,15 @@ class EventBridgeRuleUtils: @staticmethod - def create_dead_letter_queue_with_policy(rule_logical_id, rule_arn, queue_logical_id=None): + def create_dead_letter_queue_with_policy(rule_logical_id, rule_arn, queue_logical_id=None, attributes=None): resources = [] - queue = SQSQueue(queue_logical_id or rule_logical_id + "Queue") + queue = SQSQueue(queue_logical_id or rule_logical_id + "Queue", attributes=attributes) dlq_queue_arn = queue.get_runtime_attr("arn") dlq_queue_url = queue.get_runtime_attr("queue_url") # grant necessary permission to Eventbridge Rule resource for sending messages to dead-letter queue - policy = SQSQueuePolicy(rule_logical_id + "QueuePolicy") + policy = SQSQueuePolicy(rule_logical_id + "QueuePolicy", attributes=attributes) policy.PolicyDocument = SQSQueuePolicies.eventbridge_dlq_send_message_resource_based_policy( rule_arn, dlq_queue_arn ) @@ -41,14 +41,14 @@ def validate_dlq_config(source_logical_id, dead_letter_config): raise InvalidEventException(source_logical_id, "No 'Arn' or 'Type' property provided for DeadLetterConfig") @staticmethod - def get_dlq_queue_arn_and_resources(cw_event_source, source_arn): + def get_dlq_queue_arn_and_resources(cw_event_source, source_arn, attributes): """returns dlq queue arn and dlq_resources, assuming cw_event_source.DeadLetterConfig has been validated""" dlq_queue_arn = cw_event_source.DeadLetterConfig.get("Arn") if dlq_queue_arn is not None: return dlq_queue_arn, [] queue_logical_id = cw_event_source.DeadLetterConfig.get("QueueLogicalId") dlq_resources = EventBridgeRuleUtils.create_dead_letter_queue_with_policy( - cw_event_source.logical_id, source_arn, queue_logical_id + cw_event_source.logical_id, source_arn, queue_logical_id, attributes ) dlq_queue_arn = dlq_resources[0].get_runtime_attr("arn") return dlq_queue_arn, dlq_resources diff --git a/samtranslator/model/eventsources/push.py b/samtranslator/model/eventsources/push.py index d7a85b04a..39792c211 100644 --- a/samtranslator/model/eventsources/push.py +++ b/samtranslator/model/eventsources/push.py @@ -113,7 +113,8 @@ def to_cloudformation(self, **kwargs): resources = [] - events_rule = EventsRule(self.logical_id, attributes=function.get_passthrough_resource_attributes()) + passthrough_resource_attributes = function.get_passthrough_resource_attributes() + events_rule = EventsRule(self.logical_id, attributes=passthrough_resource_attributes) resources.append(events_rule) events_rule.ScheduleExpression = self.Schedule @@ -126,7 +127,9 @@ def to_cloudformation(self, **kwargs): dlq_queue_arn = None if self.DeadLetterConfig is not None: EventBridgeRuleUtils.validate_dlq_config(self.logical_id, self.DeadLetterConfig) - dlq_queue_arn, dlq_resources = EventBridgeRuleUtils.get_dlq_queue_arn_and_resources(self, source_arn) + dlq_queue_arn, dlq_resources = EventBridgeRuleUtils.get_dlq_queue_arn_and_resources( + self, source_arn, passthrough_resource_attributes + ) resources.extend(dlq_resources) events_rule.Targets = [self._construct_target(function, dlq_queue_arn)] @@ -184,7 +187,8 @@ def to_cloudformation(self, **kwargs): resources = [] - events_rule = EventsRule(self.logical_id, attributes=function.get_passthrough_resource_attributes()) + passthrough_resource_attributes = function.get_passthrough_resource_attributes() + events_rule = EventsRule(self.logical_id, attributes=passthrough_resource_attributes) events_rule.EventBusName = self.EventBusName events_rule.EventPattern = self.Pattern source_arn = events_rule.get_runtime_attr("arn") @@ -192,7 +196,9 @@ def to_cloudformation(self, **kwargs): dlq_queue_arn = None if self.DeadLetterConfig is not None: EventBridgeRuleUtils.validate_dlq_config(self.logical_id, self.DeadLetterConfig) - dlq_queue_arn, dlq_resources = EventBridgeRuleUtils.get_dlq_queue_arn_and_resources(self, source_arn) + dlq_queue_arn, dlq_resources = EventBridgeRuleUtils.get_dlq_queue_arn_and_resources( + self, source_arn, passthrough_resource_attributes + ) resources.extend(dlq_resources) events_rule.Targets = [self._construct_target(function, dlq_queue_arn)] diff --git a/samtranslator/model/stepfunctions/events.py b/samtranslator/model/stepfunctions/events.py index ee8997156..a50054528 100644 --- a/samtranslator/model/stepfunctions/events.py +++ b/samtranslator/model/stepfunctions/events.py @@ -97,7 +97,8 @@ def to_cloudformation(self, resource, **kwargs): permissions_boundary = kwargs.get("permissions_boundary") - events_rule = EventsRule(self.logical_id, attributes=resource.get_passthrough_resource_attributes()) + passthrough_resource_attributes = resource.get_passthrough_resource_attributes() + events_rule = EventsRule(self.logical_id, attributes=passthrough_resource_attributes) resources.append(events_rule) events_rule.ScheduleExpression = self.Schedule @@ -113,7 +114,9 @@ def to_cloudformation(self, resource, **kwargs): dlq_queue_arn = None if self.DeadLetterConfig is not None: EventBridgeRuleUtils.validate_dlq_config(self.logical_id, self.DeadLetterConfig) - dlq_queue_arn, dlq_resources = EventBridgeRuleUtils.get_dlq_queue_arn_and_resources(self, source_arn) + dlq_queue_arn, dlq_resources = EventBridgeRuleUtils.get_dlq_queue_arn_and_resources( + self, source_arn, passthrough_resource_attributes + ) resources.extend(dlq_resources) events_rule.Targets = [self._construct_target(resource, role, dlq_queue_arn)] @@ -168,7 +171,8 @@ def to_cloudformation(self, resource, **kwargs): permissions_boundary = kwargs.get("permissions_boundary") - events_rule = EventsRule(self.logical_id, attributes=resource.get_passthrough_resource_attributes()) + passthrough_resource_attributes = resource.get_passthrough_resource_attributes() + events_rule = EventsRule(self.logical_id, attributes=passthrough_resource_attributes) events_rule.EventBusName = self.EventBusName events_rule.EventPattern = self.Pattern @@ -181,7 +185,9 @@ def to_cloudformation(self, resource, **kwargs): dlq_queue_arn = None if self.DeadLetterConfig is not None: EventBridgeRuleUtils.validate_dlq_config(self.logical_id, self.DeadLetterConfig) - dlq_queue_arn, dlq_resources = EventBridgeRuleUtils.get_dlq_queue_arn_and_resources(self, source_arn) + dlq_queue_arn, dlq_resources = EventBridgeRuleUtils.get_dlq_queue_arn_and_resources( + self, source_arn, passthrough_resource_attributes + ) resources.extend(dlq_resources) events_rule.Targets = [self._construct_target(resource, role, dlq_queue_arn)] From be2df5d1001e99c9c97230d21bf71808f510c2fb Mon Sep 17 00:00:00 2001 From: Qingchuan Ma Date: Wed, 21 Apr 2021 14:57:47 -0700 Subject: [PATCH 19/41] Partially updated test templates (up to function with amq kms) --- .../input/api_with_source_vpc_whitelist.yaml | 4 + .../translator/input/api_with_stage_tags.yaml | 2 + ...pi_with_swagger_and_openapi_with_auth.yaml | 6 + .../translator/input/api_with_usageplans.yaml | 12 + .../input/api_with_usageplans_intrinsics.yaml | 8 + .../input/api_with_xray_tracing.yaml | 4 + .../input/application_preparing_state.yaml | 2 + .../input/application_with_intrinsics.yaml | 6 + tests/translator/input/basic_application.yaml | 8 + tests/translator/input/basic_function.yaml | 18 + .../input/basic_function_with_tags.yaml | 2 + .../input/basic_function_withimageuri.yaml | 14 + tests/translator/input/basic_layer.yaml | 8 + .../input/cloudwatch_logs_with_ref.yaml | 2 + tests/translator/input/cloudwatchevent.yaml | 4 + tests/translator/input/cloudwatchlog.yaml | 2 + .../input/cognito_userpool_with_event.yaml | 4 + tests/translator/input/depends_on.yaml | 8 + tests/translator/input/eventbridgerule.yaml | 4 + .../eventbridgerule_schedule_properties.yaml | 4 + .../input/eventbridgerule_with_dlq.yaml | 4 + .../eventbridgerule_with_retry_policy.yaml | 4 + tests/translator/input/explicit_api.yaml | 6 + .../input/explicit_api_openapi_3.yaml | 6 + ...plicit_api_with_invalid_events_config.yaml | 4 + tests/translator/input/explicit_http_api.yaml | 6 + .../input/explicit_http_api_minimum.yaml | 4 + .../input/function_concurrency.yaml | 4 + .../input/function_event_conditions.yaml | 10 + .../input/function_managed_inline_policy.yaml | 2 + .../translator/input/function_with_alias.yaml | 2 + .../function_with_alias_and_code_sha256.yaml | 2 + ...function_with_alias_and_event_sources.yaml | 8 + .../input/function_with_alias_intrinsics.yaml | 2 + tests/translator/input/function_with_amq.yaml | 2 + .../input/function_with_amq_kms.yaml | 2 + .../output/api_with_source_vpc_whitelist.json | 20 + .../output/api_with_stage_tags.json | 6 + ...pi_with_swagger_and_openapi_with_auth.json | 20 + .../api_with_swagger_authorizer_none.json | 475 ----------------- .../output/api_with_usageplans.json | 56 ++ .../api_with_usageplans_intrinsics.json | 36 ++ .../output/api_with_xray_tracing.json | 12 + .../output/application_preparing_state.json | 2 + .../output/application_with_intrinsics.json | 8 +- .../aws-cn/api_with_source_vpc_whitelist.json | 20 + .../output/aws-cn/api_with_stage_tags.json | 6 + ...pi_with_swagger_and_openapi_with_auth.json | 20 + .../api_with_swagger_authorizer_none.json | 499 ------------------ .../output/aws-cn/api_with_usageplans.json | 56 ++ .../api_with_usageplans_intrinsics.json | 36 ++ .../output/aws-cn/api_with_xray_tracing.json | 12 + .../aws-cn/application_preparing_state.json | 2 + .../aws-cn/application_with_intrinsics.json | 8 +- .../output/aws-cn/basic_application.json | 8 + .../output/aws-cn/basic_function.json | 30 ++ .../aws-cn/basic_function_with_tags.json | 6 + .../aws-cn/basic_function_withimageuri.json | 22 + .../translator/output/aws-cn/basic_layer.json | 16 +- .../aws-cn/cloudwatch_logs_with_ref.json | 8 + .../output/aws-cn/cloudwatchevent.json | 16 + .../output/aws-cn/cloudwatchlog.json | 8 + .../aws-cn/cognito_userpool_with_event.json | 8 + .../translator/output/aws-cn/depends_on.json | 16 + .../output/aws-cn/eventbridgerule.json | 16 + .../eventbridgerule_schedule_properties.json | 22 +- .../aws-cn/eventbridgerule_with_dlq.json | 20 + .../eventbridgerule_with_retry_policy.json | 16 + .../output/aws-cn/explicit_api.json | 18 + .../output/aws-cn/explicit_api_openapi_3.json | 18 + ...plicit_api_with_invalid_events_config.json | 12 + .../output/aws-cn/explicit_http_api.json | 16 + .../aws-cn/explicit_http_api_minimum.json | 14 + .../output/aws-cn/function_concurrency.json | 8 + .../aws-cn/function_event_conditions.json | 67 ++- .../function_managed_inline_policy.json | 4 + .../output/aws-cn/function_with_alias.json | 9 +- ...function_with_alias_and_event_sources.json | 61 ++- .../function_with_alias_intrinsics.json | 9 +- .../output/aws-cn/function_with_amq.json | 6 + .../output/aws-cn/function_with_amq_kms.json | 6 + .../api_with_source_vpc_whitelist.json | 20 + .../aws-us-gov/api_with_stage_tags.json | 6 + ...pi_with_swagger_and_openapi_with_auth.json | 20 + .../api_with_swagger_authorizer_none.json | 499 ------------------ .../aws-us-gov/api_with_usageplans.json | 56 ++ .../api_with_usageplans_intrinsics.json | 36 ++ .../aws-us-gov/api_with_xray_tracing.json | 12 + .../application_preparing_state.json | 2 + .../application_with_intrinsics.json | 8 +- .../output/aws-us-gov/basic_application.json | 8 + .../output/aws-us-gov/basic_function.json | 30 ++ .../aws-us-gov/basic_function_with_tags.json | 6 + .../basic_function_withimageuri.json | 22 + .../output/aws-us-gov/basic_layer.json | 16 +- .../aws-us-gov/cloudwatch_logs_with_ref.json | 8 + .../output/aws-us-gov/cloudwatchevent.json | 16 + .../output/aws-us-gov/cloudwatchlog.json | 8 + .../cognito_userpool_with_event.json | 8 + .../output/aws-us-gov/depends_on.json | 16 + .../output/aws-us-gov/eventbridgerule.json | 16 + .../eventbridgerule_schedule_properties.json | 16 + .../aws-us-gov/eventbridgerule_with_dlq.json | 20 + .../eventbridgerule_with_retry_policy.json | 16 + .../output/aws-us-gov/explicit_api.json | 18 + .../aws-us-gov/explicit_api_openapi_3.json | 18 + ...plicit_api_with_invalid_events_config.json | 12 + .../output/aws-us-gov/explicit_http_api.json | 16 + .../aws-us-gov/explicit_http_api_minimum.json | 14 + .../aws-us-gov/function_concurrency.json | 8 + .../aws-us-gov/function_event_conditions.json | 67 ++- .../function_managed_inline_policy.json | 4 + .../aws-us-gov/function_with_alias.json | 9 +- ...function_with_alias_and_event_sources.json | 61 ++- .../function_with_alias_intrinsics.json | 9 +- .../output/aws-us-gov/function_with_amq.json | 6 + .../aws-us-gov/function_with_amq_kms.json | 6 + .../translator/output/basic_application.json | 8 + tests/translator/output/basic_function.json | 30 ++ .../output/basic_function_with_tags.json | 6 + .../output/basic_function_withimageuri.json | 22 + tests/translator/output/basic_layer.json | 16 +- .../output/cloudwatch_logs_with_ref.json | 8 + tests/translator/output/cloudwatchevent.json | 16 + tests/translator/output/cloudwatchlog.json | 8 + .../output/cognito_userpool_with_event.json | 8 + tests/translator/output/depends_on.json | 16 + tests/translator/output/eventbridgerule.json | 16 + .../eventbridgerule_schedule_properties.json | 16 + .../output/eventbridgerule_with_dlq.json | 20 + .../eventbridgerule_with_retry_policy.json | 16 + tests/translator/output/explicit_api.json | 18 + .../output/explicit_api_openapi_3.json | 18 + ...plicit_api_with_invalid_events_config.json | 12 + .../translator/output/explicit_http_api.json | 16 + .../output/explicit_http_api_minimum.json | 14 + .../output/function_concurrency.json | 8 + .../output/function_event_conditions.json | 67 ++- .../function_managed_inline_policy.json | 4 + .../output/function_with_alias.json | 9 +- .../function_with_alias_and_code_sha256.json | 11 +- ...function_with_alias_and_event_sources.json | 61 ++- .../function_with_alias_intrinsics.json | 9 +- .../translator/output/function_with_amq.json | 6 + .../output/function_with_amq_kms.json | 6 + 145 files changed, 2005 insertions(+), 1517 deletions(-) delete mode 100644 tests/translator/output/api_with_swagger_authorizer_none.json delete mode 100644 tests/translator/output/aws-cn/api_with_swagger_authorizer_none.json delete mode 100644 tests/translator/output/aws-us-gov/api_with_swagger_authorizer_none.json diff --git a/tests/translator/input/api_with_source_vpc_whitelist.yaml b/tests/translator/input/api_with_source_vpc_whitelist.yaml index 1cacf3941..4d1af939c 100644 --- a/tests/translator/input/api_with_source_vpc_whitelist.yaml +++ b/tests/translator/input/api_with_source_vpc_whitelist.yaml @@ -14,6 +14,8 @@ Globals: Resources: MyFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: InlineCode: | exports.handler = async (event) => { @@ -39,6 +41,8 @@ Resources: MyApi: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod diff --git a/tests/translator/input/api_with_stage_tags.yaml b/tests/translator/input/api_with_stage_tags.yaml index 83473e116..f39b484a8 100644 --- a/tests/translator/input/api_with_stage_tags.yaml +++ b/tests/translator/input/api_with_stage_tags.yaml @@ -6,6 +6,8 @@ Parameters: Resources: MyApiWithStageTags: Type: "AWS::Serverless::Api" + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod Tags: diff --git a/tests/translator/input/api_with_swagger_and_openapi_with_auth.yaml b/tests/translator/input/api_with_swagger_and_openapi_with_auth.yaml index af30762da..86f49a7a7 100644 --- a/tests/translator/input/api_with_swagger_and_openapi_with_auth.yaml +++ b/tests/translator/input/api_with_swagger_and_openapi_with_auth.yaml @@ -14,6 +14,8 @@ Globals: Resources: ImplicitApiFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -27,6 +29,8 @@ Resources: ExplicitApi: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: SomeStage DefinitionBody: @@ -46,6 +50,8 @@ Resources: MyUserPool: Type: AWS::Cognito::UserPool + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: UserPoolName: UserPoolName Policies: diff --git a/tests/translator/input/api_with_usageplans.yaml b/tests/translator/input/api_with_usageplans.yaml index 836d98648..fa5b04a5e 100644 --- a/tests/translator/input/api_with_usageplans.yaml +++ b/tests/translator/input/api_with_usageplans.yaml @@ -8,6 +8,8 @@ Globals: Resources: MyApiOne: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -16,6 +18,8 @@ Resources: MyApiTwo: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -39,11 +43,15 @@ Resources: MyApiThree: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod MyFunctionOne: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Handler: index.handler Runtime: nodejs12.x @@ -66,6 +74,8 @@ Resources: MyFunctionTwo: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Handler: index.handler Runtime: nodejs12.x @@ -93,6 +103,8 @@ Resources: MyFunctionThree: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Handler: index.handler Runtime: nodejs12.x diff --git a/tests/translator/input/api_with_usageplans_intrinsics.yaml b/tests/translator/input/api_with_usageplans_intrinsics.yaml index 7a386b556..046d4fe55 100644 --- a/tests/translator/input/api_with_usageplans_intrinsics.yaml +++ b/tests/translator/input/api_with_usageplans_intrinsics.yaml @@ -19,6 +19,8 @@ Globals: Resources: MyApiOne: + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Condition: C1 Type: AWS::Serverless::Api Properties: @@ -27,11 +29,15 @@ Resources: MyApiTwo: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod MyFunctionOne: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Handler: index.handler Runtime: nodejs12.x @@ -54,6 +60,8 @@ Resources: MyFunctionTwo: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Handler: index.handler Runtime: nodejs12.x diff --git a/tests/translator/input/api_with_xray_tracing.yaml b/tests/translator/input/api_with_xray_tracing.yaml index 8d54a9afc..e529fd7e8 100644 --- a/tests/translator/input/api_with_xray_tracing.yaml +++ b/tests/translator/input/api_with_xray_tracing.yaml @@ -1,6 +1,8 @@ Resources: HtmlFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -15,6 +17,8 @@ Resources: HtmlApi: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod DefinitionUri: s3://sam-demo-bucket/webpage_swagger.json diff --git a/tests/translator/input/application_preparing_state.yaml b/tests/translator/input/application_preparing_state.yaml index 91feca133..90123c4f6 100644 --- a/tests/translator/input/application_preparing_state.yaml +++ b/tests/translator/input/application_preparing_state.yaml @@ -1,6 +1,8 @@ Resources: PreparingApplication: Type: 'AWS::Serverless::Application' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Location: ApplicationId: preparing diff --git a/tests/translator/input/application_with_intrinsics.yaml b/tests/translator/input/application_with_intrinsics.yaml index f99a2860a..88a59b004 100644 --- a/tests/translator/input/application_with_intrinsics.yaml +++ b/tests/translator/input/application_with_intrinsics.yaml @@ -21,6 +21,8 @@ Mappings: Resources: ApplicationRefParameter: Type: 'AWS::Serverless::Application' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Location: ApplicationId: !Ref ApplicationIdParam @@ -28,6 +30,8 @@ Resources: ApplicationFindInMap: Type: 'AWS::Serverless::Application' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Location: ApplicationId: !FindInMap @@ -42,3 +46,5 @@ Resources: - !Ref Sns Sns: Type: AWS::SNS::Topic + DeletionPolicy: Delete + UpdateReplacePolicy: Retain diff --git a/tests/translator/input/basic_application.yaml b/tests/translator/input/basic_application.yaml index 03e665a41..c508772c5 100644 --- a/tests/translator/input/basic_application.yaml +++ b/tests/translator/input/basic_application.yaml @@ -6,6 +6,8 @@ Conditions: Resources: BasicApplication: Type: 'AWS::Serverless::Application' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Location: ApplicationId: arn:aws:serverlessrepo:us-east-1:123456789012:applications/hello-world @@ -13,6 +15,8 @@ Resources: NormalApplication: Type: 'AWS::Serverless::Application' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Location: ApplicationId: arn:aws:serverlessrepo:us-east-1:123456789012:applications/hello-world @@ -27,6 +31,8 @@ Resources: ApplicationWithLocationUrl: Type: 'AWS::Serverless::Application' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Location: https://s3-us-east-1.amazonaws.com/demo-bucket/template.yaml Tags: @@ -34,6 +40,8 @@ Resources: ApplicationWithCondition: Type: 'AWS::Serverless::Application' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Condition: TestCondition Properties: Location: diff --git a/tests/translator/input/basic_function.yaml b/tests/translator/input/basic_function.yaml index ae6ba50b4..dfa007e66 100644 --- a/tests/translator/input/basic_function.yaml +++ b/tests/translator/input/basic_function.yaml @@ -8,6 +8,8 @@ Parameters: Resources: MinimalFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -15,6 +17,8 @@ Resources: FunctionWithTracing: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -23,6 +27,8 @@ Resources: FunctionWithInlineCode: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: InlineCode: "hello world" Handler: hello.handler @@ -31,6 +37,8 @@ Resources: FunctionWithCodeUriObject: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: Bucket: somebucket @@ -41,6 +49,8 @@ Resources: CompleteFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: FunctionName: MyAwesomeFunction CodeUri: s3://sam-demo-bucket/hello.zip @@ -63,6 +73,8 @@ Resources: Name2: Value2 FunctionWithPolicies: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -70,6 +82,8 @@ Resources: Policies: AmazonDynamoDBFullAccess FunctionWithPolicyDocument: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -81,6 +95,8 @@ Resources: Resource: '*' FunctionWithRoleRef: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -91,6 +107,8 @@ Resources: MyFunctionRole: # This is just some role. Actual role definition might be wrong Type: "AWS::IAM::Role" + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: AssumeRolePolicyDocument: Version: "2012-10-17" diff --git a/tests/translator/input/basic_function_with_tags.yaml b/tests/translator/input/basic_function_with_tags.yaml index 691c1141e..5c337799d 100644 --- a/tests/translator/input/basic_function_with_tags.yaml +++ b/tests/translator/input/basic_function_with_tags.yaml @@ -9,6 +9,8 @@ Parameters: Resources: AlexaSkillFunc: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Description: Created by SAM diff --git a/tests/translator/input/basic_function_withimageuri.yaml b/tests/translator/input/basic_function_withimageuri.yaml index 897642b55..03a584c4a 100644 --- a/tests/translator/input/basic_function_withimageuri.yaml +++ b/tests/translator/input/basic_function_withimageuri.yaml @@ -8,12 +8,16 @@ Parameters: Resources: MinimalImageFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: ImageUri: 123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest PackageType: Image MinimalImageFunctionPackageTypeAndImageConfig: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: ImageUri: 123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest PackageType: Image @@ -24,6 +28,8 @@ Resources: CompleteImageFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: FunctionName: MyAwesomeFunction ImageUri: 123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest @@ -50,6 +56,8 @@ Resources: FunctionWithPolicies: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: ImageUri: 123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest PackageType: Image @@ -57,6 +65,8 @@ Resources: FunctionWithPolicyDocument: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: ImageUri: 123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest PackageType: Image @@ -68,6 +78,8 @@ Resources: FunctionWithRoleRef: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: ImageUri: 123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest PackageType: Image @@ -77,6 +89,8 @@ Resources: MyFunctionRole: # This is just some role. Actual role definition might be wrong Type: "AWS::IAM::Role" + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: AssumeRolePolicyDocument: Version: "2012-10-17" diff --git a/tests/translator/input/basic_layer.yaml b/tests/translator/input/basic_layer.yaml index 170af09b1..a9f0448bf 100644 --- a/tests/translator/input/basic_layer.yaml +++ b/tests/translator/input/basic_layer.yaml @@ -7,11 +7,15 @@ Conditions: Resources: MinimalLayer: Type: 'AWS::Serverless::LayerVersion' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: ContentUri: s3://sam-demo-bucket/layer.zip LayerWithContentUriObject: Type: 'AWS::Serverless::LayerVersion' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: ContentUri: Bucket: somebucket @@ -21,6 +25,8 @@ Resources: CompleteLayer: Type: 'AWS::Serverless::LayerVersion' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: LayerName: MyAwesomeLayer ContentUri: s3://sam-demo-bucket/layer.zip @@ -33,6 +39,8 @@ Resources: LayerWithCondition: Type: 'AWS::Serverless::LayerVersion' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Condition: TestCondition Properties: ContentUri: s3://sam-demo-bucket/layer.zip diff --git a/tests/translator/input/cloudwatch_logs_with_ref.yaml b/tests/translator/input/cloudwatch_logs_with_ref.yaml index b818b66d8..5518edf3d 100644 --- a/tests/translator/input/cloudwatch_logs_with_ref.yaml +++ b/tests/translator/input/cloudwatch_logs_with_ref.yaml @@ -12,6 +12,8 @@ Parameters: Resources: TriggeredFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip?versionId=3Tcgv52_0GaDvhDva4YciYeqRyPnpIcO Handler: hello.handler diff --git a/tests/translator/input/cloudwatchevent.yaml b/tests/translator/input/cloudwatchevent.yaml index f14ebcb40..3f49b1563 100644 --- a/tests/translator/input/cloudwatchevent.yaml +++ b/tests/translator/input/cloudwatchevent.yaml @@ -1,6 +1,8 @@ Resources: ScheduledFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip?versionId=3Tcgv52_0GaDvhDva4YciYeqRyPnpIcO Handler: hello.handler @@ -12,6 +14,8 @@ Resources: Schedule: 'rate(1 minute)' TriggeredFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip?versionId=3Tcgv52_0GaDvhDva4YciYeqRyPnpIcO Handler: hello.handler diff --git a/tests/translator/input/cloudwatchlog.yaml b/tests/translator/input/cloudwatchlog.yaml index 42b2f7715..3ee844c55 100644 --- a/tests/translator/input/cloudwatchlog.yaml +++ b/tests/translator/input/cloudwatchlog.yaml @@ -1,6 +1,8 @@ Resources: TriggeredFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip?versionId=3Tcgv52_0GaDvhDva4YciYeqRyPnpIcO Handler: hello.handler diff --git a/tests/translator/input/cognito_userpool_with_event.yaml b/tests/translator/input/cognito_userpool_with_event.yaml index 97cf8a597..ecd303127 100644 --- a/tests/translator/input/cognito_userpool_with_event.yaml +++ b/tests/translator/input/cognito_userpool_with_event.yaml @@ -1,11 +1,15 @@ Resources: UserPool: Type: AWS::Cognito::UserPool + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: LambdaConfig: PreAuthentication: "Test" ImplicitApiFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml diff --git a/tests/translator/input/depends_on.yaml b/tests/translator/input/depends_on.yaml index 34d914a49..3245b4568 100644 --- a/tests/translator/input/depends_on.yaml +++ b/tests/translator/input/depends_on.yaml @@ -3,6 +3,8 @@ Resources: MyFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain DependsOn: ["MyExplicitApi", "MySamTable"] Properties: CodeUri: s3://sam-demo-bucket/code.zip @@ -18,6 +20,8 @@ Resources: MyExplicitApi: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain DependsOn: "MySamTable" Properties: DefinitionUri: s3://sam-translator-tests-dont-delete/swagger-http.json @@ -26,11 +30,15 @@ Resources: MySamTable: Type: AWS::Serverless::SimpleTable + DeletionPolicy: Delete + UpdateReplacePolicy: Retain MyOtherTable: # Test DependsOn property a non-SAM resource Type: AWS::DynamoDB::Table + DeletionPolicy: Delete + UpdateReplacePolicy: Retain DependsOn: "MySamTable" Properties: diff --git a/tests/translator/input/eventbridgerule.yaml b/tests/translator/input/eventbridgerule.yaml index e9006a464..d88d7c875 100644 --- a/tests/translator/input/eventbridgerule.yaml +++ b/tests/translator/input/eventbridgerule.yaml @@ -1,6 +1,8 @@ Resources: ScheduledFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip?versionId=3Tcgv52_0GaDvhDva4YciYeqRyPnpIcO Handler: hello.handler @@ -12,6 +14,8 @@ Resources: Schedule: 'rate(1 minute)' TriggeredFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip?versionId=3Tcgv52_0GaDvhDva4YciYeqRyPnpIcO Handler: hello.handler diff --git a/tests/translator/input/eventbridgerule_schedule_properties.yaml b/tests/translator/input/eventbridgerule_schedule_properties.yaml index 0c947dfc8..1e91adf2a 100644 --- a/tests/translator/input/eventbridgerule_schedule_properties.yaml +++ b/tests/translator/input/eventbridgerule_schedule_properties.yaml @@ -1,6 +1,8 @@ Resources: ScheduledFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip?versionId=3Tcgv52_0GaDvhDva4YciYeqRyPnpIcO Handler: hello.handler @@ -16,6 +18,8 @@ Resources: TriggeredFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip?versionId=3Tcgv52_0GaDvhDva4YciYeqRyPnpIcO Handler: hello.handler diff --git a/tests/translator/input/eventbridgerule_with_dlq.yaml b/tests/translator/input/eventbridgerule_with_dlq.yaml index 7bb7dc59d..39c996622 100644 --- a/tests/translator/input/eventbridgerule_with_dlq.yaml +++ b/tests/translator/input/eventbridgerule_with_dlq.yaml @@ -1,6 +1,8 @@ Resources: ScheduledFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip?versionId=3Tcgv52_0GaDvhDva4YciYeqRyPnpIcO Handler: hello.handler @@ -14,6 +16,8 @@ Resources: Type: SQS TriggeredFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip?versionId=3Tcgv52_0GaDvhDva4YciYeqRyPnpIcO Handler: hello.handler diff --git a/tests/translator/input/eventbridgerule_with_retry_policy.yaml b/tests/translator/input/eventbridgerule_with_retry_policy.yaml index ed66964af..f3e32a74a 100644 --- a/tests/translator/input/eventbridgerule_with_retry_policy.yaml +++ b/tests/translator/input/eventbridgerule_with_retry_policy.yaml @@ -1,6 +1,8 @@ Resources: ScheduledFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip?versionId=3Tcgv52_0GaDvhDva4YciYeqRyPnpIcO Handler: hello.handler @@ -14,6 +16,8 @@ Resources: MaximumRetryAttempts: 3 TriggeredFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip?versionId=3Tcgv52_0GaDvhDva4YciYeqRyPnpIcO Handler: hello.handler diff --git a/tests/translator/input/explicit_api.yaml b/tests/translator/input/explicit_api.yaml index a2057640c..17008e799 100644 --- a/tests/translator/input/explicit_api.yaml +++ b/tests/translator/input/explicit_api.yaml @@ -9,6 +9,8 @@ Parameters: Resources: GetHtmlFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: Bucket: sam-demo-bucket @@ -27,6 +29,8 @@ Resources: GetHtmlApi: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Name: MyGetApi StageName: @@ -41,6 +45,8 @@ Resources: ApiWithInlineSwagger: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Ref: MyStageName diff --git a/tests/translator/input/explicit_api_openapi_3.yaml b/tests/translator/input/explicit_api_openapi_3.yaml index a6f00e5e0..f1fb7f3ca 100644 --- a/tests/translator/input/explicit_api_openapi_3.yaml +++ b/tests/translator/input/explicit_api_openapi_3.yaml @@ -9,6 +9,8 @@ Parameters: Resources: GetHtmlFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: Bucket: sam-demo-bucket @@ -27,6 +29,8 @@ Resources: GetHtmlApi: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Name: MyGetApi StageName: @@ -41,6 +45,8 @@ Resources: ApiWithInlineSwagger: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Ref: MyStageName diff --git a/tests/translator/input/explicit_api_with_invalid_events_config.yaml b/tests/translator/input/explicit_api_with_invalid_events_config.yaml index 2866b5f0c..d350c6244 100644 --- a/tests/translator/input/explicit_api_with_invalid_events_config.yaml +++ b/tests/translator/input/explicit_api_with_invalid_events_config.yaml @@ -8,6 +8,8 @@ Resources: MyFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/todo_list.zip Handler: index.restapi @@ -24,6 +26,8 @@ Resources: ApiWithInlineSwagger: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod DefinitionBody: { diff --git a/tests/translator/input/explicit_http_api.yaml b/tests/translator/input/explicit_http_api.yaml index 2d5063051..4a19efef9 100644 --- a/tests/translator/input/explicit_http_api.yaml +++ b/tests/translator/input/explicit_http_api.yaml @@ -1,6 +1,8 @@ Resources: HttpApiFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/todo_list.zip Handler: index.restapi @@ -18,6 +20,8 @@ Resources: Method: get MyApi: Type: AWS::Serverless::HttpApi + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: FailOnWarnings: True Auth: @@ -34,6 +38,8 @@ Resources: MyApi2: Type: AWS::Serverless::HttpApi + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Auth: Authorizers: diff --git a/tests/translator/input/explicit_http_api_minimum.yaml b/tests/translator/input/explicit_http_api_minimum.yaml index 9a968d22a..0b6e2eebd 100644 --- a/tests/translator/input/explicit_http_api_minimum.yaml +++ b/tests/translator/input/explicit_http_api_minimum.yaml @@ -1,8 +1,12 @@ Resources: Api: Type: AWS::Serverless::HttpApi + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Function: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Handler: index.handler CodeUri: s3://bucket/key diff --git a/tests/translator/input/function_concurrency.yaml b/tests/translator/input/function_concurrency.yaml index ff39277a4..e862f50b8 100644 --- a/tests/translator/input/function_concurrency.yaml +++ b/tests/translator/input/function_concurrency.yaml @@ -5,6 +5,8 @@ Parameters: Resources: ConcurrentFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -13,6 +15,8 @@ Resources: AnotherFunction: Type: "AWS::Serverless::Function" + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler diff --git a/tests/translator/input/function_event_conditions.yaml b/tests/translator/input/function_event_conditions.yaml index f30751333..5139bf2d9 100644 --- a/tests/translator/input/function_event_conditions.yaml +++ b/tests/translator/input/function_event_conditions.yaml @@ -9,6 +9,8 @@ Resources: # S3 Event without condition, using same bucket FunctionOne: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/thumbnails.zip Handler: index.generate_thumbails @@ -24,6 +26,8 @@ Resources: # All Event Types MyAwesomeFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Condition: MyCondition Properties: CodeUri: s3://sam-demo-bucket/hello.zip @@ -112,10 +116,16 @@ Resources: Notifications: Condition: MyCondition Type: AWS::SNS::Topic + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Images: Type: AWS::S3::Bucket + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Queue: Condition: MyCondition Type: AWS::SQS::Queue + DeletionPolicy: Delete + UpdateReplacePolicy: Retain diff --git a/tests/translator/input/function_managed_inline_policy.yaml b/tests/translator/input/function_managed_inline_policy.yaml index 538d5f3c6..4a0757e91 100644 --- a/tests/translator/input/function_managed_inline_policy.yaml +++ b/tests/translator/input/function_managed_inline_policy.yaml @@ -5,6 +5,8 @@ Parameters: Resources: Function: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler diff --git a/tests/translator/input/function_with_alias.yaml b/tests/translator/input/function_with_alias.yaml index 4a2defb45..1563344a3 100644 --- a/tests/translator/input/function_with_alias.yaml +++ b/tests/translator/input/function_with_alias.yaml @@ -1,6 +1,8 @@ Resources: MinimalFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler diff --git a/tests/translator/input/function_with_alias_and_code_sha256.yaml b/tests/translator/input/function_with_alias_and_code_sha256.yaml index bec283db1..fe1c1513e 100644 --- a/tests/translator/input/function_with_alias_and_code_sha256.yaml +++ b/tests/translator/input/function_with_alias_and_code_sha256.yaml @@ -7,6 +7,8 @@ Parameters: Resources: MinimalFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler diff --git a/tests/translator/input/function_with_alias_and_event_sources.yaml b/tests/translator/input/function_with_alias_and_event_sources.yaml index 41a6bc27c..d8f60a36e 100644 --- a/tests/translator/input/function_with_alias_and_event_sources.yaml +++ b/tests/translator/input/function_with_alias_and_event_sources.yaml @@ -8,6 +8,8 @@ Parameters: Resources: MyAwesomeFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -92,12 +94,18 @@ Resources: Notifications: Type: AWS::SNS::Topic + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Images: Type: AWS::S3::Bucket + DeletionPolicy: Delete + UpdateReplacePolicy: Retain GetHtmlApi: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Name: MyGetApi StageName: diff --git a/tests/translator/input/function_with_alias_intrinsics.yaml b/tests/translator/input/function_with_alias_intrinsics.yaml index 99327286b..60f59c1ee 100644 --- a/tests/translator/input/function_with_alias_intrinsics.yaml +++ b/tests/translator/input/function_with_alias_intrinsics.yaml @@ -6,6 +6,8 @@ Parameters: Resources: MinimalFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler diff --git a/tests/translator/input/function_with_amq.yaml b/tests/translator/input/function_with_amq.yaml index 00d28b841..22f481317 100644 --- a/tests/translator/input/function_with_amq.yaml +++ b/tests/translator/input/function_with_amq.yaml @@ -1,6 +1,8 @@ Resources: MQFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/queues.zip Handler: queue.mq_handler diff --git a/tests/translator/input/function_with_amq_kms.yaml b/tests/translator/input/function_with_amq_kms.yaml index 7ea02c2df..10a0332f8 100644 --- a/tests/translator/input/function_with_amq_kms.yaml +++ b/tests/translator/input/function_with_amq_kms.yaml @@ -1,6 +1,8 @@ Resources: MQFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/queues.zip Handler: queue.mq_handler diff --git a/tests/translator/output/api_with_source_vpc_whitelist.json b/tests/translator/output/api_with_source_vpc_whitelist.json index 715b18831..0ab3b0649 100644 --- a/tests/translator/output/api_with_source_vpc_whitelist.json +++ b/tests/translator/output/api_with_source_vpc_whitelist.json @@ -8,6 +8,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -30,6 +32,8 @@ }, "MyFunctionFetchPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -51,6 +55,8 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment5332c373d4" @@ -63,6 +69,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment276f3672ac" @@ -75,6 +83,8 @@ }, "MyApiDeployment5332c373d4": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -85,6 +95,8 @@ }, "ServerlessRestApiDeployment276f3672ac": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -95,6 +107,8 @@ }, "MyFunctionApiPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -116,6 +130,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -146,6 +162,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -267,6 +285,8 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_with_stage_tags.json b/tests/translator/output/api_with_stage_tags.json index 702a6b181..2bfc01383 100644 --- a/tests/translator/output/api_with_stage_tags.json +++ b/tests/translator/output/api_with_stage_tags.json @@ -8,6 +8,8 @@ "Resources": { "MyApiWithStageTagsDeployment5332c373d4": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithStageTags" @@ -18,6 +20,8 @@ }, "MyApiWithStageTags": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -33,6 +37,8 @@ }, "MyApiWithStageTagsProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithStageTagsDeployment5332c373d4" diff --git a/tests/translator/output/api_with_swagger_and_openapi_with_auth.json b/tests/translator/output/api_with_swagger_and_openapi_with_auth.json index 03c070ad7..663be750d 100644 --- a/tests/translator/output/api_with_swagger_and_openapi_with_auth.json +++ b/tests/translator/output/api_with_swagger_and_openapi_with_auth.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -109,6 +115,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -126,6 +134,8 @@ }, "ServerlessRestApiDeploymentdb4b9da82a": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -136,6 +146,8 @@ }, "ExplicitApiSomeStageStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -153,6 +165,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -174,6 +188,8 @@ }, "MyUserPool": { "Type": "AWS::Cognito::UserPool", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "UsernameAttributes": [ "email" @@ -195,6 +211,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -248,6 +266,8 @@ }, "ExplicitApiDeployment7c4f7dda23": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" diff --git a/tests/translator/output/api_with_swagger_authorizer_none.json b/tests/translator/output/api_with_swagger_authorizer_none.json deleted file mode 100644 index d9b372b88..000000000 --- a/tests/translator/output/api_with_swagger_authorizer_none.json +++ /dev/null @@ -1,475 +0,0 @@ -{ - "Resources": { - "MyFnCognitoPermissionProd": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "Principal": "apigateway.amazonaws.com", - "FunctionName": { - "Ref": "MyFn" - }, - "SourceArn": { - "Fn::Sub": [ - "arn:aws:execute-api:${AWS::Region}:${AWS::AccountId}:${__ApiId__}/${__Stage__}/GET/cognito", - { - "__Stage__": "*", - "__ApiId__": { - "Ref": "MyApiWithCognitoAuth" - } - } - ] - } - } - }, - "MyApiWithCognitoAuth": { - "Type": "AWS::ApiGateway::RestApi", - "Properties": { - "Body": { - "info": { - "version": "1.0", - "title": { - "Ref": "AWS::StackName" - } - }, - "paths": { - "/cognito": { - "get": { - "x-amazon-apigateway-integration": { - "httpMethod": "POST", - "type": "aws_proxy", - "uri": { - "Fn::Sub": "arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${MyFn.Arn}/invocations" - } - }, - "security": [ - { - "NONE": [] - } - ], - "responses": {} - } - } - }, - "swagger": "2.0", - "securityDefinitions": { - "MyCognitoAuth": { - "in": "header", - "type": "apiKey", - "name": "Authorization", - "x-amazon-apigateway-authorizer": { - "providerARNs": [ - { - "Fn::GetAtt": [ - "MyUserPool", - "Arn" - ] - } - ], - "type": "cognito_user_pools" - }, - "x-amazon-apigateway-authtype": "cognito_user_pools" - } - } - } - } - }, - "MyApiWithLambdaRequestAuthMyLambdaRequestAuthAuthorizerPermission": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "Principal": "apigateway.amazonaws.com", - "FunctionName": { - "Fn::GetAtt": [ - "MyAuthFn", - "Arn" - ] - }, - "SourceArn": { - "Fn::Sub": [ - "arn:aws:execute-api:${AWS::Region}:${AWS::AccountId}:${__ApiId__}/authorizers/*", - { - "__ApiId__": { - "Ref": "MyApiWithLambdaRequestAuth" - } - } - ] - } - } - }, - "MyApiWithLambdaRequestAuthProdStage": { - "Type": "AWS::ApiGateway::Stage", - "Properties": { - "DeploymentId": { - "Ref": "MyApiWithLambdaRequestAuthDeploymentfeb40d0e71" - }, - "RestApiId": { - "Ref": "MyApiWithLambdaRequestAuth" - }, - "StageName": "Prod" - } - }, - "MyFnLambdaTokenPermissionProd": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "Principal": "apigateway.amazonaws.com", - "FunctionName": { - "Ref": "MyFn" - }, - "SourceArn": { - "Fn::Sub": [ - "arn:aws:execute-api:${AWS::Region}:${AWS::AccountId}:${__ApiId__}/${__Stage__}/GET/lambda-token", - { - "__Stage__": "*", - "__ApiId__": { - "Ref": "MyApiWithLambdaTokenAuth" - } - } - ] - } - } - }, - "MyApiWithLambdaTokenAuthMyLambdaTokenAuthAuthorizerPermission": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "Principal": "apigateway.amazonaws.com", - "FunctionName": { - "Fn::GetAtt": [ - "MyAuthFn", - "Arn" - ] - }, - "SourceArn": { - "Fn::Sub": [ - "arn:aws:execute-api:${AWS::Region}:${AWS::AccountId}:${__ApiId__}/authorizers/*", - { - "__ApiId__": { - "Ref": "MyApiWithLambdaTokenAuth" - } - } - ] - } - } - }, - "MyFnLambdaRequestPermissionProd": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "Principal": "apigateway.amazonaws.com", - "FunctionName": { - "Ref": "MyFn" - }, - "SourceArn": { - "Fn::Sub": [ - "arn:aws:execute-api:${AWS::Region}:${AWS::AccountId}:${__ApiId__}/${__Stage__}/GET/lambda-request", - { - "__Stage__": "*", - "__ApiId__": { - "Ref": "MyApiWithLambdaRequestAuth" - } - } - ] - } - } - }, - "MyApiWithLambdaTokenAuth": { - "Type": "AWS::ApiGateway::RestApi", - "Properties": { - "Body": { - "info": { - "version": "1.0", - "title": { - "Ref": "AWS::StackName" - } - }, - "paths": { - "/lambda-token": { - "get": { - "x-amazon-apigateway-integration": { - "httpMethod": "POST", - "type": "aws_proxy", - "uri": { - "Fn::Sub": "arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${MyFn.Arn}/invocations" - } - }, - "security": [ - { - "NONE": [] - } - ], - "responses": {} - } - } - }, - "swagger": "2.0", - "securityDefinitions": { - "MyLambdaTokenAuth": { - "in": "header", - "type": "apiKey", - "name": "Authorization", - "x-amazon-apigateway-authorizer": { - "type": "token", - "authorizerUri": { - "Fn::Sub": [ - "arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${__FunctionArn__}/invocations", - { - "__FunctionArn__": { - "Fn::GetAtt": [ - "MyAuthFn", - "Arn" - ] - } - } - ] - } - }, - "x-amazon-apigateway-authtype": "custom" - } - } - } - } - }, - "MyApiWithLambdaTokenAuthProdStage": { - "Type": "AWS::ApiGateway::Stage", - "Properties": { - "DeploymentId": { - "Ref": "MyApiWithLambdaTokenAuthDeployment4644d735d8" - }, - "RestApiId": { - "Ref": "MyApiWithLambdaTokenAuth" - }, - "StageName": "Prod" - } - }, - "MyApiWithLambdaRequestAuthDeploymentfeb40d0e71": { - "Type": "AWS::ApiGateway::Deployment", - "Properties": { - "RestApiId": { - "Ref": "MyApiWithLambdaRequestAuth" - }, - "Description": "RestApi deployment id: feb40d0e712dce07ba2392d6bb86eff0c5b22b7b", - "StageName": "Stage" - } - }, - "MyUserPool": { - "Type": "AWS::Cognito::UserPool", - "Properties": { - "UsernameAttributes": [ - "email" - ], - "UserPoolName": "UserPoolName", - "Policies": { - "PasswordPolicy": { - "MinimumLength": 8 - } - }, - "Schema": [ - { - "AttributeDataType": "String", - "Required": false, - "Name": "email" - } - ] - } - }, - "MyAuthFn": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Handler": "index.handler", - "Code": { - "ZipFile": "exports.handler = async (event) => {\n return {\n statusCode: 200,\n body: JSON.stringify(event),\n headers: {}\n }\n}\n" - }, - "Role": { - "Fn::GetAtt": [ - "MyAuthFnRole", - "Arn" - ] - }, - "Runtime": "nodejs12.x", - "Tags": [ - { - "Value": "SAM", - "Key": "lambda:createdBy" - } - ] - } - }, - "MyApiWithLambdaRequestAuth": { - "Type": "AWS::ApiGateway::RestApi", - "Properties": { - "Body": { - "info": { - "version": "1.0", - "title": { - "Ref": "AWS::StackName" - } - }, - "paths": { - "/lambda-request": { - "get": { - "x-amazon-apigateway-integration": { - "httpMethod": "POST", - "passthroughBehavior": "when_no_match", - "type": "aws_proxy", - "uri": { - "Fn::Sub": "arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${MyFn.Arn}/invocations" - } - }, - "security": [ - { - "NONE": [] - } - ], - "responses": {} - } - } - }, - "swagger": 2.0, - "schemes": [ - "https" - ], - "securityDefinitions": { - "MyLambdaRequestAuth": { - "in": "header", - "type": "apiKey", - "name": "Unused", - "x-amazon-apigateway-authorizer": { - "type": "request", - "identitySource": "method.request.header.Authorization1", - "authorizerUri": { - "Fn::Sub": [ - "arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${__FunctionArn__}/invocations", - { - "__FunctionArn__": { - "Fn::GetAtt": [ - "MyAuthFn", - "Arn" - ] - } - } - ] - } - }, - "x-amazon-apigateway-authtype": "custom" - } - } - } - } - }, - "MyApiWithLambdaTokenAuthDeployment4644d735d8": { - "Type": "AWS::ApiGateway::Deployment", - "Properties": { - "RestApiId": { - "Ref": "MyApiWithLambdaTokenAuth" - }, - "Description": "RestApi deployment id: 4644d735d869a70806f7145ca725b1c8cb248fb7", - "StageName": "Stage" - } - }, - "MyAuthFnRole": { - "Type": "AWS::IAM::Role", - "Properties": { - "ManagedPolicyArns": [ - "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ], - "Tags": [ - { - "Value": "SAM", - "Key": "lambda:createdBy" - } - ], - "AssumeRolePolicyDocument": { - "Version": "2012-10-17", - "Statement": [ - { - "Action": [ - "sts:AssumeRole" - ], - "Effect": "Allow", - "Principal": { - "Service": [ - "lambda.amazonaws.com" - ] - } - } - ] - } - } - }, - "MyApiWithCognitoAuthDeploymentf67b169f98": { - "Type": "AWS::ApiGateway::Deployment", - "Properties": { - "RestApiId": { - "Ref": "MyApiWithCognitoAuth" - }, - "Description": "RestApi deployment id: f67b169f98fefb4627c6065af2d5e26ca6ea4da8", - "StageName": "Stage" - } - }, - "MyFnRole": { - "Type": "AWS::IAM::Role", - "Properties": { - "ManagedPolicyArns": [ - "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ], - "Tags": [ - { - "Value": "SAM", - "Key": "lambda:createdBy" - } - ], - "AssumeRolePolicyDocument": { - "Version": "2012-10-17", - "Statement": [ - { - "Action": [ - "sts:AssumeRole" - ], - "Effect": "Allow", - "Principal": { - "Service": [ - "lambda.amazonaws.com" - ] - } - } - ] - } - } - }, - "MyApiWithCognitoAuthProdStage": { - "Type": "AWS::ApiGateway::Stage", - "Properties": { - "DeploymentId": { - "Ref": "MyApiWithCognitoAuthDeploymentf67b169f98" - }, - "RestApiId": { - "Ref": "MyApiWithCognitoAuth" - }, - "StageName": "Prod" - } - }, - "MyFn": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Handler": "index.handler", - "Code": { - "ZipFile": "exports.handler = async (event) => {\n return {\n statusCode: 200,\n body: JSON.stringify(event),\n headers: {}\n }\n}\n" - }, - "Role": { - "Fn::GetAtt": [ - "MyFnRole", - "Arn" - ] - }, - "Runtime": "nodejs12.x", - "Tags": [ - { - "Value": "SAM", - "Key": "lambda:createdBy" - } - ] - } - } - } -} \ No newline at end of file diff --git a/tests/translator/output/api_with_usageplans.json b/tests/translator/output/api_with_usageplans.json index 488548465..536495525 100644 --- a/tests/translator/output/api_with_usageplans.json +++ b/tests/translator/output/api_with_usageplans.json @@ -40,6 +40,8 @@ "Resources": { "MyFunctionThreeRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -70,6 +72,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment7a26848ac9" @@ -82,6 +86,8 @@ }, "MyApiTwoUsagePlanKey": { "Type": "AWS::ApiGateway::UsagePlanKey", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "KeyType": "API_KEY", "KeyId": { @@ -97,6 +103,8 @@ }, "MyApiThree": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -137,6 +145,8 @@ }, "ServerlessRestApiDeployment7a26848ac9": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -147,6 +157,8 @@ }, "MyFunctionThreeApiKeyPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -168,6 +180,8 @@ }, "MyFunctionTwo": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -190,6 +204,8 @@ }, "MyFunctionOneApiKeyPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -211,6 +227,8 @@ }, "MyApiOneDeployment46fb22a429": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiOne" @@ -221,6 +239,8 @@ }, "MyFunctionTwoApiKeyPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -242,6 +262,8 @@ }, "MyFunctionOneRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -272,6 +294,8 @@ }, "MyApiTwo": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -312,6 +336,8 @@ }, "MyFunctionTwoRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -342,6 +368,8 @@ }, "MyFunctionOne": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -364,6 +392,8 @@ }, "ServerlessUsagePlan": { "Type": "AWS::ApiGateway::UsagePlan", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiStages": [ { @@ -391,6 +421,8 @@ }, "MyApiTwoUsagePlan": { "Type": "AWS::ApiGateway::UsagePlan", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiStages": [ { @@ -430,6 +462,8 @@ }, "MyApiThreeDeployment1d9cff47dc": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiThree" @@ -440,6 +474,8 @@ }, "MyFunctionTwoImplicitApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -461,6 +497,8 @@ }, "MyApiTwoProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiTwoDeploymente9d97923b9" @@ -473,6 +511,8 @@ }, "MyApiOneProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiOneDeployment46fb22a429" @@ -485,6 +525,8 @@ }, "MyApiTwoDeploymente9d97923b9": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiTwo" @@ -495,6 +537,8 @@ }, "MyFunctionThree": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -517,6 +561,8 @@ }, "MyApiThreeProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiThreeDeployment1d9cff47dc" @@ -529,6 +575,8 @@ }, "ServerlessUsagePlanKey": { "Type": "AWS::ApiGateway::UsagePlanKey", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "KeyType": "API_KEY", "KeyId": { @@ -544,6 +592,8 @@ }, "MyApiOne": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -584,6 +634,8 @@ }, "ServerlessApiKey": { "Type": "AWS::ApiGateway::ApiKey", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Enabled": true, "StageKeys": [ @@ -611,6 +663,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -651,6 +705,8 @@ }, "MyApiTwoApiKey": { "Type": "AWS::ApiGateway::ApiKey", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Enabled": true, "StageKeys": [ diff --git a/tests/translator/output/api_with_usageplans_intrinsics.json b/tests/translator/output/api_with_usageplans_intrinsics.json index ce2e5413d..2026da551 100644 --- a/tests/translator/output/api_with_usageplans_intrinsics.json +++ b/tests/translator/output/api_with_usageplans_intrinsics.json @@ -30,6 +30,8 @@ "Resources": { "MyApiTwoUsagePlanKey": { "Type": "AWS::ApiGateway::UsagePlanKey", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "KeyType": "API_KEY", "KeyId": { @@ -45,6 +47,8 @@ }, "MyApiTwoDeploymenta78b9db9dd": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiTwo" @@ -54,6 +58,8 @@ }, "MyApiOneUsagePlan": { "Type": "AWS::ApiGateway::UsagePlan", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiStages": [ { @@ -73,6 +79,8 @@ }, "MyApiTwoUsagePlan": { "Type": "AWS::ApiGateway::UsagePlan", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiStages": [ { @@ -91,6 +99,8 @@ }, "MyApiTwoProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiTwoDeploymenta78b9db9dd" @@ -103,6 +113,8 @@ }, "MyApiOneDeployment37a3a51a0f": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiOne" @@ -113,6 +125,8 @@ }, "MyApiOneProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiOneDeployment37a3a51a0f" @@ -126,6 +140,8 @@ }, "MyApiOneApiKey": { "Type": "AWS::ApiGateway::ApiKey", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Enabled": true, "StageKeys": [ @@ -146,6 +162,8 @@ }, "MyFunctionTwoRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -176,6 +194,8 @@ }, "MyApiOneUsagePlanKey": { "Type": "AWS::ApiGateway::UsagePlanKey", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "KeyType": "API_KEY", "KeyId": { @@ -192,6 +212,8 @@ }, "MyApiTwoApiKey": { "Type": "AWS::ApiGateway::ApiKey", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Enabled": true, "StageKeys": [ @@ -211,6 +233,8 @@ }, "MyFunctionOneApiKeyPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -232,6 +256,8 @@ }, "MyFunctionTwo": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -254,6 +280,8 @@ }, "MyFunctionTwoApiKeyPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -275,6 +303,8 @@ }, "MyFunctionOneRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -305,6 +335,8 @@ }, "MyApiTwo": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -347,6 +379,8 @@ }, "MyApiOne": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -390,6 +424,8 @@ }, "MyFunctionOne": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { diff --git a/tests/translator/output/api_with_xray_tracing.json b/tests/translator/output/api_with_xray_tracing.json index 04fb1acb4..adf696219 100644 --- a/tests/translator/output/api_with_xray_tracing.json +++ b/tests/translator/output/api_with_xray_tracing.json @@ -2,6 +2,8 @@ "Resources": { "HtmlFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -32,6 +34,8 @@ }, "HtmlApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "HtmlApiDeploymentf117c932f7" @@ -45,6 +49,8 @@ }, "HtmlFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -64,6 +70,8 @@ }, "HtmlApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "HtmlApi" @@ -74,6 +82,8 @@ }, "HtmlApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BodyS3Location": { "Bucket": "sam-demo-bucket", @@ -83,6 +93,8 @@ }, "HtmlFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/application_preparing_state.json b/tests/translator/output/application_preparing_state.json index 92fe7cc8d..bfb82c032 100644 --- a/tests/translator/output/application_preparing_state.json +++ b/tests/translator/output/application_preparing_state.json @@ -2,6 +2,8 @@ "Resources": { "PreparingApplication": { "Type": "AWS::CloudFormation::Stack", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "TemplateURL": "https://awsserverlessrepo-changesets-xxx.s3.amazonaws.com/signed-url", "Tags": [ diff --git a/tests/translator/output/application_with_intrinsics.json b/tests/translator/output/application_with_intrinsics.json index d0fa43411..d72f4513d 100644 --- a/tests/translator/output/application_with_intrinsics.json +++ b/tests/translator/output/application_with_intrinsics.json @@ -28,6 +28,8 @@ "Resources": { "ApplicationFindInMap": { "Type": "AWS::CloudFormation::Stack", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "NotificationARNs": [ { @@ -53,6 +55,8 @@ }, "ApplicationRefParameter": { "Type": "AWS::CloudFormation::Stack", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "TemplateURL": "https://awsserverlessrepo-changesets-xxx.s3.amazonaws.com/signed-url", "Tags": [ @@ -72,7 +76,9 @@ } }, "Sns": { - "Type": "AWS::SNS::Topic" + "Type": "AWS::SNS::Topic", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" } } } diff --git a/tests/translator/output/aws-cn/api_with_source_vpc_whitelist.json b/tests/translator/output/aws-cn/api_with_source_vpc_whitelist.json index 0d238d2a2..76f5ba883 100644 --- a/tests/translator/output/aws-cn/api_with_source_vpc_whitelist.json +++ b/tests/translator/output/aws-cn/api_with_source_vpc_whitelist.json @@ -8,6 +8,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -30,6 +32,8 @@ }, "MyFunctionFetchPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -51,6 +55,8 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment5332c373d4" @@ -63,6 +69,8 @@ }, "ServerlessRestApiDeploymentf39840708b": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -73,6 +81,8 @@ }, "MyApiDeployment5332c373d4": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -83,6 +93,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentf39840708b" @@ -95,6 +107,8 @@ }, "MyFunctionApiPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -116,6 +130,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -146,6 +162,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -275,6 +293,8 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_stage_tags.json b/tests/translator/output/aws-cn/api_with_stage_tags.json index 1e9912886..ad7510546 100644 --- a/tests/translator/output/aws-cn/api_with_stage_tags.json +++ b/tests/translator/output/aws-cn/api_with_stage_tags.json @@ -8,6 +8,8 @@ "Resources": { "MyApiWithStageTagsDeployment5332c373d4": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithStageTags" @@ -18,6 +20,8 @@ }, "MyApiWithStageTags": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -41,6 +45,8 @@ }, "MyApiWithStageTagsProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithStageTagsDeployment5332c373d4" diff --git a/tests/translator/output/aws-cn/api_with_swagger_and_openapi_with_auth.json b/tests/translator/output/aws-cn/api_with_swagger_and_openapi_with_auth.json index 553c9fc90..eb35d710e 100644 --- a/tests/translator/output/aws-cn/api_with_swagger_and_openapi_with_auth.json +++ b/tests/translator/output/aws-cn/api_with_swagger_and_openapi_with_auth.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -117,6 +123,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -134,6 +142,8 @@ }, "ServerlessRestApiDeploymente1212668e0": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -144,6 +154,8 @@ }, "ExplicitApiSomeStageStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -161,6 +173,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -182,6 +196,8 @@ }, "MyUserPool": { "Type": "AWS::Cognito::UserPool", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "UsernameAttributes": [ "email" @@ -203,6 +219,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -264,6 +282,8 @@ }, "ExplicitApiDeployment7c4f7dda23": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" diff --git a/tests/translator/output/aws-cn/api_with_swagger_authorizer_none.json b/tests/translator/output/aws-cn/api_with_swagger_authorizer_none.json deleted file mode 100644 index bf67b0a5a..000000000 --- a/tests/translator/output/aws-cn/api_with_swagger_authorizer_none.json +++ /dev/null @@ -1,499 +0,0 @@ -{ - "Resources": { - "MyFnCognitoPermissionProd": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "Principal": "apigateway.amazonaws.com", - "FunctionName": { - "Ref": "MyFn" - }, - "SourceArn": { - "Fn::Sub": [ - "arn:aws-cn:execute-api:${AWS::Region}:${AWS::AccountId}:${__ApiId__}/${__Stage__}/GET/cognito", - { - "__Stage__": "*", - "__ApiId__": { - "Ref": "MyApiWithCognitoAuth" - } - } - ] - } - } - }, - "MyApiWithCognitoAuth": { - "Type": "AWS::ApiGateway::RestApi", - "Properties": { - "Body": { - "info": { - "version": "1.0", - "title": { - "Ref": "AWS::StackName" - } - }, - "paths": { - "/cognito": { - "get": { - "x-amazon-apigateway-integration": { - "httpMethod": "POST", - "type": "aws_proxy", - "uri": { - "Fn::Sub": "arn:aws-cn:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${MyFn.Arn}/invocations" - } - }, - "security": [ - { - "NONE": [] - } - ], - "responses": {} - } - } - }, - "swagger": "2.0", - "securityDefinitions": { - "MyCognitoAuth": { - "in": "header", - "type": "apiKey", - "name": "Authorization", - "x-amazon-apigateway-authorizer": { - "providerARNs": [ - { - "Fn::GetAtt": [ - "MyUserPool", - "Arn" - ] - } - ], - "type": "cognito_user_pools" - }, - "x-amazon-apigateway-authtype": "cognito_user_pools" - } - } - }, - "EndpointConfiguration": { - "Types": [ - "REGIONAL" - ] - }, - "Parameters": { - "endpointConfigurationTypes": "REGIONAL" - } - } - }, - "MyApiWithLambdaRequestAuthDeploymentbad519dbd8": { - "Type": "AWS::ApiGateway::Deployment", - "Properties": { - "RestApiId": { - "Ref": "MyApiWithLambdaRequestAuth" - }, - "Description": "RestApi deployment id: bad519dbd801b0e2c63dc6f2011f43bce33c262a", - "StageName": "Stage" - } - }, - "MyApiWithLambdaTokenAuthDeployment29918bbdc1": { - "Type": "AWS::ApiGateway::Deployment", - "Properties": { - "RestApiId": { - "Ref": "MyApiWithLambdaTokenAuth" - }, - "Description": "RestApi deployment id: 29918bbdc180ceedbabcf34c01ca5342e8c019cd", - "StageName": "Stage" - } - }, - "MyFnLambdaTokenPermissionProd": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "Principal": "apigateway.amazonaws.com", - "FunctionName": { - "Ref": "MyFn" - }, - "SourceArn": { - "Fn::Sub": [ - "arn:aws-cn:execute-api:${AWS::Region}:${AWS::AccountId}:${__ApiId__}/${__Stage__}/GET/lambda-token", - { - "__Stage__": "*", - "__ApiId__": { - "Ref": "MyApiWithLambdaTokenAuth" - } - } - ] - } - } - }, - "MyApiWithLambdaTokenAuthMyLambdaTokenAuthAuthorizerPermission": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "Principal": "apigateway.amazonaws.com", - "FunctionName": { - "Fn::GetAtt": [ - "MyAuthFn", - "Arn" - ] - }, - "SourceArn": { - "Fn::Sub": [ - "arn:aws-cn:execute-api:${AWS::Region}:${AWS::AccountId}:${__ApiId__}/authorizers/*", - { - "__ApiId__": { - "Ref": "MyApiWithLambdaTokenAuth" - } - } - ] - } - } - }, - "MyFnLambdaRequestPermissionProd": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "Principal": "apigateway.amazonaws.com", - "FunctionName": { - "Ref": "MyFn" - }, - "SourceArn": { - "Fn::Sub": [ - "arn:aws-cn:execute-api:${AWS::Region}:${AWS::AccountId}:${__ApiId__}/${__Stage__}/GET/lambda-request", - { - "__Stage__": "*", - "__ApiId__": { - "Ref": "MyApiWithLambdaRequestAuth" - } - } - ] - } - } - }, - "MyApiWithLambdaTokenAuth": { - "Type": "AWS::ApiGateway::RestApi", - "Properties": { - "Body": { - "info": { - "version": "1.0", - "title": { - "Ref": "AWS::StackName" - } - }, - "paths": { - "/lambda-token": { - "get": { - "x-amazon-apigateway-integration": { - "httpMethod": "POST", - "type": "aws_proxy", - "uri": { - "Fn::Sub": "arn:aws-cn:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${MyFn.Arn}/invocations" - } - }, - "security": [ - { - "NONE": [] - } - ], - "responses": {} - } - } - }, - "swagger": "2.0", - "securityDefinitions": { - "MyLambdaTokenAuth": { - "in": "header", - "type": "apiKey", - "name": "Authorization", - "x-amazon-apigateway-authorizer": { - "type": "token", - "authorizerUri": { - "Fn::Sub": [ - "arn:aws-cn:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${__FunctionArn__}/invocations", - { - "__FunctionArn__": { - "Fn::GetAtt": [ - "MyAuthFn", - "Arn" - ] - } - } - ] - } - }, - "x-amazon-apigateway-authtype": "custom" - } - } - }, - "EndpointConfiguration": { - "Types": [ - "REGIONAL" - ] - }, - "Parameters": { - "endpointConfigurationTypes": "REGIONAL" - } - } - }, - "MyApiWithLambdaTokenAuthProdStage": { - "Type": "AWS::ApiGateway::Stage", - "Properties": { - "DeploymentId": { - "Ref": "MyApiWithLambdaTokenAuthDeployment29918bbdc1" - }, - "RestApiId": { - "Ref": "MyApiWithLambdaTokenAuth" - }, - "StageName": "Prod" - } - }, - "MyApiWithLambdaRequestAuthProdStage": { - "Type": "AWS::ApiGateway::Stage", - "Properties": { - "DeploymentId": { - "Ref": "MyApiWithLambdaRequestAuthDeploymentbad519dbd8" - }, - "RestApiId": { - "Ref": "MyApiWithLambdaRequestAuth" - }, - "StageName": "Prod" - } - }, - "MyUserPool": { - "Type": "AWS::Cognito::UserPool", - "Properties": { - "UsernameAttributes": [ - "email" - ], - "UserPoolName": "UserPoolName", - "Policies": { - "PasswordPolicy": { - "MinimumLength": 8 - } - }, - "Schema": [ - { - "AttributeDataType": "String", - "Required": false, - "Name": "email" - } - ] - } - }, - "MyAuthFn": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Handler": "index.handler", - "Code": { - "ZipFile": "exports.handler = async (event) => {\n return {\n statusCode: 200,\n body: JSON.stringify(event),\n headers: {}\n }\n}\n" - }, - "Role": { - "Fn::GetAtt": [ - "MyAuthFnRole", - "Arn" - ] - }, - "Runtime": "nodejs12.x", - "Tags": [ - { - "Value": "SAM", - "Key": "lambda:createdBy" - } - ] - } - }, - "MyApiWithLambdaRequestAuth": { - "Type": "AWS::ApiGateway::RestApi", - "Properties": { - "Body": { - "info": { - "version": "1.0", - "title": { - "Ref": "AWS::StackName" - } - }, - "paths": { - "/lambda-request": { - "get": { - "x-amazon-apigateway-integration": { - "httpMethod": "POST", - "passthroughBehavior": "when_no_match", - "type": "aws_proxy", - "uri": { - "Fn::Sub": "arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${MyFn.Arn}/invocations" - } - }, - "security": [ - { - "NONE": [] - } - ], - "responses": {} - } - } - }, - "swagger": 2.0, - "schemes": [ - "https" - ], - "securityDefinitions": { - "MyLambdaRequestAuth": { - "in": "header", - "type": "apiKey", - "name": "Unused", - "x-amazon-apigateway-authorizer": { - "type": "request", - "identitySource": "method.request.header.Authorization1", - "authorizerUri": { - "Fn::Sub": [ - "arn:aws-cn:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${__FunctionArn__}/invocations", - { - "__FunctionArn__": { - "Fn::GetAtt": [ - "MyAuthFn", - "Arn" - ] - } - } - ] - } - }, - "x-amazon-apigateway-authtype": "custom" - } - } - }, - "EndpointConfiguration": { - "Types": [ - "REGIONAL" - ] - }, - "Parameters": { - "endpointConfigurationTypes": "REGIONAL" - } - } - }, - "MyApiWithCognitoAuthDeployment77726cd3cb": { - "Type": "AWS::ApiGateway::Deployment", - "Properties": { - "RestApiId": { - "Ref": "MyApiWithCognitoAuth" - }, - "Description": "RestApi deployment id: 77726cd3cb8eddd94a4856ca8d65ee0f39d03b2e", - "StageName": "Stage" - } - }, - "MyAuthFnRole": { - "Type": "AWS::IAM::Role", - "Properties": { - "ManagedPolicyArns": [ - "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ], - "Tags": [ - { - "Value": "SAM", - "Key": "lambda:createdBy" - } - ], - "AssumeRolePolicyDocument": { - "Version": "2012-10-17", - "Statement": [ - { - "Action": [ - "sts:AssumeRole" - ], - "Effect": "Allow", - "Principal": { - "Service": [ - "lambda.amazonaws.com" - ] - } - } - ] - } - } - }, - "MyFnRole": { - "Type": "AWS::IAM::Role", - "Properties": { - "ManagedPolicyArns": [ - "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ], - "Tags": [ - { - "Value": "SAM", - "Key": "lambda:createdBy" - } - ], - "AssumeRolePolicyDocument": { - "Version": "2012-10-17", - "Statement": [ - { - "Action": [ - "sts:AssumeRole" - ], - "Effect": "Allow", - "Principal": { - "Service": [ - "lambda.amazonaws.com" - ] - } - } - ] - } - } - }, - "MyApiWithCognitoAuthProdStage": { - "Type": "AWS::ApiGateway::Stage", - "Properties": { - "DeploymentId": { - "Ref": "MyApiWithCognitoAuthDeployment77726cd3cb" - }, - "RestApiId": { - "Ref": "MyApiWithCognitoAuth" - }, - "StageName": "Prod" - } - }, - "MyFn": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Handler": "index.handler", - "Code": { - "ZipFile": "exports.handler = async (event) => {\n return {\n statusCode: 200,\n body: JSON.stringify(event),\n headers: {}\n }\n}\n" - }, - "Role": { - "Fn::GetAtt": [ - "MyFnRole", - "Arn" - ] - }, - "Runtime": "nodejs12.x", - "Tags": [ - { - "Value": "SAM", - "Key": "lambda:createdBy" - } - ] - } - }, - "MyApiWithLambdaRequestAuthMyLambdaRequestAuthAuthorizerPermission": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "Principal": "apigateway.amazonaws.com", - "FunctionName": { - "Fn::GetAtt": [ - "MyAuthFn", - "Arn" - ] - }, - "SourceArn": { - "Fn::Sub": [ - "arn:aws-cn:execute-api:${AWS::Region}:${AWS::AccountId}:${__ApiId__}/authorizers/*", - { - "__ApiId__": { - "Ref": "MyApiWithLambdaRequestAuth" - } - } - ] - } - } - } - } -} \ No newline at end of file diff --git a/tests/translator/output/aws-cn/api_with_usageplans.json b/tests/translator/output/aws-cn/api_with_usageplans.json index 60dc7b392..3167b7c45 100644 --- a/tests/translator/output/aws-cn/api_with_usageplans.json +++ b/tests/translator/output/aws-cn/api_with_usageplans.json @@ -40,6 +40,8 @@ "Resources": { "MyFunctionThreeRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -70,6 +72,8 @@ }, "MyApiOneDeployment7997029260": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiOne" @@ -80,6 +84,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment40b50dc688" @@ -92,6 +98,8 @@ }, "MyApiTwoUsagePlanKey": { "Type": "AWS::ApiGateway::UsagePlanKey", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "KeyType": "API_KEY", "KeyId": { @@ -107,6 +115,8 @@ }, "MyApiThree": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -155,6 +165,8 @@ }, "MyFunctionThreeApiKeyPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -176,6 +188,8 @@ }, "MyFunctionTwo": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -198,6 +212,8 @@ }, "MyFunctionOneApiKeyPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -219,6 +235,8 @@ }, "MyFunctionTwoApiKeyPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -240,6 +258,8 @@ }, "MyFunctionOneRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -270,6 +290,8 @@ }, "MyApiTwo": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -318,6 +340,8 @@ }, "MyFunctionTwoRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -348,6 +372,8 @@ }, "MyFunctionOne": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -370,6 +396,8 @@ }, "ServerlessRestApiDeployment40b50dc688": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -380,6 +408,8 @@ }, "ServerlessUsagePlan": { "Type": "AWS::ApiGateway::UsagePlan", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiStages": [ { @@ -407,6 +437,8 @@ }, "MyApiTwoUsagePlan": { "Type": "AWS::ApiGateway::UsagePlan", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiStages": [ { @@ -446,6 +478,8 @@ }, "MyFunctionTwoImplicitApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -467,6 +501,8 @@ }, "MyApiTwoProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiTwoDeployment03730b64c4" @@ -479,6 +515,8 @@ }, "MyApiOneProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiOneDeployment7997029260" @@ -491,6 +529,8 @@ }, "MyApiTwoDeployment03730b64c4": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiTwo" @@ -501,6 +541,8 @@ }, "MyFunctionThree": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -523,6 +565,8 @@ }, "MyApiThreeProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiThreeDeploymentfa9f73f027" @@ -535,6 +579,8 @@ }, "ServerlessUsagePlanKey": { "Type": "AWS::ApiGateway::UsagePlanKey", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "KeyType": "API_KEY", "KeyId": { @@ -550,6 +596,8 @@ }, "MyApiOne": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -598,6 +646,8 @@ }, "ServerlessApiKey": { "Type": "AWS::ApiGateway::ApiKey", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Enabled": true, "StageKeys": [ @@ -625,6 +675,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -673,6 +725,8 @@ }, "MyApiThreeDeploymentfa9f73f027": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiThree" @@ -683,6 +737,8 @@ }, "MyApiTwoApiKey": { "Type": "AWS::ApiGateway::ApiKey", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Enabled": true, "StageKeys": [ diff --git a/tests/translator/output/aws-cn/api_with_usageplans_intrinsics.json b/tests/translator/output/aws-cn/api_with_usageplans_intrinsics.json index c9a6c4230..00459d7a2 100644 --- a/tests/translator/output/aws-cn/api_with_usageplans_intrinsics.json +++ b/tests/translator/output/aws-cn/api_with_usageplans_intrinsics.json @@ -30,6 +30,8 @@ "Resources": { "MyApiTwoUsagePlanKey": { "Type": "AWS::ApiGateway::UsagePlanKey", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "KeyType": "API_KEY", "KeyId": { @@ -45,6 +47,8 @@ }, "MyApiOneUsagePlan": { "Type": "AWS::ApiGateway::UsagePlan", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiStages": [ { @@ -64,6 +68,8 @@ }, "MyApiTwoUsagePlan": { "Type": "AWS::ApiGateway::UsagePlan", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiStages": [ { @@ -82,6 +88,8 @@ }, "MyApiTwoDeploymenta997b9e562": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiTwo" @@ -91,6 +99,8 @@ }, "MyApiOneUsagePlanKey": { "Type": "AWS::ApiGateway::UsagePlanKey", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "KeyType": "API_KEY", "KeyId": { @@ -107,6 +117,8 @@ }, "MyApiTwoProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiTwoDeploymenta997b9e562" @@ -119,6 +131,8 @@ }, "MyApiOneProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiOneDeploymentd8cca8c82b" @@ -132,6 +146,8 @@ }, "MyApiOneApiKey": { "Type": "AWS::ApiGateway::ApiKey", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Enabled": true, "StageKeys": [ @@ -152,6 +168,8 @@ }, "MyFunctionTwoRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -182,6 +200,8 @@ }, "MyApiOneDeploymentd8cca8c82b": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiOne" @@ -192,6 +212,8 @@ }, "MyApiTwoApiKey": { "Type": "AWS::ApiGateway::ApiKey", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Enabled": true, "StageKeys": [ @@ -211,6 +233,8 @@ }, "MyFunctionOneApiKeyPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -232,6 +256,8 @@ }, "MyFunctionTwo": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -254,6 +280,8 @@ }, "MyFunctionTwoApiKeyPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -275,6 +303,8 @@ }, "MyFunctionOneRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -305,6 +335,8 @@ }, "MyApiTwo": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -355,6 +387,8 @@ }, "MyApiOne": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -406,6 +440,8 @@ }, "MyFunctionOne": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { diff --git a/tests/translator/output/aws-cn/api_with_xray_tracing.json b/tests/translator/output/aws-cn/api_with_xray_tracing.json index 34acf4597..1fc8c5cf0 100644 --- a/tests/translator/output/aws-cn/api_with_xray_tracing.json +++ b/tests/translator/output/aws-cn/api_with_xray_tracing.json @@ -2,6 +2,8 @@ "Resources": { "HtmlFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -32,6 +34,8 @@ }, "HtmlApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "HtmlApiDeploymentf117c932f7" @@ -45,6 +49,8 @@ }, "HtmlFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -64,6 +70,8 @@ }, "HtmlApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "HtmlApi" @@ -74,6 +82,8 @@ }, "HtmlApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -91,6 +101,8 @@ }, "HtmlFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-cn/application_preparing_state.json b/tests/translator/output/aws-cn/application_preparing_state.json index 92fe7cc8d..bfb82c032 100644 --- a/tests/translator/output/aws-cn/application_preparing_state.json +++ b/tests/translator/output/aws-cn/application_preparing_state.json @@ -2,6 +2,8 @@ "Resources": { "PreparingApplication": { "Type": "AWS::CloudFormation::Stack", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "TemplateURL": "https://awsserverlessrepo-changesets-xxx.s3.amazonaws.com/signed-url", "Tags": [ diff --git a/tests/translator/output/aws-cn/application_with_intrinsics.json b/tests/translator/output/aws-cn/application_with_intrinsics.json index 314a99e30..494b74b01 100644 --- a/tests/translator/output/aws-cn/application_with_intrinsics.json +++ b/tests/translator/output/aws-cn/application_with_intrinsics.json @@ -28,6 +28,8 @@ "Resources": { "ApplicationFindInMap": { "Type": "AWS::CloudFormation::Stack", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "NotificationARNs": [ { @@ -53,6 +55,8 @@ }, "ApplicationRefParameter": { "Type": "AWS::CloudFormation::Stack", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "TemplateURL": "https://awsserverlessrepo-changesets-xxx.s3.amazonaws.com/signed-url", "Tags": [ @@ -72,7 +76,9 @@ } }, "Sns": { - "Type": "AWS::SNS::Topic" + "Type": "AWS::SNS::Topic", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" } } } diff --git a/tests/translator/output/aws-cn/basic_application.json b/tests/translator/output/aws-cn/basic_application.json index 058e8037e..fa4e7d8e4 100644 --- a/tests/translator/output/aws-cn/basic_application.json +++ b/tests/translator/output/aws-cn/basic_application.json @@ -10,6 +10,8 @@ "Resources": { "NormalApplication": { "Type": "AWS::CloudFormation::Stack", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "NotificationARNs": [ "arn:aws:sns:us-east-1:123456789012:sns-arn" @@ -41,6 +43,8 @@ }, "BasicApplication": { "Type": "AWS::CloudFormation::Stack", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "TemplateURL": "https://awsserverlessrepo-changesets-xxx.s3.amazonaws.com/signed-url", "Tags": [ @@ -61,6 +65,8 @@ }, "ApplicationWithLocationUrl": { "Type": "AWS::CloudFormation::Stack", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "TemplateURL": "https://s3-us-east-1.amazonaws.com/demo-bucket/template.yaml", "Tags": [ @@ -77,6 +83,8 @@ }, "ApplicationWithCondition": { "Type": "AWS::CloudFormation::Stack", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "TemplateURL": "https://awsserverlessrepo-changesets-xxx.s3.amazonaws.com/signed-url", "Tags": [ diff --git a/tests/translator/output/aws-cn/basic_function.json b/tests/translator/output/aws-cn/basic_function.json index f3d2b1891..2c37233b6 100644 --- a/tests/translator/output/aws-cn/basic_function.json +++ b/tests/translator/output/aws-cn/basic_function.json @@ -12,6 +12,8 @@ "Resources": { "FunctionWithInlineCode": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "TracingConfig": { "Mode": "Active" @@ -37,6 +39,8 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -67,6 +71,8 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -90,6 +96,8 @@ }, "FunctionWithPolicyDocument": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -113,6 +121,8 @@ }, "FunctionWithPolicies": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -136,6 +146,8 @@ }, "FunctionWithCodeUriObjectRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -166,6 +178,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Path": "/", "Policies": [ @@ -203,6 +217,8 @@ }, "CompleteFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -245,6 +261,8 @@ }, "FunctionWithCodeUriObject": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -269,6 +287,8 @@ }, "FunctionWithPoliciesRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -300,6 +320,8 @@ }, "FunctionWithInlineCodeRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -331,6 +353,8 @@ }, "FunctionWithTracingRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -362,6 +386,8 @@ }, "FunctionWithRoleRef": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -385,6 +411,8 @@ }, "FunctionWithTracing": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "TracingConfig": { "Mode": "Active" @@ -411,6 +439,8 @@ }, "FunctionWithPolicyDocumentRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-cn/basic_function_with_tags.json b/tests/translator/output/aws-cn/basic_function_with_tags.json index 119f925f3..b51f7e069 100644 --- a/tests/translator/output/aws-cn/basic_function_with_tags.json +++ b/tests/translator/output/aws-cn/basic_function_with_tags.json @@ -9,6 +9,8 @@ "Resources": { "AlexaSkillFuncRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -58,6 +60,8 @@ }, "AlexaSkillFuncAlexaSkillEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { @@ -68,6 +72,8 @@ }, "AlexaSkillFunc": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-cn/basic_function_withimageuri.json b/tests/translator/output/aws-cn/basic_function_withimageuri.json index 894fbb717..a9b5f1163 100644 --- a/tests/translator/output/aws-cn/basic_function_withimageuri.json +++ b/tests/translator/output/aws-cn/basic_function_withimageuri.json @@ -12,6 +12,8 @@ "Resources": { "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -49,6 +51,8 @@ }, "MinimalImageFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ImageUri": "123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest" @@ -70,6 +74,8 @@ }, "MinimalImageFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -100,6 +106,8 @@ }, "MinimalImageFunctionPackageTypeAndImageConfig": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ImageUri": "123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest" @@ -126,6 +134,8 @@ }, "MinimalImageFunctionPackageTypeAndImageConfigRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -156,6 +166,8 @@ }, "CompleteImageFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ImageUri": "123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest" @@ -201,6 +213,8 @@ }, "FunctionWithPolicies": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ImageUri": "123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest" @@ -222,6 +236,8 @@ }, "FunctionWithPoliciesRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -253,6 +269,8 @@ }, "FunctionWithPolicyDocument": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ImageUri": "123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest" @@ -274,6 +292,8 @@ }, "FunctionWithPolicyDocumentRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -320,6 +340,8 @@ }, "FunctionWithRoleRef": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ImageUri": "123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest" diff --git a/tests/translator/output/aws-cn/basic_layer.json b/tests/translator/output/aws-cn/basic_layer.json index d373bd19c..9c430b9b1 100644 --- a/tests/translator/output/aws-cn/basic_layer.json +++ b/tests/translator/output/aws-cn/basic_layer.json @@ -8,8 +8,9 @@ } }, "Resources": { - "LayerWithCondition7c655e10ea": { - "DeletionPolicy": "Retain", + "LayerWithConditionec24995757": { + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Type": "AWS::Lambda::LayerVersion", "Properties": { "Content": { @@ -20,8 +21,9 @@ }, "Condition": "TestCondition" }, - "MinimalLayer0c7f96cce7": { - "DeletionPolicy": "Retain", + "MinimalLayer7d49517128": { + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Type": "AWS::Lambda::LayerVersion", "Properties": { "Content": { @@ -31,7 +33,8 @@ "LayerName": "MinimalLayer" } }, - "CompleteLayer5d71a60e81": { + "CompleteLayer01b64931e6": { + "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Retain", "Type": "AWS::Lambda::LayerVersion", "Properties": { @@ -48,7 +51,8 @@ ] } }, - "LayerWithContentUriObjectbdbf1b82ac": { + "LayerWithContentUriObject678c9b5427": { + "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete", "Type": "AWS::Lambda::LayerVersion", "Properties": { diff --git a/tests/translator/output/aws-cn/cloudwatch_logs_with_ref.json b/tests/translator/output/aws-cn/cloudwatch_logs_with_ref.json index 029fab42e..f170efee7 100644 --- a/tests/translator/output/aws-cn/cloudwatch_logs_with_ref.json +++ b/tests/translator/output/aws-cn/cloudwatch_logs_with_ref.json @@ -13,6 +13,8 @@ "Resources": { "TriggeredFunctionCWLogEvent": { "Type": "AWS::Logs::SubscriptionFilter", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DestinationArn": { "Fn::GetAtt": [ @@ -33,6 +35,8 @@ }, "TriggeredFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -57,6 +61,8 @@ }, "TriggeredFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -87,6 +93,8 @@ }, "TriggeredFunctionCWLogEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "logs.amazonaws.com", diff --git a/tests/translator/output/aws-cn/cloudwatchevent.json b/tests/translator/output/aws-cn/cloudwatchevent.json index b62317f54..27b0f00d7 100644 --- a/tests/translator/output/aws-cn/cloudwatchevent.json +++ b/tests/translator/output/aws-cn/cloudwatchevent.json @@ -2,6 +2,8 @@ "Resources": { "ScheduledFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -32,6 +34,8 @@ }, "TriggeredFunctionOnTerminatePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -48,6 +52,8 @@ }, "ScheduledFunctionSchedulePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -64,6 +70,8 @@ }, "ScheduledFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -88,6 +96,8 @@ }, "TriggeredFunctionOnTerminate": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -112,6 +122,8 @@ }, "TriggeredFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -136,6 +148,8 @@ }, "TriggeredFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -166,6 +180,8 @@ }, "ScheduledFunctionSchedule": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ScheduleExpression": "rate(1 minute)", "Targets": [ diff --git a/tests/translator/output/aws-cn/cloudwatchlog.json b/tests/translator/output/aws-cn/cloudwatchlog.json index f11344282..83d950b1b 100644 --- a/tests/translator/output/aws-cn/cloudwatchlog.json +++ b/tests/translator/output/aws-cn/cloudwatchlog.json @@ -2,6 +2,8 @@ "Resources": { "TriggeredFunctionCWLogEvent": { "Type": "AWS::Logs::SubscriptionFilter", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DestinationArn": { "Fn::GetAtt": [ @@ -18,6 +20,8 @@ }, "TriggeredFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -42,6 +46,8 @@ }, "TriggeredFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -72,6 +78,8 @@ }, "TriggeredFunctionCWLogEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "logs.amazonaws.com", diff --git a/tests/translator/output/aws-cn/cognito_userpool_with_event.json b/tests/translator/output/aws-cn/cognito_userpool_with_event.json index 973838a75..9d0c71d99 100644 --- a/tests/translator/output/aws-cn/cognito_userpool_with_event.json +++ b/tests/translator/output/aws-cn/cognito_userpool_with_event.json @@ -2,6 +2,8 @@ "Resources": { "UserPool": { "Type": "AWS::Cognito::UserPool", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "LambdaConfig": { "PreSignUp": { @@ -27,6 +29,8 @@ }, "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -50,6 +54,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -80,6 +86,8 @@ }, "ImplicitApiFunctionCognitoPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { diff --git a/tests/translator/output/aws-cn/depends_on.json b/tests/translator/output/aws-cn/depends_on.json index f05114985..d4de265b6 100644 --- a/tests/translator/output/aws-cn/depends_on.json +++ b/tests/translator/output/aws-cn/depends_on.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -29,6 +31,8 @@ }, "MyExplicitApiDeployment74b681ce04": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyExplicitApi" @@ -39,6 +43,8 @@ }, "MyExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -57,6 +63,8 @@ }, "MyOtherTable": { "Type": "AWS::DynamoDB::Table", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "KeySchema": [ { @@ -82,6 +90,8 @@ }, "MyExplicitApidevStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyExplicitApiDeployment74b681ce04" @@ -94,6 +104,8 @@ }, "MySamTable": { "Type": "AWS::DynamoDB::Table", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BillingMode": "PAY_PER_REQUEST", "AttributeDefinitions": [ @@ -112,6 +124,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -142,6 +156,8 @@ }, "MyFunctionMyApiPermissiondev": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-cn/eventbridgerule.json b/tests/translator/output/aws-cn/eventbridgerule.json index 91c6a68e8..67a33837a 100644 --- a/tests/translator/output/aws-cn/eventbridgerule.json +++ b/tests/translator/output/aws-cn/eventbridgerule.json @@ -2,6 +2,8 @@ "Resources": { "ScheduledFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -32,6 +34,8 @@ }, "TriggeredFunctionOnTerminatePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -48,6 +52,8 @@ }, "ScheduledFunctionSchedulePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -64,6 +70,8 @@ }, "ScheduledFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -88,6 +96,8 @@ }, "TriggeredFunctionOnTerminate": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -112,6 +122,8 @@ }, "TriggeredFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -136,6 +148,8 @@ }, "TriggeredFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -166,6 +180,8 @@ }, "ScheduledFunctionSchedule": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ScheduleExpression": "rate(1 minute)", "Targets": [ diff --git a/tests/translator/output/aws-cn/eventbridgerule_schedule_properties.json b/tests/translator/output/aws-cn/eventbridgerule_schedule_properties.json index 4f463b834..b7e4396a6 100644 --- a/tests/translator/output/aws-cn/eventbridgerule_schedule_properties.json +++ b/tests/translator/output/aws-cn/eventbridgerule_schedule_properties.json @@ -2,6 +2,8 @@ "Resources": { "ScheduledFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -32,6 +34,8 @@ }, "TriggeredFunctionOnTerminatePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -48,6 +52,8 @@ }, "ScheduledFunctionSchedulePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -64,6 +70,8 @@ }, "ScheduledFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -88,6 +96,8 @@ }, "TriggeredFunctionOnTerminate": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -111,6 +121,8 @@ }, "TriggeredFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -135,6 +147,8 @@ }, "TriggeredFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -165,11 +179,13 @@ }, "ScheduledFunctionSchedule": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ScheduleExpression": "rate(1 minute)", - "Name": "test-schedule", - "Description": "Test Schedule", - "State": "ENABLED", + "Name": "test-schedule", + "Description": "Test Schedule", + "State": "ENABLED", "Targets": [ { "Id": "ScheduledFunctionScheduleLambdaTarget", diff --git a/tests/translator/output/aws-cn/eventbridgerule_with_dlq.json b/tests/translator/output/aws-cn/eventbridgerule_with_dlq.json index 6f6fa0460..11455cf14 100644 --- a/tests/translator/output/aws-cn/eventbridgerule_with_dlq.json +++ b/tests/translator/output/aws-cn/eventbridgerule_with_dlq.json @@ -2,6 +2,8 @@ "Resources": { "ScheduledFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -32,6 +34,8 @@ }, "ScheduledFunctionScheduleQueuePolicy": { "Type": "AWS::SQS::QueuePolicy", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Queues": [ { @@ -70,6 +74,8 @@ }, "TriggeredFunctionOnTerminate": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -97,6 +103,8 @@ }, "TriggeredFunctionOnTerminatePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -113,6 +121,8 @@ }, "ScheduledFunctionSchedulePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -129,6 +139,8 @@ }, "ScheduledFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -153,10 +165,14 @@ }, "ScheduledFunctionScheduleQueue": { "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": {} }, "TriggeredFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -181,6 +197,8 @@ }, "TriggeredFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -211,6 +229,8 @@ }, "ScheduledFunctionSchedule": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ScheduleExpression": "rate(1 minute)", "Targets": [ diff --git a/tests/translator/output/aws-cn/eventbridgerule_with_retry_policy.json b/tests/translator/output/aws-cn/eventbridgerule_with_retry_policy.json index d1ab9d848..7e834d5f1 100644 --- a/tests/translator/output/aws-cn/eventbridgerule_with_retry_policy.json +++ b/tests/translator/output/aws-cn/eventbridgerule_with_retry_policy.json @@ -2,6 +2,8 @@ "Resources": { "ScheduledFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -32,6 +34,8 @@ }, "TriggeredFunctionOnTerminatePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -48,6 +52,8 @@ }, "ScheduledFunctionSchedulePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -64,6 +70,8 @@ }, "ScheduledFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -88,6 +96,8 @@ }, "TriggeredFunctionOnTerminate": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -116,6 +126,8 @@ }, "TriggeredFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -140,6 +152,8 @@ }, "TriggeredFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -170,6 +184,8 @@ }, "ScheduledFunctionSchedule": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ScheduleExpression": "rate(1 minute)", "Targets": [ diff --git a/tests/translator/output/aws-cn/explicit_api.json b/tests/translator/output/aws-cn/explicit_api.json index 81fb57d35..db3c14830 100644 --- a/tests/translator/output/aws-cn/explicit_api.json +++ b/tests/translator/output/aws-cn/explicit_api.json @@ -12,6 +12,8 @@ "Resources": { "GetHtmlFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -35,6 +37,8 @@ }, "ApiWithInlineSwaggerStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ApiWithInlineSwaggerDeployment09cda3d97b" @@ -49,6 +53,8 @@ }, "GetHtmlApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "GetHtmlApi" @@ -59,6 +65,8 @@ }, "GetHtmlFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -91,6 +99,8 @@ }, "ApiWithInlineSwagger": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "this": "is", @@ -108,6 +118,8 @@ }, "GetHtmlFunctionGetHtmlPermissionStage": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -129,6 +141,8 @@ }, "GetHtmlApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -147,6 +161,8 @@ }, "GetHtmlApiStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "GetHtmlApiDeploymentf117c932f7" @@ -167,6 +183,8 @@ }, "ApiWithInlineSwaggerDeployment09cda3d97b": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ApiWithInlineSwagger" diff --git a/tests/translator/output/aws-cn/explicit_api_openapi_3.json b/tests/translator/output/aws-cn/explicit_api_openapi_3.json index 38e863d3a..60b14ae84 100644 --- a/tests/translator/output/aws-cn/explicit_api_openapi_3.json +++ b/tests/translator/output/aws-cn/explicit_api_openapi_3.json @@ -12,6 +12,8 @@ "Resources": { "GetHtmlFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -35,6 +37,8 @@ }, "ApiWithInlineSwaggerStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ApiWithInlineSwaggerDeployment74abcb3a5b" @@ -49,6 +53,8 @@ }, "GetHtmlApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "GetHtmlApi" @@ -59,6 +65,8 @@ }, "ApiWithInlineSwaggerDeployment74abcb3a5b": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ApiWithInlineSwagger" @@ -68,6 +76,8 @@ }, "GetHtmlFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -100,6 +110,8 @@ }, "ApiWithInlineSwagger": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "this": "is", @@ -117,6 +129,8 @@ }, "GetHtmlFunctionGetHtmlPermissionStage": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -138,6 +152,8 @@ }, "GetHtmlApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -156,6 +172,8 @@ }, "GetHtmlApiStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "GetHtmlApiDeploymentf117c932f7" diff --git a/tests/translator/output/aws-cn/explicit_api_with_invalid_events_config.json b/tests/translator/output/aws-cn/explicit_api_with_invalid_events_config.json index c4238ab30..2e8fb3046 100644 --- a/tests/translator/output/aws-cn/explicit_api_with_invalid_events_config.json +++ b/tests/translator/output/aws-cn/explicit_api_with_invalid_events_config.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -25,6 +27,8 @@ }, "MyFunctionAddApiPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -44,6 +48,8 @@ }, "ApiWithInlineSwaggerProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ApiWithInlineSwaggerDeployment22d399868d" @@ -56,6 +62,8 @@ }, "ApiWithInlineSwagger": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -92,6 +100,8 @@ }, "ApiWithInlineSwaggerDeployment22d399868d": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ApiWithInlineSwagger" @@ -102,6 +112,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-cn/explicit_http_api.json b/tests/translator/output/aws-cn/explicit_http_api.json index 2eebb7bb8..105ded6af 100644 --- a/tests/translator/output/aws-cn/explicit_http_api.json +++ b/tests/translator/output/aws-cn/explicit_http_api.json @@ -2,6 +2,8 @@ "Resources": { "MyApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -15,6 +17,8 @@ }, "MyApi2ApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi2" @@ -28,6 +32,8 @@ }, "HttpApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.restapi", "Code": { @@ -51,6 +57,8 @@ }, "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -72,6 +80,8 @@ }, "MyApi2": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -144,6 +154,8 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -174,6 +186,8 @@ }, "HttpApiFunctionBasePathPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -195,6 +209,8 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FailOnWarnings": true, "Body": { diff --git a/tests/translator/output/aws-cn/explicit_http_api_minimum.json b/tests/translator/output/aws-cn/explicit_http_api_minimum.json index 09367ab43..a2e49d1af 100644 --- a/tests/translator/output/aws-cn/explicit_http_api_minimum.json +++ b/tests/translator/output/aws-cn/explicit_http_api_minimum.json @@ -2,6 +2,8 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -25,6 +27,8 @@ }, "FunctionApiPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -46,6 +50,8 @@ }, "Api": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -67,6 +73,8 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -97,6 +105,8 @@ }, "ServerlessHttpApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -133,6 +143,8 @@ }, "ServerlessHttpApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "ServerlessHttpApi" @@ -146,6 +158,8 @@ }, "ApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "Api" diff --git a/tests/translator/output/aws-cn/function_concurrency.json b/tests/translator/output/aws-cn/function_concurrency.json index c7cdb002b..462e5c148 100644 --- a/tests/translator/output/aws-cn/function_concurrency.json +++ b/tests/translator/output/aws-cn/function_concurrency.json @@ -7,6 +7,8 @@ "Resources": { "ConcurrentFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -36,6 +38,8 @@ }, "ConcurrentFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -58,6 +62,8 @@ }, "AnotherFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -87,6 +93,8 @@ }, "AnotherFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-cn/function_event_conditions.json b/tests/translator/output/aws-cn/function_event_conditions.json index 1e1ee3b38..5524262e6 100644 --- a/tests/translator/output/aws-cn/function_event_conditions.json +++ b/tests/translator/output/aws-cn/function_event_conditions.json @@ -10,6 +10,8 @@ "Resources": { "MyAwesomeFunctionAliasLive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "FunctionVersion": { @@ -26,6 +28,8 @@ }, "MyAwesomeFunctionNotificationTopicPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Action": "lambda:InvokeFunction", @@ -40,6 +44,8 @@ }, "MyAwesomeFunctionCWEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Action": "lambda:InvokeFunction", @@ -57,6 +63,8 @@ }, "MyAwesomeFunctionEBRulePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Action": "lambda:InvokeFunction", @@ -74,6 +82,8 @@ }, "MyAwesomeFunctionDDBStream": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "BatchSize": 200, @@ -86,6 +96,8 @@ }, "MyAwesomeFunctionIoTRule": { "Type": "AWS::IoT::TopicRule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "TopicRulePayload": { @@ -106,6 +118,8 @@ }, "MyAwesomeFunctionKinesisStream": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "BatchSize": 100, @@ -118,6 +132,8 @@ }, "MyAwesomeFunctionIoTRulePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Action": "lambda:InvokeFunction", @@ -142,6 +158,8 @@ }, "MyAwesomeFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Endpoint": { @@ -155,6 +173,8 @@ }, "MyAwesomeFunctionS3TriggerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Action": "lambda:InvokeFunction", @@ -169,6 +189,8 @@ }, "MyAwesomeFunctionCWLogPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Action": "lambda:InvokeFunction", @@ -188,6 +210,8 @@ }, "MyAwesomeFunctionEBSchedule": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "ScheduleExpression": "rate(1 minute)", @@ -203,6 +227,8 @@ }, "MyAwesomeFunctionCWLog": { "Type": "AWS::Logs::SubscriptionFilter", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "DestinationArn": { @@ -217,6 +243,8 @@ }, "MyAwesomeFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "ManagedPolicyArns": [ @@ -251,6 +279,8 @@ }, "MyAwesomeFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Code": { @@ -275,6 +305,8 @@ }, "MyAwesomeFunctionCWEvent": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "EventPattern": { @@ -296,6 +328,8 @@ }, "MyAwesomeFunctionEBRule": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "EventPattern": { @@ -316,7 +350,8 @@ } }, "MyAwesomeFunctionVersion640128d35d": { - "DeletionPolicy": "Retain", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Type": "AWS::Lambda::Version", "Condition": "MyCondition", "Properties": { @@ -327,10 +362,14 @@ }, "Notifications": { "Condition": "MyCondition", - "Type": "AWS::SNS::Topic" + "Type": "AWS::SNS::Topic", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, "MyAwesomeFunctionEBSchedulePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Action": "lambda:InvokeFunction", @@ -348,6 +387,8 @@ }, "FunctionOneImageBucketPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -361,6 +402,8 @@ }, "FunctionOneRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -391,6 +434,8 @@ }, "FunctionOne": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -414,6 +459,8 @@ }, "Images": { "Type": "AWS::S3::Bucket", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "NotificationConfiguration": { "LambdaConfigurations": [ @@ -463,6 +510,8 @@ }, "MyAwesomeFunctionSNSTopicWithSQSSubscription": { "Type": "AWS::SNS::Subscription", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Endpoint": { "Fn::GetAtt": [ @@ -479,6 +528,8 @@ }, "MyAwesomeFunctionSNSTopicWithSQSSubscriptionQueuePolicy": { "Type": "AWS::SQS::QueuePolicy", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Queues": [ { @@ -513,6 +564,8 @@ }, "MyAwesomeFunctionSNSTopicWithSQSSubscriptionEventSourceMapping": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BatchSize": 10, "Enabled": true, @@ -531,10 +584,14 @@ "MyAwesomeFunctionAnotherSNSWithSQSSubscriptionQueue": { "Condition": "MyCondition", "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": {} }, "MyAwesomeFunctionAnotherSNSWithSQSSubscriptionEventSourceMapping": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BatchSize": 10, "Enabled": true, @@ -552,6 +609,8 @@ }, "MyAwesomeFunctionAnotherSNSWithSQSSubscription": { "Type": "AWS::SNS::Subscription", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Endpoint": { "Fn::GetAtt": [ @@ -568,6 +627,8 @@ }, "MyAwesomeFunctionAnotherSNSWithSQSSubscriptionQueuePolicy": { "Type": "AWS::SQS::QueuePolicy", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Queues": [ { @@ -602,6 +663,8 @@ }, "Queue": { "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition" } } diff --git a/tests/translator/output/aws-cn/function_managed_inline_policy.json b/tests/translator/output/aws-cn/function_managed_inline_policy.json index af76c7621..f15380c02 100644 --- a/tests/translator/output/aws-cn/function_managed_inline_policy.json +++ b/tests/translator/output/aws-cn/function_managed_inline_policy.json @@ -8,6 +8,8 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -31,6 +33,8 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", diff --git a/tests/translator/output/aws-cn/function_with_alias.json b/tests/translator/output/aws-cn/function_with_alias.json index cf8953e96..9aea9696f 100644 --- a/tests/translator/output/aws-cn/function_with_alias.json +++ b/tests/translator/output/aws-cn/function_with_alias.json @@ -1,8 +1,9 @@ { "Resources": { "MinimalFunctionVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Description": "sam-testing", "FunctionName": { @@ -12,6 +13,8 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -27,6 +30,8 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -50,6 +55,8 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-cn/function_with_alias_and_event_sources.json b/tests/translator/output/aws-cn/function_with_alias_and_event_sources.json index e48747d79..cb673315b 100644 --- a/tests/translator/output/aws-cn/function_with_alias_and_event_sources.json +++ b/tests/translator/output/aws-cn/function_with_alias_and_event_sources.json @@ -8,6 +8,8 @@ "Resources": { "MyAwesomeFunctionAliasLive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -23,6 +25,8 @@ }, "MyAwesomeFunctionNotificationTopicPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "sns.amazonaws.com", @@ -36,6 +40,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment042edc7e2e" @@ -48,6 +54,8 @@ }, "GetHtmlApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "GetHtmlApi" @@ -58,6 +66,8 @@ }, "MyAwesomeFunctionCWEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -74,6 +84,8 @@ }, "MyAwesomeFunctionEBRulePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -90,6 +102,8 @@ }, "MyAwesomeFunctionDDBStream": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BatchSize": 200, "EventSourceArn": "arn:aws:dynamodb:us-west-2:012345678901:table/TestTable/stream/2015-05-11T21:21:33.291", @@ -101,6 +115,8 @@ }, "MyAwesomeFunctionIoTRule": { "Type": "AWS::IoT::TopicRule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "TopicRulePayload": { "AwsIotSqlVersion": "beta", @@ -120,6 +136,8 @@ }, "MyAwesomeFunctionKinesisStream": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BatchSize": 100, "EventSourceArn": "arn:aws:kinesis:us-west-2:012345678901:stream/my-stream", @@ -131,6 +149,8 @@ }, "MyAwesomeFunctionImplicitApiPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -152,6 +172,8 @@ }, "MyAwesomeFunctionIoTRulePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -175,6 +197,8 @@ }, "MyAwesomeFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Endpoint": { "Ref": "MyAwesomeFunctionAliasLive" @@ -187,6 +211,8 @@ }, "MyAwesomeFunctionS3TriggerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -200,6 +226,8 @@ }, "GetHtmlApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -218,6 +246,8 @@ }, "MyAwesomeFunctionCWLogPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "logs.amazonaws.com", @@ -236,6 +266,8 @@ }, "MyAwesomeFunctionEBSchedule": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ScheduleExpression": "rate(1 minute)", "Targets": [ @@ -250,6 +282,8 @@ }, "MyAwesomeFunctionCWLog": { "Type": "AWS::Logs::SubscriptionFilter", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DestinationArn": { "Ref": "MyAwesomeFunctionAliasLive" @@ -263,6 +297,8 @@ }, "MyAwesomeFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -295,6 +331,8 @@ }, "MyAwesomeFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -318,6 +356,8 @@ }, "MyAwesomeFunctionCWEvent": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -338,6 +378,8 @@ }, "MyAwesomeFunctionEBRule": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -357,8 +399,9 @@ } }, "MyAwesomeFunctionVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MyAwesomeFunction" @@ -367,6 +410,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -402,10 +447,14 @@ } }, "Notifications": { - "Type": "AWS::SNS::Topic" + "Type": "AWS::SNS::Topic", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, "MyAwesomeFunctionEBSchedulePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -422,6 +471,8 @@ }, "Images": { "Type": "AWS::S3::Bucket", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "NotificationConfiguration": { "LambdaConfigurations": [ @@ -440,6 +491,8 @@ }, "GetHtmlApiStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "GetHtmlApiDeploymentf117c932f7" @@ -459,6 +512,8 @@ }, "MyAwesomeFunctionExplicitApiPermissionStage": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -480,6 +535,8 @@ }, "ServerlessRestApiDeployment042edc7e2e": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" diff --git a/tests/translator/output/aws-cn/function_with_alias_intrinsics.json b/tests/translator/output/aws-cn/function_with_alias_intrinsics.json index 3fff52854..99d76a600 100644 --- a/tests/translator/output/aws-cn/function_with_alias_intrinsics.json +++ b/tests/translator/output/aws-cn/function_with_alias_intrinsics.json @@ -7,8 +7,9 @@ }, "Resources": { "MinimalFunctionVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -17,6 +18,8 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -32,6 +35,8 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -55,6 +60,8 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-cn/function_with_amq.json b/tests/translator/output/aws-cn/function_with_amq.json index 6a34ed771..9ed678fc9 100644 --- a/tests/translator/output/aws-cn/function_with_amq.json +++ b/tests/translator/output/aws-cn/function_with_amq.json @@ -2,6 +2,8 @@ "Resources": { "MQFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -25,6 +27,8 @@ }, "MQFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -78,6 +82,8 @@ }, "MQFunctionMyMQQueue": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EventSourceArn": "arn:aws:mq:us-east-2:123456789012:broker:MyBroker:b-1234a5b6-78cd-901e-2fgh-3i45j6k178l9", "FunctionName": { diff --git a/tests/translator/output/aws-cn/function_with_amq_kms.json b/tests/translator/output/aws-cn/function_with_amq_kms.json index e79122065..2079f1d98 100644 --- a/tests/translator/output/aws-cn/function_with_amq_kms.json +++ b/tests/translator/output/aws-cn/function_with_amq_kms.json @@ -2,6 +2,8 @@ "Resources": { "MQFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -25,6 +27,8 @@ }, "MQFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -85,6 +89,8 @@ }, "MQFunctionMyMQQueue": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EventSourceArn": "arn:aws:mq:us-east-2:123456789012:broker:MyBroker:b-1234a5b6-78cd-901e-2fgh-3i45j6k178l9", "FunctionName": { diff --git a/tests/translator/output/aws-us-gov/api_with_source_vpc_whitelist.json b/tests/translator/output/aws-us-gov/api_with_source_vpc_whitelist.json index f6b28aa07..7b2502476 100644 --- a/tests/translator/output/aws-us-gov/api_with_source_vpc_whitelist.json +++ b/tests/translator/output/aws-us-gov/api_with_source_vpc_whitelist.json @@ -8,6 +8,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -30,6 +32,8 @@ }, "MyFunctionFetchPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -51,6 +55,8 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment5332c373d4" @@ -63,6 +69,8 @@ }, "MyApiDeployment5332c373d4": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -73,6 +81,8 @@ }, "ServerlessRestApiDeploymente6268e43cf": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -83,6 +93,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymente6268e43cf" @@ -95,6 +107,8 @@ }, "MyFunctionApiPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -116,6 +130,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -146,6 +162,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -275,6 +293,8 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_with_stage_tags.json b/tests/translator/output/aws-us-gov/api_with_stage_tags.json index 1e9912886..ad7510546 100644 --- a/tests/translator/output/aws-us-gov/api_with_stage_tags.json +++ b/tests/translator/output/aws-us-gov/api_with_stage_tags.json @@ -8,6 +8,8 @@ "Resources": { "MyApiWithStageTagsDeployment5332c373d4": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithStageTags" @@ -18,6 +20,8 @@ }, "MyApiWithStageTags": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -41,6 +45,8 @@ }, "MyApiWithStageTagsProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithStageTagsDeployment5332c373d4" diff --git a/tests/translator/output/aws-us-gov/api_with_swagger_and_openapi_with_auth.json b/tests/translator/output/aws-us-gov/api_with_swagger_and_openapi_with_auth.json index 898e3ae3b..ae736058d 100644 --- a/tests/translator/output/aws-us-gov/api_with_swagger_and_openapi_with_auth.json +++ b/tests/translator/output/aws-us-gov/api_with_swagger_and_openapi_with_auth.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -117,6 +123,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -134,6 +142,8 @@ }, "ExplicitApiSomeStageStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -151,6 +161,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -172,6 +184,8 @@ }, "ServerlessRestApiDeploymentc969c99f9d": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -182,6 +196,8 @@ }, "MyUserPool": { "Type": "AWS::Cognito::UserPool", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "UsernameAttributes": [ "email" @@ -203,6 +219,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -264,6 +282,8 @@ }, "ExplicitApiDeployment7c4f7dda23": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" diff --git a/tests/translator/output/aws-us-gov/api_with_swagger_authorizer_none.json b/tests/translator/output/aws-us-gov/api_with_swagger_authorizer_none.json deleted file mode 100644 index 3edd2c2a6..000000000 --- a/tests/translator/output/aws-us-gov/api_with_swagger_authorizer_none.json +++ /dev/null @@ -1,499 +0,0 @@ -{ - "Resources": { - "MyFnCognitoPermissionProd": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "Principal": "apigateway.amazonaws.com", - "FunctionName": { - "Ref": "MyFn" - }, - "SourceArn": { - "Fn::Sub": [ - "arn:aws-us-gov:execute-api:${AWS::Region}:${AWS::AccountId}:${__ApiId__}/${__Stage__}/GET/cognito", - { - "__Stage__": "*", - "__ApiId__": { - "Ref": "MyApiWithCognitoAuth" - } - } - ] - } - } - }, - "MyApiWithCognitoAuth": { - "Type": "AWS::ApiGateway::RestApi", - "Properties": { - "Body": { - "info": { - "version": "1.0", - "title": { - "Ref": "AWS::StackName" - } - }, - "paths": { - "/cognito": { - "get": { - "x-amazon-apigateway-integration": { - "httpMethod": "POST", - "type": "aws_proxy", - "uri": { - "Fn::Sub": "arn:aws-us-gov:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${MyFn.Arn}/invocations" - } - }, - "security": [ - { - "NONE": [] - } - ], - "responses": {} - } - } - }, - "swagger": "2.0", - "securityDefinitions": { - "MyCognitoAuth": { - "in": "header", - "type": "apiKey", - "name": "Authorization", - "x-amazon-apigateway-authorizer": { - "providerARNs": [ - { - "Fn::GetAtt": [ - "MyUserPool", - "Arn" - ] - } - ], - "type": "cognito_user_pools" - }, - "x-amazon-apigateway-authtype": "cognito_user_pools" - } - } - }, - "EndpointConfiguration": { - "Types": [ - "REGIONAL" - ] - }, - "Parameters": { - "endpointConfigurationTypes": "REGIONAL" - } - } - }, - "MyApiWithLambdaRequestAuthDeployment9c20de6c65": { - "Type": "AWS::ApiGateway::Deployment", - "Properties": { - "RestApiId": { - "Ref": "MyApiWithLambdaRequestAuth" - }, - "Description": "RestApi deployment id: 9c20de6c65c8aa8750d3136af13b9a69bc7d3e5e", - "StageName": "Stage" - } - }, - "MyApiWithLambdaTokenAuthDeployment4f66714fd8": { - "Type": "AWS::ApiGateway::Deployment", - "Properties": { - "RestApiId": { - "Ref": "MyApiWithLambdaTokenAuth" - }, - "Description": "RestApi deployment id: 4f66714fd88af2798cc2462bd8ce435aa77a340c", - "StageName": "Stage" - } - }, - "MyApiWithLambdaRequestAuthMyLambdaRequestAuthAuthorizerPermission": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "Principal": "apigateway.amazonaws.com", - "FunctionName": { - "Fn::GetAtt": [ - "MyAuthFn", - "Arn" - ] - }, - "SourceArn": { - "Fn::Sub": [ - "arn:aws-us-gov:execute-api:${AWS::Region}:${AWS::AccountId}:${__ApiId__}/authorizers/*", - { - "__ApiId__": { - "Ref": "MyApiWithLambdaRequestAuth" - } - } - ] - } - } - }, - "MyApiWithCognitoAuthDeploymentbac15a89c4": { - "Type": "AWS::ApiGateway::Deployment", - "Properties": { - "RestApiId": { - "Ref": "MyApiWithCognitoAuth" - }, - "Description": "RestApi deployment id: bac15a89c4ef70c7a908f93d9f39dc7ce56fa1e3", - "StageName": "Stage" - } - }, - "MyApiWithLambdaRequestAuthProdStage": { - "Type": "AWS::ApiGateway::Stage", - "Properties": { - "DeploymentId": { - "Ref": "MyApiWithLambdaRequestAuthDeployment9c20de6c65" - }, - "RestApiId": { - "Ref": "MyApiWithLambdaRequestAuth" - }, - "StageName": "Prod" - } - }, - "MyFnLambdaTokenPermissionProd": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "Principal": "apigateway.amazonaws.com", - "FunctionName": { - "Ref": "MyFn" - }, - "SourceArn": { - "Fn::Sub": [ - "arn:aws-us-gov:execute-api:${AWS::Region}:${AWS::AccountId}:${__ApiId__}/${__Stage__}/GET/lambda-token", - { - "__Stage__": "*", - "__ApiId__": { - "Ref": "MyApiWithLambdaTokenAuth" - } - } - ] - } - } - }, - "MyFnLambdaRequestPermissionProd": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "Principal": "apigateway.amazonaws.com", - "FunctionName": { - "Ref": "MyFn" - }, - "SourceArn": { - "Fn::Sub": [ - "arn:aws-us-gov:execute-api:${AWS::Region}:${AWS::AccountId}:${__ApiId__}/${__Stage__}/GET/lambda-request", - { - "__Stage__": "*", - "__ApiId__": { - "Ref": "MyApiWithLambdaRequestAuth" - } - } - ] - } - } - }, - "MyApiWithLambdaTokenAuth": { - "Type": "AWS::ApiGateway::RestApi", - "Properties": { - "Body": { - "info": { - "version": "1.0", - "title": { - "Ref": "AWS::StackName" - } - }, - "paths": { - "/lambda-token": { - "get": { - "x-amazon-apigateway-integration": { - "httpMethod": "POST", - "type": "aws_proxy", - "uri": { - "Fn::Sub": "arn:aws-us-gov:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${MyFn.Arn}/invocations" - } - }, - "security": [ - { - "NONE": [] - } - ], - "responses": {} - } - } - }, - "swagger": "2.0", - "securityDefinitions": { - "MyLambdaTokenAuth": { - "in": "header", - "type": "apiKey", - "name": "Authorization", - "x-amazon-apigateway-authorizer": { - "type": "token", - "authorizerUri": { - "Fn::Sub": [ - "arn:aws-us-gov:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${__FunctionArn__}/invocations", - { - "__FunctionArn__": { - "Fn::GetAtt": [ - "MyAuthFn", - "Arn" - ] - } - } - ] - } - }, - "x-amazon-apigateway-authtype": "custom" - } - } - }, - "EndpointConfiguration": { - "Types": [ - "REGIONAL" - ] - }, - "Parameters": { - "endpointConfigurationTypes": "REGIONAL" - } - } - }, - "MyApiWithLambdaTokenAuthProdStage": { - "Type": "AWS::ApiGateway::Stage", - "Properties": { - "DeploymentId": { - "Ref": "MyApiWithLambdaTokenAuthDeployment4f66714fd8" - }, - "RestApiId": { - "Ref": "MyApiWithLambdaTokenAuth" - }, - "StageName": "Prod" - } - }, - "MyUserPool": { - "Type": "AWS::Cognito::UserPool", - "Properties": { - "UsernameAttributes": [ - "email" - ], - "UserPoolName": "UserPoolName", - "Policies": { - "PasswordPolicy": { - "MinimumLength": 8 - } - }, - "Schema": [ - { - "AttributeDataType": "String", - "Required": false, - "Name": "email" - } - ] - } - }, - "MyAuthFn": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Handler": "index.handler", - "Code": { - "ZipFile": "exports.handler = async (event) => {\n return {\n statusCode: 200,\n body: JSON.stringify(event),\n headers: {}\n }\n}\n" - }, - "Role": { - "Fn::GetAtt": [ - "MyAuthFnRole", - "Arn" - ] - }, - "Runtime": "nodejs12.x", - "Tags": [ - { - "Value": "SAM", - "Key": "lambda:createdBy" - } - ] - } - }, - "MyApiWithLambdaRequestAuth": { - "Type": "AWS::ApiGateway::RestApi", - "Properties": { - "Body": { - "info": { - "version": "1.0", - "title": { - "Ref": "AWS::StackName" - } - }, - "paths": { - "/lambda-request": { - "get": { - "x-amazon-apigateway-integration": { - "httpMethod": "POST", - "passthroughBehavior": "when_no_match", - "type": "aws_proxy", - "uri": { - "Fn::Sub": "arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${MyFn.Arn}/invocations" - } - }, - "security": [ - { - "NONE": [] - } - ], - "responses": {} - } - } - }, - "swagger": 2.0, - "schemes": [ - "https" - ], - "securityDefinitions": { - "MyLambdaRequestAuth": { - "in": "header", - "type": "apiKey", - "name": "Unused", - "x-amazon-apigateway-authorizer": { - "type": "request", - "identitySource": "method.request.header.Authorization1", - "authorizerUri": { - "Fn::Sub": [ - "arn:aws-us-gov:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${__FunctionArn__}/invocations", - { - "__FunctionArn__": { - "Fn::GetAtt": [ - "MyAuthFn", - "Arn" - ] - } - } - ] - } - }, - "x-amazon-apigateway-authtype": "custom" - } - } - }, - "EndpointConfiguration": { - "Types": [ - "REGIONAL" - ] - }, - "Parameters": { - "endpointConfigurationTypes": "REGIONAL" - } - } - }, - "MyApiWithLambdaTokenAuthMyLambdaTokenAuthAuthorizerPermission": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "Principal": "apigateway.amazonaws.com", - "FunctionName": { - "Fn::GetAtt": [ - "MyAuthFn", - "Arn" - ] - }, - "SourceArn": { - "Fn::Sub": [ - "arn:aws-us-gov:execute-api:${AWS::Region}:${AWS::AccountId}:${__ApiId__}/authorizers/*", - { - "__ApiId__": { - "Ref": "MyApiWithLambdaTokenAuth" - } - } - ] - } - } - }, - "MyAuthFnRole": { - "Type": "AWS::IAM::Role", - "Properties": { - "ManagedPolicyArns": [ - "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ], - "Tags": [ - { - "Value": "SAM", - "Key": "lambda:createdBy" - } - ], - "AssumeRolePolicyDocument": { - "Version": "2012-10-17", - "Statement": [ - { - "Action": [ - "sts:AssumeRole" - ], - "Effect": "Allow", - "Principal": { - "Service": [ - "lambda.amazonaws.com" - ] - } - } - ] - } - } - }, - "MyFnRole": { - "Type": "AWS::IAM::Role", - "Properties": { - "ManagedPolicyArns": [ - "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ], - "Tags": [ - { - "Value": "SAM", - "Key": "lambda:createdBy" - } - ], - "AssumeRolePolicyDocument": { - "Version": "2012-10-17", - "Statement": [ - { - "Action": [ - "sts:AssumeRole" - ], - "Effect": "Allow", - "Principal": { - "Service": [ - "lambda.amazonaws.com" - ] - } - } - ] - } - } - }, - "MyApiWithCognitoAuthProdStage": { - "Type": "AWS::ApiGateway::Stage", - "Properties": { - "DeploymentId": { - "Ref": "MyApiWithCognitoAuthDeploymentbac15a89c4" - }, - "RestApiId": { - "Ref": "MyApiWithCognitoAuth" - }, - "StageName": "Prod" - } - }, - "MyFn": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Handler": "index.handler", - "Code": { - "ZipFile": "exports.handler = async (event) => {\n return {\n statusCode: 200,\n body: JSON.stringify(event),\n headers: {}\n }\n}\n" - }, - "Role": { - "Fn::GetAtt": [ - "MyFnRole", - "Arn" - ] - }, - "Runtime": "nodejs12.x", - "Tags": [ - { - "Value": "SAM", - "Key": "lambda:createdBy" - } - ] - } - } - } -} \ No newline at end of file diff --git a/tests/translator/output/aws-us-gov/api_with_usageplans.json b/tests/translator/output/aws-us-gov/api_with_usageplans.json index bda4c204a..eefe8c4c0 100644 --- a/tests/translator/output/aws-us-gov/api_with_usageplans.json +++ b/tests/translator/output/aws-us-gov/api_with_usageplans.json @@ -40,6 +40,8 @@ "Resources": { "MyFunctionThreeRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -70,6 +72,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentd197b03bdf" @@ -82,6 +86,8 @@ }, "MyApiTwoUsagePlanKey": { "Type": "AWS::ApiGateway::UsagePlanKey", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "KeyType": "API_KEY", "KeyId": { @@ -97,6 +103,8 @@ }, "MyApiThree": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -145,6 +153,8 @@ }, "MyFunctionThreeApiKeyPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -166,6 +176,8 @@ }, "MyApiTwoApiKey": { "Type": "AWS::ApiGateway::ApiKey", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Enabled": true, "StageKeys": [ @@ -185,6 +197,8 @@ }, "MyFunctionTwo": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -207,6 +221,8 @@ }, "MyFunctionOneApiKeyPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -228,6 +244,8 @@ }, "MyFunctionTwoApiKeyPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -249,6 +267,8 @@ }, "MyFunctionOneRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -279,6 +299,8 @@ }, "MyApiTwo": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -327,6 +349,8 @@ }, "MyFunctionTwoRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -357,6 +381,8 @@ }, "MyFunctionOne": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -379,6 +405,8 @@ }, "ServerlessUsagePlan": { "Type": "AWS::ApiGateway::UsagePlan", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiStages": [ { @@ -406,6 +434,8 @@ }, "ServerlessApiKey": { "Type": "AWS::ApiGateway::ApiKey", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Enabled": true, "StageKeys": [ @@ -433,6 +463,8 @@ }, "MyApiTwoUsagePlan": { "Type": "AWS::ApiGateway::UsagePlan", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiStages": [ { @@ -472,6 +504,8 @@ }, "ServerlessRestApiDeploymentd197b03bdf": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -482,6 +516,8 @@ }, "MyApiTwoDeployment0e45b81469": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiTwo" @@ -492,6 +528,8 @@ }, "MyFunctionTwoImplicitApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -513,6 +551,8 @@ }, "MyApiTwoProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiTwoDeployment0e45b81469" @@ -525,6 +565,8 @@ }, "MyApiOneProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiOneDeploymentdccbc5fda1" @@ -537,6 +579,8 @@ }, "MyApiThreeDeployment5206882d23": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiThree" @@ -547,6 +591,8 @@ }, "MyApiThreeProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiThreeDeployment5206882d23" @@ -559,6 +605,8 @@ }, "ServerlessUsagePlanKey": { "Type": "AWS::ApiGateway::UsagePlanKey", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "KeyType": "API_KEY", "KeyId": { @@ -574,6 +622,8 @@ }, "MyApiOne": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -622,6 +672,8 @@ }, "MyApiOneDeploymentdccbc5fda1": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiOne" @@ -632,6 +684,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -680,6 +734,8 @@ }, "MyFunctionThree": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { diff --git a/tests/translator/output/aws-us-gov/api_with_usageplans_intrinsics.json b/tests/translator/output/aws-us-gov/api_with_usageplans_intrinsics.json index 0a9355d91..10825d205 100644 --- a/tests/translator/output/aws-us-gov/api_with_usageplans_intrinsics.json +++ b/tests/translator/output/aws-us-gov/api_with_usageplans_intrinsics.json @@ -30,6 +30,8 @@ "Resources": { "MyApiTwoUsagePlanKey": { "Type": "AWS::ApiGateway::UsagePlanKey", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "KeyType": "API_KEY", "KeyId": { @@ -45,6 +47,8 @@ }, "MyApiTwoDeployment802c3b471d": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiTwo" @@ -54,6 +58,8 @@ }, "MyApiOneUsagePlan": { "Type": "AWS::ApiGateway::UsagePlan", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiStages": [ { @@ -73,6 +79,8 @@ }, "MyApiOneDeployment8b73115419": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiOne" @@ -83,6 +91,8 @@ }, "MyApiTwoUsagePlan": { "Type": "AWS::ApiGateway::UsagePlan", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiStages": [ { @@ -101,6 +111,8 @@ }, "MyApiTwoProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiTwoDeployment802c3b471d" @@ -113,6 +125,8 @@ }, "MyApiOneProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiOneDeployment8b73115419" @@ -126,6 +140,8 @@ }, "MyApiOneApiKey": { "Type": "AWS::ApiGateway::ApiKey", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Enabled": true, "StageKeys": [ @@ -146,6 +162,8 @@ }, "MyFunctionTwoRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -176,6 +194,8 @@ }, "MyApiOneUsagePlanKey": { "Type": "AWS::ApiGateway::UsagePlanKey", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "KeyType": "API_KEY", "KeyId": { @@ -192,6 +212,8 @@ }, "MyApiTwoApiKey": { "Type": "AWS::ApiGateway::ApiKey", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Enabled": true, "StageKeys": [ @@ -211,6 +233,8 @@ }, "MyFunctionOneApiKeyPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -232,6 +256,8 @@ }, "MyFunctionTwo": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -254,6 +280,8 @@ }, "MyFunctionTwoApiKeyPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -275,6 +303,8 @@ }, "MyFunctionOneRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -305,6 +335,8 @@ }, "MyApiTwo": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -355,6 +387,8 @@ }, "MyApiOne": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -406,6 +440,8 @@ }, "MyFunctionOne": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { diff --git a/tests/translator/output/aws-us-gov/api_with_xray_tracing.json b/tests/translator/output/aws-us-gov/api_with_xray_tracing.json index f8b546a91..c86685387 100644 --- a/tests/translator/output/aws-us-gov/api_with_xray_tracing.json +++ b/tests/translator/output/aws-us-gov/api_with_xray_tracing.json @@ -2,6 +2,8 @@ "Resources": { "HtmlFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -32,6 +34,8 @@ }, "HtmlApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "HtmlApiDeploymentf117c932f7" @@ -45,6 +49,8 @@ }, "HtmlFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -64,6 +70,8 @@ }, "HtmlApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "HtmlApi" @@ -74,6 +82,8 @@ }, "HtmlApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -91,6 +101,8 @@ }, "HtmlFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-us-gov/application_preparing_state.json b/tests/translator/output/aws-us-gov/application_preparing_state.json index 92fe7cc8d..bfb82c032 100644 --- a/tests/translator/output/aws-us-gov/application_preparing_state.json +++ b/tests/translator/output/aws-us-gov/application_preparing_state.json @@ -2,6 +2,8 @@ "Resources": { "PreparingApplication": { "Type": "AWS::CloudFormation::Stack", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "TemplateURL": "https://awsserverlessrepo-changesets-xxx.s3.amazonaws.com/signed-url", "Tags": [ diff --git a/tests/translator/output/aws-us-gov/application_with_intrinsics.json b/tests/translator/output/aws-us-gov/application_with_intrinsics.json index b21b0c3ea..cbed10f0f 100644 --- a/tests/translator/output/aws-us-gov/application_with_intrinsics.json +++ b/tests/translator/output/aws-us-gov/application_with_intrinsics.json @@ -28,6 +28,8 @@ "Resources": { "ApplicationFindInMap": { "Type": "AWS::CloudFormation::Stack", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "NotificationARNs": [ { @@ -53,6 +55,8 @@ }, "ApplicationRefParameter": { "Type": "AWS::CloudFormation::Stack", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "TemplateURL": "https://awsserverlessrepo-changesets-xxx.s3.amazonaws.com/signed-url", "Tags": [ @@ -72,7 +76,9 @@ } }, "Sns": { - "Type": "AWS::SNS::Topic" + "Type": "AWS::SNS::Topic", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" } } } diff --git a/tests/translator/output/aws-us-gov/basic_application.json b/tests/translator/output/aws-us-gov/basic_application.json index 058e8037e..fa4e7d8e4 100644 --- a/tests/translator/output/aws-us-gov/basic_application.json +++ b/tests/translator/output/aws-us-gov/basic_application.json @@ -10,6 +10,8 @@ "Resources": { "NormalApplication": { "Type": "AWS::CloudFormation::Stack", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "NotificationARNs": [ "arn:aws:sns:us-east-1:123456789012:sns-arn" @@ -41,6 +43,8 @@ }, "BasicApplication": { "Type": "AWS::CloudFormation::Stack", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "TemplateURL": "https://awsserverlessrepo-changesets-xxx.s3.amazonaws.com/signed-url", "Tags": [ @@ -61,6 +65,8 @@ }, "ApplicationWithLocationUrl": { "Type": "AWS::CloudFormation::Stack", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "TemplateURL": "https://s3-us-east-1.amazonaws.com/demo-bucket/template.yaml", "Tags": [ @@ -77,6 +83,8 @@ }, "ApplicationWithCondition": { "Type": "AWS::CloudFormation::Stack", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "TemplateURL": "https://awsserverlessrepo-changesets-xxx.s3.amazonaws.com/signed-url", "Tags": [ diff --git a/tests/translator/output/aws-us-gov/basic_function.json b/tests/translator/output/aws-us-gov/basic_function.json index ad22b6c2b..d33d120e5 100644 --- a/tests/translator/output/aws-us-gov/basic_function.json +++ b/tests/translator/output/aws-us-gov/basic_function.json @@ -12,6 +12,8 @@ "Resources": { "FunctionWithInlineCode": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "TracingConfig": { "Mode": "Active" @@ -37,6 +39,8 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -67,6 +71,8 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -90,6 +96,8 @@ }, "FunctionWithPolicyDocument": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -113,6 +121,8 @@ }, "FunctionWithPolicies": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -136,6 +146,8 @@ }, "FunctionWithCodeUriObjectRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -166,6 +178,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Path": "/", "Policies": [ @@ -203,6 +217,8 @@ }, "CompleteFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -245,6 +261,8 @@ }, "FunctionWithCodeUriObject": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -269,6 +287,8 @@ }, "FunctionWithPoliciesRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -300,6 +320,8 @@ }, "FunctionWithInlineCodeRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -331,6 +353,8 @@ }, "FunctionWithTracingRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -362,6 +386,8 @@ }, "FunctionWithRoleRef": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -385,6 +411,8 @@ }, "FunctionWithTracing": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "TracingConfig": { "Mode": "Active" @@ -411,6 +439,8 @@ }, "FunctionWithPolicyDocumentRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-us-gov/basic_function_with_tags.json b/tests/translator/output/aws-us-gov/basic_function_with_tags.json index 2e9855ec6..ce97e4c4d 100644 --- a/tests/translator/output/aws-us-gov/basic_function_with_tags.json +++ b/tests/translator/output/aws-us-gov/basic_function_with_tags.json @@ -9,6 +9,8 @@ "Resources": { "AlexaSkillFuncRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -57,6 +59,8 @@ }, "AlexaSkillFuncAlexaSkillEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { @@ -67,6 +71,8 @@ }, "AlexaSkillFunc": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-us-gov/basic_function_withimageuri.json b/tests/translator/output/aws-us-gov/basic_function_withimageuri.json index bb91395e6..9e8c9dbbe 100644 --- a/tests/translator/output/aws-us-gov/basic_function_withimageuri.json +++ b/tests/translator/output/aws-us-gov/basic_function_withimageuri.json @@ -12,6 +12,8 @@ "Resources": { "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -49,6 +51,8 @@ }, "MinimalImageFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ImageUri": "123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest" @@ -70,6 +74,8 @@ }, "MinimalImageFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -100,6 +106,8 @@ }, "MinimalImageFunctionPackageTypeAndImageConfig": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ImageUri": "123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest" @@ -126,6 +134,8 @@ }, "MinimalImageFunctionPackageTypeAndImageConfigRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -156,6 +166,8 @@ }, "CompleteImageFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ImageUri": "123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest" @@ -201,6 +213,8 @@ }, "FunctionWithPolicies": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ImageUri": "123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest" @@ -222,6 +236,8 @@ }, "FunctionWithPoliciesRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -253,6 +269,8 @@ }, "FunctionWithPolicyDocument": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ImageUri": "123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest" @@ -274,6 +292,8 @@ }, "FunctionWithPolicyDocumentRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -320,6 +340,8 @@ }, "FunctionWithRoleRef": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ImageUri": "123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest" diff --git a/tests/translator/output/aws-us-gov/basic_layer.json b/tests/translator/output/aws-us-gov/basic_layer.json index d373bd19c..9c430b9b1 100644 --- a/tests/translator/output/aws-us-gov/basic_layer.json +++ b/tests/translator/output/aws-us-gov/basic_layer.json @@ -8,8 +8,9 @@ } }, "Resources": { - "LayerWithCondition7c655e10ea": { - "DeletionPolicy": "Retain", + "LayerWithConditionec24995757": { + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Type": "AWS::Lambda::LayerVersion", "Properties": { "Content": { @@ -20,8 +21,9 @@ }, "Condition": "TestCondition" }, - "MinimalLayer0c7f96cce7": { - "DeletionPolicy": "Retain", + "MinimalLayer7d49517128": { + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Type": "AWS::Lambda::LayerVersion", "Properties": { "Content": { @@ -31,7 +33,8 @@ "LayerName": "MinimalLayer" } }, - "CompleteLayer5d71a60e81": { + "CompleteLayer01b64931e6": { + "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Retain", "Type": "AWS::Lambda::LayerVersion", "Properties": { @@ -48,7 +51,8 @@ ] } }, - "LayerWithContentUriObjectbdbf1b82ac": { + "LayerWithContentUriObject678c9b5427": { + "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete", "Type": "AWS::Lambda::LayerVersion", "Properties": { diff --git a/tests/translator/output/aws-us-gov/cloudwatch_logs_with_ref.json b/tests/translator/output/aws-us-gov/cloudwatch_logs_with_ref.json index f61871da5..4b995bace 100644 --- a/tests/translator/output/aws-us-gov/cloudwatch_logs_with_ref.json +++ b/tests/translator/output/aws-us-gov/cloudwatch_logs_with_ref.json @@ -13,6 +13,8 @@ "Resources": { "TriggeredFunctionCWLogEvent": { "Type": "AWS::Logs::SubscriptionFilter", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DestinationArn": { "Fn::GetAtt": [ @@ -33,6 +35,8 @@ }, "TriggeredFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -57,6 +61,8 @@ }, "TriggeredFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -87,6 +93,8 @@ }, "TriggeredFunctionCWLogEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "logs.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/cloudwatchevent.json b/tests/translator/output/aws-us-gov/cloudwatchevent.json index 3d8914b21..4f4f9afd5 100644 --- a/tests/translator/output/aws-us-gov/cloudwatchevent.json +++ b/tests/translator/output/aws-us-gov/cloudwatchevent.json @@ -2,6 +2,8 @@ "Resources": { "ScheduledFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -32,6 +34,8 @@ }, "TriggeredFunctionOnTerminatePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -48,6 +52,8 @@ }, "ScheduledFunctionSchedulePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -64,6 +70,8 @@ }, "ScheduledFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -88,6 +96,8 @@ }, "TriggeredFunctionOnTerminate": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -112,6 +122,8 @@ }, "TriggeredFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -136,6 +148,8 @@ }, "TriggeredFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -166,6 +180,8 @@ }, "ScheduledFunctionSchedule": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ScheduleExpression": "rate(1 minute)", "Targets": [ diff --git a/tests/translator/output/aws-us-gov/cloudwatchlog.json b/tests/translator/output/aws-us-gov/cloudwatchlog.json index 74d47771d..c58faaa8c 100644 --- a/tests/translator/output/aws-us-gov/cloudwatchlog.json +++ b/tests/translator/output/aws-us-gov/cloudwatchlog.json @@ -2,6 +2,8 @@ "Resources": { "TriggeredFunctionCWLogEvent": { "Type": "AWS::Logs::SubscriptionFilter", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DestinationArn": { "Fn::GetAtt": [ @@ -18,6 +20,8 @@ }, "TriggeredFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -42,6 +46,8 @@ }, "TriggeredFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -72,6 +78,8 @@ }, "TriggeredFunctionCWLogEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "logs.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/cognito_userpool_with_event.json b/tests/translator/output/aws-us-gov/cognito_userpool_with_event.json index 82a183830..5b6e03db5 100644 --- a/tests/translator/output/aws-us-gov/cognito_userpool_with_event.json +++ b/tests/translator/output/aws-us-gov/cognito_userpool_with_event.json @@ -2,6 +2,8 @@ "Resources": { "UserPool": { "Type": "AWS::Cognito::UserPool", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "LambdaConfig": { "PreSignUp": { @@ -27,6 +29,8 @@ }, "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -50,6 +54,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -80,6 +86,8 @@ }, "ImplicitApiFunctionCognitoPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { diff --git a/tests/translator/output/aws-us-gov/depends_on.json b/tests/translator/output/aws-us-gov/depends_on.json index 6e1282963..1e21ec236 100644 --- a/tests/translator/output/aws-us-gov/depends_on.json +++ b/tests/translator/output/aws-us-gov/depends_on.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -29,6 +31,8 @@ }, "MyExplicitApiDeployment74b681ce04": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyExplicitApi" @@ -39,6 +43,8 @@ }, "MyExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -57,6 +63,8 @@ }, "MyOtherTable": { "Type": "AWS::DynamoDB::Table", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "KeySchema": [ { @@ -82,6 +90,8 @@ }, "MyExplicitApidevStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyExplicitApiDeployment74b681ce04" @@ -94,6 +104,8 @@ }, "MySamTable": { "Type": "AWS::DynamoDB::Table", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BillingMode": "PAY_PER_REQUEST", "AttributeDefinitions": [ @@ -112,6 +124,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -142,6 +156,8 @@ }, "MyFunctionMyApiPermissiondev": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/eventbridgerule.json b/tests/translator/output/aws-us-gov/eventbridgerule.json index 799d38946..b349a0712 100644 --- a/tests/translator/output/aws-us-gov/eventbridgerule.json +++ b/tests/translator/output/aws-us-gov/eventbridgerule.json @@ -2,6 +2,8 @@ "Resources": { "ScheduledFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -32,6 +34,8 @@ }, "TriggeredFunctionOnTerminatePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -48,6 +52,8 @@ }, "ScheduledFunctionSchedulePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -64,6 +70,8 @@ }, "ScheduledFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -88,6 +96,8 @@ }, "TriggeredFunctionOnTerminate": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -112,6 +122,8 @@ }, "TriggeredFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -136,6 +148,8 @@ }, "TriggeredFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -166,6 +180,8 @@ }, "ScheduledFunctionSchedule": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ScheduleExpression": "rate(1 minute)", "Targets": [ diff --git a/tests/translator/output/aws-us-gov/eventbridgerule_schedule_properties.json b/tests/translator/output/aws-us-gov/eventbridgerule_schedule_properties.json index 6a6eef9ce..b1f54a6b2 100644 --- a/tests/translator/output/aws-us-gov/eventbridgerule_schedule_properties.json +++ b/tests/translator/output/aws-us-gov/eventbridgerule_schedule_properties.json @@ -2,6 +2,8 @@ "Resources": { "ScheduledFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -32,6 +34,8 @@ }, "TriggeredFunctionOnTerminatePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -48,6 +52,8 @@ }, "ScheduledFunctionSchedulePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -64,6 +70,8 @@ }, "ScheduledFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -88,6 +96,8 @@ }, "TriggeredFunctionOnTerminate": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -111,6 +121,8 @@ }, "TriggeredFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -135,6 +147,8 @@ }, "TriggeredFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -165,6 +179,8 @@ }, "ScheduledFunctionSchedule": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ScheduleExpression": "rate(1 minute)", "Name": "test-schedule", diff --git a/tests/translator/output/aws-us-gov/eventbridgerule_with_dlq.json b/tests/translator/output/aws-us-gov/eventbridgerule_with_dlq.json index b5dd4901b..eac210019 100644 --- a/tests/translator/output/aws-us-gov/eventbridgerule_with_dlq.json +++ b/tests/translator/output/aws-us-gov/eventbridgerule_with_dlq.json @@ -2,6 +2,8 @@ "Resources": { "ScheduledFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -32,6 +34,8 @@ }, "ScheduledFunctionScheduleQueuePolicy": { "Type": "AWS::SQS::QueuePolicy", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Queues": [ { @@ -70,6 +74,8 @@ }, "TriggeredFunctionOnTerminate": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -97,6 +103,8 @@ }, "TriggeredFunctionOnTerminatePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -113,6 +121,8 @@ }, "ScheduledFunctionSchedulePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -129,6 +139,8 @@ }, "ScheduledFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -153,10 +165,14 @@ }, "ScheduledFunctionScheduleQueue": { "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": {} }, "TriggeredFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -181,6 +197,8 @@ }, "TriggeredFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -211,6 +229,8 @@ }, "ScheduledFunctionSchedule": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ScheduleExpression": "rate(1 minute)", "Targets": [ diff --git a/tests/translator/output/aws-us-gov/eventbridgerule_with_retry_policy.json b/tests/translator/output/aws-us-gov/eventbridgerule_with_retry_policy.json index d904833c3..f19fc2022 100644 --- a/tests/translator/output/aws-us-gov/eventbridgerule_with_retry_policy.json +++ b/tests/translator/output/aws-us-gov/eventbridgerule_with_retry_policy.json @@ -2,6 +2,8 @@ "Resources": { "ScheduledFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -32,6 +34,8 @@ }, "TriggeredFunctionOnTerminatePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -48,6 +52,8 @@ }, "ScheduledFunctionSchedulePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -64,6 +70,8 @@ }, "ScheduledFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -88,6 +96,8 @@ }, "TriggeredFunctionOnTerminate": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -116,6 +126,8 @@ }, "TriggeredFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -140,6 +152,8 @@ }, "TriggeredFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -170,6 +184,8 @@ }, "ScheduledFunctionSchedule": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ScheduleExpression": "rate(1 minute)", "Targets": [ diff --git a/tests/translator/output/aws-us-gov/explicit_api.json b/tests/translator/output/aws-us-gov/explicit_api.json index 5c2d3ec05..047ca2fa1 100644 --- a/tests/translator/output/aws-us-gov/explicit_api.json +++ b/tests/translator/output/aws-us-gov/explicit_api.json @@ -12,6 +12,8 @@ "Resources": { "GetHtmlFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -35,6 +37,8 @@ }, "ApiWithInlineSwaggerStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ApiWithInlineSwaggerDeployment09cda3d97b" @@ -49,6 +53,8 @@ }, "GetHtmlApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "GetHtmlApi" @@ -59,6 +65,8 @@ }, "GetHtmlFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -91,6 +99,8 @@ }, "ApiWithInlineSwagger": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "this": "is", @@ -108,6 +118,8 @@ }, "GetHtmlFunctionGetHtmlPermissionStage": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -129,6 +141,8 @@ }, "GetHtmlApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -147,6 +161,8 @@ }, "GetHtmlApiStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "GetHtmlApiDeploymentf117c932f7" @@ -167,6 +183,8 @@ }, "ApiWithInlineSwaggerDeployment09cda3d97b": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ApiWithInlineSwagger" diff --git a/tests/translator/output/aws-us-gov/explicit_api_openapi_3.json b/tests/translator/output/aws-us-gov/explicit_api_openapi_3.json index 49592d0b2..7b41a6094 100644 --- a/tests/translator/output/aws-us-gov/explicit_api_openapi_3.json +++ b/tests/translator/output/aws-us-gov/explicit_api_openapi_3.json @@ -12,6 +12,8 @@ "Resources": { "GetHtmlFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -35,6 +37,8 @@ }, "ApiWithInlineSwaggerStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ApiWithInlineSwaggerDeployment74abcb3a5b" @@ -49,6 +53,8 @@ }, "GetHtmlApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "GetHtmlApi" @@ -59,6 +65,8 @@ }, "ApiWithInlineSwaggerDeployment74abcb3a5b": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ApiWithInlineSwagger" @@ -68,6 +76,8 @@ }, "GetHtmlFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -100,6 +110,8 @@ }, "ApiWithInlineSwagger": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "this": "is", @@ -117,6 +129,8 @@ }, "GetHtmlFunctionGetHtmlPermissionStage": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -138,6 +152,8 @@ }, "GetHtmlApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -156,6 +172,8 @@ }, "GetHtmlApiStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "GetHtmlApiDeploymentf117c932f7" diff --git a/tests/translator/output/aws-us-gov/explicit_api_with_invalid_events_config.json b/tests/translator/output/aws-us-gov/explicit_api_with_invalid_events_config.json index be3dbcbf9..2010798ec 100644 --- a/tests/translator/output/aws-us-gov/explicit_api_with_invalid_events_config.json +++ b/tests/translator/output/aws-us-gov/explicit_api_with_invalid_events_config.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -25,6 +27,8 @@ }, "MyFunctionAddApiPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -44,6 +48,8 @@ }, "ApiWithInlineSwaggerProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ApiWithInlineSwaggerDeployment22d399868d" @@ -56,6 +62,8 @@ }, "ApiWithInlineSwagger": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -92,6 +100,8 @@ }, "ApiWithInlineSwaggerDeployment22d399868d": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ApiWithInlineSwagger" @@ -102,6 +112,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-us-gov/explicit_http_api.json b/tests/translator/output/aws-us-gov/explicit_http_api.json index e3ff6cce6..eee7b8f00 100644 --- a/tests/translator/output/aws-us-gov/explicit_http_api.json +++ b/tests/translator/output/aws-us-gov/explicit_http_api.json @@ -2,6 +2,8 @@ "Resources": { "MyApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -15,6 +17,8 @@ }, "MyApi2ApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi2" @@ -28,6 +32,8 @@ }, "HttpApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.restapi", "Code": { @@ -51,6 +57,8 @@ }, "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -72,6 +80,8 @@ }, "MyApi2": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -144,6 +154,8 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -174,6 +186,8 @@ }, "HttpApiFunctionBasePathPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -195,6 +209,8 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FailOnWarnings": true, "Body": { diff --git a/tests/translator/output/aws-us-gov/explicit_http_api_minimum.json b/tests/translator/output/aws-us-gov/explicit_http_api_minimum.json index df8e5fcfb..8b1c84fa2 100644 --- a/tests/translator/output/aws-us-gov/explicit_http_api_minimum.json +++ b/tests/translator/output/aws-us-gov/explicit_http_api_minimum.json @@ -2,6 +2,8 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -25,6 +27,8 @@ }, "FunctionApiPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -46,6 +50,8 @@ }, "Api": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -67,6 +73,8 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -97,6 +105,8 @@ }, "ServerlessHttpApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -133,6 +143,8 @@ }, "ServerlessHttpApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "ServerlessHttpApi" @@ -146,6 +158,8 @@ }, "ApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "Api" diff --git a/tests/translator/output/aws-us-gov/function_concurrency.json b/tests/translator/output/aws-us-gov/function_concurrency.json index 9eb5d9f57..84ce4e5ab 100644 --- a/tests/translator/output/aws-us-gov/function_concurrency.json +++ b/tests/translator/output/aws-us-gov/function_concurrency.json @@ -7,6 +7,8 @@ "Resources": { "ConcurrentFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -36,6 +38,8 @@ }, "ConcurrentFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -58,6 +62,8 @@ }, "AnotherFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -87,6 +93,8 @@ }, "AnotherFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-us-gov/function_event_conditions.json b/tests/translator/output/aws-us-gov/function_event_conditions.json index d35bfe484..33d8a5139 100644 --- a/tests/translator/output/aws-us-gov/function_event_conditions.json +++ b/tests/translator/output/aws-us-gov/function_event_conditions.json @@ -10,6 +10,8 @@ "Resources": { "MyAwesomeFunctionAliasLive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "FunctionVersion": { @@ -26,6 +28,8 @@ }, "MyAwesomeFunctionNotificationTopicPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Action": "lambda:InvokeFunction", @@ -40,6 +44,8 @@ }, "MyAwesomeFunctionCWEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Action": "lambda:InvokeFunction", @@ -57,6 +63,8 @@ }, "MyAwesomeFunctionEBRulePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Action": "lambda:InvokeFunction", @@ -74,6 +82,8 @@ }, "MyAwesomeFunctionDDBStream": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "BatchSize": 200, @@ -86,6 +96,8 @@ }, "MyAwesomeFunctionIoTRule": { "Type": "AWS::IoT::TopicRule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "TopicRulePayload": { @@ -106,6 +118,8 @@ }, "MyAwesomeFunctionKinesisStream": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "BatchSize": 100, @@ -118,6 +132,8 @@ }, "MyAwesomeFunctionIoTRulePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Action": "lambda:InvokeFunction", @@ -142,6 +158,8 @@ }, "MyAwesomeFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Endpoint": { @@ -155,6 +173,8 @@ }, "MyAwesomeFunctionS3TriggerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Action": "lambda:InvokeFunction", @@ -169,6 +189,8 @@ }, "MyAwesomeFunctionCWLogPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Action": "lambda:InvokeFunction", @@ -188,6 +210,8 @@ }, "MyAwesomeFunctionEBSchedule": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "ScheduleExpression": "rate(1 minute)", @@ -203,6 +227,8 @@ }, "MyAwesomeFunctionCWLog": { "Type": "AWS::Logs::SubscriptionFilter", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "DestinationArn": { @@ -217,6 +243,8 @@ }, "MyAwesomeFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "ManagedPolicyArns": [ @@ -251,6 +279,8 @@ }, "MyAwesomeFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Code": { @@ -275,6 +305,8 @@ }, "MyAwesomeFunctionCWEvent": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "EventPattern": { @@ -296,6 +328,8 @@ }, "MyAwesomeFunctionEBRule": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "EventPattern": { @@ -316,7 +350,8 @@ } }, "MyAwesomeFunctionVersion640128d35d": { - "DeletionPolicy": "Retain", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Type": "AWS::Lambda::Version", "Condition": "MyCondition", "Properties": { @@ -327,10 +362,14 @@ }, "Notifications": { "Condition": "MyCondition", - "Type": "AWS::SNS::Topic" + "Type": "AWS::SNS::Topic", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, "MyAwesomeFunctionEBSchedulePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Action": "lambda:InvokeFunction", @@ -348,6 +387,8 @@ }, "FunctionOneImageBucketPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -361,6 +402,8 @@ }, "FunctionOneRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -391,6 +434,8 @@ }, "FunctionOne": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -414,6 +459,8 @@ }, "Images": { "Type": "AWS::S3::Bucket", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "NotificationConfiguration": { "LambdaConfigurations": [ @@ -463,6 +510,8 @@ }, "MyAwesomeFunctionSNSTopicWithSQSSubscription": { "Type": "AWS::SNS::Subscription", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Endpoint": { "Fn::GetAtt": [ @@ -479,6 +528,8 @@ }, "MyAwesomeFunctionSNSTopicWithSQSSubscriptionQueuePolicy": { "Type": "AWS::SQS::QueuePolicy", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Queues": [ { @@ -513,6 +564,8 @@ }, "MyAwesomeFunctionSNSTopicWithSQSSubscriptionEventSourceMapping": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BatchSize": 10, "Enabled": true, @@ -531,10 +584,14 @@ "MyAwesomeFunctionAnotherSNSWithSQSSubscriptionQueue": { "Condition": "MyCondition", "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": {} }, "MyAwesomeFunctionAnotherSNSWithSQSSubscriptionEventSourceMapping": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BatchSize": 10, "Enabled": true, @@ -552,6 +609,8 @@ }, "MyAwesomeFunctionAnotherSNSWithSQSSubscription": { "Type": "AWS::SNS::Subscription", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Endpoint": { "Fn::GetAtt": [ @@ -568,6 +627,8 @@ }, "MyAwesomeFunctionAnotherSNSWithSQSSubscriptionQueuePolicy": { "Type": "AWS::SQS::QueuePolicy", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Queues": [ { @@ -602,6 +663,8 @@ }, "Queue": { "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition" } } diff --git a/tests/translator/output/aws-us-gov/function_managed_inline_policy.json b/tests/translator/output/aws-us-gov/function_managed_inline_policy.json index ffbf7809d..ab924b11c 100644 --- a/tests/translator/output/aws-us-gov/function_managed_inline_policy.json +++ b/tests/translator/output/aws-us-gov/function_managed_inline_policy.json @@ -8,6 +8,8 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -31,6 +33,8 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", diff --git a/tests/translator/output/aws-us-gov/function_with_alias.json b/tests/translator/output/aws-us-gov/function_with_alias.json index aae104be5..8bfaf9a44 100644 --- a/tests/translator/output/aws-us-gov/function_with_alias.json +++ b/tests/translator/output/aws-us-gov/function_with_alias.json @@ -1,8 +1,9 @@ { "Resources": { "MinimalFunctionVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Description": "sam-testing", "FunctionName": { @@ -12,6 +13,8 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -27,6 +30,8 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -50,6 +55,8 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-us-gov/function_with_alias_and_event_sources.json b/tests/translator/output/aws-us-gov/function_with_alias_and_event_sources.json index 99ccfc0b3..eb3280591 100644 --- a/tests/translator/output/aws-us-gov/function_with_alias_and_event_sources.json +++ b/tests/translator/output/aws-us-gov/function_with_alias_and_event_sources.json @@ -8,6 +8,8 @@ "Resources": { "MyAwesomeFunctionAliasLive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -23,6 +25,8 @@ }, "MyAwesomeFunctionNotificationTopicPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "sns.amazonaws.com", @@ -36,6 +40,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentd696835fbb" @@ -48,6 +54,8 @@ }, "GetHtmlApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "GetHtmlApi" @@ -58,6 +66,8 @@ }, "MyAwesomeFunctionCWEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -74,6 +84,8 @@ }, "MyAwesomeFunctionEBRulePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -90,6 +102,8 @@ }, "MyAwesomeFunctionDDBStream": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BatchSize": 200, "EventSourceArn": "arn:aws:dynamodb:us-west-2:012345678901:table/TestTable/stream/2015-05-11T21:21:33.291", @@ -101,6 +115,8 @@ }, "MyAwesomeFunctionIoTRule": { "Type": "AWS::IoT::TopicRule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "TopicRulePayload": { "AwsIotSqlVersion": "beta", @@ -120,6 +136,8 @@ }, "MyAwesomeFunctionKinesisStream": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BatchSize": 100, "EventSourceArn": "arn:aws:kinesis:us-west-2:012345678901:stream/my-stream", @@ -131,6 +149,8 @@ }, "MyAwesomeFunctionImplicitApiPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -152,6 +172,8 @@ }, "ServerlessRestApiDeploymentd696835fbb": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -162,6 +184,8 @@ }, "MyAwesomeFunctionIoTRulePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -185,6 +209,8 @@ }, "MyAwesomeFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Endpoint": { "Ref": "MyAwesomeFunctionAliasLive" @@ -197,6 +223,8 @@ }, "MyAwesomeFunctionS3TriggerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -210,6 +238,8 @@ }, "GetHtmlApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -228,6 +258,8 @@ }, "MyAwesomeFunctionCWLogPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "logs.amazonaws.com", @@ -246,6 +278,8 @@ }, "MyAwesomeFunctionEBSchedule": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ScheduleExpression": "rate(1 minute)", "Targets": [ @@ -260,6 +294,8 @@ }, "MyAwesomeFunctionCWLog": { "Type": "AWS::Logs::SubscriptionFilter", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DestinationArn": { "Ref": "MyAwesomeFunctionAliasLive" @@ -273,6 +309,8 @@ }, "MyAwesomeFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -305,6 +343,8 @@ }, "MyAwesomeFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -328,6 +368,8 @@ }, "MyAwesomeFunctionCWEvent": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -348,6 +390,8 @@ }, "MyAwesomeFunctionEBRule": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -367,8 +411,9 @@ } }, "MyAwesomeFunctionVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MyAwesomeFunction" @@ -377,6 +422,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -412,10 +459,14 @@ } }, "Notifications": { - "Type": "AWS::SNS::Topic" + "Type": "AWS::SNS::Topic", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, "MyAwesomeFunctionEBSchedulePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -432,6 +483,8 @@ }, "Images": { "Type": "AWS::S3::Bucket", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "NotificationConfiguration": { "LambdaConfigurations": [ @@ -450,6 +503,8 @@ }, "GetHtmlApiStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "GetHtmlApiDeploymentf117c932f7" @@ -469,6 +524,8 @@ }, "MyAwesomeFunctionExplicitApiPermissionStage": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/function_with_alias_intrinsics.json b/tests/translator/output/aws-us-gov/function_with_alias_intrinsics.json index 6844f0abb..bfa03df54 100644 --- a/tests/translator/output/aws-us-gov/function_with_alias_intrinsics.json +++ b/tests/translator/output/aws-us-gov/function_with_alias_intrinsics.json @@ -7,8 +7,9 @@ }, "Resources": { "MinimalFunctionVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -17,6 +18,8 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -32,6 +35,8 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -55,6 +60,8 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-us-gov/function_with_amq.json b/tests/translator/output/aws-us-gov/function_with_amq.json index a8a471c86..ac045fcd3 100644 --- a/tests/translator/output/aws-us-gov/function_with_amq.json +++ b/tests/translator/output/aws-us-gov/function_with_amq.json @@ -2,6 +2,8 @@ "Resources": { "MQFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -25,6 +27,8 @@ }, "MQFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -78,6 +82,8 @@ }, "MQFunctionMyMQQueue": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EventSourceArn": "arn:aws:mq:us-east-2:123456789012:broker:MyBroker:b-1234a5b6-78cd-901e-2fgh-3i45j6k178l9", "FunctionName": { diff --git a/tests/translator/output/aws-us-gov/function_with_amq_kms.json b/tests/translator/output/aws-us-gov/function_with_amq_kms.json index 37b991a49..b8e23fbd2 100644 --- a/tests/translator/output/aws-us-gov/function_with_amq_kms.json +++ b/tests/translator/output/aws-us-gov/function_with_amq_kms.json @@ -2,6 +2,8 @@ "Resources": { "MQFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -25,6 +27,8 @@ }, "MQFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -85,6 +89,8 @@ }, "MQFunctionMyMQQueue": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EventSourceArn": "arn:aws:mq:us-east-2:123456789012:broker:MyBroker:b-1234a5b6-78cd-901e-2fgh-3i45j6k178l9", "FunctionName": { diff --git a/tests/translator/output/basic_application.json b/tests/translator/output/basic_application.json index 058e8037e..fa4e7d8e4 100644 --- a/tests/translator/output/basic_application.json +++ b/tests/translator/output/basic_application.json @@ -10,6 +10,8 @@ "Resources": { "NormalApplication": { "Type": "AWS::CloudFormation::Stack", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "NotificationARNs": [ "arn:aws:sns:us-east-1:123456789012:sns-arn" @@ -41,6 +43,8 @@ }, "BasicApplication": { "Type": "AWS::CloudFormation::Stack", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "TemplateURL": "https://awsserverlessrepo-changesets-xxx.s3.amazonaws.com/signed-url", "Tags": [ @@ -61,6 +65,8 @@ }, "ApplicationWithLocationUrl": { "Type": "AWS::CloudFormation::Stack", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "TemplateURL": "https://s3-us-east-1.amazonaws.com/demo-bucket/template.yaml", "Tags": [ @@ -77,6 +83,8 @@ }, "ApplicationWithCondition": { "Type": "AWS::CloudFormation::Stack", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "TemplateURL": "https://awsserverlessrepo-changesets-xxx.s3.amazonaws.com/signed-url", "Tags": [ diff --git a/tests/translator/output/basic_function.json b/tests/translator/output/basic_function.json index 8b1e210f4..da0b27964 100644 --- a/tests/translator/output/basic_function.json +++ b/tests/translator/output/basic_function.json @@ -12,6 +12,8 @@ "Resources": { "FunctionWithInlineCode": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "TracingConfig": { "Mode": "Active" @@ -37,6 +39,8 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -67,6 +71,8 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -90,6 +96,8 @@ }, "FunctionWithPolicyDocument": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -113,6 +121,8 @@ }, "FunctionWithPolicies": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -136,6 +146,8 @@ }, "FunctionWithCodeUriObjectRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -166,6 +178,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Path": "/", "Policies": [ @@ -203,6 +217,8 @@ }, "CompleteFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -245,6 +261,8 @@ }, "FunctionWithCodeUriObject": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -269,6 +287,8 @@ }, "FunctionWithPoliciesRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -300,6 +320,8 @@ }, "FunctionWithInlineCodeRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -331,6 +353,8 @@ }, "FunctionWithTracingRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -362,6 +386,8 @@ }, "FunctionWithRoleRef": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -385,6 +411,8 @@ }, "FunctionWithTracing": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "TracingConfig": { "Mode": "Active" @@ -411,6 +439,8 @@ }, "FunctionWithPolicyDocumentRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/basic_function_with_tags.json b/tests/translator/output/basic_function_with_tags.json index 1a23e3ae3..da5bd5395 100644 --- a/tests/translator/output/basic_function_with_tags.json +++ b/tests/translator/output/basic_function_with_tags.json @@ -9,6 +9,8 @@ "Resources": { "AlexaSkillFuncRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -57,6 +59,8 @@ }, "AlexaSkillFuncAlexaSkillEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { @@ -67,6 +71,8 @@ }, "AlexaSkillFunc": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/basic_function_withimageuri.json b/tests/translator/output/basic_function_withimageuri.json index 2dfe45898..f97f4493b 100644 --- a/tests/translator/output/basic_function_withimageuri.json +++ b/tests/translator/output/basic_function_withimageuri.json @@ -12,6 +12,8 @@ "Resources": { "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -49,6 +51,8 @@ }, "MinimalImageFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ImageUri": "123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest" @@ -70,6 +74,8 @@ }, "MinimalImageFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -100,6 +106,8 @@ }, "MinimalImageFunctionPackageTypeAndImageConfig": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ImageUri": "123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest" @@ -126,6 +134,8 @@ }, "MinimalImageFunctionPackageTypeAndImageConfigRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -156,6 +166,8 @@ }, "CompleteImageFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ImageUri": "123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest" @@ -201,6 +213,8 @@ }, "FunctionWithPolicies": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ImageUri": "123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest" @@ -222,6 +236,8 @@ }, "FunctionWithPoliciesRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -253,6 +269,8 @@ }, "FunctionWithPolicyDocument": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ImageUri": "123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest" @@ -274,6 +292,8 @@ }, "FunctionWithPolicyDocumentRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -320,6 +340,8 @@ }, "FunctionWithRoleRef": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ImageUri": "123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest" diff --git a/tests/translator/output/basic_layer.json b/tests/translator/output/basic_layer.json index d373bd19c..9c430b9b1 100644 --- a/tests/translator/output/basic_layer.json +++ b/tests/translator/output/basic_layer.json @@ -8,8 +8,9 @@ } }, "Resources": { - "LayerWithCondition7c655e10ea": { - "DeletionPolicy": "Retain", + "LayerWithConditionec24995757": { + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Type": "AWS::Lambda::LayerVersion", "Properties": { "Content": { @@ -20,8 +21,9 @@ }, "Condition": "TestCondition" }, - "MinimalLayer0c7f96cce7": { - "DeletionPolicy": "Retain", + "MinimalLayer7d49517128": { + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Type": "AWS::Lambda::LayerVersion", "Properties": { "Content": { @@ -31,7 +33,8 @@ "LayerName": "MinimalLayer" } }, - "CompleteLayer5d71a60e81": { + "CompleteLayer01b64931e6": { + "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Retain", "Type": "AWS::Lambda::LayerVersion", "Properties": { @@ -48,7 +51,8 @@ ] } }, - "LayerWithContentUriObjectbdbf1b82ac": { + "LayerWithContentUriObject678c9b5427": { + "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete", "Type": "AWS::Lambda::LayerVersion", "Properties": { diff --git a/tests/translator/output/cloudwatch_logs_with_ref.json b/tests/translator/output/cloudwatch_logs_with_ref.json index 9c0faab67..9b077b4e4 100644 --- a/tests/translator/output/cloudwatch_logs_with_ref.json +++ b/tests/translator/output/cloudwatch_logs_with_ref.json @@ -13,6 +13,8 @@ "Resources": { "TriggeredFunctionCWLogEvent": { "Type": "AWS::Logs::SubscriptionFilter", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DestinationArn": { "Fn::GetAtt": [ @@ -33,6 +35,8 @@ }, "TriggeredFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -57,6 +61,8 @@ }, "TriggeredFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -87,6 +93,8 @@ }, "TriggeredFunctionCWLogEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "logs.amazonaws.com", diff --git a/tests/translator/output/cloudwatchevent.json b/tests/translator/output/cloudwatchevent.json index 8d7f5d0d4..d37d69bcd 100644 --- a/tests/translator/output/cloudwatchevent.json +++ b/tests/translator/output/cloudwatchevent.json @@ -2,6 +2,8 @@ "Resources": { "ScheduledFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -32,6 +34,8 @@ }, "TriggeredFunctionOnTerminatePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -48,6 +52,8 @@ }, "ScheduledFunctionSchedulePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -64,6 +70,8 @@ }, "ScheduledFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -88,6 +96,8 @@ }, "TriggeredFunctionOnTerminate": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -112,6 +122,8 @@ }, "TriggeredFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -136,6 +148,8 @@ }, "TriggeredFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -166,6 +180,8 @@ }, "ScheduledFunctionSchedule": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ScheduleExpression": "rate(1 minute)", "Targets": [ diff --git a/tests/translator/output/cloudwatchlog.json b/tests/translator/output/cloudwatchlog.json index 52af6f596..144dbd9e3 100644 --- a/tests/translator/output/cloudwatchlog.json +++ b/tests/translator/output/cloudwatchlog.json @@ -2,6 +2,8 @@ "Resources": { "TriggeredFunctionCWLogEvent": { "Type": "AWS::Logs::SubscriptionFilter", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DestinationArn": { "Fn::GetAtt": [ @@ -18,6 +20,8 @@ }, "TriggeredFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -42,6 +46,8 @@ }, "TriggeredFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -72,6 +78,8 @@ }, "TriggeredFunctionCWLogEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "logs.amazonaws.com", diff --git a/tests/translator/output/cognito_userpool_with_event.json b/tests/translator/output/cognito_userpool_with_event.json index 277f38c37..2f1777b26 100644 --- a/tests/translator/output/cognito_userpool_with_event.json +++ b/tests/translator/output/cognito_userpool_with_event.json @@ -2,6 +2,8 @@ "Resources": { "UserPool": { "Type": "AWS::Cognito::UserPool", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "LambdaConfig": { "PreSignUp": { @@ -27,6 +29,8 @@ }, "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -50,6 +54,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -80,6 +86,8 @@ }, "ImplicitApiFunctionCognitoPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { diff --git a/tests/translator/output/depends_on.json b/tests/translator/output/depends_on.json index c21c75273..e001e1b57 100644 --- a/tests/translator/output/depends_on.json +++ b/tests/translator/output/depends_on.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -29,6 +31,8 @@ }, "MyExplicitApiDeployment74b681ce04": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyExplicitApi" @@ -39,6 +43,8 @@ }, "MyExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BodyS3Location": { "Bucket": "sam-translator-tests-dont-delete", @@ -49,6 +55,8 @@ }, "MyOtherTable": { "Type": "AWS::DynamoDB::Table", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "KeySchema": [ { @@ -74,6 +82,8 @@ }, "MyExplicitApidevStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyExplicitApiDeployment74b681ce04" @@ -86,6 +96,8 @@ }, "MySamTable": { "Type": "AWS::DynamoDB::Table", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BillingMode": "PAY_PER_REQUEST", "AttributeDefinitions": [ @@ -104,6 +116,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -134,6 +148,8 @@ }, "MyFunctionMyApiPermissiondev": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/eventbridgerule.json b/tests/translator/output/eventbridgerule.json index 0ea8edf56..e1700840b 100644 --- a/tests/translator/output/eventbridgerule.json +++ b/tests/translator/output/eventbridgerule.json @@ -2,6 +2,8 @@ "Resources": { "ScheduledFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -32,6 +34,8 @@ }, "TriggeredFunctionOnTerminatePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -48,6 +52,8 @@ }, "ScheduledFunctionSchedulePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -64,6 +70,8 @@ }, "ScheduledFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -88,6 +96,8 @@ }, "TriggeredFunctionOnTerminate": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -112,6 +122,8 @@ }, "TriggeredFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -136,6 +148,8 @@ }, "TriggeredFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -166,6 +180,8 @@ }, "ScheduledFunctionSchedule": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ScheduleExpression": "rate(1 minute)", "Targets": [ diff --git a/tests/translator/output/eventbridgerule_schedule_properties.json b/tests/translator/output/eventbridgerule_schedule_properties.json index 2ea3bd9c1..36bf00145 100644 --- a/tests/translator/output/eventbridgerule_schedule_properties.json +++ b/tests/translator/output/eventbridgerule_schedule_properties.json @@ -2,6 +2,8 @@ "Resources": { "ScheduledFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -32,6 +34,8 @@ }, "TriggeredFunctionOnTerminatePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -48,6 +52,8 @@ }, "ScheduledFunctionSchedulePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -64,6 +70,8 @@ }, "ScheduledFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -88,6 +96,8 @@ }, "TriggeredFunctionOnTerminate": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -111,6 +121,8 @@ }, "TriggeredFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -135,6 +147,8 @@ }, "TriggeredFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -165,6 +179,8 @@ }, "ScheduledFunctionSchedule": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ScheduleExpression": "rate(1 minute)", "Name": "test-schedule", diff --git a/tests/translator/output/eventbridgerule_with_dlq.json b/tests/translator/output/eventbridgerule_with_dlq.json index 2d5c96a91..6334d73a2 100644 --- a/tests/translator/output/eventbridgerule_with_dlq.json +++ b/tests/translator/output/eventbridgerule_with_dlq.json @@ -2,6 +2,8 @@ "Resources": { "ScheduledFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -32,6 +34,8 @@ }, "ScheduledFunctionScheduleQueuePolicy": { "Type": "AWS::SQS::QueuePolicy", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Queues": [ { @@ -70,6 +74,8 @@ }, "TriggeredFunctionOnTerminate": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -97,6 +103,8 @@ }, "TriggeredFunctionOnTerminatePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -113,6 +121,8 @@ }, "ScheduledFunctionSchedulePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -129,6 +139,8 @@ }, "ScheduledFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -153,10 +165,14 @@ }, "ScheduledFunctionScheduleQueue": { "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": {} }, "TriggeredFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -181,6 +197,8 @@ }, "TriggeredFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -211,6 +229,8 @@ }, "ScheduledFunctionSchedule": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ScheduleExpression": "rate(1 minute)", "Targets": [ diff --git a/tests/translator/output/eventbridgerule_with_retry_policy.json b/tests/translator/output/eventbridgerule_with_retry_policy.json index 2cc7e5d9c..5b290bb9f 100644 --- a/tests/translator/output/eventbridgerule_with_retry_policy.json +++ b/tests/translator/output/eventbridgerule_with_retry_policy.json @@ -2,6 +2,8 @@ "Resources": { "ScheduledFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -32,6 +34,8 @@ }, "TriggeredFunctionOnTerminatePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -48,6 +52,8 @@ }, "ScheduledFunctionSchedulePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -64,6 +70,8 @@ }, "ScheduledFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -88,6 +96,8 @@ }, "TriggeredFunctionOnTerminate": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -116,6 +126,8 @@ }, "TriggeredFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -140,6 +152,8 @@ }, "TriggeredFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -170,6 +184,8 @@ }, "ScheduledFunctionSchedule": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ScheduleExpression": "rate(1 minute)", "Targets": [ diff --git a/tests/translator/output/explicit_api.json b/tests/translator/output/explicit_api.json index cfc5f2e0f..6c29c587b 100644 --- a/tests/translator/output/explicit_api.json +++ b/tests/translator/output/explicit_api.json @@ -12,6 +12,8 @@ "Resources": { "GetHtmlFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -35,6 +37,8 @@ }, "ApiWithInlineSwaggerStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ApiWithInlineSwaggerDeployment09cda3d97b" @@ -49,6 +53,8 @@ }, "GetHtmlApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "GetHtmlApi" @@ -59,6 +65,8 @@ }, "GetHtmlFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -91,6 +99,8 @@ }, "ApiWithInlineSwagger": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "this": "is", @@ -100,6 +110,8 @@ }, "GetHtmlFunctionGetHtmlPermissionStage": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -121,6 +133,8 @@ }, "GetHtmlApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BodyS3Location": { "Bucket": "sam-demo-bucket", @@ -131,6 +145,8 @@ }, "GetHtmlApiStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "GetHtmlApiDeploymentf117c932f7" @@ -151,6 +167,8 @@ }, "ApiWithInlineSwaggerDeployment09cda3d97b": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ApiWithInlineSwagger" diff --git a/tests/translator/output/explicit_api_openapi_3.json b/tests/translator/output/explicit_api_openapi_3.json index 4397a036c..72dd5d724 100644 --- a/tests/translator/output/explicit_api_openapi_3.json +++ b/tests/translator/output/explicit_api_openapi_3.json @@ -12,6 +12,8 @@ "Resources": { "GetHtmlFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -35,6 +37,8 @@ }, "ApiWithInlineSwaggerStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ApiWithInlineSwaggerDeployment74abcb3a5b" @@ -49,6 +53,8 @@ }, "GetHtmlApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "GetHtmlApi" @@ -59,6 +65,8 @@ }, "ApiWithInlineSwaggerDeployment74abcb3a5b": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ApiWithInlineSwagger" @@ -68,6 +76,8 @@ }, "GetHtmlFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -100,6 +110,8 @@ }, "ApiWithInlineSwagger": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "this": "is", @@ -109,6 +121,8 @@ }, "GetHtmlFunctionGetHtmlPermissionStage": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -130,6 +144,8 @@ }, "GetHtmlApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BodyS3Location": { "Bucket": "sam-demo-bucket", @@ -140,6 +156,8 @@ }, "GetHtmlApiStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "GetHtmlApiDeploymentf117c932f7" diff --git a/tests/translator/output/explicit_api_with_invalid_events_config.json b/tests/translator/output/explicit_api_with_invalid_events_config.json index 854035d36..1d85eebaa 100644 --- a/tests/translator/output/explicit_api_with_invalid_events_config.json +++ b/tests/translator/output/explicit_api_with_invalid_events_config.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -25,6 +27,8 @@ }, "MyFunctionAddApiPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -44,6 +48,8 @@ }, "ApiWithInlineSwaggerProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ApiWithInlineSwaggerDeployment22d399868d" @@ -56,6 +62,8 @@ }, "ApiWithInlineSwagger": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -84,6 +92,8 @@ }, "ApiWithInlineSwaggerDeployment22d399868d": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ApiWithInlineSwagger" @@ -94,6 +104,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/explicit_http_api.json b/tests/translator/output/explicit_http_api.json index 8a8a6dab6..3865fa984 100644 --- a/tests/translator/output/explicit_http_api.json +++ b/tests/translator/output/explicit_http_api.json @@ -2,6 +2,8 @@ "Resources": { "MyApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -15,6 +17,8 @@ }, "MyApi2ApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi2" @@ -28,6 +32,8 @@ }, "HttpApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.restapi", "Code": { @@ -51,6 +57,8 @@ }, "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -72,6 +80,8 @@ }, "MyApi2": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -144,6 +154,8 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -174,6 +186,8 @@ }, "HttpApiFunctionBasePathPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -195,6 +209,8 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FailOnWarnings": true, "Body": { diff --git a/tests/translator/output/explicit_http_api_minimum.json b/tests/translator/output/explicit_http_api_minimum.json index 37be2617d..5aec9af7c 100644 --- a/tests/translator/output/explicit_http_api_minimum.json +++ b/tests/translator/output/explicit_http_api_minimum.json @@ -2,6 +2,8 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -25,6 +27,8 @@ }, "FunctionApiPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -46,6 +50,8 @@ }, "Api": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -67,6 +73,8 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -97,6 +105,8 @@ }, "ServerlessHttpApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -133,6 +143,8 @@ }, "ServerlessHttpApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "ServerlessHttpApi" @@ -146,6 +158,8 @@ }, "ApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "Api" diff --git a/tests/translator/output/function_concurrency.json b/tests/translator/output/function_concurrency.json index afd5f36c7..c92ed166c 100644 --- a/tests/translator/output/function_concurrency.json +++ b/tests/translator/output/function_concurrency.json @@ -7,6 +7,8 @@ "Resources": { "ConcurrentFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -36,6 +38,8 @@ }, "ConcurrentFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -58,6 +62,8 @@ }, "AnotherFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -87,6 +93,8 @@ }, "AnotherFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/function_event_conditions.json b/tests/translator/output/function_event_conditions.json index 4926995a9..915148277 100644 --- a/tests/translator/output/function_event_conditions.json +++ b/tests/translator/output/function_event_conditions.json @@ -10,6 +10,8 @@ "Resources": { "MyAwesomeFunctionAliasLive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "FunctionVersion": { @@ -26,6 +28,8 @@ }, "MyAwesomeFunctionNotificationTopicPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Action": "lambda:InvokeFunction", @@ -40,6 +44,8 @@ }, "MyAwesomeFunctionCWEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Action": "lambda:InvokeFunction", @@ -57,6 +63,8 @@ }, "MyAwesomeFunctionEBRulePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Action": "lambda:InvokeFunction", @@ -74,6 +82,8 @@ }, "MyAwesomeFunctionDDBStream": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "BatchSize": 200, @@ -86,6 +96,8 @@ }, "MyAwesomeFunctionIoTRule": { "Type": "AWS::IoT::TopicRule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "TopicRulePayload": { @@ -106,6 +118,8 @@ }, "MyAwesomeFunctionKinesisStream": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "BatchSize": 100, @@ -118,6 +132,8 @@ }, "MyAwesomeFunctionIoTRulePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Action": "lambda:InvokeFunction", @@ -142,6 +158,8 @@ }, "MyAwesomeFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Endpoint": { @@ -155,6 +173,8 @@ }, "MyAwesomeFunctionS3TriggerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Action": "lambda:InvokeFunction", @@ -169,6 +189,8 @@ }, "MyAwesomeFunctionCWLogPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Action": "lambda:InvokeFunction", @@ -188,6 +210,8 @@ }, "MyAwesomeFunctionEBSchedule": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "ScheduleExpression": "rate(1 minute)", @@ -203,6 +227,8 @@ }, "MyAwesomeFunctionCWLog": { "Type": "AWS::Logs::SubscriptionFilter", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "DestinationArn": { @@ -217,6 +243,8 @@ }, "MyAwesomeFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "ManagedPolicyArns": [ @@ -251,6 +279,8 @@ }, "MyAwesomeFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Code": { @@ -275,6 +305,8 @@ }, "MyAwesomeFunctionCWEvent": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "EventPattern": { @@ -296,6 +328,8 @@ }, "MyAwesomeFunctionEBRule": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "EventPattern": { @@ -316,7 +350,8 @@ } }, "MyAwesomeFunctionVersion640128d35d": { - "DeletionPolicy": "Retain", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Type": "AWS::Lambda::Version", "Condition": "MyCondition", "Properties": { @@ -327,10 +362,14 @@ }, "Notifications": { "Condition": "MyCondition", - "Type": "AWS::SNS::Topic" + "Type": "AWS::SNS::Topic", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, "MyAwesomeFunctionEBSchedulePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Action": "lambda:InvokeFunction", @@ -348,6 +387,8 @@ }, "FunctionOneImageBucketPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -361,6 +402,8 @@ }, "FunctionOneRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -391,6 +434,8 @@ }, "FunctionOne": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -414,6 +459,8 @@ }, "Images": { "Type": "AWS::S3::Bucket", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "NotificationConfiguration": { "LambdaConfigurations": [ @@ -463,6 +510,8 @@ }, "MyAwesomeFunctionSNSTopicWithSQSSubscription": { "Type": "AWS::SNS::Subscription", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Endpoint": { "Fn::GetAtt": [ @@ -479,6 +528,8 @@ }, "MyAwesomeFunctionSNSTopicWithSQSSubscriptionQueuePolicy": { "Type": "AWS::SQS::QueuePolicy", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Queues": [ { @@ -513,6 +564,8 @@ }, "MyAwesomeFunctionSNSTopicWithSQSSubscriptionEventSourceMapping": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BatchSize": 10, "Enabled": true, @@ -531,10 +584,14 @@ "MyAwesomeFunctionAnotherSNSWithSQSSubscriptionQueue": { "Condition": "MyCondition", "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": {} }, "MyAwesomeFunctionAnotherSNSWithSQSSubscriptionEventSourceMapping": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BatchSize": 10, "Enabled": true, @@ -552,6 +609,8 @@ }, "MyAwesomeFunctionAnotherSNSWithSQSSubscription": { "Type": "AWS::SNS::Subscription", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Endpoint": { "Fn::GetAtt": [ @@ -568,6 +627,8 @@ }, "MyAwesomeFunctionAnotherSNSWithSQSSubscriptionQueuePolicy": { "Type": "AWS::SQS::QueuePolicy", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Queues": [ { @@ -602,6 +663,8 @@ }, "Queue": { "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Condition": "MyCondition" } } diff --git a/tests/translator/output/function_managed_inline_policy.json b/tests/translator/output/function_managed_inline_policy.json index a05542ae8..7e4ef246e 100644 --- a/tests/translator/output/function_managed_inline_policy.json +++ b/tests/translator/output/function_managed_inline_policy.json @@ -8,6 +8,8 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -31,6 +33,8 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", diff --git a/tests/translator/output/function_with_alias.json b/tests/translator/output/function_with_alias.json index 306c5b387..141140198 100644 --- a/tests/translator/output/function_with_alias.json +++ b/tests/translator/output/function_with_alias.json @@ -1,8 +1,9 @@ { "Resources": { "MinimalFunctionVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Description": "sam-testing", "FunctionName": { @@ -12,6 +13,8 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -27,6 +30,8 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -50,6 +55,8 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/function_with_alias_and_code_sha256.json b/tests/translator/output/function_with_alias_and_code_sha256.json index 5f89a1632..fbf71280a 100644 --- a/tests/translator/output/function_with_alias_and_code_sha256.json +++ b/tests/translator/output/function_with_alias_and_code_sha256.json @@ -1,8 +1,9 @@ { "Resources": { - "MinimalFunctionVersion6b86b273ff": { - "DeletionPolicy": "Retain", + "MinimalFunctionVersion6b86b273ff": { "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Description": "sam-testing", "FunctionName": { @@ -12,6 +13,8 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -27,6 +30,8 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -50,6 +55,8 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/function_with_alias_and_event_sources.json b/tests/translator/output/function_with_alias_and_event_sources.json index eb62f8fae..05500909f 100644 --- a/tests/translator/output/function_with_alias_and_event_sources.json +++ b/tests/translator/output/function_with_alias_and_event_sources.json @@ -8,6 +8,8 @@ "Resources": { "MyAwesomeFunctionAliasLive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -23,6 +25,8 @@ }, "MyAwesomeFunctionNotificationTopicPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "sns.amazonaws.com", @@ -36,6 +40,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment79e6116109" @@ -48,6 +54,8 @@ }, "GetHtmlApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "GetHtmlApi" @@ -58,6 +66,8 @@ }, "MyAwesomeFunctionCWEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -74,6 +84,8 @@ }, "MyAwesomeFunctionEBRulePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -90,6 +102,8 @@ }, "MyAwesomeFunctionDDBStream": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BatchSize": 200, "EventSourceArn": "arn:aws:dynamodb:us-west-2:012345678901:table/TestTable/stream/2015-05-11T21:21:33.291", @@ -101,6 +115,8 @@ }, "MyAwesomeFunctionIoTRule": { "Type": "AWS::IoT::TopicRule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "TopicRulePayload": { "AwsIotSqlVersion": "beta", @@ -120,6 +136,8 @@ }, "MyAwesomeFunctionKinesisStream": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BatchSize": 100, "EventSourceArn": "arn:aws:kinesis:us-west-2:012345678901:stream/my-stream", @@ -131,6 +149,8 @@ }, "MyAwesomeFunctionImplicitApiPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -152,6 +172,8 @@ }, "MyAwesomeFunctionIoTRulePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -175,6 +197,8 @@ }, "MyAwesomeFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Endpoint": { "Ref": "MyAwesomeFunctionAliasLive" @@ -187,6 +211,8 @@ }, "MyAwesomeFunctionS3TriggerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -200,6 +226,8 @@ }, "GetHtmlApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BodyS3Location": { "Bucket": "sam-demo-bucket", @@ -210,6 +238,8 @@ }, "ServerlessRestApiDeployment79e6116109": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -220,6 +250,8 @@ }, "MyAwesomeFunctionCWLogPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "logs.amazonaws.com", @@ -238,6 +270,8 @@ }, "MyAwesomeFunctionEBSchedule": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ScheduleExpression": "rate(1 minute)", "Targets": [ @@ -252,6 +286,8 @@ }, "MyAwesomeFunctionCWLog": { "Type": "AWS::Logs::SubscriptionFilter", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DestinationArn": { "Ref": "MyAwesomeFunctionAliasLive" @@ -265,6 +301,8 @@ }, "MyAwesomeFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -297,6 +335,8 @@ }, "MyAwesomeFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -320,6 +360,8 @@ }, "MyAwesomeFunctionCWEvent": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -340,6 +382,8 @@ }, "MyAwesomeFunctionEBRule": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -359,8 +403,9 @@ } }, "MyAwesomeFunctionVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MyAwesomeFunction" @@ -369,6 +414,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -396,10 +443,14 @@ } }, "Notifications": { - "Type": "AWS::SNS::Topic" + "Type": "AWS::SNS::Topic", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, "MyAwesomeFunctionEBSchedulePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -416,6 +467,8 @@ }, "Images": { "Type": "AWS::S3::Bucket", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "NotificationConfiguration": { "LambdaConfigurations": [ @@ -434,6 +487,8 @@ }, "GetHtmlApiStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "GetHtmlApiDeploymentf117c932f7" @@ -453,6 +508,8 @@ }, "MyAwesomeFunctionExplicitApiPermissionStage": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/function_with_alias_intrinsics.json b/tests/translator/output/function_with_alias_intrinsics.json index 507f8af00..c4510023c 100644 --- a/tests/translator/output/function_with_alias_intrinsics.json +++ b/tests/translator/output/function_with_alias_intrinsics.json @@ -7,8 +7,9 @@ }, "Resources": { "MinimalFunctionVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -17,6 +18,8 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -32,6 +35,8 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -55,6 +60,8 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/function_with_amq.json b/tests/translator/output/function_with_amq.json index 0d35f71c2..a6b0483e2 100644 --- a/tests/translator/output/function_with_amq.json +++ b/tests/translator/output/function_with_amq.json @@ -2,6 +2,8 @@ "Resources": { "MQFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -25,6 +27,8 @@ }, "MQFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -78,6 +82,8 @@ }, "MQFunctionMyMQQueue": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EventSourceArn": "arn:aws:mq:us-east-2:123456789012:broker:MyBroker:b-1234a5b6-78cd-901e-2fgh-3i45j6k178l9", "FunctionName": { diff --git a/tests/translator/output/function_with_amq_kms.json b/tests/translator/output/function_with_amq_kms.json index 94ae8666a..249da646a 100644 --- a/tests/translator/output/function_with_amq_kms.json +++ b/tests/translator/output/function_with_amq_kms.json @@ -2,6 +2,8 @@ "Resources": { "MQFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -25,6 +27,8 @@ }, "MQFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -85,6 +89,8 @@ }, "MQFunctionMyMQQueue": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EventSourceArn": "arn:aws:mq:us-east-2:123456789012:broker:MyBroker:b-1234a5b6-78cd-901e-2fgh-3i45j6k178l9", "FunctionName": { From 3e2c69fc6514c41c00cad2d604da570b91f39707 Mon Sep 17 00:00:00 2001 From: Qingchuan Ma Date: Mon, 26 Apr 2021 09:24:55 -0700 Subject: [PATCH 20/41] Partially updated test templates (up to sns) --- .../input/function_with_condition.yaml | 2 + ...ction_with_conditional_managed_policy.yaml | 2 + ...ional_managed_policy_and_ref_no_value.yaml | 2 + ...tion_with_conditional_policy_template.yaml | 2 + ...onal_policy_template_and_ref_no_value.yaml | 2 + ...stom_codedeploy_deployment_preference.yaml | 14 ++++ ...onal_codedeploy_deployment_preference.yaml | 2 + ...ction_with_deployment_and_custom_role.yaml | 6 ++ ...ction_with_deployment_no_service_role.yaml | 6 ++ .../function_with_deployment_preference.yaml | 2 + ...oyment_preference_alarms_intrinsic_if.yaml | 2 + ..._deployment_preference_all_parameters.yaml | 12 +++- ...deployment_preference_from_parameters.yaml | 12 +++- ...ment_preference_multiple_combinations.yaml | 12 ++++ ...n_with_disabled_deployment_preference.yaml | 2 + tests/translator/input/function_with_dlq.yaml | 4 ++ .../input/function_with_event_dest.yaml | 8 +++ .../input/function_with_event_dest_basic.yaml | 2 + .../function_with_event_dest_conditional.yaml | 4 ++ .../function_with_event_source_mapping.yaml | 14 +++- .../function_with_file_system_config.yaml | 8 +++ .../input/function_with_global_layers.yaml | 2 + .../input/function_with_kmskeyarn.yaml | 6 ++ .../input/function_with_layers.yaml | 10 +++ .../input/function_with_many_layers.yaml | 4 ++ .../function_with_permissions_boundary.yaml | 2 + .../input/function_with_policy_templates.yaml | 6 ++ .../function_with_request_parameters.yaml | 6 ++ .../input/function_with_resource_refs.yaml | 6 ++ .../input/function_with_signing_profile.yaml | 6 ++ ..._with_sns_event_source_all_parameters.yaml | 2 + .../global_handle_path_level_parameter.yaml | 6 ++ tests/translator/input/globals_for_api.yaml | 6 ++ .../input/globals_for_function.yaml | 4 ++ .../input/globals_for_simpletable.yaml | 4 +- tests/translator/input/http_api_def_uri.yaml | 6 ++ .../input/http_api_description.yaml | 4 ++ .../input/http_api_existing_openapi.yaml | 4 ++ .../http_api_existing_openapi_conditions.yaml | 4 ++ .../input/http_api_explicit_stage.yaml | 4 ++ .../input/http_api_lambda_auth.yaml | 6 ++ .../input/http_api_lambda_auth_full.yaml | 6 ++ .../translator/input/http_api_with_cors.yaml | 4 ++ ...icit_and_explicit_api_with_conditions.yaml | 10 +++ tests/translator/input/implicit_api.yaml | 4 ++ ...icit_api_with_auth_and_conditions_max.yaml | 12 ++++ .../implicit_api_with_many_conditions.yaml | 22 ++++++ ...api_with_serverless_rest_api_resource.yaml | 6 ++ tests/translator/input/implicit_http_api.yaml | 4 ++ ...mplicit_http_api_auth_and_simple_case.yaml | 2 + ...mplicit_http_api_with_many_conditions.yaml | 22 ++++++ tests/translator/input/inline_precedence.yaml | 2 + .../translator/input/intrinsic_functions.yaml | 22 ++++++ tests/translator/input/iot_rule.yaml | 2 + .../input/layers_all_properties.yaml | 6 ++ .../input/layers_with_intrinsics.yaml | 16 +++++ ...api_with_serverless_rest_api_resource.yaml | 10 +++ tests/translator/input/s3.yaml | 4 ++ tests/translator/input/s3_create_remove.yaml | 4 ++ ...ing_lambda_notification_configuration.yaml | 4 ++ ...ting_other_notification_configuration.yaml | 4 ++ tests/translator/input/s3_filter.yaml | 4 ++ .../input/s3_multiple_events_same_bucket.yaml | 4 ++ .../input/s3_multiple_functions.yaml | 6 ++ tests/translator/input/s3_with_condition.yaml | 4 ++ tests/translator/input/s3_with_dependsOn.yaml | 6 ++ .../simple_table_ref_parameter_intrinsic.yaml | 2 + .../input/simple_table_with_extra_tags.yaml | 2 + .../input/simple_table_with_table_name.yaml | 6 ++ tests/translator/input/simpletable.yaml | 4 ++ .../input/simpletable_with_sse.yaml | 2 + tests/translator/input/sns.yaml | 4 ++ .../sns_existing_other_subscription.yaml | 4 ++ tests/translator/input/sns_existing_sqs.yaml | 8 ++- tests/translator/input/sns_outside_sqs.yaml | 4 ++ tests/translator/input/sns_sqs.yaml | 4 ++ .../input/sns_topic_outside_template.yaml | 2 + .../aws-cn/function_with_condition.json | 4 ++ ...ction_with_conditional_managed_policy.json | 4 ++ ...ional_managed_policy_and_ref_no_value.json | 4 ++ ...tion_with_conditional_policy_template.json | 4 ++ ...onal_policy_template_and_ref_no_value.json | 4 ++ ...stom_codedeploy_deployment_preference.json | 65 ++++++++++++++--- ...onal_codedeploy_deployment_preference.json | 9 ++- ...ction_with_deployment_and_custom_role.json | 20 +++++- ...ction_with_deployment_no_service_role.json | 22 +++++- .../function_with_deployment_preference.json | 9 ++- ...oyment_preference_alarms_intrinsic_if.json | 9 ++- ..._deployment_preference_all_parameters.json | 23 +++++- ...deployment_preference_from_parameters.json | 23 +++++- ...ment_preference_multiple_combinations.json | 37 +++++++++- ...n_with_disabled_deployment_preference.json | 11 ++- .../output/aws-cn/function_with_dlq.json | 8 +++ .../aws-cn/function_with_event_dest.json | 22 ++++++ .../function_with_event_dest_basic.json | 13 +++- .../function_with_event_dest_conditional.json | 12 ++++ .../function_with_event_source_mapping.json | 24 ++++++- .../function_with_file_system_config.json | 12 +++- .../aws-cn/function_with_global_layers.json | 4 ++ .../aws-cn/function_with_kmskeyarn.json | 10 +++ .../output/aws-cn/function_with_layers.json | 23 +++++- .../aws-cn/function_with_many_layers.json | 11 ++- .../function_with_permissions_boundary.json | 4 ++ .../function_with_policy_templates.json | 12 ++++ .../function_with_request_parameters.json | 24 +++++++ .../aws-cn/function_with_resource_refs.json | 15 +++- .../aws-cn/function_with_signing_profile.json | 8 +++ ..._with_sns_event_source_all_parameters.json | 8 +++ .../global_handle_path_level_parameter.json | 20 ++++++ .../output/aws-cn/globals_for_api.json | 20 ++++++ .../output/aws-cn/globals_for_function.json | 18 ++++- .../aws-cn/globals_for_simpletable.json | 2 + .../output/aws-cn/http_api_def_uri.json | 16 +++++ .../output/aws-cn/http_api_description.json | 10 +++ .../aws-cn/http_api_existing_openapi.json | 10 +++ .../http_api_existing_openapi_conditions.json | 10 +++ .../aws-cn/http_api_explicit_stage.json | 10 +++ .../output/aws-cn/http_api_lambda_auth.json | 14 ++++ .../aws-cn/http_api_lambda_auth_full.json | 14 ++++ .../output/aws-cn/http_api_with_cors.json | 16 +++++ ...icit_and_explicit_api_with_conditions.json | 36 ++++++++++ .../output/aws-cn/implicit_api.json | 22 ++++++ ...icit_api_with_auth_and_conditions_max.json | 48 +++++++++++++ .../implicit_api_with_many_conditions.json | 72 +++++++++++++++++++ ...api_with_serverless_rest_api_resource.json | 22 ++++++ .../output/aws-cn/implicit_http_api.json | 18 +++++ ...mplicit_http_api_auth_and_simple_case.json | 10 +++ ...mplicit_http_api_with_many_conditions.json | 70 ++++++++++++++++++ .../output/aws-cn/inline_precedence.json | 4 ++ .../output/aws-cn/intrinsic_functions.json | 46 +++++++++++- tests/translator/output/aws-cn/iot_rule.json | 12 ++++ .../output/aws-cn/layers_all_properties.json | 20 ++++-- .../output/aws-cn/layers_with_intrinsics.json | 44 +++++++----- ...api_with_serverless_rest_api_resource.json | 18 +++++ tests/translator/output/aws-cn/s3.json | 8 +++ .../output/aws-cn/s3_create_remove.json | 8 +++ ...ing_lambda_notification_configuration.json | 8 +++ ...ting_other_notification_configuration.json | 8 +++ tests/translator/output/aws-cn/s3_filter.json | 8 +++ .../s3_multiple_events_same_bucket.json | 10 +++ .../output/aws-cn/s3_multiple_functions.json | 14 ++++ .../output/aws-cn/s3_with_condition.json | 8 +++ .../output/aws-cn/s3_with_dependsOn.json | 12 +++- .../simple_table_ref_parameter_intrinsic.json | 2 + .../aws-cn/simple_table_with_extra_tags.json | 2 + .../aws-cn/simple_table_with_table_name.json | 6 ++ .../translator/output/aws-cn/simpletable.json | 4 ++ .../output/aws-cn/simpletable_with_sse.json | 2 + tests/translator/output/aws-cn/sns.json | 12 +++- .../sns_existing_other_subscription.json | 10 +++ .../output/aws-cn/sns_existing_sqs.json | 18 ++++- .../output/aws-cn/sns_outside_sqs.json | 14 +++- tests/translator/output/aws-cn/sns_sqs.json | 16 ++++- .../aws-cn/sns_topic_outside_template.json | 8 +++ .../aws-us-gov/function_with_condition.json | 4 ++ ...ction_with_conditional_managed_policy.json | 4 ++ ...ional_managed_policy_and_ref_no_value.json | 4 ++ ...tion_with_conditional_policy_template.json | 4 ++ ...onal_policy_template_and_ref_no_value.json | 4 ++ ...stom_codedeploy_deployment_preference.json | 69 +++++++++++++++--- ...onal_codedeploy_deployment_preference.json | 9 ++- ...ction_with_deployment_and_custom_role.json | 18 ++++- ...ction_with_deployment_no_service_role.json | 22 +++++- .../function_with_deployment_preference.json | 9 ++- ...oyment_preference_alarms_intrinsic_if.json | 9 ++- ..._deployment_preference_all_parameters.json | 23 +++++- ...deployment_preference_from_parameters.json | 23 +++++- ...ment_preference_multiple_combinations.json | 37 +++++++++- ...n_with_disabled_deployment_preference.json | 9 ++- .../output/aws-us-gov/function_with_dlq.json | 8 +++ .../aws-us-gov/function_with_event_dest.json | 22 ++++++ .../function_with_event_dest_basic.json | 13 +++- .../function_with_event_dest_conditional.json | 12 ++++ .../function_with_event_source_mapping.json | 24 ++++++- .../function_with_file_system_config.json | 12 +++- .../function_with_global_layers.json | 4 ++ .../aws-us-gov/function_with_kmskeyarn.json | 10 +++ .../aws-us-gov/function_with_layers.json | 23 +++++- .../aws-us-gov/function_with_many_layers.json | 11 ++- .../function_with_permissions_boundary.json | 4 ++ .../function_with_policy_templates.json | 12 ++++ .../function_with_request_parameters.json | 24 +++++++ .../function_with_resource_refs.json | 17 ++++- .../function_with_signing_profile.json | 8 +++ ..._with_sns_event_source_all_parameters.json | 8 +++ .../global_handle_path_level_parameter.json | 20 ++++++ .../output/aws-us-gov/globals_for_api.json | 20 ++++++ .../aws-us-gov/globals_for_function.json | 18 ++++- .../aws-us-gov/globals_for_simpletable.json | 2 + .../output/aws-us-gov/http_api_def_uri.json | 16 +++++ .../aws-us-gov/http_api_description.json | 10 +++ .../aws-us-gov/http_api_existing_openapi.json | 10 +++ .../http_api_existing_openapi_conditions.json | 10 +++ .../aws-us-gov/http_api_explicit_stage.json | 10 +++ .../aws-us-gov/http_api_lambda_auth.json | 14 ++++ .../aws-us-gov/http_api_lambda_auth_full.json | 14 ++++ .../output/aws-us-gov/http_api_with_cors.json | 16 +++++ ...icit_and_explicit_api_with_conditions.json | 36 ++++++++++ .../output/aws-us-gov/implicit_api.json | 22 ++++++ ...icit_api_with_auth_and_conditions_max.json | 48 +++++++++++++ .../implicit_api_with_many_conditions.json | 72 +++++++++++++++++++ ...api_with_serverless_rest_api_resource.json | 22 ++++++ .../output/aws-us-gov/implicit_http_api.json | 18 +++++ ...mplicit_http_api_auth_and_simple_case.json | 10 +++ ...mplicit_http_api_with_many_conditions.json | 70 ++++++++++++++++++ .../output/aws-us-gov/inline_precedence.json | 4 ++ .../aws-us-gov/intrinsic_functions.json | 46 +++++++++++- .../output/aws-us-gov/iot_rule.json | 12 ++++ .../aws-us-gov/layers_all_properties.json | 20 ++++-- .../aws-us-gov/layers_with_intrinsics.json | 44 +++++++----- ...api_with_serverless_rest_api_resource.json | 18 +++++ tests/translator/output/aws-us-gov/s3.json | 8 +++ .../output/aws-us-gov/s3_create_remove.json | 8 +++ ...ing_lambda_notification_configuration.json | 8 +++ ...ting_other_notification_configuration.json | 8 +++ .../output/aws-us-gov/s3_filter.json | 8 +++ .../s3_multiple_events_same_bucket.json | 10 +++ .../aws-us-gov/s3_multiple_functions.json | 14 ++++ .../output/aws-us-gov/s3_with_condition.json | 8 +++ .../output/aws-us-gov/s3_with_dependsOn.json | 12 +++- .../simple_table_ref_parameter_intrinsic.json | 2 + .../simple_table_with_extra_tags.json | 2 + .../simple_table_with_table_name.json | 6 ++ .../output/aws-us-gov/simpletable.json | 4 ++ .../aws-us-gov/simpletable_with_sse.json | 2 + tests/translator/output/aws-us-gov/sns.json | 12 +++- .../sns_existing_other_subscription.json | 10 +++ .../output/aws-us-gov/sns_existing_sqs.json | 18 ++++- .../output/aws-us-gov/sns_outside_sqs.json | 14 +++- .../translator/output/aws-us-gov/sns_sqs.json | 16 ++++- .../sns_topic_outside_template.json | 8 +++ .../output/function_with_condition.json | 4 ++ ...ction_with_conditional_managed_policy.json | 4 ++ ...ional_managed_policy_and_ref_no_value.json | 4 ++ ...tion_with_conditional_policy_template.json | 4 ++ ...onal_policy_template_and_ref_no_value.json | 4 ++ ...stom_codedeploy_deployment_preference.json | 63 ++++++++++++++-- ...onal_codedeploy_deployment_preference.json | 9 ++- ...ction_with_deployment_and_custom_role.json | 18 ++++- ...ction_with_deployment_no_service_role.json | 20 +++++- .../function_with_deployment_preference.json | 9 ++- ...oyment_preference_alarms_intrinsic_if.json | 9 ++- ..._deployment_preference_all_parameters.json | 23 +++++- ...deployment_preference_from_parameters.json | 23 +++++- ...ment_preference_multiple_combinations.json | 37 +++++++++- ...n_with_disabled_deployment_preference.json | 9 ++- .../translator/output/function_with_dlq.json | 8 +++ .../output/function_with_event_dest.json | 22 ++++++ .../function_with_event_dest_basic.json | 13 +++- .../function_with_event_dest_conditional.json | 12 ++++ .../function_with_event_source_mapping.json | 24 ++++++- .../function_with_file_system_config.json | 12 +++- .../output/function_with_global_layers.json | 4 ++ .../output/function_with_kmskeyarn.json | 10 +++ .../output/function_with_layers.json | 23 +++++- .../output/function_with_many_layers.json | 11 ++- .../function_with_permissions_boundary.json | 4 ++ .../function_with_policy_templates.json | 12 ++++ .../function_with_request_parameters.json | 24 +++++++ .../output/function_with_resource_refs.json | 15 +++- .../output/function_with_signing_profile.json | 8 +++ ..._with_sns_event_source_all_parameters.json | 8 +++ .../global_handle_path_level_parameter.json | 20 ++++++ tests/translator/output/globals_for_api.json | 20 ++++++ .../output/globals_for_function.json | 18 ++++- .../output/globals_for_simpletable.json | 2 + tests/translator/output/http_api_def_uri.json | 16 +++++ .../output/http_api_description.json | 10 +++ .../output/http_api_existing_openapi.json | 10 +++ .../http_api_existing_openapi_conditions.json | 10 +++ .../output/http_api_explicit_stage.json | 10 +++ .../output/http_api_lambda_auth.json | 14 ++++ .../output/http_api_lambda_auth_full.json | 14 ++++ .../translator/output/http_api_with_cors.json | 16 +++++ ...icit_and_explicit_api_with_conditions.json | 36 ++++++++++ tests/translator/output/implicit_api.json | 22 ++++++ ...icit_api_with_auth_and_conditions_max.json | 48 +++++++++++++ .../implicit_api_with_many_conditions.json | 72 +++++++++++++++++++ ...api_with_serverless_rest_api_resource.json | 22 ++++++ .../translator/output/implicit_http_api.json | 18 +++++ ...mplicit_http_api_auth_and_simple_case.json | 10 +++ ...mplicit_http_api_with_many_conditions.json | 70 ++++++++++++++++++ .../translator/output/inline_precedence.json | 4 ++ .../output/intrinsic_functions.json | 46 +++++++++++- tests/translator/output/iot_rule.json | 12 ++++ .../output/layers_all_properties.json | 20 ++++-- .../output/layers_with_intrinsics.json | 44 +++++++----- ...api_with_serverless_rest_api_resource.json | 18 +++++ tests/translator/output/s3.json | 8 +++ tests/translator/output/s3_create_remove.json | 8 +++ ...ing_lambda_notification_configuration.json | 8 +++ ...ting_other_notification_configuration.json | 8 +++ tests/translator/output/s3_filter.json | 8 +++ .../s3_multiple_events_same_bucket.json | 10 +++ .../output/s3_multiple_functions.json | 14 ++++ .../translator/output/s3_with_condition.json | 8 +++ .../translator/output/s3_with_dependsOn.json | 12 +++- .../simple_table_ref_parameter_intrinsic.json | 2 + .../output/simple_table_with_extra_tags.json | 2 + .../output/simple_table_with_table_name.json | 6 ++ tests/translator/output/simpletable.json | 4 ++ .../output/simpletable_with_sse.json | 2 + tests/translator/output/sns.json | 12 +++- .../sns_existing_other_subscription.json | 10 +++ tests/translator/output/sns_existing_sqs.json | 18 ++++- tests/translator/output/sns_outside_sqs.json | 14 +++- tests/translator/output/sns_sqs.json | 16 ++++- .../output/sns_topic_outside_template.json | 8 +++ 308 files changed, 3940 insertions(+), 218 deletions(-) diff --git a/tests/translator/input/function_with_condition.yaml b/tests/translator/input/function_with_condition.yaml index 059ea737b..0f05eda79 100644 --- a/tests/translator/input/function_with_condition.yaml +++ b/tests/translator/input/function_with_condition.yaml @@ -6,6 +6,8 @@ Conditions: Resources: ConditionFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Condition: "TestCondition" Properties: CodeUri: s3://sam-demo-bucket/hello.zip diff --git a/tests/translator/input/function_with_conditional_managed_policy.yaml b/tests/translator/input/function_with_conditional_managed_policy.yaml index 6bfed9d07..81ec262cd 100644 --- a/tests/translator/input/function_with_conditional_managed_policy.yaml +++ b/tests/translator/input/function_with_conditional_managed_policy.yaml @@ -5,6 +5,8 @@ Conditions: Resources: FunctionWithConditionalPolicy: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Description: A function that has Fn::If in the policies property Handler: hello.handler diff --git a/tests/translator/input/function_with_conditional_managed_policy_and_ref_no_value.yaml b/tests/translator/input/function_with_conditional_managed_policy_and_ref_no_value.yaml index 62f952801..b2d536f43 100644 --- a/tests/translator/input/function_with_conditional_managed_policy_and_ref_no_value.yaml +++ b/tests/translator/input/function_with_conditional_managed_policy_and_ref_no_value.yaml @@ -5,6 +5,8 @@ Conditions: Resources: FunctionWithConditionalPolicy: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Description: A function that has Fn::If in the policies property Handler: hello.handler diff --git a/tests/translator/input/function_with_conditional_policy_template.yaml b/tests/translator/input/function_with_conditional_policy_template.yaml index 4b7a0b8fe..f19197f9b 100644 --- a/tests/translator/input/function_with_conditional_policy_template.yaml +++ b/tests/translator/input/function_with_conditional_policy_template.yaml @@ -5,6 +5,8 @@ Conditions: Resources: FunctionWithConditionalPolicy: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Description: A function that has Fn::If in the policies property Handler: hello.handler diff --git a/tests/translator/input/function_with_conditional_policy_template_and_ref_no_value.yaml b/tests/translator/input/function_with_conditional_policy_template_and_ref_no_value.yaml index 432b4db2a..e9756c9ba 100644 --- a/tests/translator/input/function_with_conditional_policy_template_and_ref_no_value.yaml +++ b/tests/translator/input/function_with_conditional_policy_template_and_ref_no_value.yaml @@ -5,6 +5,8 @@ Conditions: Resources: FunctionWithConditionalPolicy: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Description: A function that has Fn::If in the policies property Handler: hello.handler diff --git a/tests/translator/input/function_with_custom_codedeploy_deployment_preference.yaml b/tests/translator/input/function_with_custom_codedeploy_deployment_preference.yaml index 1a6a8606a..5653638c6 100644 --- a/tests/translator/input/function_with_custom_codedeploy_deployment_preference.yaml +++ b/tests/translator/input/function_with_custom_codedeploy_deployment_preference.yaml @@ -27,6 +27,8 @@ Conditions: Resources: MinimalFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -37,6 +39,8 @@ Resources: CustomWithFindInMap: # Doesn't work Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -47,6 +51,8 @@ Resources: CustomWithCondition: # Works Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -57,6 +63,8 @@ Resources: CustomWithCondition2: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -67,6 +75,8 @@ Resources: NormalWithSub: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -77,6 +87,8 @@ Resources: CustomWithSub: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -87,6 +99,8 @@ Resources: NormalWithRef: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler diff --git a/tests/translator/input/function_with_custom_conditional_codedeploy_deployment_preference.yaml b/tests/translator/input/function_with_custom_conditional_codedeploy_deployment_preference.yaml index 50bb95e6d..93472b202 100644 --- a/tests/translator/input/function_with_custom_conditional_codedeploy_deployment_preference.yaml +++ b/tests/translator/input/function_with_custom_conditional_codedeploy_deployment_preference.yaml @@ -10,6 +10,8 @@ Conditions: Resources: HelloWorldFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Handler: index.handler Runtime: nodejs12.x diff --git a/tests/translator/input/function_with_deployment_and_custom_role.yaml b/tests/translator/input/function_with_deployment_and_custom_role.yaml index 448b0fdc0..034c9a9a4 100644 --- a/tests/translator/input/function_with_deployment_and_custom_role.yaml +++ b/tests/translator/input/function_with_deployment_and_custom_role.yaml @@ -8,6 +8,8 @@ Resources: MinimalFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -15,6 +17,8 @@ Resources: FunctionWithRole: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -23,6 +27,8 @@ Resources: DeploymentRole: Type: AWS::IAM::Role + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: ManagedPolicyArns: - arn:aws:iam::aws:policy/service-role/AWSCodeDeployRole diff --git a/tests/translator/input/function_with_deployment_no_service_role.yaml b/tests/translator/input/function_with_deployment_no_service_role.yaml index ae40a6a00..69095188f 100644 --- a/tests/translator/input/function_with_deployment_no_service_role.yaml +++ b/tests/translator/input/function_with_deployment_no_service_role.yaml @@ -9,6 +9,8 @@ Resources: MinimalFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -16,6 +18,8 @@ Resources: OtherFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -23,6 +27,8 @@ Resources: DeploymentRole: Type: AWS::IAM::Role + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: ManagedPolicyArns: - arn:aws:iam::aws:policy/service-role/AWSCodeDeployRole diff --git a/tests/translator/input/function_with_deployment_preference.yaml b/tests/translator/input/function_with_deployment_preference.yaml index d3d5f47d2..61ba3c8e1 100644 --- a/tests/translator/input/function_with_deployment_preference.yaml +++ b/tests/translator/input/function_with_deployment_preference.yaml @@ -15,6 +15,8 @@ Conditions: Resources: MinimalFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler diff --git a/tests/translator/input/function_with_deployment_preference_alarms_intrinsic_if.yaml b/tests/translator/input/function_with_deployment_preference_alarms_intrinsic_if.yaml index f392f1062..e8e022b9b 100644 --- a/tests/translator/input/function_with_deployment_preference_alarms_intrinsic_if.yaml +++ b/tests/translator/input/function_with_deployment_preference_alarms_intrinsic_if.yaml @@ -6,6 +6,8 @@ Conditions: Resources: MinimalFunction: Type: "AWS::Serverless::Function" + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler diff --git a/tests/translator/input/function_with_deployment_preference_all_parameters.yaml b/tests/translator/input/function_with_deployment_preference_all_parameters.yaml index cbbc80e5f..05f42158a 100644 --- a/tests/translator/input/function_with_deployment_preference_all_parameters.yaml +++ b/tests/translator/input/function_with_deployment_preference_all_parameters.yaml @@ -1,6 +1,8 @@ Resources: MinimalFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -23,6 +25,8 @@ Resources: MySanityTestFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Handler: hello.handler Runtime: python2.7 @@ -32,6 +36,8 @@ Resources: MyValidationTestFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Handler: hello.handler Runtime: python2.7 @@ -41,6 +47,8 @@ Resources: MyCloudWatchAlarm: Type: AWS::CloudWatch::Alarm + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: ComparisonOperator: GreaterThanThreshold EvaluationPeriods: 1 @@ -50,4 +58,6 @@ Resources: Threshold: 10 MySNSTopic: - Type: AWS::SNS::Topic \ No newline at end of file + Type: AWS::SNS::Topic + DeletionPolicy: Delete + UpdateReplacePolicy: Retain \ No newline at end of file diff --git a/tests/translator/input/function_with_deployment_preference_from_parameters.yaml b/tests/translator/input/function_with_deployment_preference_from_parameters.yaml index b77580f9b..fcb0a6699 100644 --- a/tests/translator/input/function_with_deployment_preference_from_parameters.yaml +++ b/tests/translator/input/function_with_deployment_preference_from_parameters.yaml @@ -12,6 +12,8 @@ Parameters: Resources: MinimalFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -34,6 +36,8 @@ Resources: MySanityTestFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Handler: hello.handler Runtime: python2.7 @@ -43,6 +47,8 @@ Resources: MyValidationTestFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Handler: hello.handler Runtime: python2.7 @@ -52,6 +58,8 @@ Resources: MyCloudWatchAlarm: Type: AWS::CloudWatch::Alarm + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: ComparisonOperator: GreaterThanThreshold EvaluationPeriods: 1 @@ -61,4 +69,6 @@ Resources: Threshold: 10 MySNSTopic: - Type: AWS::SNS::Topic \ No newline at end of file + Type: AWS::SNS::Topic + DeletionPolicy: Delete + UpdateReplacePolicy: Retain \ No newline at end of file diff --git a/tests/translator/input/function_with_deployment_preference_multiple_combinations.yaml b/tests/translator/input/function_with_deployment_preference_multiple_combinations.yaml index 9cc5703d8..c4f8b7b44 100644 --- a/tests/translator/input/function_with_deployment_preference_multiple_combinations.yaml +++ b/tests/translator/input/function_with_deployment_preference_multiple_combinations.yaml @@ -1,6 +1,8 @@ Resources: MinimalFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -9,6 +11,8 @@ Resources: MinimalFunctionWithMinimalDeploymentPreference: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -19,6 +23,8 @@ Resources: MinimalFunctionWithDeploymentPreferenceWithHooksAndAlarms: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -34,6 +40,8 @@ Resources: MySanityTestFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Handler: hello.handler Runtime: python2.7 @@ -43,6 +51,8 @@ Resources: MyValidationTestFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Handler: hello.handler Runtime: python2.7 @@ -52,6 +62,8 @@ Resources: MyCloudWatchAlarm: Type: AWS::CloudWatch::Alarm + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: ComparisonOperator: GreaterThanThreshold EvaluationPeriods: 1 diff --git a/tests/translator/input/function_with_disabled_deployment_preference.yaml b/tests/translator/input/function_with_disabled_deployment_preference.yaml index 26b7dc8e1..a1f87ff26 100644 --- a/tests/translator/input/function_with_disabled_deployment_preference.yaml +++ b/tests/translator/input/function_with_disabled_deployment_preference.yaml @@ -1,6 +1,8 @@ Resources: MinimalFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler diff --git a/tests/translator/input/function_with_dlq.yaml b/tests/translator/input/function_with_dlq.yaml index 217777345..7c33091da 100644 --- a/tests/translator/input/function_with_dlq.yaml +++ b/tests/translator/input/function_with_dlq.yaml @@ -2,6 +2,8 @@ Transform: "AWS::Serverless-2016-10-31" Resources: MySnsDlqLambdaFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Handler: index.handler Runtime: python2.7 @@ -12,6 +14,8 @@ Resources: MySqsDlqLambdaFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Handler: index.handler Runtime: python2.7 diff --git a/tests/translator/input/function_with_event_dest.yaml b/tests/translator/input/function_with_event_dest.yaml index 23e1a7524..60173cdf3 100644 --- a/tests/translator/input/function_with_event_dest.yaml +++ b/tests/translator/input/function_with_event_dest.yaml @@ -20,6 +20,8 @@ Conditions: Resources: MyTestFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: EventInvokeConfig: MaximumEventAgeInSeconds: 70 @@ -52,6 +54,8 @@ Resources: MemorySize: 1024 MyTestFunction2: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: EventInvokeConfig: MaximumEventAgeInSeconds: 70 @@ -85,6 +89,8 @@ Resources: DestinationLambda: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: InlineCode: | exports.handler = async (event) => { @@ -99,6 +105,8 @@ Resources: MemorySize: 1024 SNSSubscription: Type: AWS::SNS::Subscription + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Condition: TopicCreationEnabled Properties: Endpoint: example@example.com diff --git a/tests/translator/input/function_with_event_dest_basic.yaml b/tests/translator/input/function_with_event_dest_basic.yaml index e26b32059..341965eb2 100644 --- a/tests/translator/input/function_with_event_dest_basic.yaml +++ b/tests/translator/input/function_with_event_dest_basic.yaml @@ -18,6 +18,8 @@ Globals: Resources: MyTestFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: InlineCode: | exports.handler = function(event, context, callback) { diff --git a/tests/translator/input/function_with_event_dest_conditional.yaml b/tests/translator/input/function_with_event_dest_conditional.yaml index 45e1b69e1..3d65cd1e7 100644 --- a/tests/translator/input/function_with_event_dest_conditional.yaml +++ b/tests/translator/input/function_with_event_dest_conditional.yaml @@ -15,6 +15,8 @@ Conditions: Resources: MyTestFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Condition: FunctionCondition Properties: EventInvokeConfig: @@ -48,6 +50,8 @@ Resources: MemorySize: 1024 DestinationLambda: Condition: FunctionInlineEnabled + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Type: AWS::Serverless::Function Properties: InlineCode: | diff --git a/tests/translator/input/function_with_event_source_mapping.yaml b/tests/translator/input/function_with_event_source_mapping.yaml index edea3e214..336a44031 100644 --- a/tests/translator/input/function_with_event_source_mapping.yaml +++ b/tests/translator/input/function_with_event_source_mapping.yaml @@ -10,6 +10,8 @@ Parameters: Resources: MyFunctionForBatchingExample: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Handler: index.handler InlineCode: | @@ -62,15 +64,21 @@ Resources: KinesisStream: Type: AWS::Kinesis::Stream + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: ShardCount: 1 KinesisStream1: Type: AWS::Kinesis::Stream + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: ShardCount: 1 DynamoDBTable: Type: AWS::DynamoDB::Table + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: AttributeDefinitions: - AttributeName: id @@ -86,5 +94,9 @@ Resources: MySqsQueue: Type: AWS::SQS::Queue + DeletionPolicy: Delete + UpdateReplacePolicy: Retain MySnsTopic: - Type: AWS::SNS::Topic \ No newline at end of file + Type: AWS::SNS::Topic + DeletionPolicy: Delete + UpdateReplacePolicy: Retain \ No newline at end of file diff --git a/tests/translator/input/function_with_file_system_config.yaml b/tests/translator/input/function_with_file_system_config.yaml index 46864d092..f6a453aea 100644 --- a/tests/translator/input/function_with_file_system_config.yaml +++ b/tests/translator/input/function_with_file_system_config.yaml @@ -15,9 +15,13 @@ Parameters: Resources: EfsFileSystem: Type: AWS::EFS::FileSystem + DeletionPolicy: Delete + UpdateReplacePolicy: Retain MountTarget: Type: AWS::EFS::MountTarget + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: FileSystemId: !Ref EfsFileSystem SubnetId: subnet-abc123 @@ -25,11 +29,15 @@ Resources: AccessPoint: Type: AWS::EFS::AccessPoint + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: FileSystemId: !Ref EfsFileSystem LambdaFunctionWithEfs: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: InlineCode: | const fs = require('fs') diff --git a/tests/translator/input/function_with_global_layers.yaml b/tests/translator/input/function_with_global_layers.yaml index 2b4d6eb32..035662d66 100644 --- a/tests/translator/input/function_with_global_layers.yaml +++ b/tests/translator/input/function_with_global_layers.yaml @@ -8,6 +8,8 @@ Globals: Resources: ManyLayersFunc: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler diff --git a/tests/translator/input/function_with_kmskeyarn.yaml b/tests/translator/input/function_with_kmskeyarn.yaml index 4679b19a0..0229dcad7 100644 --- a/tests/translator/input/function_with_kmskeyarn.yaml +++ b/tests/translator/input/function_with_kmskeyarn.yaml @@ -1,6 +1,8 @@ Resources: FunctionWithKeyArn: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -9,6 +11,8 @@ Resources: FunctionWithReferenceToKeyArn: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -18,6 +22,8 @@ Resources: myKey: Type: "AWS::KMS::Key" + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Description: "A sample key" KeyPolicy: diff --git a/tests/translator/input/function_with_layers.yaml b/tests/translator/input/function_with_layers.yaml index 1e34324d0..78b2aa6e5 100644 --- a/tests/translator/input/function_with_layers.yaml +++ b/tests/translator/input/function_with_layers.yaml @@ -1,6 +1,8 @@ Resources: MinimalLayerFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -10,6 +12,8 @@ Resources: FunctionNoLayerVersion: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -19,6 +23,8 @@ Resources: FunctionLayerWithSubIntrinsic: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -29,6 +35,8 @@ Resources: FunctionReferencesLayer: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -38,5 +46,7 @@ Resources: MyLayer: Type: 'AWS::Serverless::LayerVersion' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: ContentUri: s3://sam-demo-bucket/layer.zip diff --git a/tests/translator/input/function_with_many_layers.yaml b/tests/translator/input/function_with_many_layers.yaml index 78ba2bc4a..fda5c89e5 100644 --- a/tests/translator/input/function_with_many_layers.yaml +++ b/tests/translator/input/function_with_many_layers.yaml @@ -1,6 +1,8 @@ Resources: ManyLayersFunc: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -14,5 +16,7 @@ Resources: MyLayer: Type: 'AWS::Serverless::LayerVersion' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: ContentUri: s3://sam-demo-bucket/layer.zip diff --git a/tests/translator/input/function_with_permissions_boundary.yaml b/tests/translator/input/function_with_permissions_boundary.yaml index 5cad58b7f..811fcd32e 100644 --- a/tests/translator/input/function_with_permissions_boundary.yaml +++ b/tests/translator/input/function_with_permissions_boundary.yaml @@ -1,6 +1,8 @@ Resources: MinimalFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler diff --git a/tests/translator/input/function_with_policy_templates.yaml b/tests/translator/input/function_with_policy_templates.yaml index 34fd86683..054fe9db2 100644 --- a/tests/translator/input/function_with_policy_templates.yaml +++ b/tests/translator/input/function_with_policy_templates.yaml @@ -6,6 +6,8 @@ Resources: OnePolicyTemplate: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -21,6 +23,8 @@ Resources: MultiplePolicyTemplates: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -33,6 +37,8 @@ Resources: AllCombinations: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler diff --git a/tests/translator/input/function_with_request_parameters.yaml b/tests/translator/input/function_with_request_parameters.yaml index 2875457c5..754d1d725 100644 --- a/tests/translator/input/function_with_request_parameters.yaml +++ b/tests/translator/input/function_with_request_parameters.yaml @@ -2,11 +2,15 @@ Resources: Api: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod ApiParameterFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -25,6 +29,8 @@ Resources: NoApiParameterFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml diff --git a/tests/translator/input/function_with_resource_refs.yaml b/tests/translator/input/function_with_resource_refs.yaml index 02732661c..de64caeb2 100644 --- a/tests/translator/input/function_with_resource_refs.yaml +++ b/tests/translator/input/function_with_resource_refs.yaml @@ -7,6 +7,8 @@ Resources: MinimalFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -15,6 +17,8 @@ Resources: FunctionWithoutAlias: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -22,6 +26,8 @@ Resources: MyBucket: Type: AWS::S3::Bucket + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Name: Fn::GetAtt: ["MinimalFunction.Alias", "Name"] diff --git a/tests/translator/input/function_with_signing_profile.yaml b/tests/translator/input/function_with_signing_profile.yaml index 09a032367..6b83178dd 100644 --- a/tests/translator/input/function_with_signing_profile.yaml +++ b/tests/translator/input/function_with_signing_profile.yaml @@ -2,6 +2,8 @@ Resources: FunctionWithSigningProfile: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -10,6 +12,8 @@ Resources: MySignedFunctionCodeSigningConfig: Type: AWS::Lambda::CodeSigningConfig + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Description: "Code Signing for MySignedLambdaFunction" AllowedPublishers: @@ -20,5 +24,7 @@ Resources: SigningProfile: Type: AWS::Signer::SigningProfile + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: PlatformId: AWSLambda-SHA384-ECDSA \ No newline at end of file diff --git a/tests/translator/input/function_with_sns_event_source_all_parameters.yaml b/tests/translator/input/function_with_sns_event_source_all_parameters.yaml index 65711e733..d35e9a079 100644 --- a/tests/translator/input/function_with_sns_event_source_all_parameters.yaml +++ b/tests/translator/input/function_with_sns_event_source_all_parameters.yaml @@ -1,6 +1,8 @@ Resources: MyAwesomeFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler diff --git a/tests/translator/input/global_handle_path_level_parameter.yaml b/tests/translator/input/global_handle_path_level_parameter.yaml index 0b8e642f1..aff2212e4 100644 --- a/tests/translator/input/global_handle_path_level_parameter.yaml +++ b/tests/translator/input/global_handle_path_level_parameter.yaml @@ -14,6 +14,8 @@ Globals: Resources: ImplicitApiFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -27,6 +29,8 @@ Resources: ExplicitApi: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: SomeStage DefinitionBody: @@ -51,6 +55,8 @@ Resources: MyUserPool: Type: AWS::Cognito::UserPool + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: UserPoolName: UserPoolName Policies: diff --git a/tests/translator/input/globals_for_api.yaml b/tests/translator/input/globals_for_api.yaml index e68eddfcf..3c02882f9 100644 --- a/tests/translator/input/globals_for_api.yaml +++ b/tests/translator/input/globals_for_api.yaml @@ -15,6 +15,8 @@ Globals: Resources: ImplicitApiFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -28,6 +30,8 @@ Resources: ExplicitApi: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: SomeStage DefinitionBody: @@ -46,6 +50,8 @@ Resources: MyUserPool: Type: AWS::Cognito::UserPool + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: UserPoolName: UserPoolName Policies: diff --git a/tests/translator/input/globals_for_function.yaml b/tests/translator/input/globals_for_function.yaml index d16829df4..6836c46f9 100644 --- a/tests/translator/input/globals_for_function.yaml +++ b/tests/translator/input/globals_for_function.yaml @@ -26,9 +26,13 @@ Globals: Resources: MinimalFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain FunctionWithOverrides: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: index.handler diff --git a/tests/translator/input/globals_for_simpletable.yaml b/tests/translator/input/globals_for_simpletable.yaml index 6a03a75ed..49b583a17 100644 --- a/tests/translator/input/globals_for_simpletable.yaml +++ b/tests/translator/input/globals_for_simpletable.yaml @@ -5,4 +5,6 @@ Globals: Resources: MinimalTable: - Type: AWS::Serverless::SimpleTable \ No newline at end of file + Type: AWS::Serverless::SimpleTable + DeletionPolicy: Delete + UpdateReplacePolicy: Retain \ No newline at end of file diff --git a/tests/translator/input/http_api_def_uri.yaml b/tests/translator/input/http_api_def_uri.yaml index 0182af394..e0332d9ee 100644 --- a/tests/translator/input/http_api_def_uri.yaml +++ b/tests/translator/input/http_api_def_uri.yaml @@ -6,6 +6,8 @@ Globals: Resources: MyApi: Type: AWS::Serverless::HttpApi + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: DefinitionUri: s3://bucket/key StageName: !Join ["", ["Stage", "Name"]] @@ -14,6 +16,8 @@ Resources: MyApi2: Type: AWS::Serverless::HttpApi + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: DefinitionUri: Bucket: bucket @@ -22,6 +26,8 @@ Resources: Function: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Runtime: python3.7 Handler: index.handler diff --git a/tests/translator/input/http_api_description.yaml b/tests/translator/input/http_api_description.yaml index 268584d89..780ff5c2f 100644 --- a/tests/translator/input/http_api_description.yaml +++ b/tests/translator/input/http_api_description.yaml @@ -1,6 +1,8 @@ Resources: HttpApi: Type: AWS::Serverless::HttpApi + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: DefinitionBody: openapi: "3.0.1" @@ -10,6 +12,8 @@ Resources: Function: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Runtime: python3.7 Handler: index.handler diff --git a/tests/translator/input/http_api_existing_openapi.yaml b/tests/translator/input/http_api_existing_openapi.yaml index 891d9199e..956d8d2c7 100644 --- a/tests/translator/input/http_api_existing_openapi.yaml +++ b/tests/translator/input/http_api_existing_openapi.yaml @@ -17,6 +17,8 @@ Globals: Resources: HttpApiFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/todo_list.zip Handler: index.restapi @@ -44,6 +46,8 @@ Resources: Method: GET MyApi: Type: AWS::Serverless::HttpApi + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CorsConfiguration: AllowOrigins: diff --git a/tests/translator/input/http_api_existing_openapi_conditions.yaml b/tests/translator/input/http_api_existing_openapi_conditions.yaml index 6b9c91c5f..d48eed442 100644 --- a/tests/translator/input/http_api_existing_openapi_conditions.yaml +++ b/tests/translator/input/http_api_existing_openapi_conditions.yaml @@ -7,6 +7,8 @@ Resources: HttpApiFunction: Condition: condition Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/todo_list.zip Handler: index.restapi @@ -35,6 +37,8 @@ Resources: ApiId: !Ref MyApi MyApi: Type: AWS::Serverless::HttpApi + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Tags: Tag1: value1 diff --git a/tests/translator/input/http_api_explicit_stage.yaml b/tests/translator/input/http_api_explicit_stage.yaml index 576ab3a6a..ba78ec424 100644 --- a/tests/translator/input/http_api_explicit_stage.yaml +++ b/tests/translator/input/http_api_explicit_stage.yaml @@ -16,6 +16,8 @@ Globals: Resources: HttpApiFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/todo_list.zip Handler: index.restapi @@ -32,6 +34,8 @@ Resources: MyApi: Type: AWS::Serverless::HttpApi + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod StageVariables: diff --git a/tests/translator/input/http_api_lambda_auth.yaml b/tests/translator/input/http_api_lambda_auth.yaml index 04bd02d60..d217cd941 100644 --- a/tests/translator/input/http_api_lambda_auth.yaml +++ b/tests/translator/input/http_api_lambda_auth.yaml @@ -1,6 +1,8 @@ Resources: HttpApiFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/todo_list.zip Handler: index.restapi @@ -26,6 +28,8 @@ Resources: MyAuthFn: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler @@ -33,6 +37,8 @@ Resources: MyApi: Type: AWS::Serverless::HttpApi + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Tags: Tag1: value1 diff --git a/tests/translator/input/http_api_lambda_auth_full.yaml b/tests/translator/input/http_api_lambda_auth_full.yaml index 5a5b976fa..0844b32d8 100644 --- a/tests/translator/input/http_api_lambda_auth_full.yaml +++ b/tests/translator/input/http_api_lambda_auth_full.yaml @@ -1,6 +1,8 @@ Resources: HttpApiFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/todo_list.zip Handler: index.restapi @@ -26,6 +28,8 @@ Resources: MyAuthFn: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler @@ -33,6 +37,8 @@ Resources: MyApi: Type: AWS::Serverless::HttpApi + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Tags: Tag1: value1 diff --git a/tests/translator/input/http_api_with_cors.yaml b/tests/translator/input/http_api_with_cors.yaml index 0c0ebee49..87036a682 100644 --- a/tests/translator/input/http_api_with_cors.yaml +++ b/tests/translator/input/http_api_with_cors.yaml @@ -22,6 +22,8 @@ Globals: Resources: HttpApiFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: InlineCode: | exports.handler = async (event) => { @@ -44,6 +46,8 @@ Resources: MyApi: Type: AWS::Serverless::HttpApi + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: DefinitionBody: info: diff --git a/tests/translator/input/implicit_and_explicit_api_with_conditions.yaml b/tests/translator/input/implicit_and_explicit_api_with_conditions.yaml index aaae92b6a..661f78c9c 100644 --- a/tests/translator/input/implicit_and_explicit_api_with_conditions.yaml +++ b/tests/translator/input/implicit_and_explicit_api_with_conditions.yaml @@ -22,6 +22,8 @@ Conditions: Resources: implicithello1: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Condition: implicithello1condition Properties: Handler: index.handler @@ -38,6 +40,8 @@ Resources: Method: get implicithello2: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Condition: implicithello2condition Properties: Handler: index.handler @@ -55,10 +59,14 @@ Resources: explicitapi: Type: 'AWS::Serverless::Api' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod explicithello1: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Condition: explicithello1condition Properties: Handler: index.handler @@ -76,6 +84,8 @@ Resources: Method: get explicithello2: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Condition: explicithello2condition Properties: Handler: index.handler diff --git a/tests/translator/input/implicit_api.yaml b/tests/translator/input/implicit_api.yaml index bb4e5a287..55fd7a9d1 100644 --- a/tests/translator/input/implicit_api.yaml +++ b/tests/translator/input/implicit_api.yaml @@ -1,6 +1,8 @@ Resources: RestApiFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/todo_list.zip Handler: index.restapi @@ -25,6 +27,8 @@ Resources: GetHtmlFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/todo_list.zip Handler: index.gethtml diff --git a/tests/translator/input/implicit_api_with_auth_and_conditions_max.yaml b/tests/translator/input/implicit_api_with_auth_and_conditions_max.yaml index e32f9206e..cd9783ec7 100644 --- a/tests/translator/input/implicit_api_with_auth_and_conditions_max.yaml +++ b/tests/translator/input/implicit_api_with_auth_and_conditions_max.yaml @@ -76,6 +76,8 @@ Conditions: Resources: MyFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Condition: FunctionCondition Properties: CodeUri: s3://sam-demo-bucket/thumbnails.zip @@ -91,6 +93,8 @@ Resources: Authorizer: NONE MyFunction2: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Condition: FunctionCondition2 Properties: CodeUri: s3://sam-demo-bucket/thumbnails.zip @@ -106,6 +110,8 @@ Resources: Authorizer: MyCognitoAuthMultipleUserPools MyFunction3: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Condition: FunctionCondition3 Properties: CodeUri: s3://sam-demo-bucket/thumbnails.zip @@ -121,6 +127,8 @@ Resources: Authorizer: MyLambdaTokenAuth MyFunction4: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Condition: FunctionCondition4 Properties: CodeUri: s3://sam-demo-bucket/thumbnails.zip @@ -136,6 +144,8 @@ Resources: Authorizer: MyLambdaTokenAuthNoneFunctionInvokeRole MyFunction5: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Condition: FunctionCondition5 Properties: CodeUri: s3://sam-demo-bucket/thumbnails.zip @@ -151,6 +161,8 @@ Resources: Authorizer: MyLambdaRequestAuth MyFunction6: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Condition: FunctionCondition6 Properties: CodeUri: s3://sam-demo-bucket/thumbnails.zip diff --git a/tests/translator/input/implicit_api_with_many_conditions.yaml b/tests/translator/input/implicit_api_with_many_conditions.yaml index 4c0b926cb..347c059fe 100644 --- a/tests/translator/input/implicit_api_with_many_conditions.yaml +++ b/tests/translator/input/implicit_api_with_many_conditions.yaml @@ -50,6 +50,8 @@ Conditions: Resources: hello: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Condition: MyCondition Properties: Handler: index.handler @@ -66,6 +68,8 @@ Resources: Method: get helloworld: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Condition: Cond Properties: Handler: index.handler @@ -82,6 +86,8 @@ Resources: Method: post helloworld1: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Condition: Cond1 Properties: Handler: index.handler @@ -98,6 +104,8 @@ Resources: Method: post helloworld2: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Condition: Cond2 Properties: Handler: index.handler @@ -114,6 +122,8 @@ Resources: Method: post helloworld3: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Condition: Cond3 Properties: Handler: index.handler @@ -130,6 +140,8 @@ Resources: Method: post helloworld4: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Condition: Cond4 Properties: Handler: index.handler @@ -146,6 +158,8 @@ Resources: Method: post helloworld5: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Condition: Cond5 Properties: Handler: index.handler @@ -162,6 +176,8 @@ Resources: Method: post helloworld6: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Condition: Cond6 Properties: Handler: index.handler @@ -178,6 +194,8 @@ Resources: Method: post helloworld7: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Condition: Cond7 Properties: Handler: index.handler @@ -194,6 +212,8 @@ Resources: Method: post helloworld8: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Condition: Cond8 Properties: Handler: index.handler @@ -210,6 +230,8 @@ Resources: Method: post helloworld9: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Condition: Cond9 Properties: Handler: index.handler diff --git a/tests/translator/input/implicit_api_with_serverless_rest_api_resource.yaml b/tests/translator/input/implicit_api_with_serverless_rest_api_resource.yaml index 1b6497808..4f4946854 100644 --- a/tests/translator/input/implicit_api_with_serverless_rest_api_resource.yaml +++ b/tests/translator/input/implicit_api_with_serverless_rest_api_resource.yaml @@ -1,6 +1,8 @@ Resources: RestApiFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/todo_list.zip Handler: index.restapi @@ -25,6 +27,8 @@ Resources: GetHtmlFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/todo_list.zip Handler: index.gethtml @@ -39,6 +43,8 @@ Resources: ServerlessRestApi: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler diff --git a/tests/translator/input/implicit_http_api.yaml b/tests/translator/input/implicit_http_api.yaml index ee141d7d5..eaea54691 100644 --- a/tests/translator/input/implicit_http_api.yaml +++ b/tests/translator/input/implicit_http_api.yaml @@ -1,6 +1,8 @@ Resources: HttpApiFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/todo_list.zip Handler: index.restapi @@ -17,6 +19,8 @@ Resources: HttpApiFunction2: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/todo_list.zip Handler: index.restapi diff --git a/tests/translator/input/implicit_http_api_auth_and_simple_case.yaml b/tests/translator/input/implicit_http_api_auth_and_simple_case.yaml index 944e7c840..e932297c5 100644 --- a/tests/translator/input/implicit_http_api_auth_and_simple_case.yaml +++ b/tests/translator/input/implicit_http_api_auth_and_simple_case.yaml @@ -1,6 +1,8 @@ Resources: RestApiFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/todo_list.zip Handler: index.restapi diff --git a/tests/translator/input/implicit_http_api_with_many_conditions.yaml b/tests/translator/input/implicit_http_api_with_many_conditions.yaml index 47dad4bd6..4aab32adb 100644 --- a/tests/translator/input/implicit_http_api_with_many_conditions.yaml +++ b/tests/translator/input/implicit_http_api_with_many_conditions.yaml @@ -64,6 +64,8 @@ Globals: Resources: hello: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Condition: MyCondition Properties: Handler: index.handler @@ -82,6 +84,8 @@ Resources: Method: get helloworld1099: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Condition: Cond Properties: Handler: index.handler @@ -105,6 +109,8 @@ Resources: Method: get helloworld1: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Condition: Cond1 Properties: Handler: index.handler @@ -121,6 +127,8 @@ Resources: Method: post helloworld2: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Condition: Cond2 Properties: Handler: index.handler @@ -137,6 +145,8 @@ Resources: Method: post helloworld3: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Condition: Cond3 Properties: Handler: index.handler @@ -153,6 +163,8 @@ Resources: Method: post helloworld4: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Condition: Cond4 Properties: Handler: index.handler @@ -169,6 +181,8 @@ Resources: Method: post helloworld5: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Condition: Cond5 Properties: Handler: index.handler @@ -185,6 +199,8 @@ Resources: Method: post helloworld6: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Condition: Cond6 Properties: Handler: index.handler @@ -201,6 +217,8 @@ Resources: Method: post helloworld7: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Condition: Cond7 Properties: Handler: index.handler @@ -217,6 +235,8 @@ Resources: Method: post helloworld8: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Condition: Cond8 Properties: Handler: index.handler @@ -233,6 +253,8 @@ Resources: Method: post helloworld9: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Condition: Cond9 Properties: Handler: index.handler diff --git a/tests/translator/input/inline_precedence.yaml b/tests/translator/input/inline_precedence.yaml index 04812fb29..103074754 100644 --- a/tests/translator/input/inline_precedence.yaml +++ b/tests/translator/input/inline_precedence.yaml @@ -1,6 +1,8 @@ Resources: HelloWorldFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: InlineCode: | "def lambda_handler(): diff --git a/tests/translator/input/intrinsic_functions.yaml b/tests/translator/input/intrinsic_functions.yaml index 723cb273b..deeccd19f 100644 --- a/tests/translator/input/intrinsic_functions.yaml +++ b/tests/translator/input/intrinsic_functions.yaml @@ -26,6 +26,8 @@ Conditions: Resources: MyFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: FunctionName: Fn::Sub: ${FunctionName} @@ -60,6 +62,8 @@ Resources: MyExplicitApi: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Name: Ref: MyExplicitApiName @@ -73,6 +77,8 @@ Resources: FunctionWithExplicitS3Uri: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Handler: stream.ddb_handler Runtime: python2.7 @@ -83,6 +89,8 @@ Resources: ApiWithExplicitS3Uri: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Condition: TrueCondition Properties: StageName: dev @@ -93,6 +101,8 @@ Resources: DynamoDBFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/streams.zip Handler: stream.ddb_handler @@ -108,6 +118,8 @@ Resources: MyTable: Type: AWS::DynamoDB::Table + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: AttributeDefinitions: @@ -125,6 +137,8 @@ Resources: MySqsDlqLambdaFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Handler: index.handler Runtime: python2.7 @@ -138,9 +152,13 @@ Resources: SqsDlqQueue: Type: AWS::SQS::Queue + DeletionPolicy: Delete + UpdateReplacePolicy: Retain MySnsDlqLambdaFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Handler: index.handler Runtime: python2.7 @@ -152,9 +170,13 @@ Resources: SnsDlqQueue: Type: AWS::SNS::Topic + DeletionPolicy: Delete + UpdateReplacePolicy: Retain MyNewRole: Type: AWS::IAM::Role + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: AssumeRolePolicyDocument: Statement: diff --git a/tests/translator/input/iot_rule.yaml b/tests/translator/input/iot_rule.yaml index b6c1f9846..d21754f0d 100644 --- a/tests/translator/input/iot_rule.yaml +++ b/tests/translator/input/iot_rule.yaml @@ -6,6 +6,8 @@ Parameters: {} Resources: IoTRuleFunc: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Description: Created by SAM diff --git a/tests/translator/input/layers_all_properties.yaml b/tests/translator/input/layers_all_properties.yaml index 03fef5dbc..444194a3e 100644 --- a/tests/translator/input/layers_all_properties.yaml +++ b/tests/translator/input/layers_all_properties.yaml @@ -6,18 +6,24 @@ Parameters: Resources: MyLayer: Type: 'AWS::Serverless::LayerVersion' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: ContentUri: s3://bucket/key RetentionPolicy: !Ref LayerDeleteParam MyLayerWithAName: Type: 'AWS::Serverless::LayerVersion' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: ContentUri: s3://bucket/key LayerName: DifferentLayerName MyFunction: Type: "AWS::Serverless::Function" + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: app.handler diff --git a/tests/translator/input/layers_with_intrinsics.yaml b/tests/translator/input/layers_with_intrinsics.yaml index 21afcde88..36d0249fe 100644 --- a/tests/translator/input/layers_with_intrinsics.yaml +++ b/tests/translator/input/layers_with_intrinsics.yaml @@ -14,12 +14,16 @@ Parameters: Resources: LayerWithLicenseIntrinsic: Type: 'AWS::Serverless::LayerVersion' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: ContentUri: s3://sam-demo-bucket/layer.zip LicenseInfo: !Ref LayerLicenseInfo LayerWithRuntimesIntrinsic: Type: 'AWS::Serverless::LayerVersion' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: ContentUri: s3://sam-demo-bucket/layer.zip CompatibleRuntimes: @@ -27,6 +31,8 @@ Resources: LayerWithSingleListRefRuntimesIntrinsic: Type: 'AWS::Serverless::LayerVersion' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: ContentUri: s3://sam-demo-bucket/layer.zip CompatibleRuntimes: @@ -34,6 +40,8 @@ Resources: LayerWithMixedListRefRuntimesIntrinsic: Type: 'AWS::Serverless::LayerVersion' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: ContentUri: s3://sam-demo-bucket/layer.zip CompatibleRuntimes: @@ -42,24 +50,32 @@ Resources: LayerWithNameIntrinsic: Type: AWS::Serverless::LayerVersion + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: ContentUri: s3://sam-demo-bucket/layer.zip LayerName: !Ref LayerNameParam LayerWithSubNameIntrinsic: Type: AWS::Serverless::LayerVersion + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: ContentUri: s3://sam-demo-bucket/layer.zip LayerName: !Sub layer-${LayerNameParam} LayerWithRefNameIntrinsicRegion: Type: AWS::Serverless::LayerVersion + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: ContentUri: s3://sam-demo-bucket/layer.zip LayerName: !Ref 'AWS::Region' LayerWithSubNameIntrinsicRegion: Type: AWS::Serverless::LayerVersion + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: ContentUri: s3://sam-demo-bucket/layer.zip LayerName: !Sub 'layer-${AWS::Region}' diff --git a/tests/translator/input/no_implicit_api_with_serverless_rest_api_resource.yaml b/tests/translator/input/no_implicit_api_with_serverless_rest_api_resource.yaml index 84e478a3b..58ea6e6a5 100644 --- a/tests/translator/input/no_implicit_api_with_serverless_rest_api_resource.yaml +++ b/tests/translator/input/no_implicit_api_with_serverless_rest_api_resource.yaml @@ -1,6 +1,8 @@ Resources: ThumbnailFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/thumbnails.zip Handler: index.generate_thumbails @@ -15,6 +17,8 @@ Resources: ServerlessRestApi: Type: AWS::ApiGateway::RestApi + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Body: info: @@ -58,9 +62,13 @@ Resources: Images: Type: AWS::S3::Bucket + DeletionPolicy: Delete + UpdateReplacePolicy: Retain RestApiFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -68,6 +76,8 @@ Resources: GetHtmlFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler diff --git a/tests/translator/input/s3.yaml b/tests/translator/input/s3.yaml index 69e100da5..d410701b0 100644 --- a/tests/translator/input/s3.yaml +++ b/tests/translator/input/s3.yaml @@ -1,6 +1,8 @@ Resources: ThumbnailFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/thumbnails.zip Handler: index.generate_thumbails @@ -15,3 +17,5 @@ Resources: Images: Type: AWS::S3::Bucket + DeletionPolicy: Delete + UpdateReplacePolicy: Retain diff --git a/tests/translator/input/s3_create_remove.yaml b/tests/translator/input/s3_create_remove.yaml index f14cf2a4f..ae64d07e2 100644 --- a/tests/translator/input/s3_create_remove.yaml +++ b/tests/translator/input/s3_create_remove.yaml @@ -1,6 +1,8 @@ Resources: ThumbnailFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/thumbnails.zip Handler: index.generate_thumbails @@ -17,6 +19,8 @@ Resources: Images: Type: AWS::S3::Bucket + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: BucketName: "BucketNameParameter" BucketEncryption: diff --git a/tests/translator/input/s3_existing_lambda_notification_configuration.yaml b/tests/translator/input/s3_existing_lambda_notification_configuration.yaml index 045381426..90997c26d 100644 --- a/tests/translator/input/s3_existing_lambda_notification_configuration.yaml +++ b/tests/translator/input/s3_existing_lambda_notification_configuration.yaml @@ -1,6 +1,8 @@ Resources: ThumbnailFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/thumbnails.zip Handler: index.generate_thumbails @@ -15,6 +17,8 @@ Resources: Images: Type: AWS::S3::Bucket + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: NotificationConfiguration: LambdaConfigurations: diff --git a/tests/translator/input/s3_existing_other_notification_configuration.yaml b/tests/translator/input/s3_existing_other_notification_configuration.yaml index a4bd945a6..191995b90 100644 --- a/tests/translator/input/s3_existing_other_notification_configuration.yaml +++ b/tests/translator/input/s3_existing_other_notification_configuration.yaml @@ -1,6 +1,8 @@ Resources: ThumbnailFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/thumbnails.zip Handler: index.generate_thumbails @@ -15,6 +17,8 @@ Resources: Images: Type: AWS::S3::Bucket + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: NotificationConfiguration: TopicConfigurations: diff --git a/tests/translator/input/s3_filter.yaml b/tests/translator/input/s3_filter.yaml index 0f6acefd5..d622b7c28 100644 --- a/tests/translator/input/s3_filter.yaml +++ b/tests/translator/input/s3_filter.yaml @@ -1,6 +1,8 @@ Resources: ThumbnailFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/thumbnails.zip Handler: index.generate_thumbails @@ -20,3 +22,5 @@ Resources: Images: Type: AWS::S3::Bucket + DeletionPolicy: Delete + UpdateReplacePolicy: Retain diff --git a/tests/translator/input/s3_multiple_events_same_bucket.yaml b/tests/translator/input/s3_multiple_events_same_bucket.yaml index 63c396d62..9daf49386 100644 --- a/tests/translator/input/s3_multiple_events_same_bucket.yaml +++ b/tests/translator/input/s3_multiple_events_same_bucket.yaml @@ -1,6 +1,8 @@ Resources: ThumbnailFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/thumbnails.zip Handler: index.generate_thumbails @@ -26,3 +28,5 @@ Resources: Images: Type: AWS::S3::Bucket + DeletionPolicy: Delete + UpdateReplacePolicy: Retain diff --git a/tests/translator/input/s3_multiple_functions.yaml b/tests/translator/input/s3_multiple_functions.yaml index 75c356975..8cb79c5d0 100644 --- a/tests/translator/input/s3_multiple_functions.yaml +++ b/tests/translator/input/s3_multiple_functions.yaml @@ -1,6 +1,8 @@ Resources: FunctionOne: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/thumbnails.zip Handler: index.generate_thumbails @@ -15,6 +17,8 @@ Resources: FunctionTwo: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/thumbnails.zip Handler: index.generate_thumbails @@ -29,6 +33,8 @@ Resources: Images: Type: AWS::S3::Bucket + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: PublicAccessBlockConfiguration: BlockPublicAcls: true diff --git a/tests/translator/input/s3_with_condition.yaml b/tests/translator/input/s3_with_condition.yaml index c15f4dff8..d1ce4089a 100644 --- a/tests/translator/input/s3_with_condition.yaml +++ b/tests/translator/input/s3_with_condition.yaml @@ -6,6 +6,8 @@ Conditions: Resources: ThumbnailFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Condition: MyCondition Properties: CodeUri: s3://sam-demo-bucket/thumbnails.zip @@ -21,3 +23,5 @@ Resources: Images: Type: AWS::S3::Bucket + DeletionPolicy: Delete + UpdateReplacePolicy: Retain diff --git a/tests/translator/input/s3_with_dependsOn.yaml b/tests/translator/input/s3_with_dependsOn.yaml index 6d41122b4..e2b3f6bc6 100644 --- a/tests/translator/input/s3_with_dependsOn.yaml +++ b/tests/translator/input/s3_with_dependsOn.yaml @@ -1,9 +1,13 @@ Resources: Topic: Type: AWS::SNS::Topic + DeletionPolicy: Delete + UpdateReplacePolicy: Retain ThumbnailFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/thumbnails.zip Handler: index.generate_thumbails @@ -18,4 +22,6 @@ Resources: Images: Type: AWS::S3::Bucket + DeletionPolicy: Delete + UpdateReplacePolicy: Retain DependsOn: Topic diff --git a/tests/translator/input/simple_table_ref_parameter_intrinsic.yaml b/tests/translator/input/simple_table_ref_parameter_intrinsic.yaml index 55fcfdec8..bb9b18001 100644 --- a/tests/translator/input/simple_table_ref_parameter_intrinsic.yaml +++ b/tests/translator/input/simple_table_ref_parameter_intrinsic.yaml @@ -11,6 +11,8 @@ Parameters: Resources: MinimalTableRefParamLongForm: Type: 'AWS::Serverless::SimpleTable' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: ProvisionedThroughput: ReadCapacityUnits: diff --git a/tests/translator/input/simple_table_with_extra_tags.yaml b/tests/translator/input/simple_table_with_extra_tags.yaml index d8daa60c0..547ae7fcf 100644 --- a/tests/translator/input/simple_table_with_extra_tags.yaml +++ b/tests/translator/input/simple_table_with_extra_tags.yaml @@ -6,6 +6,8 @@ Parameters: Resources: MinimalTableWithTags: Type: 'AWS::Serverless::SimpleTable' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Tags: TagKey1: TagValue1 diff --git a/tests/translator/input/simple_table_with_table_name.yaml b/tests/translator/input/simple_table_with_table_name.yaml index 8055c0d70..5db127ab5 100644 --- a/tests/translator/input/simple_table_with_table_name.yaml +++ b/tests/translator/input/simple_table_with_table_name.yaml @@ -6,17 +6,23 @@ Parameters: Resources: MinimalTableWithTableName: Type: 'AWS::Serverless::SimpleTable' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: TableName: MySimpleTable MinimalTableWithRefTableName: Type: 'AWS::Serverless::SimpleTable' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: TableName: Ref: MySimpleTableParameter MinimalTableWithSubTableName: Type: 'AWS::Serverless::SimpleTable' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: TableName: Fn::Sub: "${AWS::StackName}MySimpleTable" \ No newline at end of file diff --git a/tests/translator/input/simpletable.yaml b/tests/translator/input/simpletable.yaml index cfa0b3913..607530571 100644 --- a/tests/translator/input/simpletable.yaml +++ b/tests/translator/input/simpletable.yaml @@ -1,8 +1,12 @@ Resources: MinimalTable: Type: 'AWS::Serverless::SimpleTable' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain CompleteTable: Type: 'AWS::Serverless::SimpleTable' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: PrimaryKey: Name: member-number diff --git a/tests/translator/input/simpletable_with_sse.yaml b/tests/translator/input/simpletable_with_sse.yaml index b9c6560e8..6421fe244 100644 --- a/tests/translator/input/simpletable_with_sse.yaml +++ b/tests/translator/input/simpletable_with_sse.yaml @@ -1,6 +1,8 @@ Resources: TableWithSSE: Type: 'AWS::Serverless::SimpleTable' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: SSESpecification: SSEEnabled: true \ No newline at end of file diff --git a/tests/translator/input/sns.yaml b/tests/translator/input/sns.yaml index 510e60786..dfa542075 100644 --- a/tests/translator/input/sns.yaml +++ b/tests/translator/input/sns.yaml @@ -1,6 +1,8 @@ Resources: SaveNotificationFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/notifications.zip Handler: index.save_notification @@ -14,3 +16,5 @@ Resources: Notifications: Type: AWS::SNS::Topic + DeletionPolicy: Delete + UpdateReplacePolicy: Retain diff --git a/tests/translator/input/sns_existing_other_subscription.yaml b/tests/translator/input/sns_existing_other_subscription.yaml index 0555028eb..1ae338b08 100644 --- a/tests/translator/input/sns_existing_other_subscription.yaml +++ b/tests/translator/input/sns_existing_other_subscription.yaml @@ -1,6 +1,8 @@ Resources: SaveNotificationFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/notifications.zip Handler: index.save_notification @@ -14,6 +16,8 @@ Resources: Notifications: Type: AWS::SNS::Topic + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Subscription: - Endpoint: my-queue-arn diff --git a/tests/translator/input/sns_existing_sqs.yaml b/tests/translator/input/sns_existing_sqs.yaml index bbd2c77f2..a5b86b061 100644 --- a/tests/translator/input/sns_existing_sqs.yaml +++ b/tests/translator/input/sns_existing_sqs.yaml @@ -1,6 +1,8 @@ Resources: SaveNotificationFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/notifications.zip Handler: index.save_notification @@ -26,6 +28,10 @@ Resources: Notifications: Type: AWS::SNS::Topic + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Queue: - Type: AWS::SQS::Queue \ No newline at end of file + Type: AWS::SQS::Queue + DeletionPolicy: Delete + UpdateReplacePolicy: Retain \ No newline at end of file diff --git a/tests/translator/input/sns_outside_sqs.yaml b/tests/translator/input/sns_outside_sqs.yaml index 08436c1ae..0a353ee6d 100644 --- a/tests/translator/input/sns_outside_sqs.yaml +++ b/tests/translator/input/sns_outside_sqs.yaml @@ -1,6 +1,8 @@ Resources: SaveNotificationFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/notifications.zip Handler: index.save_notification @@ -26,3 +28,5 @@ Resources: Notifications: Type: AWS::SNS::Topic + DeletionPolicy: Delete + UpdateReplacePolicy: Retain diff --git a/tests/translator/input/sns_sqs.yaml b/tests/translator/input/sns_sqs.yaml index dad81363e..ebe43d858 100644 --- a/tests/translator/input/sns_sqs.yaml +++ b/tests/translator/input/sns_sqs.yaml @@ -1,6 +1,8 @@ Resources: SaveNotificationFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/notifications.zip Handler: index.save_notification @@ -21,3 +23,5 @@ Resources: Notifications: Type: AWS::SNS::Topic + DeletionPolicy: Delete + UpdateReplacePolicy: Retain diff --git a/tests/translator/input/sns_topic_outside_template.yaml b/tests/translator/input/sns_topic_outside_template.yaml index 539a2357f..8611a2fbc 100644 --- a/tests/translator/input/sns_topic_outside_template.yaml +++ b/tests/translator/input/sns_topic_outside_template.yaml @@ -4,6 +4,8 @@ Parameters: Resources: SaveNotificationFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/notifications.zip Handler: index.save_notification diff --git a/tests/translator/output/aws-cn/function_with_condition.json b/tests/translator/output/aws-cn/function_with_condition.json index 4fbd2abf8..9589faa21 100644 --- a/tests/translator/output/aws-cn/function_with_condition.json +++ b/tests/translator/output/aws-cn/function_with_condition.json @@ -10,6 +10,8 @@ "Resources": { "ConditionFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -34,6 +36,8 @@ }, "ConditionFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-cn/function_with_conditional_managed_policy.json b/tests/translator/output/aws-cn/function_with_conditional_managed_policy.json index a71779ff9..140e67f11 100644 --- a/tests/translator/output/aws-cn/function_with_conditional_managed_policy.json +++ b/tests/translator/output/aws-cn/function_with_conditional_managed_policy.json @@ -10,6 +10,8 @@ "Resources": { "FunctionWithConditionalPolicy": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -34,6 +36,8 @@ }, "FunctionWithConditionalPolicyRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", diff --git a/tests/translator/output/aws-cn/function_with_conditional_managed_policy_and_ref_no_value.json b/tests/translator/output/aws-cn/function_with_conditional_managed_policy_and_ref_no_value.json index 794ee731d..10de66f45 100644 --- a/tests/translator/output/aws-cn/function_with_conditional_managed_policy_and_ref_no_value.json +++ b/tests/translator/output/aws-cn/function_with_conditional_managed_policy_and_ref_no_value.json @@ -10,6 +10,8 @@ "Resources": { "FunctionWithConditionalPolicy": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -34,6 +36,8 @@ }, "FunctionWithConditionalPolicyRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", diff --git a/tests/translator/output/aws-cn/function_with_conditional_policy_template.json b/tests/translator/output/aws-cn/function_with_conditional_policy_template.json index 9dc9f720a..aab11669f 100644 --- a/tests/translator/output/aws-cn/function_with_conditional_policy_template.json +++ b/tests/translator/output/aws-cn/function_with_conditional_policy_template.json @@ -10,6 +10,8 @@ "Resources": { "FunctionWithConditionalPolicy": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -34,6 +36,8 @@ }, "FunctionWithConditionalPolicyRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-cn/function_with_conditional_policy_template_and_ref_no_value.json b/tests/translator/output/aws-cn/function_with_conditional_policy_template_and_ref_no_value.json index 109cf4819..f0811e9c5 100644 --- a/tests/translator/output/aws-cn/function_with_conditional_policy_template_and_ref_no_value.json +++ b/tests/translator/output/aws-cn/function_with_conditional_policy_template_and_ref_no_value.json @@ -10,6 +10,8 @@ "Resources": { "FunctionWithConditionalPolicy": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -34,6 +36,8 @@ }, "FunctionWithConditionalPolicyRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-cn/function_with_custom_codedeploy_deployment_preference.json b/tests/translator/output/aws-cn/function_with_custom_codedeploy_deployment_preference.json index f3d5e0510..4460aadab 100644 --- a/tests/translator/output/aws-cn/function_with_custom_codedeploy_deployment_preference.json +++ b/tests/translator/output/aws-cn/function_with_custom_codedeploy_deployment_preference.json @@ -34,6 +34,8 @@ "Resources": { "NormalWithRefAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -58,8 +60,9 @@ } }, "CustomWithFindInMapVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "CustomWithFindInMap" @@ -108,6 +111,8 @@ }, "CustomWithFindInMapAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -133,6 +138,8 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -156,6 +163,8 @@ }, "CustomWithSubAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -181,6 +190,8 @@ }, "NormalWithSub": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -203,8 +214,9 @@ } }, "CustomWithConditionVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "CustomWithCondition" @@ -240,9 +252,10 @@ } } }, - "CustomWithCondition2Version640128d35d": { - "DeletionPolicy": "Retain", + "CustomWithCondition2Version640128d35d": { "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "CustomWithCondition2" @@ -251,6 +264,8 @@ }, "CustomWithCondition": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -274,6 +289,8 @@ }, "CustomWithSub": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -302,8 +319,9 @@ } }, "NormalWithRefVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "NormalWithRef" @@ -404,6 +422,8 @@ }, "NormalWithSubAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -428,8 +448,9 @@ } }, "CustomWithSubVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "CustomWithSub" @@ -438,6 +459,8 @@ }, "CustomWithSubRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -468,6 +491,8 @@ }, "CustomWithConditionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -538,6 +563,8 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -568,6 +595,8 @@ }, "CustomWithFindInMap": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -590,8 +619,9 @@ } }, "NormalWithSubVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "NormalWithSub" @@ -600,6 +630,8 @@ }, "CustomWithConditionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -625,6 +657,8 @@ }, "CustomWithFindInMapRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -655,6 +689,8 @@ }, "NormalWithRef": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -678,6 +714,8 @@ }, "CustomWithCondition2": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -728,6 +766,8 @@ }, "NormalWithRefRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -758,6 +798,8 @@ }, "CustomWithCondition2Aliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -783,6 +825,8 @@ }, "NormalWithSubRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -812,8 +856,9 @@ } }, "MinimalFunctionVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -849,6 +894,8 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -874,6 +921,8 @@ }, "CustomWithCondition2Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-cn/function_with_custom_conditional_codedeploy_deployment_preference.json b/tests/translator/output/aws-cn/function_with_custom_conditional_codedeploy_deployment_preference.json index 26c5417e6..f628da6b8 100644 --- a/tests/translator/output/aws-cn/function_with_custom_conditional_codedeploy_deployment_preference.json +++ b/tests/translator/output/aws-cn/function_with_custom_conditional_codedeploy_deployment_preference.json @@ -33,6 +33,8 @@ }, "HelloWorldFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -139,8 +141,9 @@ } }, "HelloWorldFunctionVersionfb53d5c2e6": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "HelloWorldFunction" @@ -149,6 +152,8 @@ }, "HelloWorldFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -174,6 +179,8 @@ }, "HelloWorldFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { diff --git a/tests/translator/output/aws-cn/function_with_deployment_and_custom_role.json b/tests/translator/output/aws-cn/function_with_deployment_and_custom_role.json index 03a936a6d..e09e6d735 100644 --- a/tests/translator/output/aws-cn/function_with_deployment_and_custom_role.json +++ b/tests/translator/output/aws-cn/function_with_deployment_and_custom_role.json @@ -2,6 +2,8 @@ "Resources": { "FunctionWithRole": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -25,6 +27,8 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -48,6 +52,8 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -78,6 +84,8 @@ }, "DeploymentRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSCodeDeployRole" @@ -100,9 +108,10 @@ } } }, - "FunctionWithRoleVersion640128d35d": { - "DeletionPolicy": "Retain", + "FunctionWithRoleVersion640128d35d": { "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "FunctionWithRole" @@ -208,8 +217,9 @@ } }, "MinimalFunctionVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -218,6 +228,8 @@ }, "FunctionWithRoleAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -243,6 +255,8 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { diff --git a/tests/translator/output/aws-cn/function_with_deployment_no_service_role.json b/tests/translator/output/aws-cn/function_with_deployment_no_service_role.json index 65d6a4483..a8e253da2 100644 --- a/tests/translator/output/aws-cn/function_with_deployment_no_service_role.json +++ b/tests/translator/output/aws-cn/function_with_deployment_no_service_role.json @@ -33,6 +33,8 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -56,6 +58,8 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -85,8 +89,9 @@ } }, "OtherFunctionVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "OtherFunction" @@ -95,6 +100,8 @@ }, "OtherFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -125,6 +132,8 @@ }, "DeploymentRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSCodeDeployRole" @@ -184,9 +193,10 @@ "ComputePlatform": "Lambda" } }, - "MinimalFunctionVersion640128d35d": { - "DeletionPolicy": "Retain", + "MinimalFunctionVersion640128d35d": { "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -195,6 +205,8 @@ }, "OtherFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -218,6 +230,8 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -243,6 +257,8 @@ }, "OtherFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { diff --git a/tests/translator/output/aws-cn/function_with_deployment_preference.json b/tests/translator/output/aws-cn/function_with_deployment_preference.json index 830ecaa18..77307da60 100644 --- a/tests/translator/output/aws-cn/function_with_deployment_preference.json +++ b/tests/translator/output/aws-cn/function_with_deployment_preference.json @@ -63,6 +63,8 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -93,6 +95,8 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -145,8 +149,9 @@ } }, "MinimalFunctionVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -155,6 +160,8 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { diff --git a/tests/translator/output/aws-cn/function_with_deployment_preference_alarms_intrinsic_if.json b/tests/translator/output/aws-cn/function_with_deployment_preference_alarms_intrinsic_if.json index 077d23fc8..dca960256 100644 --- a/tests/translator/output/aws-cn/function_with_deployment_preference_alarms_intrinsic_if.json +++ b/tests/translator/output/aws-cn/function_with_deployment_preference_alarms_intrinsic_if.json @@ -10,6 +10,8 @@ "Resources": { "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -33,7 +35,8 @@ }, "MinimalFunctionVersion640128d35d": { "Type": "AWS::Lambda::Version", - "DeletionPolicy": "Retain", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -42,6 +45,8 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -67,6 +72,8 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", diff --git a/tests/translator/output/aws-cn/function_with_deployment_preference_all_parameters.json b/tests/translator/output/aws-cn/function_with_deployment_preference_all_parameters.json index 739a81811..bd64d3d6d 100644 --- a/tests/translator/output/aws-cn/function_with_deployment_preference_all_parameters.json +++ b/tests/translator/output/aws-cn/function_with_deployment_preference_all_parameters.json @@ -2,6 +2,8 @@ "Resources": { "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -25,6 +27,8 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "MySanityTestFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -85,6 +91,8 @@ }, "MyCloudWatchAlarm": { "Type": "AWS::CloudWatch::Alarm", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EvaluationPeriods": 1, "Namespace": "AWS/EC2", @@ -152,6 +160,8 @@ }, "MySanityTestFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "my-bucket", @@ -204,8 +214,9 @@ } }, "MinimalFunctionVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -214,6 +225,8 @@ }, "MyValidationTestFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "my-bucket", @@ -237,6 +250,8 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -268,6 +283,8 @@ }, "MyValidationTestFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -297,7 +314,9 @@ } }, "MySNSTopic": { - "Type": "AWS::SNS::Topic" + "Type": "AWS::SNS::Topic", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" } } } \ No newline at end of file diff --git a/tests/translator/output/aws-cn/function_with_deployment_preference_from_parameters.json b/tests/translator/output/aws-cn/function_with_deployment_preference_from_parameters.json index 0e83fb6c6..6389c3926 100644 --- a/tests/translator/output/aws-cn/function_with_deployment_preference_from_parameters.json +++ b/tests/translator/output/aws-cn/function_with_deployment_preference_from_parameters.json @@ -16,6 +16,8 @@ "Resources": { "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -39,6 +41,8 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -69,6 +73,8 @@ }, "MySanityTestFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -99,6 +105,8 @@ }, "MyCloudWatchAlarm": { "Type": "AWS::CloudWatch::Alarm", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EvaluationPeriods": 1, "Namespace": "AWS/EC2", @@ -166,6 +174,8 @@ }, "MySanityTestFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "my-bucket", @@ -218,8 +228,9 @@ } }, "MinimalFunctionVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -228,6 +239,8 @@ }, "MyValidationTestFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "my-bucket", @@ -251,6 +264,8 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -282,6 +297,8 @@ }, "MyValidationTestFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -311,7 +328,9 @@ } }, "MySNSTopic": { - "Type": "AWS::SNS::Topic" + "Type": "AWS::SNS::Topic", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" } } } \ No newline at end of file diff --git a/tests/translator/output/aws-cn/function_with_deployment_preference_multiple_combinations.json b/tests/translator/output/aws-cn/function_with_deployment_preference_multiple_combinations.json index 7c9543aa5..b7846ed5d 100644 --- a/tests/translator/output/aws-cn/function_with_deployment_preference_multiple_combinations.json +++ b/tests/translator/output/aws-cn/function_with_deployment_preference_multiple_combinations.json @@ -2,6 +2,8 @@ "Resources": { "MinimalFunctionWithDeploymentPreferenceWithHooksAndAlarms": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -25,6 +27,8 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -78,6 +84,8 @@ }, "MinimalFunctionWithMinimalDeploymentPreferenceRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -108,6 +116,8 @@ }, "MyCloudWatchAlarm": { "Type": "AWS::CloudWatch::Alarm", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EvaluationPeriods": 1, "Namespace": "AWS/EC2", @@ -119,6 +129,8 @@ }, "MinimalFunctionWithMinimalDeploymentPreferenceAliaslivewithdeployment": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -187,8 +199,9 @@ } }, "MinimalFunctionWithMinimalDeploymentPreferenceVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunctionWithMinimalDeploymentPreference" @@ -197,6 +210,8 @@ }, "MinimalFunctionWithDeploymentPreferenceWithHooksAndAlarmsRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -227,6 +242,8 @@ }, "MySanityTestFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -257,6 +274,8 @@ }, "MinimalFunctionWithMinimalDeploymentPreference": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -280,6 +299,8 @@ }, "MySanityTestFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "my-bucket", @@ -302,8 +323,9 @@ } }, "MinimalFunctionWithDeploymentPreferenceWithHooksAndAlarmsVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunctionWithDeploymentPreferenceWithHooksAndAlarms" @@ -375,8 +397,9 @@ } }, "MinimalFunctionVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -385,6 +408,8 @@ }, "MyValidationTestFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -415,6 +440,8 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -430,6 +457,8 @@ }, "MinimalFunctionWithDeploymentPreferenceWithHooksAndAlarmsAliaslivewithdeploymentwithhooksandalarms": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -461,6 +490,8 @@ }, "MyValidationTestFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "my-bucket", diff --git a/tests/translator/output/aws-cn/function_with_disabled_deployment_preference.json b/tests/translator/output/aws-cn/function_with_disabled_deployment_preference.json index 80337bcd2..6045e1f2a 100644 --- a/tests/translator/output/aws-cn/function_with_disabled_deployment_preference.json +++ b/tests/translator/output/aws-cn/function_with_disabled_deployment_preference.json @@ -1,8 +1,9 @@ { "Resources": { - "MinimalFunctionVersion640128d35d": { - "DeletionPolicy": "Retain", + "MinimalFunctionVersion640128d35d": { "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -11,6 +12,8 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -26,6 +29,8 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -49,6 +54,8 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-cn/function_with_dlq.json b/tests/translator/output/aws-cn/function_with_dlq.json index 3c006a0af..61d9c5cc5 100644 --- a/tests/translator/output/aws-cn/function_with_dlq.json +++ b/tests/translator/output/aws-cn/function_with_dlq.json @@ -2,6 +2,8 @@ "Resources": { "MySnsDlqLambdaFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -47,6 +49,8 @@ }, "MySqsDlqLambdaFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -92,6 +96,8 @@ }, "MySqsDlqLambdaFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -118,6 +124,8 @@ }, "MySnsDlqLambdaFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-cn/function_with_event_dest.json b/tests/translator/output/aws-cn/function_with_event_dest.json index b719a2dc1..961ee8ab6 100644 --- a/tests/translator/output/aws-cn/function_with_event_dest.json +++ b/tests/translator/output/aws-cn/function_with_event_dest.json @@ -49,6 +49,8 @@ "Resources": { "MyTestFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -124,11 +126,15 @@ }, "MyTestFunctionEventInvokeConfigOnSuccessQueue": { "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": {}, "Condition": "NOTQueueCreationDisabled2da03e5b6f" }, "SNSSubscription": { "Type": "AWS::SNS::Subscription", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Endpoint": "example@example.com", "Protocol": "email", @@ -140,6 +146,8 @@ }, "MyTestFunctionEventInvokeConfig": { "Type": "AWS::Lambda::EventInvokeConfig", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "MaximumEventAgeInSeconds": 70, "MaximumRetryAttempts": 1, @@ -178,6 +186,8 @@ }, "MyTestFunction2Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -239,6 +249,8 @@ }, "DestinationLambda": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async (event) => {\n const response = {\n statusCode: 200,\n body: JSON.stringify('Hello from Lambda!'),\n };\n return response;\n};\n" @@ -262,6 +274,8 @@ }, "MyTestFunction2EventInvokeConfig": { "Type": "AWS::Lambda::EventInvokeConfig", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "MaximumEventAgeInSeconds": 70, "MaximumRetryAttempts": 1, @@ -286,6 +300,8 @@ }, "DestinationLambdaRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -316,6 +332,8 @@ }, "MyTestFunction2": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = function(event, context, callback) {\n var event_received_at = new Date().toISOString();\n console.log('Event received at: ' + event_received_at);\n console.log('Received event:', JSON.stringify(event, null, 2));\n\n if (event.Success) {\n console.log(\"Success\");\n context.callbackWaitsForEmptyEventLoop = false;\n callback(null);\n } else {\n console.log(\"Failure\");\n context.callbackWaitsForEmptyEventLoop = false;\n callback(new Error(\"Failure from event, Success = false, I am failing!\"), 'Destination Function Error Thrown');\n }\n}; \n" @@ -339,6 +357,8 @@ }, "MyTestFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = function(event, context, callback) {\n var event_received_at = new Date().toISOString();\n console.log('Event received at: ' + event_received_at);\n console.log('Received event:', JSON.stringify(event, null, 2));\n\n if (event.Success) {\n console.log(\"Success\");\n context.callbackWaitsForEmptyEventLoop = false;\n callback(null);\n } else {\n console.log(\"Failure\");\n context.callbackWaitsForEmptyEventLoop = false;\n callback(new Error(\"Failure from event, Success = false, I am failing!\"), 'Destination Function Error Thrown');\n }\n}; \n" @@ -362,6 +382,8 @@ }, "MyTestFunctionEventInvokeConfigOnFailureTopic": { "Type": "AWS::SNS::Topic", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": {}, "Condition": "TopicCreationEnabled" } diff --git a/tests/translator/output/aws-cn/function_with_event_dest_basic.json b/tests/translator/output/aws-cn/function_with_event_dest_basic.json index 01a3440e1..0e757eae5 100644 --- a/tests/translator/output/aws-cn/function_with_event_dest_basic.json +++ b/tests/translator/output/aws-cn/function_with_event_dest_basic.json @@ -8,10 +8,14 @@ "Resources": { "MyTestFunctionEventInvokeConfigOnSuccessQueue": { "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": {} }, "MyTestFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -73,6 +77,8 @@ }, "MyTestFunctionEventInvokeConfig": { "Type": "AWS::Lambda::EventInvokeConfig", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "MaximumEventAgeInSeconds": 70, "MaximumRetryAttempts": 1, @@ -100,6 +106,8 @@ }, "MyTestFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = function(event, context, callback) {\n var event_received_at = new Date().toISOString();\n console.log('Event received at: ' + event_received_at);\n console.log('Received event:', JSON.stringify(event, null, 2));\n\n if (event.Success) {\n console.log(\"Success\");\n context.callbackWaitsForEmptyEventLoop = false;\n callback(null);\n } else {\n console.log(\"Failure\");\n context.callbackWaitsForEmptyEventLoop = false;\n callback(new Error(\"Failure from event, Success = false, I am failing!\"), 'Destination Function Error Thrown');\n }\n}; \n" @@ -123,6 +131,8 @@ }, "MyTestFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -137,8 +147,9 @@ } }, "MyTestFunctionVersiondaf9da458d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MyTestFunction" diff --git a/tests/translator/output/aws-cn/function_with_event_dest_conditional.json b/tests/translator/output/aws-cn/function_with_event_dest_conditional.json index e90a0e585..a30d1ba7b 100644 --- a/tests/translator/output/aws-cn/function_with_event_dest_conditional.json +++ b/tests/translator/output/aws-cn/function_with_event_dest_conditional.json @@ -59,6 +59,8 @@ "Resources": { "DestinationLambdaRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -90,11 +92,15 @@ }, "MyTestFunctionEventInvokeConfigOnSuccessQueue": { "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": {}, "Condition": "FunctionConditionANDNOTQueueCreationDisabled2da03e5b6fe547d4e2d6" }, "MyTestFunctionEventInvokeConfig": { "Type": "AWS::Lambda::EventInvokeConfig", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "MaximumEventAgeInSeconds": 70, "MaximumRetryAttempts": 1, @@ -137,6 +143,8 @@ }, "MyTestFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = function(event, context, callback) {\n var event_received_at = new Date().toISOString();\n console.log('Event received at: ' + event_received_at);\n console.log('Received event:', JSON.stringify(event, null, 2));\n\n if (event.Success) {\n console.log(\"Success\");\n context.callbackWaitsForEmptyEventLoop = false;\n callback(null);\n } else {\n console.log(\"Failure\");\n context.callbackWaitsForEmptyEventLoop = false;\n callback(new Error(\"Failure from event, Success = false, I am failing!\"), 'Destination Function Error Thrown');\n }\n}; \n" @@ -161,6 +169,8 @@ }, "DestinationLambda": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async (event) => {\n const response = {\n statusCode: 200,\n body: JSON.stringify('Hello from Lambda!'),\n };\n return response;\n};\n" @@ -185,6 +195,8 @@ }, "MyTestFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", diff --git a/tests/translator/output/aws-cn/function_with_event_source_mapping.json b/tests/translator/output/aws-cn/function_with_event_source_mapping.json index c566b9490..c608349d6 100644 --- a/tests/translator/output/aws-cn/function_with_event_source_mapping.json +++ b/tests/translator/output/aws-cn/function_with_event_source_mapping.json @@ -9,13 +9,19 @@ }, "Resources": { "MySqsQueue": { - "Type": "AWS::SQS::Queue" + "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, "MySnsTopic": { - "Type": "AWS::SNS::Topic" + "Type": "AWS::SNS::Topic", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, "MyFunctionForBatchingExampleStream": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "MaximumBatchingWindowInSeconds": 20, "EventSourceArn": { @@ -32,6 +38,8 @@ }, "DynamoDBTable": { "Type": "AWS::DynamoDB::Table", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "KeySchema": [ { @@ -56,6 +64,8 @@ }, "MyFunctionForBatchingExampleRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -147,12 +157,16 @@ }, "KinesisStream1": { "Type": "AWS::Kinesis::Stream", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ShardCount": 1 } }, "MyFunctionForBatchingExampleDynamoDBStreamEvent": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "MaximumBatchingWindowInSeconds": { "Ref": "MyBatchingWindowParam" @@ -188,6 +202,8 @@ }, "MyFunctionForBatchingExample": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -210,6 +226,8 @@ }, "MyFunctionForBatchingExampleStreamEvent": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "MaximumBatchingWindowInSeconds": { "Ref": "MyBatchingWindowParam" @@ -235,6 +253,8 @@ }, "KinesisStream": { "Type": "AWS::Kinesis::Stream", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ShardCount": 1 } diff --git a/tests/translator/output/aws-cn/function_with_file_system_config.json b/tests/translator/output/aws-cn/function_with_file_system_config.json index 9fc9269eb..28283ba89 100644 --- a/tests/translator/output/aws-cn/function_with_file_system_config.json +++ b/tests/translator/output/aws-cn/function_with_file_system_config.json @@ -1,10 +1,14 @@ { "Resources": { "EfsFileSystem": { - "Type": "AWS::EFS::FileSystem" + "Type": "AWS::EFS::FileSystem", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, "LambdaFunctionWithEfs": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "const fs = require('fs')\nconst path = require('path')\nconst efsMountPath = '/mnt/efs'\n\nexports.handler = async (event, context, callback) => {\nconst directory = path.join(efsMountPath, event.body)\nconst files = fs.readdirSync(directory)\nreturn files\n}\n" @@ -48,6 +52,8 @@ }, "MountTarget": { "Type": "AWS::EFS::MountTarget", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "SubnetId": "subnet-abc123", "FileSystemId": { @@ -60,6 +66,8 @@ }, "LambdaFunctionWithEfsRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -91,6 +99,8 @@ }, "AccessPoint": { "Type": "AWS::EFS::AccessPoint", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FileSystemId": { "Ref": "EfsFileSystem" diff --git a/tests/translator/output/aws-cn/function_with_global_layers.json b/tests/translator/output/aws-cn/function_with_global_layers.json index e0fcdb520..4c6b09896 100644 --- a/tests/translator/output/aws-cn/function_with_global_layers.json +++ b/tests/translator/output/aws-cn/function_with_global_layers.json @@ -2,6 +2,8 @@ "Resources": { "ManyLayersFuncRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -32,6 +34,8 @@ }, "ManyLayersFunc": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-cn/function_with_kmskeyarn.json b/tests/translator/output/aws-cn/function_with_kmskeyarn.json index c26fd2506..3a9a54a8d 100644 --- a/tests/translator/output/aws-cn/function_with_kmskeyarn.json +++ b/tests/translator/output/aws-cn/function_with_kmskeyarn.json @@ -2,6 +2,8 @@ "Resources": { "FunctionWithKeyArnRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -32,6 +34,8 @@ }, "FunctionWithReferenceToKeyArnRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -62,6 +66,8 @@ }, "FunctionWithKeyArn": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -86,6 +92,8 @@ }, "myKey": { "Type": "AWS::KMS::Key", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "KeyPolicy": { "Version": "2012-10-17", @@ -109,6 +117,8 @@ }, "FunctionWithReferenceToKeyArn": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-cn/function_with_layers.json b/tests/translator/output/aws-cn/function_with_layers.json index 7c2004acf..9fddf9a15 100644 --- a/tests/translator/output/aws-cn/function_with_layers.json +++ b/tests/translator/output/aws-cn/function_with_layers.json @@ -2,6 +2,8 @@ "Resources": { "MinimalLayerFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Layers": [ "arn:aws:lambda:us-east-1:123456789101:layer:CorpXLayer:1" @@ -26,9 +28,10 @@ "Runtime": "python2.7" } }, - "MyLayera5167acaba": { - "DeletionPolicy": "Retain", + "MyLayer43a7918434": { "Type": "AWS::Lambda::LayerVersion", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "sam-demo-bucket", @@ -39,10 +42,12 @@ }, "FunctionReferencesLayer": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Layers": [ { - "Ref": "MyLayera5167acaba" + "Ref": "MyLayer43a7918434" } ], "Code": { @@ -67,6 +72,8 @@ }, "MinimalLayerFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -97,6 +104,8 @@ }, "FunctionReferencesLayerRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -127,6 +136,8 @@ }, "FunctionLayerWithSubIntrinsic": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Layers": [ { @@ -158,6 +169,8 @@ }, "FunctionNoLayerVersion": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Layers": [ "arn:aws:lambda:us-east-1:123456789101:layer:CorpXLayer:1" @@ -184,6 +197,8 @@ }, "FunctionNoLayerVersionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -214,6 +229,8 @@ }, "FunctionLayerWithSubIntrinsicRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-cn/function_with_many_layers.json b/tests/translator/output/aws-cn/function_with_many_layers.json index 2bff7ff8f..b93566f5e 100644 --- a/tests/translator/output/aws-cn/function_with_many_layers.json +++ b/tests/translator/output/aws-cn/function_with_many_layers.json @@ -1,8 +1,9 @@ { "Resources": { - "MyLayera5167acaba": { - "DeletionPolicy": "Retain", + "MyLayer43a7918434": { "Type": "AWS::Lambda::LayerVersion", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "sam-demo-bucket", @@ -13,6 +14,8 @@ }, "ManyLayersFuncRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -43,6 +46,8 @@ }, "ManyLayersFunc": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Layers": [ "arn:aws:lambda:us-east-1:123456789101:layer:z:1", @@ -54,7 +59,7 @@ "Fn::Sub": "arn:${AWS::Partition}:lambda:${AWS::Region}:123456789101:layer:c:1" }, { - "Ref": "MyLayera5167acaba" + "Ref": "MyLayer43a7918434" } ], "Code": { diff --git a/tests/translator/output/aws-cn/function_with_permissions_boundary.json b/tests/translator/output/aws-cn/function_with_permissions_boundary.json index b71af4f7b..637e63f39 100644 --- a/tests/translator/output/aws-cn/function_with_permissions_boundary.json +++ b/tests/translator/output/aws-cn/function_with_permissions_boundary.json @@ -2,6 +2,8 @@ "Resources": { "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -33,6 +35,8 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { diff --git a/tests/translator/output/aws-cn/function_with_policy_templates.json b/tests/translator/output/aws-cn/function_with_policy_templates.json index d6e45817e..7c4b53775 100644 --- a/tests/translator/output/aws-cn/function_with_policy_templates.json +++ b/tests/translator/output/aws-cn/function_with_policy_templates.json @@ -7,6 +7,8 @@ "Resources": { "OnePolicyTemplate": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -30,6 +32,8 @@ }, "MultiplePolicyTemplates": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -53,6 +57,8 @@ }, "OnePolicyTemplateRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -118,6 +124,8 @@ }, "MultiplePolicyTemplatesRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -197,6 +205,8 @@ }, "AllCombinations": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -220,6 +230,8 @@ }, "AllCombinationsRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaRole", diff --git a/tests/translator/output/aws-cn/function_with_request_parameters.json b/tests/translator/output/aws-cn/function_with_request_parameters.json index d5715a354..9c213975a 100644 --- a/tests/translator/output/aws-cn/function_with_request_parameters.json +++ b/tests/translator/output/aws-cn/function_with_request_parameters.json @@ -2,6 +2,8 @@ "Resources": { "ApiParameterFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "NoApiParameterFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ServerlessRestApiDeployment32042a0513": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -65,6 +71,8 @@ }, "ApiParameterFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -95,6 +103,8 @@ }, "NoApiParameterFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -116,6 +126,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment32042a0513" @@ -128,6 +140,8 @@ }, "ApiDeploymentd779e9df57": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "Api" @@ -138,6 +152,8 @@ }, "Api": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -185,6 +201,8 @@ }, "ApiParameterFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -204,6 +222,8 @@ }, "ApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ApiDeploymentd779e9df57" @@ -216,6 +236,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -272,6 +294,8 @@ }, "NoApiParameterFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { diff --git a/tests/translator/output/aws-cn/function_with_resource_refs.json b/tests/translator/output/aws-cn/function_with_resource_refs.json index 89ab2a671..ad27e4a38 100644 --- a/tests/translator/output/aws-cn/function_with_resource_refs.json +++ b/tests/translator/output/aws-cn/function_with_resource_refs.json @@ -53,6 +53,8 @@ "Resources": { "FunctionWithoutAlias": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -76,6 +78,8 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -106,6 +110,8 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -129,6 +135,8 @@ }, "FunctionWithoutAliasRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -158,8 +166,9 @@ } }, "MinimalFunctionVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -168,6 +177,8 @@ }, "MyBucket": { "Type": "AWS::S3::Bucket", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Name": { "Fn::GetAtt": [ @@ -179,6 +190,8 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ diff --git a/tests/translator/output/aws-cn/function_with_signing_profile.json b/tests/translator/output/aws-cn/function_with_signing_profile.json index d25c7e526..2e07d93ee 100644 --- a/tests/translator/output/aws-cn/function_with_signing_profile.json +++ b/tests/translator/output/aws-cn/function_with_signing_profile.json @@ -2,6 +2,8 @@ "Resources": { "FunctionWithSigningProfile": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -28,6 +30,8 @@ }, "FunctionWithSigningProfileRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -58,6 +62,8 @@ }, "MySignedFunctionCodeSigningConfig": { "Type": "AWS::Lambda::CodeSigningConfig", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "CodeSigningPolicies": { "UntrustedArtifactOnDeployment": "Enforce" @@ -77,6 +83,8 @@ }, "SigningProfile": { "Type": "AWS::Signer::SigningProfile", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "PlatformId": "AWSLambda-SHA384-ECDSA" } diff --git a/tests/translator/output/aws-cn/function_with_sns_event_source_all_parameters.json b/tests/translator/output/aws-cn/function_with_sns_event_source_all_parameters.json index 7cf732ff1..5b009f9ec 100644 --- a/tests/translator/output/aws-cn/function_with_sns_event_source_all_parameters.json +++ b/tests/translator/output/aws-cn/function_with_sns_event_source_all_parameters.json @@ -2,6 +2,8 @@ "Resources": { "MyAwesomeFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FilterPolicy": { "store": [ @@ -39,6 +41,8 @@ }, "MyAwesomeFunctionNotificationTopicPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "sns.amazonaws.com", @@ -50,6 +54,8 @@ }, "MyAwesomeFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -80,6 +86,8 @@ }, "MyAwesomeFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-cn/global_handle_path_level_parameter.json b/tests/translator/output/aws-cn/global_handle_path_level_parameter.json index 51b5040b7..df03ba605 100644 --- a/tests/translator/output/aws-cn/global_handle_path_level_parameter.json +++ b/tests/translator/output/aws-cn/global_handle_path_level_parameter.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -125,6 +131,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -142,6 +150,8 @@ }, "ServerlessRestApiDeploymente1212668e0": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -152,6 +162,8 @@ }, "ExplicitApiSomeStageStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -169,6 +181,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -190,6 +204,8 @@ }, "MyUserPool": { "Type": "AWS::Cognito::UserPool", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "UsernameAttributes": [ "email" @@ -211,6 +227,8 @@ }, "ExplicitApiDeployment9a254aa466": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -221,6 +239,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/globals_for_api.json b/tests/translator/output/aws-cn/globals_for_api.json index 27c4118f0..3ce20482e 100644 --- a/tests/translator/output/aws-cn/globals_for_api.json +++ b/tests/translator/output/aws-cn/globals_for_api.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -124,6 +130,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -141,6 +149,8 @@ }, "ExplicitApiSomeStageStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -158,6 +168,8 @@ }, "ServerlessRestApiDeploymentf6c326a165": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -168,6 +180,8 @@ }, "ExplicitApiDeployment43e01e673d": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -178,6 +192,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -199,6 +215,8 @@ }, "MyUserPool": { "Type": "AWS::Cognito::UserPool", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "UsernameAttributes": [ "email" @@ -220,6 +238,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/globals_for_function.json b/tests/translator/output/aws-cn/globals_for_function.json index 79ecc2ab9..de6c22ffa 100644 --- a/tests/translator/output/aws-cn/globals_for_function.json +++ b/tests/translator/output/aws-cn/globals_for_function.json @@ -2,6 +2,8 @@ "Resources": { "FunctionWithOverridesRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -43,6 +45,8 @@ }, "FunctionWithOverrides": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Layers": [ { @@ -104,6 +108,8 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -141,6 +147,8 @@ }, "FunctionWithOverridesAliasprod": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -156,6 +164,8 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Layers": [ { @@ -208,6 +218,8 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -222,8 +234,9 @@ } }, "FunctionWithOverridesVersion096ed3b52b": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "FunctionWithOverrides" @@ -231,8 +244,9 @@ } }, "MinimalFunctionVersion0a06fc8fb1": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" diff --git a/tests/translator/output/aws-cn/globals_for_simpletable.json b/tests/translator/output/aws-cn/globals_for_simpletable.json index 313fd286c..990238365 100644 --- a/tests/translator/output/aws-cn/globals_for_simpletable.json +++ b/tests/translator/output/aws-cn/globals_for_simpletable.json @@ -2,6 +2,8 @@ "Resources": { "MinimalTable": { "Type": "AWS::DynamoDB::Table", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BillingMode": "PAY_PER_REQUEST", "SSESpecification": { diff --git a/tests/translator/output/aws-cn/http_api_def_uri.json b/tests/translator/output/aws-cn/http_api_def_uri.json index f285640fc..3cd0db66d 100644 --- a/tests/translator/output/aws-cn/http_api_def_uri.json +++ b/tests/translator/output/aws-cn/http_api_def_uri.json @@ -2,6 +2,8 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -25,6 +27,8 @@ }, "FunctionApiPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -44,6 +48,8 @@ }, "MyApiStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -66,6 +72,8 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -96,6 +104,8 @@ }, "MyApi2ApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi2" @@ -109,6 +119,8 @@ }, "MyApi2": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BodyS3Location": { "Version": "version", @@ -119,6 +131,8 @@ }, "FunctionApi2Permission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -140,6 +154,8 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BodyS3Location": { "Bucket": "bucket", diff --git a/tests/translator/output/aws-cn/http_api_description.json b/tests/translator/output/aws-cn/http_api_description.json index e5b49fcb3..8d6d6bc0f 100644 --- a/tests/translator/output/aws-cn/http_api_description.json +++ b/tests/translator/output/aws-cn/http_api_description.json @@ -2,6 +2,8 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -25,6 +27,8 @@ }, "FunctionApiPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -44,6 +48,8 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -74,6 +80,8 @@ }, "HttpApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AutoDeploy": true, "ApiId": { @@ -87,6 +95,8 @@ }, "HttpApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "openapi": "3.0.1", diff --git a/tests/translator/output/aws-cn/http_api_existing_openapi.json b/tests/translator/output/aws-cn/http_api_existing_openapi.json index 606deddcb..ddb17d59c 100644 --- a/tests/translator/output/aws-cn/http_api_existing_openapi.json +++ b/tests/translator/output/aws-cn/http_api_existing_openapi.json @@ -8,6 +8,8 @@ "Resources": { "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -29,6 +31,8 @@ }, "MyApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -42,6 +46,8 @@ }, "HttpApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.restapi", "Code": { @@ -65,6 +71,8 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -96,6 +104,8 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/http_api_existing_openapi_conditions.json b/tests/translator/output/aws-cn/http_api_existing_openapi_conditions.json index c674491ca..115dd2f5e 100644 --- a/tests/translator/output/aws-cn/http_api_existing_openapi_conditions.json +++ b/tests/translator/output/aws-cn/http_api_existing_openapi_conditions.json @@ -10,6 +10,8 @@ "Resources": { "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -32,6 +34,8 @@ }, "MyApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -47,6 +51,8 @@ }, "HttpApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.restapi", "Code": { @@ -71,6 +77,8 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -102,6 +110,8 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/http_api_explicit_stage.json b/tests/translator/output/aws-cn/http_api_explicit_stage.json index eb33d241d..6eeb619b6 100644 --- a/tests/translator/output/aws-cn/http_api_explicit_stage.json +++ b/tests/translator/output/aws-cn/http_api_explicit_stage.json @@ -12,6 +12,8 @@ "Resources": { "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -33,6 +35,8 @@ }, "HttpApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.restapi", "Code": { @@ -56,6 +60,8 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AutoDeploy": true, "StageVariables": { @@ -84,6 +90,8 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -114,6 +122,8 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FailOnWarnings": true, "Body": { diff --git a/tests/translator/output/aws-cn/http_api_lambda_auth.json b/tests/translator/output/aws-cn/http_api_lambda_auth.json index 9f40ee94f..9c65d2e04 100644 --- a/tests/translator/output/aws-cn/http_api_lambda_auth.json +++ b/tests/translator/output/aws-cn/http_api_lambda_auth.json @@ -2,6 +2,8 @@ "Resources": { "HttpApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -25,6 +27,8 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -55,6 +59,8 @@ }, "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { @@ -76,6 +82,8 @@ }, "MyAuthFn": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "bucket", @@ -99,6 +107,8 @@ }, "MyAuthFnRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -129,6 +139,8 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "openapi": "3.0.1", @@ -238,6 +250,8 @@ }, "MyApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" diff --git a/tests/translator/output/aws-cn/http_api_lambda_auth_full.json b/tests/translator/output/aws-cn/http_api_lambda_auth_full.json index 7fe416f92..3d9f44428 100644 --- a/tests/translator/output/aws-cn/http_api_lambda_auth_full.json +++ b/tests/translator/output/aws-cn/http_api_lambda_auth_full.json @@ -2,6 +2,8 @@ "Resources": { "HttpApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -25,6 +27,8 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -55,6 +59,8 @@ }, "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { @@ -76,6 +82,8 @@ }, "MyAuthFn": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "bucket", @@ -99,6 +107,8 @@ }, "MyAuthFnRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -129,6 +139,8 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "openapi": "3.0.1", @@ -252,6 +264,8 @@ }, "MyApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" diff --git a/tests/translator/output/aws-cn/http_api_with_cors.json b/tests/translator/output/aws-cn/http_api_with_cors.json index ccf90e087..278064a44 100644 --- a/tests/translator/output/aws-cn/http_api_with_cors.json +++ b/tests/translator/output/aws-cn/http_api_with_cors.json @@ -10,6 +10,8 @@ "Resources": { "MyApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -23,6 +25,8 @@ }, "ServerlessHttpApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "ServerlessHttpApi" @@ -36,6 +40,8 @@ }, "ServerlessHttpApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -92,6 +98,8 @@ }, "HttpApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -114,6 +122,8 @@ }, "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -135,6 +145,8 @@ }, "HttpApiFunctionImplicitApiPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -156,6 +168,8 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -186,6 +200,8 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/implicit_and_explicit_api_with_conditions.json b/tests/translator/output/aws-cn/implicit_and_explicit_api_with_conditions.json index 4ebfafc91..af16d22f2 100644 --- a/tests/translator/output/aws-cn/implicit_and_explicit_api_with_conditions.json +++ b/tests/translator/output/aws-cn/implicit_and_explicit_api_with_conditions.json @@ -39,6 +39,8 @@ "Resources": { "explicithello2": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -64,6 +66,8 @@ }, "implicithello2Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -95,6 +99,8 @@ }, "explicithello1": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -120,6 +126,8 @@ }, "ServerlessRestApiDeploymentafcab1755e": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -131,6 +139,8 @@ }, "explicitapiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "explicitapiDeploymentc5102c0776" @@ -143,6 +153,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentafcab1755e" @@ -156,6 +168,8 @@ }, "explicithello2Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -187,6 +201,8 @@ }, "explicithello1ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -209,6 +225,8 @@ }, "implicithello2": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -234,6 +252,8 @@ }, "implicithello1ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -256,6 +276,8 @@ }, "explicitapiDeploymentc5102c0776": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "explicitapi" @@ -266,6 +288,8 @@ }, "implicithello1": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -291,6 +315,8 @@ }, "explicithello2ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -313,6 +339,8 @@ }, "explicitapi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -409,6 +437,8 @@ }, "implicithello2ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -431,6 +461,8 @@ }, "explicithello1Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -462,6 +494,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -559,6 +593,8 @@ }, "implicithello1Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-cn/implicit_api.json b/tests/translator/output/aws-cn/implicit_api.json index 913146077..020d3aea6 100644 --- a/tests/translator/output/aws-cn/implicit_api.json +++ b/tests/translator/output/aws-cn/implicit_api.json @@ -2,6 +2,8 @@ "Resources": { "RestApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -33,6 +35,8 @@ }, "RestApiFunctionAddItemPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -54,6 +58,8 @@ }, "GetHtmlFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -75,6 +81,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentb5184bf2cc" @@ -87,6 +95,8 @@ }, "GetHtmlFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -110,6 +120,8 @@ }, "GetHtmlFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -141,6 +153,8 @@ }, "RestApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -164,6 +178,8 @@ }, "ServerlessRestApiDeploymentb5184bf2cc": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -174,6 +190,8 @@ }, "RestApiFunctionGetListPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -195,6 +213,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -267,6 +287,8 @@ }, "RestApiFunctionCompleteItemPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-cn/implicit_api_with_auth_and_conditions_max.json b/tests/translator/output/aws-cn/implicit_api_with_auth_and_conditions_max.json index c0bad5fb1..ae885116a 100644 --- a/tests/translator/output/aws-cn/implicit_api_with_auth_and_conditions_max.json +++ b/tests/translator/output/aws-cn/implicit_api_with_auth_and_conditions_max.json @@ -81,6 +81,8 @@ "Resources": { "MyFunction4": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -105,6 +107,8 @@ }, "MyFunction6": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -129,6 +133,8 @@ }, "MyFunction2WithCognitoMultipleUserPoolsAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -151,6 +157,8 @@ }, "MyFunction3": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -175,6 +183,8 @@ }, "MyFunction2": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -199,6 +209,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment6b0de9dc9a" @@ -212,6 +224,8 @@ }, "MyFunction5Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -243,6 +257,8 @@ }, "MyFunction2Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -274,6 +290,8 @@ }, "MyFunction4Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -305,6 +323,8 @@ }, "MyFunction5": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -329,6 +349,8 @@ }, "MyFunction6Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -360,6 +382,8 @@ }, "ServerlessRestApiMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -379,6 +403,8 @@ }, "MyFunctionWithNoAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -401,6 +427,8 @@ }, "MyFunction3Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -432,6 +460,8 @@ }, "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -456,6 +486,8 @@ }, "MyFunction4WithLambdaTokenAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -478,6 +510,8 @@ }, "ServerlessRestApiMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -497,6 +531,8 @@ }, "MyFunction5WithLambdaRequestAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -519,6 +555,8 @@ }, "ServerlessRestApiMyLambdaTokenAuthNoneFunctionInvokeRoleAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -538,6 +576,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -569,6 +609,8 @@ }, "ServerlessRestApiDeployment6b0de9dc9a": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -580,6 +622,8 @@ }, "MyFunction3WithLambdaTokenAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -602,6 +646,8 @@ }, "MyFunction6WithDefaultAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -624,6 +670,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/implicit_api_with_many_conditions.json b/tests/translator/output/aws-cn/implicit_api_with_many_conditions.json index bfe56a522..ff7c03c08 100644 --- a/tests/translator/output/aws-cn/implicit_api_with_many_conditions.json +++ b/tests/translator/output/aws-cn/implicit_api_with_many_conditions.json @@ -125,6 +125,8 @@ "Resources": { "helloworld7ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -147,6 +149,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment5d9ff7b9fd" @@ -160,6 +164,8 @@ }, "helloworld1Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -191,6 +197,8 @@ }, "helloworld7": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -216,6 +224,8 @@ }, "helloworld6": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -241,6 +251,8 @@ }, "helloworldRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -272,6 +284,8 @@ }, "helloworld4": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -297,6 +311,8 @@ }, "helloworld3": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -322,6 +338,8 @@ }, "helloworld2": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -347,6 +365,8 @@ }, "helloworld1": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -372,6 +392,8 @@ }, "helloworld9": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -397,6 +419,8 @@ }, "helloApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -419,6 +443,8 @@ }, "helloworld2ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -441,6 +467,8 @@ }, "helloworld3ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -463,6 +491,8 @@ }, "helloworld1ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -485,6 +515,8 @@ }, "helloworld8": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -510,6 +542,8 @@ }, "helloworld6ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -532,6 +566,8 @@ }, "ServerlessRestApiDeployment5d9ff7b9fd": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -543,6 +579,8 @@ }, "helloworld4Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -574,6 +612,8 @@ }, "helloworldApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -596,6 +636,8 @@ }, "helloworld9Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -627,6 +669,8 @@ }, "helloworld5ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -649,6 +693,8 @@ }, "helloworld8ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -671,6 +717,8 @@ }, "helloRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -702,6 +750,8 @@ }, "helloworld8Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -733,6 +783,8 @@ }, "helloworld": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -758,6 +810,8 @@ }, "helloworld5Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -789,6 +843,8 @@ }, "hello": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -814,6 +870,8 @@ }, "helloworld5": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -839,6 +897,8 @@ }, "helloworld9ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -861,6 +921,8 @@ }, "helloworld6Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -892,6 +954,8 @@ }, "helloworld7Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -923,6 +987,8 @@ }, "helloworld2Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -954,6 +1020,8 @@ }, "helloworld3Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -985,6 +1053,8 @@ }, "helloworld4ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -1007,6 +1077,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/implicit_api_with_serverless_rest_api_resource.json b/tests/translator/output/aws-cn/implicit_api_with_serverless_rest_api_resource.json index 8acd95d0f..169f82af4 100644 --- a/tests/translator/output/aws-cn/implicit_api_with_serverless_rest_api_resource.json +++ b/tests/translator/output/aws-cn/implicit_api_with_serverless_rest_api_resource.json @@ -2,6 +2,8 @@ "Resources": { "RestApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -33,6 +35,8 @@ }, "RestApiFunctionAddItemPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -54,6 +58,8 @@ }, "GetHtmlFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -75,6 +81,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentb5184bf2cc" @@ -87,6 +95,8 @@ }, "GetHtmlFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -110,6 +120,8 @@ }, "GetHtmlFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -141,6 +153,8 @@ }, "RestApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -164,6 +178,8 @@ }, "ServerlessRestApiDeploymentb5184bf2cc": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -174,6 +190,8 @@ }, "RestApiFunctionGetListPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -195,6 +213,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -267,6 +287,8 @@ }, "RestApiFunctionCompleteItemPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-cn/implicit_http_api.json b/tests/translator/output/aws-cn/implicit_http_api.json index c23badb55..af582ddb7 100644 --- a/tests/translator/output/aws-cn/implicit_http_api.json +++ b/tests/translator/output/aws-cn/implicit_http_api.json @@ -2,6 +2,8 @@ "Resources": { "ServerlessHttpApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "ServerlessHttpApi" @@ -15,6 +17,8 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -46,6 +50,8 @@ }, "HttpApiFunction2Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -77,6 +83,8 @@ }, "HttpApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.restapi", "Code": { @@ -100,6 +108,8 @@ }, "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -121,6 +131,8 @@ }, "HttpApiFunction2": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.restapi", "Code": { @@ -144,6 +156,8 @@ }, "ServerlessHttpApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -231,6 +245,8 @@ }, "HttpApiFunction2PathParametersPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -252,6 +268,8 @@ }, "HttpApiFunction2Basic2Permission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-cn/implicit_http_api_auth_and_simple_case.json b/tests/translator/output/aws-cn/implicit_http_api_auth_and_simple_case.json index b3e095010..723132b47 100644 --- a/tests/translator/output/aws-cn/implicit_http_api_auth_and_simple_case.json +++ b/tests/translator/output/aws-cn/implicit_http_api_auth_and_simple_case.json @@ -2,6 +2,8 @@ "Resources": { "ServerlessHttpApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "ServerlessHttpApi" @@ -15,6 +17,8 @@ }, "RestApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -46,6 +50,8 @@ }, "RestApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.restapi", "Code": { @@ -69,6 +75,8 @@ }, "RestApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -90,6 +98,8 @@ }, "ServerlessHttpApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/implicit_http_api_with_many_conditions.json b/tests/translator/output/aws-cn/implicit_http_api_with_many_conditions.json index 90f1f1c0f..c91728d59 100644 --- a/tests/translator/output/aws-cn/implicit_http_api_with_many_conditions.json +++ b/tests/translator/output/aws-cn/implicit_http_api_with_many_conditions.json @@ -116,6 +116,8 @@ "Resources": { "helloworld9HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -138,6 +140,8 @@ }, "helloworld9Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -169,6 +173,8 @@ }, "helloworld2HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -191,6 +197,8 @@ }, "ServerlessHttpApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -683,6 +691,8 @@ }, "helloworld6HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -705,6 +715,8 @@ }, "helloworld1Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -736,6 +748,8 @@ }, "helloworld7": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -761,6 +775,8 @@ }, "helloworld6": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -786,6 +802,8 @@ }, "helloworld5": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -811,6 +829,8 @@ }, "helloworld1099Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -842,6 +862,8 @@ }, "helloworld3": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -867,6 +889,8 @@ }, "helloworld2": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -892,6 +916,8 @@ }, "helloworld1": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -917,6 +943,8 @@ }, "helloworld9": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -942,6 +970,8 @@ }, "hello": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -967,6 +997,8 @@ }, "helloRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -998,6 +1030,8 @@ }, "helloworld7HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -1020,6 +1054,8 @@ }, "helloHttpApiEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -1042,6 +1078,8 @@ }, "helloworld1HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -1064,6 +1102,8 @@ }, "helloworld5Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -1095,6 +1135,8 @@ }, "helloworld4Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -1126,6 +1168,8 @@ }, "helloworld1099HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -1148,6 +1192,8 @@ }, "helloworld5HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -1170,6 +1216,8 @@ }, "helloworld7Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -1201,6 +1249,8 @@ }, "helloworld2Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -1232,6 +1282,8 @@ }, "helloworld8Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -1263,6 +1315,8 @@ }, "helloworld4": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -1288,6 +1342,8 @@ }, "helloworld1099": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -1313,6 +1369,8 @@ }, "helloworld8HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -1335,6 +1393,8 @@ }, "ServerlessHttpApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AutoDeploy": true, "ApiId": { @@ -1373,6 +1433,8 @@ }, "helloworld3Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -1404,6 +1466,8 @@ }, "helloworld8": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -1429,6 +1493,8 @@ }, "helloworld4HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -1451,6 +1517,8 @@ }, "helloworld6Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -1482,6 +1550,8 @@ }, "helloworld3HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-cn/inline_precedence.json b/tests/translator/output/aws-cn/inline_precedence.json index 5a3b8edd7..c2566a666 100644 --- a/tests/translator/output/aws-cn/inline_precedence.json +++ b/tests/translator/output/aws-cn/inline_precedence.json @@ -2,6 +2,8 @@ "Resources": { "HelloWorldFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -32,6 +34,8 @@ }, "HelloWorldFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.lambda_handler", "Code": { diff --git a/tests/translator/output/aws-cn/intrinsic_functions.json b/tests/translator/output/aws-cn/intrinsic_functions.json index 4c06c2cf8..784a174b5 100644 --- a/tests/translator/output/aws-cn/intrinsic_functions.json +++ b/tests/translator/output/aws-cn/intrinsic_functions.json @@ -32,6 +32,8 @@ "Resources": { "MyExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -52,6 +54,8 @@ }, "MyTable": { "Type": "AWS::DynamoDB::Table", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "KeySchema": [ { @@ -75,10 +79,14 @@ } }, "SnsDlqQueue": { - "Type": "AWS::SNS::Topic" + "Type": "AWS::SNS::Topic", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, "MySqsDlqLambdaFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -109,10 +117,14 @@ } }, "SqsDlqQueue": { - "Type": "AWS::SQS::Queue" + "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, "ApiWithExplicitS3Uri": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -132,6 +144,8 @@ }, "MyExplicitApiDeployment7145dd00ce": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyExplicitApi" @@ -142,6 +156,8 @@ }, "FunctionWithExplicitS3Uri": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "stream.ddb_handler", "Code": { @@ -166,6 +182,8 @@ }, "MySnsDlqLambdaFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -213,6 +231,8 @@ }, "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "TracingConfig": { "Mode": { @@ -272,6 +292,8 @@ }, "FunctionWithExplicitS3UriRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -302,6 +324,8 @@ }, "DynamoDBFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -333,6 +357,8 @@ }, "MySnsDlqLambdaFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -361,6 +387,8 @@ }, "MyNewRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -400,6 +428,8 @@ }, "DynamoDBFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "stream.ddb_handler", "Code": { @@ -423,6 +453,8 @@ }, "ApiWithExplicitS3UridevStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ApiWithExplicitS3UriDeploymenta227798f00" @@ -436,6 +468,8 @@ }, "DynamoDBFunctionMyDDBStream": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BatchSize": 200, "EventSourceArn": { @@ -452,6 +486,8 @@ }, "ApiWithExplicitS3UriDeploymenta227798f00": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ApiWithExplicitS3Uri" @@ -463,6 +499,8 @@ }, "MySqsDlqLambdaFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -513,6 +551,8 @@ }, "MyExplicitApidevStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyExplicitApiDeployment7145dd00ce" @@ -539,6 +579,8 @@ }, "MyFunctionMyApiPermissiondev": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-cn/iot_rule.json b/tests/translator/output/aws-cn/iot_rule.json index c54b46f7f..34d3c1db6 100644 --- a/tests/translator/output/aws-cn/iot_rule.json +++ b/tests/translator/output/aws-cn/iot_rule.json @@ -4,6 +4,8 @@ "Resources": { "IoTRuleFuncMyIoTRule": { "Type": "AWS::IoT::TopicRule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "TopicRulePayload": { "AwsIotSqlVersion": "beta", @@ -26,6 +28,8 @@ }, "IoTRuleFuncMyOtherIoTRule": { "Type": "AWS::IoT::TopicRule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "TopicRulePayload": { "Actions": [ @@ -47,6 +51,8 @@ }, "IoTRuleFuncMyIoTRulePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -70,6 +76,8 @@ }, "IoTRuleFuncMyOtherIoTRulePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -93,6 +101,8 @@ }, "IoTRuleFunc": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -119,6 +129,8 @@ }, "IoTRuleFuncRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-cn/layers_all_properties.json b/tests/translator/output/aws-cn/layers_all_properties.json index 3520acb5b..3c45e0cea 100644 --- a/tests/translator/output/aws-cn/layers_all_properties.json +++ b/tests/translator/output/aws-cn/layers_all_properties.json @@ -2,7 +2,7 @@ "Outputs": { "LayerSub": { "Value": { - "Fn::Sub": "${MyLayerd04062b365}" + "Fn::Sub": "${MyLayerf16259d4b8}" } }, "FunctionAtt": { @@ -15,7 +15,7 @@ }, "LayerName": { "Value": { - "Ref": "MyLayerd04062b365" + "Ref": "MyLayerf16259d4b8" } }, "FunctionSub": { @@ -38,10 +38,12 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Layers": [ { - "Ref": "MyLayerd04062b365" + "Ref": "MyLayerf16259d4b8" } ], "Code": { @@ -64,9 +66,10 @@ "Runtime": "python3.6" } }, - "MyLayerd04062b365": { - "DeletionPolicy": "Delete", + "MyLayerf16259d4b8": { "Type": "AWS::Lambda::LayerVersion", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "bucket", @@ -75,9 +78,10 @@ "LayerName": "MyLayer" } }, - "MyLayerWithANamefda8c9ec8c": { - "DeletionPolicy": "Retain", + "MyLayerWithAName0c99fc75b5": { "Type": "AWS::Lambda::LayerVersion", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "bucket", @@ -88,6 +92,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-cn/layers_with_intrinsics.json b/tests/translator/output/aws-cn/layers_with_intrinsics.json index bc999791a..8353deccb 100644 --- a/tests/translator/output/aws-cn/layers_with_intrinsics.json +++ b/tests/translator/output/aws-cn/layers_with_intrinsics.json @@ -17,9 +17,10 @@ } }, "Resources": { - "LayerWithNameIntrinsiccf8baed8b9": { - "DeletionPolicy": "Retain", + "LayerWithNameIntrinsic1935b50dbd": { "Type": "AWS::Lambda::LayerVersion", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "sam-demo-bucket", @@ -28,9 +29,10 @@ "LayerName": "SomeLayerName" } }, - "LayerWithRefNameIntrinsicRegion186db7e435": { - "DeletionPolicy": "Retain", + "LayerWithRefNameIntrinsicRegion8bb3f168f3": { "Type": "AWS::Lambda::LayerVersion", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "sam-demo-bucket", @@ -39,9 +41,10 @@ "LayerName": "cn-north-1" } }, - "LayerWithSubNameIntrinsicRegionfbc3f9f13d": { - "DeletionPolicy": "Retain", + "LayerWithSubNameIntrinsicRegion33dad6e41a": { "Type": "AWS::Lambda::LayerVersion", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "sam-demo-bucket", @@ -52,9 +55,10 @@ } } }, - "LayerWithRuntimesIntrinsic1a006faa85": { - "DeletionPolicy": "Retain", + "LayerWithRuntimesIntrinsic15bceab8a8": { "Type": "AWS::Lambda::LayerVersion", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "sam-demo-bucket", @@ -66,8 +70,7 @@ } } }, - "LayerWithSingleListRefRuntimesIntrinsic9d7a72f24a": { - "DeletionPolicy": "Retain", + "LayerWithSingleListRefRuntimesIntrinsic3243ec999b": { "Properties": { "CompatibleRuntimes": [ { @@ -80,10 +83,11 @@ }, "LayerName": "LayerWithSingleListRefRuntimesIntrinsic" }, - "Type": "AWS::Lambda::LayerVersion" + "Type": "AWS::Lambda::LayerVersion", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, - "LayerWithMixedListRefRuntimesIntrinsic71fd80f592": { - "DeletionPolicy": "Retain", + "LayerWithMixedListRefRuntimesIntrinsicbd637a121f": { "Properties": { "CompatibleRuntimes": [ { @@ -97,11 +101,14 @@ }, "LayerName": "LayerWithMixedListRefRuntimesIntrinsic" }, - "Type": "AWS::Lambda::LayerVersion" + "Type": "AWS::Lambda::LayerVersion", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, - "LayerWithLicenseIntrinsic965c8d0c9b": { - "DeletionPolicy": "Retain", + "LayerWithLicenseIntrinsicf158772ce9": { "Type": "AWS::Lambda::LayerVersion", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "sam-demo-bucket", @@ -111,9 +118,10 @@ "LicenseInfo": "MIT-0 License" } }, - "LayerWithSubNameIntrinsic6e9b477102": { + "LayerWithSubNameIntrinsic8566d42a51": { "Type": "AWS::Lambda::LayerVersion", - "DeletionPolicy": "Retain", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-cn/no_implicit_api_with_serverless_rest_api_resource.json b/tests/translator/output/aws-cn/no_implicit_api_with_serverless_rest_api_resource.json index d100ffdc6..a82eac5a8 100644 --- a/tests/translator/output/aws-cn/no_implicit_api_with_serverless_rest_api_resource.json +++ b/tests/translator/output/aws-cn/no_implicit_api_with_serverless_rest_api_resource.json @@ -2,6 +2,8 @@ "Resources": { "GetHtmlFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -25,6 +27,8 @@ }, "GetHtmlFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ThumbnailFunctionImageBucketPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -68,6 +74,8 @@ }, "RestApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -98,6 +106,8 @@ }, "RestApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -121,6 +131,8 @@ }, "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -151,6 +163,8 @@ }, "Images": { "Type": "AWS::S3::Bucket", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "NotificationConfiguration": { "LambdaConfigurations": [ @@ -172,6 +186,8 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.generate_thumbails", "Code": { @@ -195,6 +211,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/s3.json b/tests/translator/output/aws-cn/s3.json index be472d564..c8b735232 100644 --- a/tests/translator/output/aws-cn/s3.json +++ b/tests/translator/output/aws-cn/s3.json @@ -2,6 +2,8 @@ "Resources": { "Images": { "Type": "AWS::S3::Bucket", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "DependsOn": ["ThumbnailFunctionImageBucketPermission"], "Properties": { "NotificationConfiguration": { @@ -21,6 +23,8 @@ }, "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -51,6 +55,8 @@ }, "ThumbnailFunctionImageBucketPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -64,6 +70,8 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-cn/s3_create_remove.json b/tests/translator/output/aws-cn/s3_create_remove.json index 0c2833cd4..45d3a8aaa 100644 --- a/tests/translator/output/aws-cn/s3_create_remove.json +++ b/tests/translator/output/aws-cn/s3_create_remove.json @@ -2,6 +2,8 @@ "Resources": { "Images": { "Type": "AWS::S3::Bucket", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "DependsOn": ["ThumbnailFunctionImageBucketPermission"], "Properties": { "NotificationConfiguration": { @@ -38,6 +40,8 @@ }, "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -68,6 +72,8 @@ }, "ThumbnailFunctionImageBucketPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -81,6 +87,8 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-cn/s3_existing_lambda_notification_configuration.json b/tests/translator/output/aws-cn/s3_existing_lambda_notification_configuration.json index be472d564..c8b735232 100644 --- a/tests/translator/output/aws-cn/s3_existing_lambda_notification_configuration.json +++ b/tests/translator/output/aws-cn/s3_existing_lambda_notification_configuration.json @@ -2,6 +2,8 @@ "Resources": { "Images": { "Type": "AWS::S3::Bucket", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "DependsOn": ["ThumbnailFunctionImageBucketPermission"], "Properties": { "NotificationConfiguration": { @@ -21,6 +23,8 @@ }, "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -51,6 +55,8 @@ }, "ThumbnailFunctionImageBucketPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -64,6 +70,8 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-cn/s3_existing_other_notification_configuration.json b/tests/translator/output/aws-cn/s3_existing_other_notification_configuration.json index 65d2709c8..164eb584d 100644 --- a/tests/translator/output/aws-cn/s3_existing_other_notification_configuration.json +++ b/tests/translator/output/aws-cn/s3_existing_other_notification_configuration.json @@ -2,6 +2,8 @@ "Resources": { "Images": { "Type": "AWS::S3::Bucket", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "NotificationConfiguration": { "LambdaConfigurations": [ @@ -29,6 +31,8 @@ }, "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,6 +63,8 @@ }, "ThumbnailFunctionImageBucketPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -72,6 +78,8 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.generate_thumbails", "Code": { diff --git a/tests/translator/output/aws-cn/s3_filter.json b/tests/translator/output/aws-cn/s3_filter.json index b9c128d6d..1778ed409 100644 --- a/tests/translator/output/aws-cn/s3_filter.json +++ b/tests/translator/output/aws-cn/s3_filter.json @@ -2,6 +2,8 @@ "Resources": { "Images": { "Type": "AWS::S3::Bucket", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "DependsOn": ["ThumbnailFunctionImageBucketPermission"], "Properties": { "NotificationConfiguration": { @@ -31,6 +33,8 @@ }, "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -61,6 +65,8 @@ }, "ThumbnailFunctionImageBucketPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -74,6 +80,8 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-cn/s3_multiple_events_same_bucket.json b/tests/translator/output/aws-cn/s3_multiple_events_same_bucket.json index 0c604138e..52480e838 100644 --- a/tests/translator/output/aws-cn/s3_multiple_events_same_bucket.json +++ b/tests/translator/output/aws-cn/s3_multiple_events_same_bucket.json @@ -2,6 +2,8 @@ "Resources": { "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -32,6 +34,8 @@ }, "ThumbnailFunctionImageBucketCreatesPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -45,6 +49,8 @@ }, "Images": { "Type": "AWS::S3::Bucket", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "DependsOn": ["ThumbnailFunctionImageBucketDeletesPermission", "ThumbnailFunctionImageBucketCreatesPermission"], "Properties": { "NotificationConfiguration": { @@ -83,6 +89,8 @@ }, "ThumbnailFunctionImageBucketDeletesPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -96,6 +104,8 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-cn/s3_multiple_functions.json b/tests/translator/output/aws-cn/s3_multiple_functions.json index e1ba64e22..f2dd02a2b 100644 --- a/tests/translator/output/aws-cn/s3_multiple_functions.json +++ b/tests/translator/output/aws-cn/s3_multiple_functions.json @@ -2,6 +2,8 @@ "Resources": { "FunctionOneRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -32,6 +34,8 @@ }, "FunctionTwoImageBucketPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -45,6 +49,8 @@ }, "Images": { "Type": "AWS::S3::Bucket", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "NotificationConfiguration": { "LambdaConfigurations": [ @@ -82,6 +88,8 @@ }, "FunctionTwoRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -112,6 +120,8 @@ }, "FunctionOneImageBucketPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -125,6 +135,8 @@ }, "FunctionTwo": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -148,6 +160,8 @@ }, "FunctionOne": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-cn/s3_with_condition.json b/tests/translator/output/aws-cn/s3_with_condition.json index 7c90662b9..aa8ac9f1c 100644 --- a/tests/translator/output/aws-cn/s3_with_condition.json +++ b/tests/translator/output/aws-cn/s3_with_condition.json @@ -10,6 +10,8 @@ "Resources": { "Images": { "Type": "AWS::S3::Bucket", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "NotificationConfiguration": { "LambdaConfigurations": [ @@ -50,6 +52,8 @@ }, "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -81,6 +85,8 @@ }, "ThumbnailFunctionImageBucketPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -95,6 +101,8 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.generate_thumbails", "Code": { diff --git a/tests/translator/output/aws-cn/s3_with_dependsOn.json b/tests/translator/output/aws-cn/s3_with_dependsOn.json index b2d321a04..4e7dc5fdc 100644 --- a/tests/translator/output/aws-cn/s3_with_dependsOn.json +++ b/tests/translator/output/aws-cn/s3_with_dependsOn.json @@ -1,10 +1,14 @@ { "Resources": { "Topic": { - "Type": "AWS::SNS::Topic" + "Type": "AWS::SNS::Topic", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, "Images": { "Type": "AWS::S3::Bucket", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "DependsOn": [ "ThumbnailFunctionImageBucketPermission", "Topic" @@ -27,6 +31,8 @@ }, "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -57,6 +63,8 @@ }, "ThumbnailFunctionImageBucketPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -70,6 +78,8 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-cn/simple_table_ref_parameter_intrinsic.json b/tests/translator/output/aws-cn/simple_table_ref_parameter_intrinsic.json index cd79e4bc1..6593dd4ac 100644 --- a/tests/translator/output/aws-cn/simple_table_ref_parameter_intrinsic.json +++ b/tests/translator/output/aws-cn/simple_table_ref_parameter_intrinsic.json @@ -16,6 +16,8 @@ "Resources": { "MinimalTableRefParamLongForm": { "Type": "AWS::DynamoDB::Table", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ProvisionedThroughput": { "WriteCapacityUnits": { diff --git a/tests/translator/output/aws-cn/simple_table_with_extra_tags.json b/tests/translator/output/aws-cn/simple_table_with_extra_tags.json index a02e088cd..36e580e2f 100644 --- a/tests/translator/output/aws-cn/simple_table_with_extra_tags.json +++ b/tests/translator/output/aws-cn/simple_table_with_extra_tags.json @@ -8,6 +8,8 @@ "Resources": { "MinimalTableWithTags": { "Type": "AWS::DynamoDB::Table", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BillingMode": "PAY_PER_REQUEST", "AttributeDefinitions": [ diff --git a/tests/translator/output/aws-cn/simple_table_with_table_name.json b/tests/translator/output/aws-cn/simple_table_with_table_name.json index f70cdcc4e..e42662064 100644 --- a/tests/translator/output/aws-cn/simple_table_with_table_name.json +++ b/tests/translator/output/aws-cn/simple_table_with_table_name.json @@ -8,6 +8,8 @@ "Resources": { "MinimalTableWithTableName": { "Type": "AWS::DynamoDB::Table", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "TableName": "MySimpleTable", "BillingMode": "PAY_PER_REQUEST", @@ -27,6 +29,8 @@ }, "MinimalTableWithRefTableName": { "Type": "AWS::DynamoDB::Table", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "TableName": { "Ref": "MySimpleTableParameter" @@ -48,6 +52,8 @@ }, "MinimalTableWithSubTableName": { "Type": "AWS::DynamoDB::Table", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "TableName": { "Fn::Sub": "${AWS::StackName}MySimpleTable" diff --git a/tests/translator/output/aws-cn/simpletable.json b/tests/translator/output/aws-cn/simpletable.json index c59f7a660..f26c9fa8f 100644 --- a/tests/translator/output/aws-cn/simpletable.json +++ b/tests/translator/output/aws-cn/simpletable.json @@ -2,6 +2,8 @@ "Resources": { "MinimalTable": { "Type": "AWS::DynamoDB::Table", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BillingMode": "PAY_PER_REQUEST", "AttributeDefinitions": [ @@ -20,6 +22,8 @@ }, "CompleteTable": { "Type": "AWS::DynamoDB::Table", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ProvisionedThroughput": { "WriteCapacityUnits": 10, diff --git a/tests/translator/output/aws-cn/simpletable_with_sse.json b/tests/translator/output/aws-cn/simpletable_with_sse.json index ab4c3d3f5..e160085a5 100644 --- a/tests/translator/output/aws-cn/simpletable_with_sse.json +++ b/tests/translator/output/aws-cn/simpletable_with_sse.json @@ -2,6 +2,8 @@ "Resources": { "TableWithSSE": { "Type": "AWS::DynamoDB::Table", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BillingMode": "PAY_PER_REQUEST", "SSESpecification": { diff --git a/tests/translator/output/aws-cn/sns.json b/tests/translator/output/aws-cn/sns.json index 236d8baef..4811a77d9 100644 --- a/tests/translator/output/aws-cn/sns.json +++ b/tests/translator/output/aws-cn/sns.json @@ -1,10 +1,14 @@ { "Resources": { "Notifications": { - "Type": "AWS::SNS::Topic" + "Type": "AWS::SNS::Topic", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, "SaveNotificationFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -35,6 +39,8 @@ }, "SaveNotificationFunctionNotificationTopicPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "sns.amazonaws.com", @@ -48,6 +54,8 @@ }, "SaveNotificationFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -71,6 +79,8 @@ }, "SaveNotificationFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Endpoint": { "Fn::GetAtt": [ diff --git a/tests/translator/output/aws-cn/sns_existing_other_subscription.json b/tests/translator/output/aws-cn/sns_existing_other_subscription.json index 98ad0f9fa..45ab41bf2 100644 --- a/tests/translator/output/aws-cn/sns_existing_other_subscription.json +++ b/tests/translator/output/aws-cn/sns_existing_other_subscription.json @@ -2,6 +2,8 @@ "Resources": { "Notifications": { "Type": "AWS::SNS::Topic", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Subscription": [ { @@ -13,6 +15,8 @@ }, "SaveNotificationFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -43,6 +47,8 @@ }, "SaveNotificationFunctionNotificationTopicPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "sns.amazonaws.com", @@ -56,6 +62,8 @@ }, "SaveNotificationFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -79,6 +87,8 @@ }, "SaveNotificationFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Endpoint": { "Fn::GetAtt": [ diff --git a/tests/translator/output/aws-cn/sns_existing_sqs.json b/tests/translator/output/aws-cn/sns_existing_sqs.json index 326c6baba..41f680d44 100644 --- a/tests/translator/output/aws-cn/sns_existing_sqs.json +++ b/tests/translator/output/aws-cn/sns_existing_sqs.json @@ -1,13 +1,19 @@ { "Resources": { "Queue": { - "Type": "AWS::SQS::Queue" + "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, "Notifications": { - "Type": "AWS::SNS::Topic" + "Type": "AWS::SNS::Topic", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, "NotificationA": { "Type": "AWS::SQS::QueuePolicy", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Queues": [ { @@ -41,6 +47,8 @@ }, "SaveNotificationFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FilterPolicy": { "price_usd": [ @@ -69,6 +77,8 @@ }, "SaveNotificationFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -100,6 +110,8 @@ }, "SaveNotificationFunctionNotificationTopicEventSourceMapping": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BatchSize": 8, "Enabled": true, @@ -116,6 +128,8 @@ }, "SaveNotificationFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.save_notification", "Code": { diff --git a/tests/translator/output/aws-cn/sns_outside_sqs.json b/tests/translator/output/aws-cn/sns_outside_sqs.json index 624867e0a..14f9e4bf5 100644 --- a/tests/translator/output/aws-cn/sns_outside_sqs.json +++ b/tests/translator/output/aws-cn/sns_outside_sqs.json @@ -2,6 +2,8 @@ "Resources": { "NotificationB": { "Type": "AWS::SQS::QueuePolicy", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Queues": [ "https://sqs.us-east-1.amazonaws.com/123456789012/MyQueue" @@ -27,10 +29,14 @@ } }, "Notifications": { - "Type": "AWS::SNS::Topic" + "Type": "AWS::SNS::Topic", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, "SaveNotificationFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FilterPolicy": { "price_usd": [ @@ -54,6 +60,8 @@ }, "SaveNotificationFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -85,6 +93,8 @@ }, "SaveNotificationFunctionNotificationTopicEventSourceMapping": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BatchSize": 8, "Enabled": true, @@ -96,6 +106,8 @@ }, "SaveNotificationFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.save_notification", "Code": { diff --git a/tests/translator/output/aws-cn/sns_sqs.json b/tests/translator/output/aws-cn/sns_sqs.json index 90961ae75..ab152c1e4 100644 --- a/tests/translator/output/aws-cn/sns_sqs.json +++ b/tests/translator/output/aws-cn/sns_sqs.json @@ -1,14 +1,20 @@ { "Resources": { "Notifications": { - "Type": "AWS::SNS::Topic" + "Type": "AWS::SNS::Topic", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, "SaveNotificationFunctionNotificationTopicQueue": { "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": {} }, "SaveNotificationFunctionNotificationTopicQueuePolicy": { "Type": "AWS::SQS::QueuePolicy", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Queues": [ { @@ -42,6 +48,8 @@ }, "SaveNotificationFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FilterPolicy": { "price_usd": [ @@ -70,6 +78,8 @@ }, "SaveNotificationFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -101,6 +111,8 @@ }, "SaveNotificationFunctionNotificationTopicEventSourceMapping": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BatchSize": 10, "Enabled": true, @@ -117,6 +129,8 @@ }, "SaveNotificationFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.save_notification", "Code": { diff --git a/tests/translator/output/aws-cn/sns_topic_outside_template.json b/tests/translator/output/aws-cn/sns_topic_outside_template.json index 60e185e06..d99b37b0e 100644 --- a/tests/translator/output/aws-cn/sns_topic_outside_template.json +++ b/tests/translator/output/aws-cn/sns_topic_outside_template.json @@ -7,6 +7,8 @@ "Resources": { "SaveNotificationFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Endpoint": { "Fn::GetAtt": [ @@ -22,6 +24,8 @@ }, "SaveNotificationFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -52,6 +56,8 @@ }, "SaveNotificationFunctionNotificationTopicPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "sns.amazonaws.com", @@ -65,6 +71,8 @@ }, "SaveNotificationFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-us-gov/function_with_condition.json b/tests/translator/output/aws-us-gov/function_with_condition.json index 55fc68469..b1ac81010 100644 --- a/tests/translator/output/aws-us-gov/function_with_condition.json +++ b/tests/translator/output/aws-us-gov/function_with_condition.json @@ -10,6 +10,8 @@ "Resources": { "ConditionFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -34,6 +36,8 @@ }, "ConditionFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-us-gov/function_with_conditional_managed_policy.json b/tests/translator/output/aws-us-gov/function_with_conditional_managed_policy.json index e2a0e8c5f..58b8a4972 100644 --- a/tests/translator/output/aws-us-gov/function_with_conditional_managed_policy.json +++ b/tests/translator/output/aws-us-gov/function_with_conditional_managed_policy.json @@ -10,6 +10,8 @@ "Resources": { "FunctionWithConditionalPolicy": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -34,6 +36,8 @@ }, "FunctionWithConditionalPolicyRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", diff --git a/tests/translator/output/aws-us-gov/function_with_conditional_managed_policy_and_ref_no_value.json b/tests/translator/output/aws-us-gov/function_with_conditional_managed_policy_and_ref_no_value.json index da893a16c..d49a6e003 100644 --- a/tests/translator/output/aws-us-gov/function_with_conditional_managed_policy_and_ref_no_value.json +++ b/tests/translator/output/aws-us-gov/function_with_conditional_managed_policy_and_ref_no_value.json @@ -10,6 +10,8 @@ "Resources": { "FunctionWithConditionalPolicy": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -34,6 +36,8 @@ }, "FunctionWithConditionalPolicyRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", diff --git a/tests/translator/output/aws-us-gov/function_with_conditional_policy_template.json b/tests/translator/output/aws-us-gov/function_with_conditional_policy_template.json index 18e2f7216..7dcc8a85d 100644 --- a/tests/translator/output/aws-us-gov/function_with_conditional_policy_template.json +++ b/tests/translator/output/aws-us-gov/function_with_conditional_policy_template.json @@ -10,6 +10,8 @@ "Resources": { "FunctionWithConditionalPolicy": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -34,6 +36,8 @@ }, "FunctionWithConditionalPolicyRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-us-gov/function_with_conditional_policy_template_and_ref_no_value.json b/tests/translator/output/aws-us-gov/function_with_conditional_policy_template_and_ref_no_value.json index 08c9629f1..c09b9713d 100644 --- a/tests/translator/output/aws-us-gov/function_with_conditional_policy_template_and_ref_no_value.json +++ b/tests/translator/output/aws-us-gov/function_with_conditional_policy_template_and_ref_no_value.json @@ -10,6 +10,8 @@ "Resources": { "FunctionWithConditionalPolicy": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -34,6 +36,8 @@ }, "FunctionWithConditionalPolicyRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-us-gov/function_with_custom_codedeploy_deployment_preference.json b/tests/translator/output/aws-us-gov/function_with_custom_codedeploy_deployment_preference.json index f601b9622..5fa549bea 100644 --- a/tests/translator/output/aws-us-gov/function_with_custom_codedeploy_deployment_preference.json +++ b/tests/translator/output/aws-us-gov/function_with_custom_codedeploy_deployment_preference.json @@ -34,6 +34,8 @@ "Resources": { "NormalWithRefAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -58,8 +60,9 @@ } }, "CustomWithFindInMapVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "CustomWithFindInMap" @@ -108,6 +111,8 @@ }, "CustomWithFindInMapAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -133,6 +138,8 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -156,6 +163,8 @@ }, "CustomWithSubAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -181,6 +190,8 @@ }, "NormalWithSub": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -202,9 +213,10 @@ ] } }, - "CustomWithConditionVersion640128d35d": { - "DeletionPolicy": "Retain", + "CustomWithConditionVersion640128d35d": { "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "CustomWithCondition" @@ -240,9 +252,10 @@ } } }, - "CustomWithCondition2Version640128d35d": { - "DeletionPolicy": "Retain", + "CustomWithCondition2Version640128d35d": { "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "CustomWithCondition2" @@ -251,6 +264,8 @@ }, "CustomWithCondition": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -274,6 +289,8 @@ }, "CustomWithSub": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -301,9 +318,10 @@ "ComputePlatform": "Lambda" } }, - "NormalWithRefVersion640128d35d": { - "DeletionPolicy": "Retain", + "NormalWithRefVersion640128d35d": { "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "NormalWithRef" @@ -404,6 +422,8 @@ }, "NormalWithSubAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -428,8 +448,9 @@ } }, "CustomWithSubVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "CustomWithSub" @@ -438,6 +459,8 @@ }, "CustomWithSubRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -468,6 +491,8 @@ }, "CustomWithConditionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -538,6 +563,8 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -568,6 +595,8 @@ }, "CustomWithFindInMap": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -590,8 +619,9 @@ } }, "NormalWithSubVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "NormalWithSub" @@ -600,6 +630,8 @@ }, "CustomWithConditionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -625,6 +657,8 @@ }, "CustomWithFindInMapRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -655,6 +689,8 @@ }, "NormalWithRef": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -678,6 +714,8 @@ }, "CustomWithCondition2": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -728,6 +766,8 @@ }, "NormalWithRefRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -758,6 +798,8 @@ }, "CustomWithCondition2Aliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -783,6 +825,8 @@ }, "NormalWithSubRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -812,8 +856,9 @@ } }, "MinimalFunctionVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -849,6 +894,8 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -874,6 +921,8 @@ }, "CustomWithCondition2Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-us-gov/function_with_custom_conditional_codedeploy_deployment_preference.json b/tests/translator/output/aws-us-gov/function_with_custom_conditional_codedeploy_deployment_preference.json index b91a7f0ff..9d724199a 100644 --- a/tests/translator/output/aws-us-gov/function_with_custom_conditional_codedeploy_deployment_preference.json +++ b/tests/translator/output/aws-us-gov/function_with_custom_conditional_codedeploy_deployment_preference.json @@ -33,6 +33,8 @@ }, "HelloWorldFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -139,8 +141,9 @@ } }, "HelloWorldFunctionVersionfb53d5c2e6": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "HelloWorldFunction" @@ -149,6 +152,8 @@ }, "HelloWorldFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -174,6 +179,8 @@ }, "HelloWorldFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { diff --git a/tests/translator/output/aws-us-gov/function_with_deployment_and_custom_role.json b/tests/translator/output/aws-us-gov/function_with_deployment_and_custom_role.json index 68a538606..f6eb96d35 100644 --- a/tests/translator/output/aws-us-gov/function_with_deployment_and_custom_role.json +++ b/tests/translator/output/aws-us-gov/function_with_deployment_and_custom_role.json @@ -2,6 +2,8 @@ "Resources": { "FunctionWithRole": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -25,6 +27,8 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -48,6 +52,8 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -78,6 +84,8 @@ }, "DeploymentRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSCodeDeployRole" @@ -101,8 +109,9 @@ } }, "FunctionWithRoleVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "FunctionWithRole" @@ -208,8 +217,9 @@ } }, "MinimalFunctionVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -218,6 +228,8 @@ }, "FunctionWithRoleAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -243,6 +255,8 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { diff --git a/tests/translator/output/aws-us-gov/function_with_deployment_no_service_role.json b/tests/translator/output/aws-us-gov/function_with_deployment_no_service_role.json index ca6cf4a1e..aac9cc42f 100644 --- a/tests/translator/output/aws-us-gov/function_with_deployment_no_service_role.json +++ b/tests/translator/output/aws-us-gov/function_with_deployment_no_service_role.json @@ -33,6 +33,8 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -56,6 +58,8 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -85,8 +89,9 @@ } }, "OtherFunctionVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "OtherFunction" @@ -95,6 +100,8 @@ }, "OtherFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -125,6 +132,8 @@ }, "DeploymentRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSCodeDeployRole" @@ -184,9 +193,10 @@ "ComputePlatform": "Lambda" } }, - "MinimalFunctionVersion640128d35d": { - "DeletionPolicy": "Retain", + "MinimalFunctionVersion640128d35d": { "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -195,6 +205,8 @@ }, "OtherFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -218,6 +230,8 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -243,6 +257,8 @@ }, "OtherFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { diff --git a/tests/translator/output/aws-us-gov/function_with_deployment_preference.json b/tests/translator/output/aws-us-gov/function_with_deployment_preference.json index 3b6868a1e..3e56a7b75 100644 --- a/tests/translator/output/aws-us-gov/function_with_deployment_preference.json +++ b/tests/translator/output/aws-us-gov/function_with_deployment_preference.json @@ -63,6 +63,8 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -93,6 +95,8 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -145,8 +149,9 @@ } }, "MinimalFunctionVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -155,6 +160,8 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { diff --git a/tests/translator/output/aws-us-gov/function_with_deployment_preference_alarms_intrinsic_if.json b/tests/translator/output/aws-us-gov/function_with_deployment_preference_alarms_intrinsic_if.json index b156bf318..904156314 100644 --- a/tests/translator/output/aws-us-gov/function_with_deployment_preference_alarms_intrinsic_if.json +++ b/tests/translator/output/aws-us-gov/function_with_deployment_preference_alarms_intrinsic_if.json @@ -10,6 +10,8 @@ "Resources": { "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -33,7 +35,8 @@ }, "MinimalFunctionVersion640128d35d": { "Type": "AWS::Lambda::Version", - "DeletionPolicy": "Retain", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -42,6 +45,8 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -67,6 +72,8 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", diff --git a/tests/translator/output/aws-us-gov/function_with_deployment_preference_all_parameters.json b/tests/translator/output/aws-us-gov/function_with_deployment_preference_all_parameters.json index 2eb18aee3..9ee044a97 100644 --- a/tests/translator/output/aws-us-gov/function_with_deployment_preference_all_parameters.json +++ b/tests/translator/output/aws-us-gov/function_with_deployment_preference_all_parameters.json @@ -2,6 +2,8 @@ "Resources": { "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -25,6 +27,8 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "MySanityTestFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -85,6 +91,8 @@ }, "MyCloudWatchAlarm": { "Type": "AWS::CloudWatch::Alarm", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EvaluationPeriods": 1, "Namespace": "AWS/EC2", @@ -152,6 +160,8 @@ }, "MySanityTestFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "my-bucket", @@ -204,8 +214,9 @@ } }, "MinimalFunctionVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -214,6 +225,8 @@ }, "MyValidationTestFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "my-bucket", @@ -237,6 +250,8 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -268,6 +283,8 @@ }, "MyValidationTestFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -297,7 +314,9 @@ } }, "MySNSTopic": { - "Type": "AWS::SNS::Topic" + "Type": "AWS::SNS::Topic", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" } } } \ No newline at end of file diff --git a/tests/translator/output/aws-us-gov/function_with_deployment_preference_from_parameters.json b/tests/translator/output/aws-us-gov/function_with_deployment_preference_from_parameters.json index 960cf3d85..b638e0243 100644 --- a/tests/translator/output/aws-us-gov/function_with_deployment_preference_from_parameters.json +++ b/tests/translator/output/aws-us-gov/function_with_deployment_preference_from_parameters.json @@ -16,6 +16,8 @@ "Resources": { "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -39,6 +41,8 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -69,6 +73,8 @@ }, "MySanityTestFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -99,6 +105,8 @@ }, "MyCloudWatchAlarm": { "Type": "AWS::CloudWatch::Alarm", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EvaluationPeriods": 1, "Namespace": "AWS/EC2", @@ -166,6 +174,8 @@ }, "MySanityTestFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "my-bucket", @@ -218,8 +228,9 @@ } }, "MinimalFunctionVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -228,6 +239,8 @@ }, "MyValidationTestFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "my-bucket", @@ -251,6 +264,8 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -282,6 +297,8 @@ }, "MyValidationTestFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -311,7 +328,9 @@ } }, "MySNSTopic": { - "Type": "AWS::SNS::Topic" + "Type": "AWS::SNS::Topic", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" } } } \ No newline at end of file diff --git a/tests/translator/output/aws-us-gov/function_with_deployment_preference_multiple_combinations.json b/tests/translator/output/aws-us-gov/function_with_deployment_preference_multiple_combinations.json index 2ad3524ec..4daea5dea 100644 --- a/tests/translator/output/aws-us-gov/function_with_deployment_preference_multiple_combinations.json +++ b/tests/translator/output/aws-us-gov/function_with_deployment_preference_multiple_combinations.json @@ -2,6 +2,8 @@ "Resources": { "MinimalFunctionWithDeploymentPreferenceWithHooksAndAlarms": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -25,6 +27,8 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -78,6 +84,8 @@ }, "MinimalFunctionWithMinimalDeploymentPreferenceRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -108,6 +116,8 @@ }, "MyCloudWatchAlarm": { "Type": "AWS::CloudWatch::Alarm", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EvaluationPeriods": 1, "Namespace": "AWS/EC2", @@ -119,6 +129,8 @@ }, "MinimalFunctionWithMinimalDeploymentPreferenceAliaslivewithdeployment": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -187,8 +199,9 @@ } }, "MinimalFunctionWithMinimalDeploymentPreferenceVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunctionWithMinimalDeploymentPreference" @@ -197,6 +210,8 @@ }, "MinimalFunctionWithDeploymentPreferenceWithHooksAndAlarmsRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -227,6 +242,8 @@ }, "MySanityTestFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -257,6 +274,8 @@ }, "MinimalFunctionWithMinimalDeploymentPreference": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -280,6 +299,8 @@ }, "MySanityTestFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "my-bucket", @@ -302,8 +323,9 @@ } }, "MinimalFunctionWithDeploymentPreferenceWithHooksAndAlarmsVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunctionWithDeploymentPreferenceWithHooksAndAlarms" @@ -375,8 +397,9 @@ } }, "MinimalFunctionVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -385,6 +408,8 @@ }, "MyValidationTestFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -415,6 +440,8 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -430,6 +457,8 @@ }, "MinimalFunctionWithDeploymentPreferenceWithHooksAndAlarmsAliaslivewithdeploymentwithhooksandalarms": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -461,6 +490,8 @@ }, "MyValidationTestFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "my-bucket", diff --git a/tests/translator/output/aws-us-gov/function_with_disabled_deployment_preference.json b/tests/translator/output/aws-us-gov/function_with_disabled_deployment_preference.json index 6057dd5f9..f3d303dd6 100644 --- a/tests/translator/output/aws-us-gov/function_with_disabled_deployment_preference.json +++ b/tests/translator/output/aws-us-gov/function_with_disabled_deployment_preference.json @@ -1,8 +1,9 @@ { "Resources": { "MinimalFunctionVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -11,6 +12,8 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -26,6 +29,8 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -49,6 +54,8 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-us-gov/function_with_dlq.json b/tests/translator/output/aws-us-gov/function_with_dlq.json index d72373ef2..ad0a39128 100644 --- a/tests/translator/output/aws-us-gov/function_with_dlq.json +++ b/tests/translator/output/aws-us-gov/function_with_dlq.json @@ -2,6 +2,8 @@ "Resources": { "MySnsDlqLambdaFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -47,6 +49,8 @@ }, "MySqsDlqLambdaFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -92,6 +96,8 @@ }, "MySqsDlqLambdaFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -118,6 +124,8 @@ }, "MySnsDlqLambdaFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-us-gov/function_with_event_dest.json b/tests/translator/output/aws-us-gov/function_with_event_dest.json index 629685776..f15d20f30 100644 --- a/tests/translator/output/aws-us-gov/function_with_event_dest.json +++ b/tests/translator/output/aws-us-gov/function_with_event_dest.json @@ -49,6 +49,8 @@ "Resources": { "MyTestFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -124,11 +126,15 @@ }, "MyTestFunctionEventInvokeConfigOnSuccessQueue": { "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": {}, "Condition": "NOTQueueCreationDisabled2da03e5b6f" }, "SNSSubscription": { "Type": "AWS::SNS::Subscription", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Endpoint": "example@example.com", "Protocol": "email", @@ -140,6 +146,8 @@ }, "MyTestFunctionEventInvokeConfig": { "Type": "AWS::Lambda::EventInvokeConfig", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "MaximumEventAgeInSeconds": 70, "MaximumRetryAttempts": 1, @@ -178,6 +186,8 @@ }, "MyTestFunction2Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -239,6 +249,8 @@ }, "DestinationLambda": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async (event) => {\n const response = {\n statusCode: 200,\n body: JSON.stringify('Hello from Lambda!'),\n };\n return response;\n};\n" @@ -262,6 +274,8 @@ }, "MyTestFunction2EventInvokeConfig": { "Type": "AWS::Lambda::EventInvokeConfig", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "MaximumEventAgeInSeconds": 70, "MaximumRetryAttempts": 1, @@ -286,6 +300,8 @@ }, "DestinationLambdaRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -316,6 +332,8 @@ }, "MyTestFunction2": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = function(event, context, callback) {\n var event_received_at = new Date().toISOString();\n console.log('Event received at: ' + event_received_at);\n console.log('Received event:', JSON.stringify(event, null, 2));\n\n if (event.Success) {\n console.log(\"Success\");\n context.callbackWaitsForEmptyEventLoop = false;\n callback(null);\n } else {\n console.log(\"Failure\");\n context.callbackWaitsForEmptyEventLoop = false;\n callback(new Error(\"Failure from event, Success = false, I am failing!\"), 'Destination Function Error Thrown');\n }\n}; \n" @@ -339,6 +357,8 @@ }, "MyTestFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = function(event, context, callback) {\n var event_received_at = new Date().toISOString();\n console.log('Event received at: ' + event_received_at);\n console.log('Received event:', JSON.stringify(event, null, 2));\n\n if (event.Success) {\n console.log(\"Success\");\n context.callbackWaitsForEmptyEventLoop = false;\n callback(null);\n } else {\n console.log(\"Failure\");\n context.callbackWaitsForEmptyEventLoop = false;\n callback(new Error(\"Failure from event, Success = false, I am failing!\"), 'Destination Function Error Thrown');\n }\n}; \n" @@ -362,6 +382,8 @@ }, "MyTestFunctionEventInvokeConfigOnFailureTopic": { "Type": "AWS::SNS::Topic", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": {}, "Condition": "TopicCreationEnabled" } diff --git a/tests/translator/output/aws-us-gov/function_with_event_dest_basic.json b/tests/translator/output/aws-us-gov/function_with_event_dest_basic.json index 2849abc9a..e86c1cc23 100644 --- a/tests/translator/output/aws-us-gov/function_with_event_dest_basic.json +++ b/tests/translator/output/aws-us-gov/function_with_event_dest_basic.json @@ -8,10 +8,14 @@ "Resources": { "MyTestFunctionEventInvokeConfigOnSuccessQueue": { "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": {} }, "MyTestFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -73,6 +77,8 @@ }, "MyTestFunctionEventInvokeConfig": { "Type": "AWS::Lambda::EventInvokeConfig", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "MaximumEventAgeInSeconds": 70, "MaximumRetryAttempts": 1, @@ -100,6 +106,8 @@ }, "MyTestFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = function(event, context, callback) {\n var event_received_at = new Date().toISOString();\n console.log('Event received at: ' + event_received_at);\n console.log('Received event:', JSON.stringify(event, null, 2));\n\n if (event.Success) {\n console.log(\"Success\");\n context.callbackWaitsForEmptyEventLoop = false;\n callback(null);\n } else {\n console.log(\"Failure\");\n context.callbackWaitsForEmptyEventLoop = false;\n callback(new Error(\"Failure from event, Success = false, I am failing!\"), 'Destination Function Error Thrown');\n }\n}; \n" @@ -123,6 +131,8 @@ }, "MyTestFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -137,8 +147,9 @@ } }, "MyTestFunctionVersiondaf9da458d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MyTestFunction" diff --git a/tests/translator/output/aws-us-gov/function_with_event_dest_conditional.json b/tests/translator/output/aws-us-gov/function_with_event_dest_conditional.json index 32175aa06..f3b767344 100644 --- a/tests/translator/output/aws-us-gov/function_with_event_dest_conditional.json +++ b/tests/translator/output/aws-us-gov/function_with_event_dest_conditional.json @@ -59,6 +59,8 @@ "Resources": { "DestinationLambdaRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -90,11 +92,15 @@ }, "MyTestFunctionEventInvokeConfigOnSuccessQueue": { "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": {}, "Condition": "FunctionConditionANDNOTQueueCreationDisabled2da03e5b6fe547d4e2d6" }, "MyTestFunctionEventInvokeConfig": { "Type": "AWS::Lambda::EventInvokeConfig", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "MaximumEventAgeInSeconds": 70, "MaximumRetryAttempts": 1, @@ -137,6 +143,8 @@ }, "MyTestFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = function(event, context, callback) {\n var event_received_at = new Date().toISOString();\n console.log('Event received at: ' + event_received_at);\n console.log('Received event:', JSON.stringify(event, null, 2));\n\n if (event.Success) {\n console.log(\"Success\");\n context.callbackWaitsForEmptyEventLoop = false;\n callback(null);\n } else {\n console.log(\"Failure\");\n context.callbackWaitsForEmptyEventLoop = false;\n callback(new Error(\"Failure from event, Success = false, I am failing!\"), 'Destination Function Error Thrown');\n }\n}; \n" @@ -161,6 +169,8 @@ }, "DestinationLambda": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async (event) => {\n const response = {\n statusCode: 200,\n body: JSON.stringify('Hello from Lambda!'),\n };\n return response;\n};\n" @@ -185,6 +195,8 @@ }, "MyTestFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", diff --git a/tests/translator/output/aws-us-gov/function_with_event_source_mapping.json b/tests/translator/output/aws-us-gov/function_with_event_source_mapping.json index a910aefed..6e902a548 100644 --- a/tests/translator/output/aws-us-gov/function_with_event_source_mapping.json +++ b/tests/translator/output/aws-us-gov/function_with_event_source_mapping.json @@ -9,13 +9,19 @@ }, "Resources": { "MySqsQueue": { - "Type": "AWS::SQS::Queue" + "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, "MySnsTopic": { - "Type": "AWS::SNS::Topic" + "Type": "AWS::SNS::Topic", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, "MyFunctionForBatchingExampleStream": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "MaximumBatchingWindowInSeconds": 20, "EventSourceArn": { @@ -32,6 +38,8 @@ }, "DynamoDBTable": { "Type": "AWS::DynamoDB::Table", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "KeySchema": [ { @@ -56,6 +64,8 @@ }, "MyFunctionForBatchingExampleRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -147,12 +157,16 @@ }, "KinesisStream1": { "Type": "AWS::Kinesis::Stream", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ShardCount": 1 } }, "MyFunctionForBatchingExampleDynamoDBStreamEvent": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "MaximumBatchingWindowInSeconds": { "Ref": "MyBatchingWindowParam" @@ -188,6 +202,8 @@ }, "MyFunctionForBatchingExample": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -210,6 +226,8 @@ }, "MyFunctionForBatchingExampleStreamEvent": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "MaximumBatchingWindowInSeconds": { "Ref": "MyBatchingWindowParam" @@ -235,6 +253,8 @@ }, "KinesisStream": { "Type": "AWS::Kinesis::Stream", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ShardCount": 1 } diff --git a/tests/translator/output/aws-us-gov/function_with_file_system_config.json b/tests/translator/output/aws-us-gov/function_with_file_system_config.json index 132a7e909..f7a9e27bf 100644 --- a/tests/translator/output/aws-us-gov/function_with_file_system_config.json +++ b/tests/translator/output/aws-us-gov/function_with_file_system_config.json @@ -1,10 +1,14 @@ { "Resources": { "EfsFileSystem": { - "Type": "AWS::EFS::FileSystem" + "Type": "AWS::EFS::FileSystem", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, "LambdaFunctionWithEfs": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "const fs = require('fs')\nconst path = require('path')\nconst efsMountPath = '/mnt/efs'\n\nexports.handler = async (event, context, callback) => {\nconst directory = path.join(efsMountPath, event.body)\nconst files = fs.readdirSync(directory)\nreturn files\n}\n" @@ -48,6 +52,8 @@ }, "MountTarget": { "Type": "AWS::EFS::MountTarget", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "SubnetId": "subnet-abc123", "FileSystemId": { @@ -60,6 +66,8 @@ }, "LambdaFunctionWithEfsRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -91,6 +99,8 @@ }, "AccessPoint": { "Type": "AWS::EFS::AccessPoint", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FileSystemId": { "Ref": "EfsFileSystem" diff --git a/tests/translator/output/aws-us-gov/function_with_global_layers.json b/tests/translator/output/aws-us-gov/function_with_global_layers.json index 58bd6af51..324ef40d4 100644 --- a/tests/translator/output/aws-us-gov/function_with_global_layers.json +++ b/tests/translator/output/aws-us-gov/function_with_global_layers.json @@ -2,6 +2,8 @@ "Resources": { "ManyLayersFuncRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -32,6 +34,8 @@ }, "ManyLayersFunc": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-us-gov/function_with_kmskeyarn.json b/tests/translator/output/aws-us-gov/function_with_kmskeyarn.json index 7ff51981f..fbd8f9454 100644 --- a/tests/translator/output/aws-us-gov/function_with_kmskeyarn.json +++ b/tests/translator/output/aws-us-gov/function_with_kmskeyarn.json @@ -2,6 +2,8 @@ "Resources": { "FunctionWithKeyArnRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -32,6 +34,8 @@ }, "FunctionWithReferenceToKeyArnRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -62,6 +66,8 @@ }, "FunctionWithKeyArn": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -86,6 +92,8 @@ }, "myKey": { "Type": "AWS::KMS::Key", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "KeyPolicy": { "Version": "2012-10-17", @@ -109,6 +117,8 @@ }, "FunctionWithReferenceToKeyArn": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-us-gov/function_with_layers.json b/tests/translator/output/aws-us-gov/function_with_layers.json index 9197f869c..9aa736de8 100644 --- a/tests/translator/output/aws-us-gov/function_with_layers.json +++ b/tests/translator/output/aws-us-gov/function_with_layers.json @@ -2,6 +2,8 @@ "Resources": { "MinimalLayerFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Layers": [ "arn:aws:lambda:us-east-1:123456789101:layer:CorpXLayer:1" @@ -26,9 +28,10 @@ "Runtime": "python2.7" } }, - "MyLayera5167acaba": { - "DeletionPolicy": "Retain", + "MyLayer43a7918434": { "Type": "AWS::Lambda::LayerVersion", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "sam-demo-bucket", @@ -39,10 +42,12 @@ }, "FunctionReferencesLayer": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Layers": [ { - "Ref": "MyLayera5167acaba" + "Ref": "MyLayer43a7918434" } ], "Code": { @@ -67,6 +72,8 @@ }, "MinimalLayerFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -97,6 +104,8 @@ }, "FunctionReferencesLayerRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -127,6 +136,8 @@ }, "FunctionLayerWithSubIntrinsic": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Layers": [ { @@ -158,6 +169,8 @@ }, "FunctionNoLayerVersion": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Layers": [ "arn:aws:lambda:us-east-1:123456789101:layer:CorpXLayer:1" @@ -184,6 +197,8 @@ }, "FunctionNoLayerVersionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -214,6 +229,8 @@ }, "FunctionLayerWithSubIntrinsicRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-us-gov/function_with_many_layers.json b/tests/translator/output/aws-us-gov/function_with_many_layers.json index 15389c0a6..a5925d80d 100644 --- a/tests/translator/output/aws-us-gov/function_with_many_layers.json +++ b/tests/translator/output/aws-us-gov/function_with_many_layers.json @@ -1,8 +1,9 @@ { "Resources": { - "MyLayera5167acaba": { - "DeletionPolicy": "Retain", + "MyLayer43a7918434": { "Type": "AWS::Lambda::LayerVersion", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "sam-demo-bucket", @@ -13,6 +14,8 @@ }, "ManyLayersFuncRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -43,6 +46,8 @@ }, "ManyLayersFunc": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Layers": [ "arn:aws:lambda:us-east-1:123456789101:layer:z:1", @@ -54,7 +59,7 @@ "Fn::Sub": "arn:${AWS::Partition}:lambda:${AWS::Region}:123456789101:layer:c:1" }, { - "Ref": "MyLayera5167acaba" + "Ref": "MyLayer43a7918434" } ], "Code": { diff --git a/tests/translator/output/aws-us-gov/function_with_permissions_boundary.json b/tests/translator/output/aws-us-gov/function_with_permissions_boundary.json index f4914ac7c..dee6d61e1 100644 --- a/tests/translator/output/aws-us-gov/function_with_permissions_boundary.json +++ b/tests/translator/output/aws-us-gov/function_with_permissions_boundary.json @@ -2,6 +2,8 @@ "Resources": { "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -33,6 +35,8 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { diff --git a/tests/translator/output/aws-us-gov/function_with_policy_templates.json b/tests/translator/output/aws-us-gov/function_with_policy_templates.json index 4ae24a6d4..f2a292100 100644 --- a/tests/translator/output/aws-us-gov/function_with_policy_templates.json +++ b/tests/translator/output/aws-us-gov/function_with_policy_templates.json @@ -7,6 +7,8 @@ "Resources": { "OnePolicyTemplate": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -30,6 +32,8 @@ }, "MultiplePolicyTemplates": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -53,6 +57,8 @@ }, "OnePolicyTemplateRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -118,6 +124,8 @@ }, "MultiplePolicyTemplatesRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -197,6 +205,8 @@ }, "AllCombinations": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -220,6 +230,8 @@ }, "AllCombinationsRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaRole", diff --git a/tests/translator/output/aws-us-gov/function_with_request_parameters.json b/tests/translator/output/aws-us-gov/function_with_request_parameters.json index 67345e559..fbd4cc870 100644 --- a/tests/translator/output/aws-us-gov/function_with_request_parameters.json +++ b/tests/translator/output/aws-us-gov/function_with_request_parameters.json @@ -2,6 +2,8 @@ "Resources": { "ApiParameterFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "NoApiParameterFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ServerlessRestApiDeploymentbe3a929cf9": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -65,6 +71,8 @@ }, "ApiDeployment5e67eb8be3": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "Api" @@ -75,6 +83,8 @@ }, "ApiParameterFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -105,6 +115,8 @@ }, "NoApiParameterFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -126,6 +138,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentbe3a929cf9" @@ -138,6 +152,8 @@ }, "Api": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -185,6 +201,8 @@ }, "ApiParameterFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -204,6 +222,8 @@ }, "ApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ApiDeployment5e67eb8be3" @@ -216,6 +236,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -272,6 +294,8 @@ }, "NoApiParameterFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { diff --git a/tests/translator/output/aws-us-gov/function_with_resource_refs.json b/tests/translator/output/aws-us-gov/function_with_resource_refs.json index b54893054..51744a1f6 100644 --- a/tests/translator/output/aws-us-gov/function_with_resource_refs.json +++ b/tests/translator/output/aws-us-gov/function_with_resource_refs.json @@ -53,6 +53,8 @@ "Resources": { "FunctionWithoutAlias": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -76,6 +78,8 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -106,6 +110,8 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -129,6 +135,8 @@ }, "FunctionWithoutAliasRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -158,8 +166,9 @@ } }, "MinimalFunctionVersion640128d35d": { - "DeletionPolicy": "Retain", - "Type": "AWS::Lambda::Version", + "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -168,6 +177,8 @@ }, "MyBucket": { "Type": "AWS::S3::Bucket", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Name": { "Fn::GetAtt": [ @@ -179,6 +190,8 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ diff --git a/tests/translator/output/aws-us-gov/function_with_signing_profile.json b/tests/translator/output/aws-us-gov/function_with_signing_profile.json index fb4065fa5..2f91d0041 100644 --- a/tests/translator/output/aws-us-gov/function_with_signing_profile.json +++ b/tests/translator/output/aws-us-gov/function_with_signing_profile.json @@ -2,6 +2,8 @@ "Resources": { "FunctionWithSigningProfile": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -28,6 +30,8 @@ }, "FunctionWithSigningProfileRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -58,6 +62,8 @@ }, "MySignedFunctionCodeSigningConfig": { "Type": "AWS::Lambda::CodeSigningConfig", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "CodeSigningPolicies": { "UntrustedArtifactOnDeployment": "Enforce" @@ -77,6 +83,8 @@ }, "SigningProfile": { "Type": "AWS::Signer::SigningProfile", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "PlatformId": "AWSLambda-SHA384-ECDSA" } diff --git a/tests/translator/output/aws-us-gov/function_with_sns_event_source_all_parameters.json b/tests/translator/output/aws-us-gov/function_with_sns_event_source_all_parameters.json index 87237d78b..57761ef10 100644 --- a/tests/translator/output/aws-us-gov/function_with_sns_event_source_all_parameters.json +++ b/tests/translator/output/aws-us-gov/function_with_sns_event_source_all_parameters.json @@ -2,6 +2,8 @@ "Resources": { "MyAwesomeFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FilterPolicy": { "store": [ @@ -39,6 +41,8 @@ }, "MyAwesomeFunctionNotificationTopicPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "sns.amazonaws.com", @@ -50,6 +54,8 @@ }, "MyAwesomeFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -80,6 +86,8 @@ }, "MyAwesomeFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-us-gov/global_handle_path_level_parameter.json b/tests/translator/output/aws-us-gov/global_handle_path_level_parameter.json index cdcf96bc2..d2bfdbbf6 100644 --- a/tests/translator/output/aws-us-gov/global_handle_path_level_parameter.json +++ b/tests/translator/output/aws-us-gov/global_handle_path_level_parameter.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -125,6 +131,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -142,6 +150,8 @@ }, "ExplicitApiSomeStageStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -159,6 +169,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -180,6 +192,8 @@ }, "ServerlessRestApiDeploymentc969c99f9d": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -190,6 +204,8 @@ }, "MyUserPool": { "Type": "AWS::Cognito::UserPool", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "UsernameAttributes": [ "email" @@ -211,6 +227,8 @@ }, "ExplicitApiDeployment9a254aa466": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -221,6 +239,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/globals_for_api.json b/tests/translator/output/aws-us-gov/globals_for_api.json index feedaa823..3ce9eccd3 100644 --- a/tests/translator/output/aws-us-gov/globals_for_api.json +++ b/tests/translator/output/aws-us-gov/globals_for_api.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -124,6 +130,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -141,6 +149,8 @@ }, "ExplicitApiSomeStageStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -158,6 +168,8 @@ }, "ExplicitApiDeployment43e01e673d": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -168,6 +180,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -189,6 +203,8 @@ }, "ServerlessRestApiDeployment6fd1928d9b": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -199,6 +215,8 @@ }, "MyUserPool": { "Type": "AWS::Cognito::UserPool", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "UsernameAttributes": [ "email" @@ -220,6 +238,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/globals_for_function.json b/tests/translator/output/aws-us-gov/globals_for_function.json index 6a7fbfe70..5ff295071 100644 --- a/tests/translator/output/aws-us-gov/globals_for_function.json +++ b/tests/translator/output/aws-us-gov/globals_for_function.json @@ -2,6 +2,8 @@ "Resources": { "FunctionWithOverridesRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -43,6 +45,8 @@ }, "FunctionWithOverrides": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Layers": [ { @@ -104,6 +108,8 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -141,6 +147,8 @@ }, "FunctionWithOverridesAliasprod": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -156,6 +164,8 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Layers": [ { @@ -208,6 +218,8 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -222,8 +234,9 @@ } }, "FunctionWithOverridesVersion096ed3b52b": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "FunctionWithOverrides" @@ -231,8 +244,9 @@ } }, "MinimalFunctionVersion0a06fc8fb1": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" diff --git a/tests/translator/output/aws-us-gov/globals_for_simpletable.json b/tests/translator/output/aws-us-gov/globals_for_simpletable.json index 313fd286c..990238365 100644 --- a/tests/translator/output/aws-us-gov/globals_for_simpletable.json +++ b/tests/translator/output/aws-us-gov/globals_for_simpletable.json @@ -2,6 +2,8 @@ "Resources": { "MinimalTable": { "Type": "AWS::DynamoDB::Table", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BillingMode": "PAY_PER_REQUEST", "SSESpecification": { diff --git a/tests/translator/output/aws-us-gov/http_api_def_uri.json b/tests/translator/output/aws-us-gov/http_api_def_uri.json index 519068750..c4db6212c 100644 --- a/tests/translator/output/aws-us-gov/http_api_def_uri.json +++ b/tests/translator/output/aws-us-gov/http_api_def_uri.json @@ -2,6 +2,8 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -25,6 +27,8 @@ }, "FunctionApiPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -44,6 +48,8 @@ }, "MyApiStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -66,6 +72,8 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -96,6 +104,8 @@ }, "MyApi2ApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi2" @@ -109,6 +119,8 @@ }, "MyApi2": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BodyS3Location": { "Version": "version", @@ -119,6 +131,8 @@ }, "FunctionApi2Permission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -140,6 +154,8 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BodyS3Location": { "Bucket": "bucket", diff --git a/tests/translator/output/aws-us-gov/http_api_description.json b/tests/translator/output/aws-us-gov/http_api_description.json index dd4a7f36c..fb8af0044 100644 --- a/tests/translator/output/aws-us-gov/http_api_description.json +++ b/tests/translator/output/aws-us-gov/http_api_description.json @@ -2,6 +2,8 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -25,6 +27,8 @@ }, "FunctionApiPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -44,6 +48,8 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -74,6 +80,8 @@ }, "HttpApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AutoDeploy": true, "ApiId": { @@ -87,6 +95,8 @@ }, "HttpApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "openapi": "3.0.1", diff --git a/tests/translator/output/aws-us-gov/http_api_existing_openapi.json b/tests/translator/output/aws-us-gov/http_api_existing_openapi.json index 5efdccc32..9b927dc45 100644 --- a/tests/translator/output/aws-us-gov/http_api_existing_openapi.json +++ b/tests/translator/output/aws-us-gov/http_api_existing_openapi.json @@ -8,6 +8,8 @@ "Resources": { "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -29,6 +31,8 @@ }, "MyApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -42,6 +46,8 @@ }, "HttpApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.restapi", "Code": { @@ -65,6 +71,8 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -96,6 +104,8 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/http_api_existing_openapi_conditions.json b/tests/translator/output/aws-us-gov/http_api_existing_openapi_conditions.json index 22e36ce32..5a3ff261f 100644 --- a/tests/translator/output/aws-us-gov/http_api_existing_openapi_conditions.json +++ b/tests/translator/output/aws-us-gov/http_api_existing_openapi_conditions.json @@ -10,6 +10,8 @@ "Resources": { "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -32,6 +34,8 @@ }, "MyApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -47,6 +51,8 @@ }, "HttpApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.restapi", "Code": { @@ -71,6 +77,8 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -102,6 +110,8 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/http_api_explicit_stage.json b/tests/translator/output/aws-us-gov/http_api_explicit_stage.json index 6fbeb6689..35c6de61f 100644 --- a/tests/translator/output/aws-us-gov/http_api_explicit_stage.json +++ b/tests/translator/output/aws-us-gov/http_api_explicit_stage.json @@ -12,6 +12,8 @@ "Resources": { "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -33,6 +35,8 @@ }, "HttpApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.restapi", "Code": { @@ -56,6 +60,8 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "StageVariables": { "VarName": "VarValue" @@ -84,6 +90,8 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -114,6 +122,8 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FailOnWarnings": true, "Body": { diff --git a/tests/translator/output/aws-us-gov/http_api_lambda_auth.json b/tests/translator/output/aws-us-gov/http_api_lambda_auth.json index bf4184c64..84715546f 100644 --- a/tests/translator/output/aws-us-gov/http_api_lambda_auth.json +++ b/tests/translator/output/aws-us-gov/http_api_lambda_auth.json @@ -2,6 +2,8 @@ "Resources": { "HttpApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -25,6 +27,8 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -55,6 +59,8 @@ }, "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { @@ -76,6 +82,8 @@ }, "MyAuthFn": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "bucket", @@ -99,6 +107,8 @@ }, "MyAuthFnRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -129,6 +139,8 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "openapi": "3.0.1", @@ -238,6 +250,8 @@ }, "MyApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" diff --git a/tests/translator/output/aws-us-gov/http_api_lambda_auth_full.json b/tests/translator/output/aws-us-gov/http_api_lambda_auth_full.json index 3fe74a218..34b0c46f5 100644 --- a/tests/translator/output/aws-us-gov/http_api_lambda_auth_full.json +++ b/tests/translator/output/aws-us-gov/http_api_lambda_auth_full.json @@ -2,6 +2,8 @@ "Resources": { "HttpApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -25,6 +27,8 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -55,6 +59,8 @@ }, "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { @@ -76,6 +82,8 @@ }, "MyAuthFn": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "bucket", @@ -99,6 +107,8 @@ }, "MyAuthFnRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -129,6 +139,8 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "openapi": "3.0.1", @@ -252,6 +264,8 @@ }, "MyApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" diff --git a/tests/translator/output/aws-us-gov/http_api_with_cors.json b/tests/translator/output/aws-us-gov/http_api_with_cors.json index 7b9ed1d10..e50105b87 100644 --- a/tests/translator/output/aws-us-gov/http_api_with_cors.json +++ b/tests/translator/output/aws-us-gov/http_api_with_cors.json @@ -10,6 +10,8 @@ "Resources": { "MyApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -23,6 +25,8 @@ }, "ServerlessHttpApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "ServerlessHttpApi" @@ -36,6 +40,8 @@ }, "ServerlessHttpApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -92,6 +98,8 @@ }, "HttpApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -114,6 +122,8 @@ }, "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -135,6 +145,8 @@ }, "HttpApiFunctionImplicitApiPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -156,6 +168,8 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -186,6 +200,8 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/implicit_and_explicit_api_with_conditions.json b/tests/translator/output/aws-us-gov/implicit_and_explicit_api_with_conditions.json index 2c5bb7890..a69b7ad2a 100644 --- a/tests/translator/output/aws-us-gov/implicit_and_explicit_api_with_conditions.json +++ b/tests/translator/output/aws-us-gov/implicit_and_explicit_api_with_conditions.json @@ -39,6 +39,8 @@ "Resources": { "explicithello2": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -64,6 +66,8 @@ }, "implicithello2Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -95,6 +99,8 @@ }, "explicithello1": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -120,6 +126,8 @@ }, "explicitapiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "explicitapiDeploymentc8f1a3b6da" @@ -132,6 +140,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment0270cbc16b" @@ -145,6 +155,8 @@ }, "explicithello2Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -176,6 +188,8 @@ }, "explicithello1ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -198,6 +212,8 @@ }, "implicithello2": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -223,6 +239,8 @@ }, "implicithello1ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -245,6 +263,8 @@ }, "ServerlessRestApiDeployment0270cbc16b": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -256,6 +276,8 @@ }, "implicithello1": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -281,6 +303,8 @@ }, "explicithello2ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -303,6 +327,8 @@ }, "explicitapiDeploymentc8f1a3b6da": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "explicitapi" @@ -313,6 +339,8 @@ }, "explicitapi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -409,6 +437,8 @@ }, "implicithello2ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -431,6 +461,8 @@ }, "explicithello1Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -462,6 +494,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -559,6 +593,8 @@ }, "implicithello1Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-us-gov/implicit_api.json b/tests/translator/output/aws-us-gov/implicit_api.json index db1922ff5..681affb13 100644 --- a/tests/translator/output/aws-us-gov/implicit_api.json +++ b/tests/translator/output/aws-us-gov/implicit_api.json @@ -2,6 +2,8 @@ "Resources": { "RestApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -34,6 +36,8 @@ }, "RestApiFunctionAddItemPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -55,6 +59,8 @@ }, "GetHtmlFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -76,6 +82,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentaaf8bd4588" @@ -88,6 +96,8 @@ }, "ServerlessRestApiDeploymentaaf8bd4588": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -98,6 +108,8 @@ }, "GetHtmlFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -121,6 +133,8 @@ }, "GetHtmlFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -153,6 +167,8 @@ }, "RestApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -176,6 +192,8 @@ }, "RestApiFunctionGetListPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -197,6 +215,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -269,6 +289,8 @@ }, "RestApiFunctionCompleteItemPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/implicit_api_with_auth_and_conditions_max.json b/tests/translator/output/aws-us-gov/implicit_api_with_auth_and_conditions_max.json index 55919ab21..232648757 100644 --- a/tests/translator/output/aws-us-gov/implicit_api_with_auth_and_conditions_max.json +++ b/tests/translator/output/aws-us-gov/implicit_api_with_auth_and_conditions_max.json @@ -81,6 +81,8 @@ "Resources": { "MyFunction4": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -105,6 +107,8 @@ }, "MyFunction6": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -129,6 +133,8 @@ }, "MyFunction2WithCognitoMultipleUserPoolsAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -151,6 +157,8 @@ }, "MyFunction3": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -175,6 +183,8 @@ }, "MyFunction2": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -199,6 +209,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment91a6380656" @@ -212,6 +224,8 @@ }, "MyFunction5Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -243,6 +257,8 @@ }, "MyFunction2Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -274,6 +290,8 @@ }, "MyFunction4Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -305,6 +323,8 @@ }, "MyFunction5": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -329,6 +349,8 @@ }, "MyFunction6Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -360,6 +382,8 @@ }, "ServerlessRestApiMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -379,6 +403,8 @@ }, "MyFunctionWithNoAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -401,6 +427,8 @@ }, "MyFunction3Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -432,6 +460,8 @@ }, "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -456,6 +486,8 @@ }, "MyFunction4WithLambdaTokenAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -478,6 +510,8 @@ }, "ServerlessRestApiMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -497,6 +531,8 @@ }, "MyFunction5WithLambdaRequestAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -519,6 +555,8 @@ }, "ServerlessRestApiMyLambdaTokenAuthNoneFunctionInvokeRoleAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -538,6 +576,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -569,6 +609,8 @@ }, "ServerlessRestApiDeployment91a6380656": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -580,6 +622,8 @@ }, "MyFunction3WithLambdaTokenAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -602,6 +646,8 @@ }, "MyFunction6WithDefaultAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -624,6 +670,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/implicit_api_with_many_conditions.json b/tests/translator/output/aws-us-gov/implicit_api_with_many_conditions.json index 7a9883371..260503992 100644 --- a/tests/translator/output/aws-us-gov/implicit_api_with_many_conditions.json +++ b/tests/translator/output/aws-us-gov/implicit_api_with_many_conditions.json @@ -125,6 +125,8 @@ "Resources": { "helloworld7ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -147,6 +149,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment8fffc54734" @@ -160,6 +164,8 @@ }, "helloworld1Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -191,6 +197,8 @@ }, "helloworld7": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -216,6 +224,8 @@ }, "helloworld6": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -241,6 +251,8 @@ }, "helloworldRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -272,6 +284,8 @@ }, "helloworld4": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -297,6 +311,8 @@ }, "helloworld3": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -322,6 +338,8 @@ }, "helloworld2": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -347,6 +365,8 @@ }, "helloworld1": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -372,6 +392,8 @@ }, "helloworld9": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -397,6 +419,8 @@ }, "helloApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -419,6 +443,8 @@ }, "helloworld2ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -441,6 +467,8 @@ }, "helloworld3ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -463,6 +491,8 @@ }, "helloworld1ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -485,6 +515,8 @@ }, "helloworld8": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -510,6 +542,8 @@ }, "helloworld6ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -532,6 +566,8 @@ }, "helloworld4Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -563,6 +599,8 @@ }, "helloworldApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -585,6 +623,8 @@ }, "helloworld9Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -616,6 +656,8 @@ }, "helloworld5ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -638,6 +680,8 @@ }, "helloworld8ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -660,6 +704,8 @@ }, "helloRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -691,6 +737,8 @@ }, "helloworld8Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -722,6 +770,8 @@ }, "helloworld": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -747,6 +797,8 @@ }, "helloworld5Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -778,6 +830,8 @@ }, "hello": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -803,6 +857,8 @@ }, "ServerlessRestApiDeployment8fffc54734": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -814,6 +870,8 @@ }, "helloworld5": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -839,6 +897,8 @@ }, "helloworld9ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -861,6 +921,8 @@ }, "helloworld6Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -892,6 +954,8 @@ }, "helloworld7Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -923,6 +987,8 @@ }, "helloworld2Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -954,6 +1020,8 @@ }, "helloworld3Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -985,6 +1053,8 @@ }, "helloworld4ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -1007,6 +1077,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/implicit_api_with_serverless_rest_api_resource.json b/tests/translator/output/aws-us-gov/implicit_api_with_serverless_rest_api_resource.json index fa2d5021d..72d1c052d 100644 --- a/tests/translator/output/aws-us-gov/implicit_api_with_serverless_rest_api_resource.json +++ b/tests/translator/output/aws-us-gov/implicit_api_with_serverless_rest_api_resource.json @@ -2,6 +2,8 @@ "Resources": { "RestApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -33,6 +35,8 @@ }, "RestApiFunctionAddItemPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -54,6 +58,8 @@ }, "GetHtmlFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -75,6 +81,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentaaf8bd4588" @@ -87,6 +95,8 @@ }, "ServerlessRestApiDeploymentaaf8bd4588": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -97,6 +107,8 @@ }, "GetHtmlFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -120,6 +132,8 @@ }, "GetHtmlFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -151,6 +165,8 @@ }, "RestApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.restapi", "Code": { @@ -174,6 +190,8 @@ }, "RestApiFunctionGetListPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -195,6 +213,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -267,6 +287,8 @@ }, "RestApiFunctionCompleteItemPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/implicit_http_api.json b/tests/translator/output/aws-us-gov/implicit_http_api.json index 713e890c6..2d6a47aee 100644 --- a/tests/translator/output/aws-us-gov/implicit_http_api.json +++ b/tests/translator/output/aws-us-gov/implicit_http_api.json @@ -2,6 +2,8 @@ "Resources": { "ServerlessHttpApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "ServerlessHttpApi" @@ -15,6 +17,8 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -46,6 +50,8 @@ }, "HttpApiFunction2Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -77,6 +83,8 @@ }, "HttpApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.restapi", "Code": { @@ -100,6 +108,8 @@ }, "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -121,6 +131,8 @@ }, "HttpApiFunction2": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.restapi", "Code": { @@ -144,6 +156,8 @@ }, "ServerlessHttpApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -231,6 +245,8 @@ }, "HttpApiFunction2PathParametersPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -252,6 +268,8 @@ }, "HttpApiFunction2Basic2Permission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/implicit_http_api_auth_and_simple_case.json b/tests/translator/output/aws-us-gov/implicit_http_api_auth_and_simple_case.json index 7ace3a522..170b974b4 100644 --- a/tests/translator/output/aws-us-gov/implicit_http_api_auth_and_simple_case.json +++ b/tests/translator/output/aws-us-gov/implicit_http_api_auth_and_simple_case.json @@ -2,6 +2,8 @@ "Resources": { "ServerlessHttpApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "ServerlessHttpApi" @@ -15,6 +17,8 @@ }, "RestApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -46,6 +50,8 @@ }, "RestApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.restapi", "Code": { @@ -69,6 +75,8 @@ }, "RestApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -90,6 +98,8 @@ }, "ServerlessHttpApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/implicit_http_api_with_many_conditions.json b/tests/translator/output/aws-us-gov/implicit_http_api_with_many_conditions.json index 9f1185595..bc7031a58 100644 --- a/tests/translator/output/aws-us-gov/implicit_http_api_with_many_conditions.json +++ b/tests/translator/output/aws-us-gov/implicit_http_api_with_many_conditions.json @@ -116,6 +116,8 @@ "Resources": { "helloworld9HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -138,6 +140,8 @@ }, "helloworld9Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -169,6 +173,8 @@ }, "helloworld2HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -191,6 +197,8 @@ }, "ServerlessHttpApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -683,6 +691,8 @@ }, "helloworld6HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -705,6 +715,8 @@ }, "helloworld1Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -736,6 +748,8 @@ }, "helloworld7": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -761,6 +775,8 @@ }, "helloworld6": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -786,6 +802,8 @@ }, "helloworld5": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -811,6 +829,8 @@ }, "helloworld1099Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -842,6 +862,8 @@ }, "helloworld3": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -867,6 +889,8 @@ }, "helloworld2": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -892,6 +916,8 @@ }, "helloworld1": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -917,6 +943,8 @@ }, "helloworld9": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -942,6 +970,8 @@ }, "hello": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -967,6 +997,8 @@ }, "helloRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -998,6 +1030,8 @@ }, "helloworld7HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -1020,6 +1054,8 @@ }, "helloHttpApiEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -1042,6 +1078,8 @@ }, "helloworld1HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -1064,6 +1102,8 @@ }, "helloworld5Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -1095,6 +1135,8 @@ }, "helloworld4Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -1126,6 +1168,8 @@ }, "helloworld1099HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -1148,6 +1192,8 @@ }, "helloworld5HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -1170,6 +1216,8 @@ }, "helloworld7Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -1201,6 +1249,8 @@ }, "helloworld2Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -1232,6 +1282,8 @@ }, "helloworld8Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -1263,6 +1315,8 @@ }, "helloworld4": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -1288,6 +1342,8 @@ }, "helloworld1099": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -1313,6 +1369,8 @@ }, "helloworld8HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -1335,6 +1393,8 @@ }, "ServerlessHttpApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AutoDeploy": true, "ApiId": { @@ -1373,6 +1433,8 @@ }, "helloworld3Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -1404,6 +1466,8 @@ }, "helloworld8": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -1429,6 +1493,8 @@ }, "helloworld4HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -1451,6 +1517,8 @@ }, "helloworld6Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -1482,6 +1550,8 @@ }, "helloworld3HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/inline_precedence.json b/tests/translator/output/aws-us-gov/inline_precedence.json index 7d650c33a..4552bce56 100644 --- a/tests/translator/output/aws-us-gov/inline_precedence.json +++ b/tests/translator/output/aws-us-gov/inline_precedence.json @@ -2,6 +2,8 @@ "Resources": { "HelloWorldFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -32,6 +34,8 @@ }, "HelloWorldFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.lambda_handler", "Code": { diff --git a/tests/translator/output/aws-us-gov/intrinsic_functions.json b/tests/translator/output/aws-us-gov/intrinsic_functions.json index fb8bdbe7a..5e0b42fcd 100644 --- a/tests/translator/output/aws-us-gov/intrinsic_functions.json +++ b/tests/translator/output/aws-us-gov/intrinsic_functions.json @@ -32,6 +32,8 @@ "Resources": { "MyExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -52,6 +54,8 @@ }, "MyTable": { "Type": "AWS::DynamoDB::Table", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "KeySchema": [ { @@ -75,10 +79,14 @@ } }, "SnsDlqQueue": { - "Type": "AWS::SNS::Topic" + "Type": "AWS::SNS::Topic", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, "MySqsDlqLambdaFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -109,10 +117,14 @@ } }, "SqsDlqQueue": { - "Type": "AWS::SQS::Queue" + "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, "ApiWithExplicitS3Uri": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -132,6 +144,8 @@ }, "MyExplicitApiDeployment7145dd00ce": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyExplicitApi" @@ -142,6 +156,8 @@ }, "FunctionWithExplicitS3Uri": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "stream.ddb_handler", "Code": { @@ -166,6 +182,8 @@ }, "MySnsDlqLambdaFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -213,6 +231,8 @@ }, "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "TracingConfig": { "Mode": { @@ -272,6 +292,8 @@ }, "FunctionWithExplicitS3UriRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -302,6 +324,8 @@ }, "DynamoDBFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -333,6 +357,8 @@ }, "MySnsDlqLambdaFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -361,6 +387,8 @@ }, "MyNewRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -400,6 +428,8 @@ }, "DynamoDBFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "stream.ddb_handler", "Code": { @@ -423,6 +453,8 @@ }, "ApiWithExplicitS3UridevStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ApiWithExplicitS3UriDeploymenta227798f00" @@ -436,6 +468,8 @@ }, "DynamoDBFunctionMyDDBStream": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BatchSize": 200, "EventSourceArn": { @@ -452,6 +486,8 @@ }, "ApiWithExplicitS3UriDeploymenta227798f00": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ApiWithExplicitS3Uri" @@ -463,6 +499,8 @@ }, "MySqsDlqLambdaFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -513,6 +551,8 @@ }, "MyExplicitApidevStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyExplicitApiDeployment7145dd00ce" @@ -539,6 +579,8 @@ }, "MyFunctionMyApiPermissiondev": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/iot_rule.json b/tests/translator/output/aws-us-gov/iot_rule.json index e648ef60d..3d5cd592e 100644 --- a/tests/translator/output/aws-us-gov/iot_rule.json +++ b/tests/translator/output/aws-us-gov/iot_rule.json @@ -4,6 +4,8 @@ "Resources": { "IoTRuleFuncMyIoTRule": { "Type": "AWS::IoT::TopicRule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "TopicRulePayload": { "AwsIotSqlVersion": "beta", @@ -26,6 +28,8 @@ }, "IoTRuleFuncMyOtherIoTRule": { "Type": "AWS::IoT::TopicRule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "TopicRulePayload": { "Actions": [ @@ -47,6 +51,8 @@ }, "IoTRuleFuncMyIoTRulePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -70,6 +76,8 @@ }, "IoTRuleFuncMyOtherIoTRulePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -93,6 +101,8 @@ }, "IoTRuleFunc": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -119,6 +129,8 @@ }, "IoTRuleFuncRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-us-gov/layers_all_properties.json b/tests/translator/output/aws-us-gov/layers_all_properties.json index 066c5eaab..0040589b1 100644 --- a/tests/translator/output/aws-us-gov/layers_all_properties.json +++ b/tests/translator/output/aws-us-gov/layers_all_properties.json @@ -2,7 +2,7 @@ "Outputs": { "LayerSub": { "Value": { - "Fn::Sub": "${MyLayerd04062b365}" + "Fn::Sub": "${MyLayerf16259d4b8}" } }, "FunctionAtt": { @@ -15,7 +15,7 @@ }, "LayerName": { "Value": { - "Ref": "MyLayerd04062b365" + "Ref": "MyLayerf16259d4b8" } }, "FunctionSub": { @@ -38,10 +38,12 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Layers": [ { - "Ref": "MyLayerd04062b365" + "Ref": "MyLayerf16259d4b8" } ], "Code": { @@ -64,9 +66,10 @@ "Runtime": "python3.6" } }, - "MyLayerd04062b365": { - "DeletionPolicy": "Delete", + "MyLayerf16259d4b8": { "Type": "AWS::Lambda::LayerVersion", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "bucket", @@ -75,9 +78,10 @@ "LayerName": "MyLayer" } }, - "MyLayerWithANamefda8c9ec8c": { - "DeletionPolicy": "Retain", + "MyLayerWithAName0c99fc75b5": { "Type": "AWS::Lambda::LayerVersion", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "bucket", @@ -88,6 +92,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-us-gov/layers_with_intrinsics.json b/tests/translator/output/aws-us-gov/layers_with_intrinsics.json index e7898aa83..0201c2f4a 100644 --- a/tests/translator/output/aws-us-gov/layers_with_intrinsics.json +++ b/tests/translator/output/aws-us-gov/layers_with_intrinsics.json @@ -17,9 +17,10 @@ } }, "Resources": { - "LayerWithNameIntrinsiccf8baed8b9": { - "DeletionPolicy": "Retain", + "LayerWithNameIntrinsic1935b50dbd": { "Type": "AWS::Lambda::LayerVersion", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "sam-demo-bucket", @@ -28,9 +29,10 @@ "LayerName": "SomeLayerName" } }, - "LayerWithRefNameIntrinsicRegionad31c93c8b": { - "DeletionPolicy": "Retain", + "LayerWithRefNameIntrinsicRegionf83cde78fb": { "Type": "AWS::Lambda::LayerVersion", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "sam-demo-bucket", @@ -39,9 +41,10 @@ "LayerName": "us-gov-west-1" } }, - "LayerWithSubNameIntrinsicRegion5b2c74d55e": { - "DeletionPolicy": "Retain", + "LayerWithSubNameIntrinsicRegion53c39f5768": { "Type": "AWS::Lambda::LayerVersion", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "sam-demo-bucket", @@ -52,9 +55,10 @@ } } }, - "LayerWithRuntimesIntrinsic1a006faa85": { - "DeletionPolicy": "Retain", + "LayerWithRuntimesIntrinsic15bceab8a8": { "Type": "AWS::Lambda::LayerVersion", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "sam-demo-bucket", @@ -66,8 +70,7 @@ } } }, - "LayerWithSingleListRefRuntimesIntrinsic9d7a72f24a": { - "DeletionPolicy": "Retain", + "LayerWithSingleListRefRuntimesIntrinsic3243ec999b": { "Properties": { "CompatibleRuntimes": [ { @@ -80,10 +83,11 @@ }, "LayerName": "LayerWithSingleListRefRuntimesIntrinsic" }, - "Type": "AWS::Lambda::LayerVersion" + "Type": "AWS::Lambda::LayerVersion", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, - "LayerWithMixedListRefRuntimesIntrinsic71fd80f592": { - "DeletionPolicy": "Retain", + "LayerWithMixedListRefRuntimesIntrinsicbd637a121f": { "Properties": { "CompatibleRuntimes": [ { @@ -97,11 +101,14 @@ }, "LayerName": "LayerWithMixedListRefRuntimesIntrinsic" }, - "Type": "AWS::Lambda::LayerVersion" + "Type": "AWS::Lambda::LayerVersion", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, - "LayerWithLicenseIntrinsic965c8d0c9b": { - "DeletionPolicy": "Retain", + "LayerWithLicenseIntrinsicf158772ce9": { "Type": "AWS::Lambda::LayerVersion", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "sam-demo-bucket", @@ -111,9 +118,10 @@ "LicenseInfo": "MIT-0 License" } }, - "LayerWithSubNameIntrinsic6e9b477102": { + "LayerWithSubNameIntrinsic8566d42a51": { "Type": "AWS::Lambda::LayerVersion", - "DeletionPolicy": "Retain", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-us-gov/no_implicit_api_with_serverless_rest_api_resource.json b/tests/translator/output/aws-us-gov/no_implicit_api_with_serverless_rest_api_resource.json index 07945dfb6..c0b7b6649 100644 --- a/tests/translator/output/aws-us-gov/no_implicit_api_with_serverless_rest_api_resource.json +++ b/tests/translator/output/aws-us-gov/no_implicit_api_with_serverless_rest_api_resource.json @@ -2,6 +2,8 @@ "Resources": { "GetHtmlFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -25,6 +27,8 @@ }, "GetHtmlFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ThumbnailFunctionImageBucketPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -68,6 +74,8 @@ }, "RestApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -98,6 +106,8 @@ }, "RestApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -121,6 +131,8 @@ }, "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -151,6 +163,8 @@ }, "Images": { "Type": "AWS::S3::Bucket", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "NotificationConfiguration": { "LambdaConfigurations": [ @@ -172,6 +186,8 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.generate_thumbails", "Code": { @@ -195,6 +211,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/s3.json b/tests/translator/output/aws-us-gov/s3.json index 31a839213..4373cbd28 100644 --- a/tests/translator/output/aws-us-gov/s3.json +++ b/tests/translator/output/aws-us-gov/s3.json @@ -2,6 +2,8 @@ "Resources": { "Images": { "Type": "AWS::S3::Bucket", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "DependsOn": ["ThumbnailFunctionImageBucketPermission"], "Properties": { "NotificationConfiguration": { @@ -21,6 +23,8 @@ }, "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -51,6 +55,8 @@ }, "ThumbnailFunctionImageBucketPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -64,6 +70,8 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-us-gov/s3_create_remove.json b/tests/translator/output/aws-us-gov/s3_create_remove.json index ad5819408..cbbaa47db 100644 --- a/tests/translator/output/aws-us-gov/s3_create_remove.json +++ b/tests/translator/output/aws-us-gov/s3_create_remove.json @@ -2,6 +2,8 @@ "Resources": { "Images": { "Type": "AWS::S3::Bucket", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "DependsOn": ["ThumbnailFunctionImageBucketPermission"], "Properties": { "NotificationConfiguration": { @@ -38,6 +40,8 @@ }, "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -68,6 +72,8 @@ }, "ThumbnailFunctionImageBucketPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -81,6 +87,8 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-us-gov/s3_existing_lambda_notification_configuration.json b/tests/translator/output/aws-us-gov/s3_existing_lambda_notification_configuration.json index 31a839213..4373cbd28 100644 --- a/tests/translator/output/aws-us-gov/s3_existing_lambda_notification_configuration.json +++ b/tests/translator/output/aws-us-gov/s3_existing_lambda_notification_configuration.json @@ -2,6 +2,8 @@ "Resources": { "Images": { "Type": "AWS::S3::Bucket", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "DependsOn": ["ThumbnailFunctionImageBucketPermission"], "Properties": { "NotificationConfiguration": { @@ -21,6 +23,8 @@ }, "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -51,6 +55,8 @@ }, "ThumbnailFunctionImageBucketPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -64,6 +70,8 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-us-gov/s3_existing_other_notification_configuration.json b/tests/translator/output/aws-us-gov/s3_existing_other_notification_configuration.json index 341682e52..9f46c809a 100644 --- a/tests/translator/output/aws-us-gov/s3_existing_other_notification_configuration.json +++ b/tests/translator/output/aws-us-gov/s3_existing_other_notification_configuration.json @@ -2,6 +2,8 @@ "Resources": { "Images": { "Type": "AWS::S3::Bucket", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "NotificationConfiguration": { "LambdaConfigurations": [ @@ -29,6 +31,8 @@ }, "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,6 +63,8 @@ }, "ThumbnailFunctionImageBucketPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -72,6 +78,8 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.generate_thumbails", "Code": { diff --git a/tests/translator/output/aws-us-gov/s3_filter.json b/tests/translator/output/aws-us-gov/s3_filter.json index a90f71b88..e41fa17a9 100644 --- a/tests/translator/output/aws-us-gov/s3_filter.json +++ b/tests/translator/output/aws-us-gov/s3_filter.json @@ -2,6 +2,8 @@ "Resources": { "Images": { "Type": "AWS::S3::Bucket", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "DependsOn": ["ThumbnailFunctionImageBucketPermission"], "Properties": { "NotificationConfiguration": { @@ -31,6 +33,8 @@ }, "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -61,6 +65,8 @@ }, "ThumbnailFunctionImageBucketPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -74,6 +80,8 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-us-gov/s3_multiple_events_same_bucket.json b/tests/translator/output/aws-us-gov/s3_multiple_events_same_bucket.json index d947979a1..51a099ccc 100644 --- a/tests/translator/output/aws-us-gov/s3_multiple_events_same_bucket.json +++ b/tests/translator/output/aws-us-gov/s3_multiple_events_same_bucket.json @@ -2,6 +2,8 @@ "Resources": { "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -32,6 +34,8 @@ }, "ThumbnailFunctionImageBucketCreatesPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -45,6 +49,8 @@ }, "Images": { "Type": "AWS::S3::Bucket", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "DependsOn": ["ThumbnailFunctionImageBucketDeletesPermission", "ThumbnailFunctionImageBucketCreatesPermission"], "Properties": { "NotificationConfiguration": { @@ -83,6 +89,8 @@ }, "ThumbnailFunctionImageBucketDeletesPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -96,6 +104,8 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-us-gov/s3_multiple_functions.json b/tests/translator/output/aws-us-gov/s3_multiple_functions.json index fd4591fe1..978bd17e9 100644 --- a/tests/translator/output/aws-us-gov/s3_multiple_functions.json +++ b/tests/translator/output/aws-us-gov/s3_multiple_functions.json @@ -2,6 +2,8 @@ "Resources": { "FunctionOneRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -32,6 +34,8 @@ }, "FunctionTwoImageBucketPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -45,6 +49,8 @@ }, "Images": { "Type": "AWS::S3::Bucket", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "NotificationConfiguration": { "LambdaConfigurations": [ @@ -82,6 +88,8 @@ }, "FunctionTwoRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -112,6 +120,8 @@ }, "FunctionOneImageBucketPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -125,6 +135,8 @@ }, "FunctionTwo": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -148,6 +160,8 @@ }, "FunctionOne": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-us-gov/s3_with_condition.json b/tests/translator/output/aws-us-gov/s3_with_condition.json index 7ec67a04b..bcb2b61c3 100644 --- a/tests/translator/output/aws-us-gov/s3_with_condition.json +++ b/tests/translator/output/aws-us-gov/s3_with_condition.json @@ -10,6 +10,8 @@ "Resources": { "Images": { "Type": "AWS::S3::Bucket", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "NotificationConfiguration": { "LambdaConfigurations": [ @@ -50,6 +52,8 @@ }, "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -81,6 +85,8 @@ }, "ThumbnailFunctionImageBucketPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -95,6 +101,8 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.generate_thumbails", "Code": { diff --git a/tests/translator/output/aws-us-gov/s3_with_dependsOn.json b/tests/translator/output/aws-us-gov/s3_with_dependsOn.json index 5a5b0412b..9896fe0a1 100644 --- a/tests/translator/output/aws-us-gov/s3_with_dependsOn.json +++ b/tests/translator/output/aws-us-gov/s3_with_dependsOn.json @@ -1,10 +1,14 @@ { "Resources": { "Topic": { - "Type": "AWS::SNS::Topic" + "Type": "AWS::SNS::Topic", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, "Images": { "Type": "AWS::S3::Bucket", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "DependsOn": [ "ThumbnailFunctionImageBucketPermission", "Topic" @@ -27,6 +31,8 @@ }, "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -57,6 +63,8 @@ }, "ThumbnailFunctionImageBucketPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -70,6 +78,8 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-us-gov/simple_table_ref_parameter_intrinsic.json b/tests/translator/output/aws-us-gov/simple_table_ref_parameter_intrinsic.json index e9a652d3b..a2d13d330 100644 --- a/tests/translator/output/aws-us-gov/simple_table_ref_parameter_intrinsic.json +++ b/tests/translator/output/aws-us-gov/simple_table_ref_parameter_intrinsic.json @@ -16,6 +16,8 @@ "Resources": { "MinimalTableRefParamLongForm": { "Type": "AWS::DynamoDB::Table", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ProvisionedThroughput": { "WriteCapacityUnits": { diff --git a/tests/translator/output/aws-us-gov/simple_table_with_extra_tags.json b/tests/translator/output/aws-us-gov/simple_table_with_extra_tags.json index a02e088cd..36e580e2f 100644 --- a/tests/translator/output/aws-us-gov/simple_table_with_extra_tags.json +++ b/tests/translator/output/aws-us-gov/simple_table_with_extra_tags.json @@ -8,6 +8,8 @@ "Resources": { "MinimalTableWithTags": { "Type": "AWS::DynamoDB::Table", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BillingMode": "PAY_PER_REQUEST", "AttributeDefinitions": [ diff --git a/tests/translator/output/aws-us-gov/simple_table_with_table_name.json b/tests/translator/output/aws-us-gov/simple_table_with_table_name.json index 57b9ef7a8..d560f80d8 100644 --- a/tests/translator/output/aws-us-gov/simple_table_with_table_name.json +++ b/tests/translator/output/aws-us-gov/simple_table_with_table_name.json @@ -8,6 +8,8 @@ "Resources": { "MinimalTableWithTableName": { "Type": "AWS::DynamoDB::Table", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "TableName": "MySimpleTable", "BillingMode": "PAY_PER_REQUEST", @@ -27,6 +29,8 @@ }, "MinimalTableWithRefTableName": { "Type": "AWS::DynamoDB::Table", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "TableName": { "Ref": "MySimpleTableParameter" @@ -48,6 +52,8 @@ }, "MinimalTableWithSubTableName": { "Type": "AWS::DynamoDB::Table", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "TableName": { "Fn::Sub": "${AWS::StackName}MySimpleTable" diff --git a/tests/translator/output/aws-us-gov/simpletable.json b/tests/translator/output/aws-us-gov/simpletable.json index c59f7a660..f26c9fa8f 100644 --- a/tests/translator/output/aws-us-gov/simpletable.json +++ b/tests/translator/output/aws-us-gov/simpletable.json @@ -2,6 +2,8 @@ "Resources": { "MinimalTable": { "Type": "AWS::DynamoDB::Table", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BillingMode": "PAY_PER_REQUEST", "AttributeDefinitions": [ @@ -20,6 +22,8 @@ }, "CompleteTable": { "Type": "AWS::DynamoDB::Table", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ProvisionedThroughput": { "WriteCapacityUnits": 10, diff --git a/tests/translator/output/aws-us-gov/simpletable_with_sse.json b/tests/translator/output/aws-us-gov/simpletable_with_sse.json index ab4c3d3f5..e160085a5 100644 --- a/tests/translator/output/aws-us-gov/simpletable_with_sse.json +++ b/tests/translator/output/aws-us-gov/simpletable_with_sse.json @@ -2,6 +2,8 @@ "Resources": { "TableWithSSE": { "Type": "AWS::DynamoDB::Table", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BillingMode": "PAY_PER_REQUEST", "SSESpecification": { diff --git a/tests/translator/output/aws-us-gov/sns.json b/tests/translator/output/aws-us-gov/sns.json index 84508ffef..aa8dde0e3 100644 --- a/tests/translator/output/aws-us-gov/sns.json +++ b/tests/translator/output/aws-us-gov/sns.json @@ -1,10 +1,14 @@ { "Resources": { "Notifications": { - "Type": "AWS::SNS::Topic" + "Type": "AWS::SNS::Topic", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, "SaveNotificationFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -35,6 +39,8 @@ }, "SaveNotificationFunctionNotificationTopicPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "sns.amazonaws.com", @@ -48,6 +54,8 @@ }, "SaveNotificationFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -71,6 +79,8 @@ }, "SaveNotificationFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Endpoint": { "Fn::GetAtt": [ diff --git a/tests/translator/output/aws-us-gov/sns_existing_other_subscription.json b/tests/translator/output/aws-us-gov/sns_existing_other_subscription.json index 8eef98beb..fa638cdcd 100644 --- a/tests/translator/output/aws-us-gov/sns_existing_other_subscription.json +++ b/tests/translator/output/aws-us-gov/sns_existing_other_subscription.json @@ -2,6 +2,8 @@ "Resources": { "Notifications": { "Type": "AWS::SNS::Topic", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Subscription": [ { @@ -13,6 +15,8 @@ }, "SaveNotificationFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -43,6 +47,8 @@ }, "SaveNotificationFunctionNotificationTopicPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "sns.amazonaws.com", @@ -56,6 +62,8 @@ }, "SaveNotificationFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -79,6 +87,8 @@ }, "SaveNotificationFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Endpoint": { "Fn::GetAtt": [ diff --git a/tests/translator/output/aws-us-gov/sns_existing_sqs.json b/tests/translator/output/aws-us-gov/sns_existing_sqs.json index 94a123576..127afd45e 100644 --- a/tests/translator/output/aws-us-gov/sns_existing_sqs.json +++ b/tests/translator/output/aws-us-gov/sns_existing_sqs.json @@ -1,13 +1,19 @@ { "Resources": { "Queue": { - "Type": "AWS::SQS::Queue" + "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, "Notifications": { - "Type": "AWS::SNS::Topic" + "Type": "AWS::SNS::Topic", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, "NotificationA": { "Type": "AWS::SQS::QueuePolicy", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Queues": [ { @@ -41,6 +47,8 @@ }, "SaveNotificationFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FilterPolicy": { "price_usd": [ @@ -69,6 +77,8 @@ }, "SaveNotificationFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -100,6 +110,8 @@ }, "SaveNotificationFunctionNotificationTopicEventSourceMapping": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BatchSize": 8, "Enabled": true, @@ -116,6 +128,8 @@ }, "SaveNotificationFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.save_notification", "Code": { diff --git a/tests/translator/output/aws-us-gov/sns_outside_sqs.json b/tests/translator/output/aws-us-gov/sns_outside_sqs.json index 79c5ff389..cc3f70f47 100644 --- a/tests/translator/output/aws-us-gov/sns_outside_sqs.json +++ b/tests/translator/output/aws-us-gov/sns_outside_sqs.json @@ -2,6 +2,8 @@ "Resources": { "NotificationB": { "Type": "AWS::SQS::QueuePolicy", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Queues": [ "https://sqs.us-east-1.amazonaws.com/123456789012/MyQueue" @@ -27,10 +29,14 @@ } }, "Notifications": { - "Type": "AWS::SNS::Topic" + "Type": "AWS::SNS::Topic", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, "SaveNotificationFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FilterPolicy": { "price_usd": [ @@ -54,6 +60,8 @@ }, "SaveNotificationFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -85,6 +93,8 @@ }, "SaveNotificationFunctionNotificationTopicEventSourceMapping": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BatchSize": 8, "Enabled": true, @@ -96,6 +106,8 @@ }, "SaveNotificationFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.save_notification", "Code": { diff --git a/tests/translator/output/aws-us-gov/sns_sqs.json b/tests/translator/output/aws-us-gov/sns_sqs.json index d81d36c86..c98729205 100644 --- a/tests/translator/output/aws-us-gov/sns_sqs.json +++ b/tests/translator/output/aws-us-gov/sns_sqs.json @@ -1,14 +1,20 @@ { "Resources": { "Notifications": { - "Type": "AWS::SNS::Topic" + "Type": "AWS::SNS::Topic", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, "SaveNotificationFunctionNotificationTopicQueue": { "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": {} }, "SaveNotificationFunctionNotificationTopicQueuePolicy": { "Type": "AWS::SQS::QueuePolicy", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Queues": [ { @@ -42,6 +48,8 @@ }, "SaveNotificationFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FilterPolicy": { "price_usd": [ @@ -70,6 +78,8 @@ }, "SaveNotificationFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -101,6 +111,8 @@ }, "SaveNotificationFunctionNotificationTopicEventSourceMapping": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BatchSize": 10, "Enabled": true, @@ -117,6 +129,8 @@ }, "SaveNotificationFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.save_notification", "Code": { diff --git a/tests/translator/output/aws-us-gov/sns_topic_outside_template.json b/tests/translator/output/aws-us-gov/sns_topic_outside_template.json index e91b956cf..aebe525ba 100644 --- a/tests/translator/output/aws-us-gov/sns_topic_outside_template.json +++ b/tests/translator/output/aws-us-gov/sns_topic_outside_template.json @@ -7,6 +7,8 @@ "Resources": { "SaveNotificationFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Endpoint": { "Fn::GetAtt": [ @@ -22,6 +24,8 @@ }, "SaveNotificationFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -52,6 +56,8 @@ }, "SaveNotificationFunctionNotificationTopicPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "sns.amazonaws.com", @@ -65,6 +71,8 @@ }, "SaveNotificationFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/function_with_condition.json b/tests/translator/output/function_with_condition.json index 25e902d7b..e45c0b63d 100644 --- a/tests/translator/output/function_with_condition.json +++ b/tests/translator/output/function_with_condition.json @@ -10,6 +10,8 @@ "Resources": { "ConditionFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -34,6 +36,8 @@ }, "ConditionFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/function_with_conditional_managed_policy.json b/tests/translator/output/function_with_conditional_managed_policy.json index db41f277c..363ba4065 100644 --- a/tests/translator/output/function_with_conditional_managed_policy.json +++ b/tests/translator/output/function_with_conditional_managed_policy.json @@ -10,6 +10,8 @@ "Resources": { "FunctionWithConditionalPolicy": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -34,6 +36,8 @@ }, "FunctionWithConditionalPolicyRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", diff --git a/tests/translator/output/function_with_conditional_managed_policy_and_ref_no_value.json b/tests/translator/output/function_with_conditional_managed_policy_and_ref_no_value.json index 2d64091de..7eab40e6d 100644 --- a/tests/translator/output/function_with_conditional_managed_policy_and_ref_no_value.json +++ b/tests/translator/output/function_with_conditional_managed_policy_and_ref_no_value.json @@ -10,6 +10,8 @@ "Resources": { "FunctionWithConditionalPolicy": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -34,6 +36,8 @@ }, "FunctionWithConditionalPolicyRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", diff --git a/tests/translator/output/function_with_conditional_policy_template.json b/tests/translator/output/function_with_conditional_policy_template.json index 9bcd6123e..0fd638d27 100644 --- a/tests/translator/output/function_with_conditional_policy_template.json +++ b/tests/translator/output/function_with_conditional_policy_template.json @@ -10,6 +10,8 @@ "Resources": { "FunctionWithConditionalPolicy": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -34,6 +36,8 @@ }, "FunctionWithConditionalPolicyRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/function_with_conditional_policy_template_and_ref_no_value.json b/tests/translator/output/function_with_conditional_policy_template_and_ref_no_value.json index 40262859a..2269fa60c 100644 --- a/tests/translator/output/function_with_conditional_policy_template_and_ref_no_value.json +++ b/tests/translator/output/function_with_conditional_policy_template_and_ref_no_value.json @@ -10,6 +10,8 @@ "Resources": { "FunctionWithConditionalPolicy": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -34,6 +36,8 @@ }, "FunctionWithConditionalPolicyRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/function_with_custom_codedeploy_deployment_preference.json b/tests/translator/output/function_with_custom_codedeploy_deployment_preference.json index 7f9d9822d..d16d6de97 100644 --- a/tests/translator/output/function_with_custom_codedeploy_deployment_preference.json +++ b/tests/translator/output/function_with_custom_codedeploy_deployment_preference.json @@ -34,6 +34,8 @@ "Resources": { "NormalWithRefAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -58,8 +60,9 @@ } }, "CustomWithFindInMapVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "CustomWithFindInMap" @@ -108,6 +111,8 @@ }, "CustomWithFindInMapAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -133,6 +138,8 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -156,6 +163,8 @@ }, "CustomWithSubAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -181,6 +190,8 @@ }, "NormalWithSub": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -203,8 +214,9 @@ } }, "CustomWithConditionVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "CustomWithCondition" @@ -241,8 +253,9 @@ } }, "CustomWithCondition2Version640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "CustomWithCondition2" @@ -251,6 +264,8 @@ }, "CustomWithCondition": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -274,6 +289,8 @@ }, "CustomWithSub": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -302,8 +319,9 @@ } }, "NormalWithRefVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "NormalWithRef" @@ -404,6 +422,8 @@ }, "NormalWithSubAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -428,8 +448,9 @@ } }, "CustomWithSubVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "CustomWithSub" @@ -438,6 +459,8 @@ }, "CustomWithSubRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -468,6 +491,8 @@ }, "CustomWithConditionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -538,6 +563,8 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -568,6 +595,8 @@ }, "CustomWithFindInMap": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -590,8 +619,9 @@ } }, "NormalWithSubVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "NormalWithSub" @@ -600,6 +630,8 @@ }, "CustomWithConditionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -625,6 +657,8 @@ }, "CustomWithFindInMapRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -655,6 +689,8 @@ }, "NormalWithRef": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -678,6 +714,8 @@ }, "CustomWithCondition2": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -728,6 +766,8 @@ }, "NormalWithRefRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -758,6 +798,8 @@ }, "CustomWithCondition2Aliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -783,6 +825,8 @@ }, "NormalWithSubRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -812,8 +856,9 @@ } }, "MinimalFunctionVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -849,6 +894,8 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -874,6 +921,8 @@ }, "CustomWithCondition2Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/function_with_custom_conditional_codedeploy_deployment_preference.json b/tests/translator/output/function_with_custom_conditional_codedeploy_deployment_preference.json index 26a20afde..235df1598 100644 --- a/tests/translator/output/function_with_custom_conditional_codedeploy_deployment_preference.json +++ b/tests/translator/output/function_with_custom_conditional_codedeploy_deployment_preference.json @@ -33,6 +33,8 @@ }, "HelloWorldFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -139,8 +141,9 @@ } }, "HelloWorldFunctionVersionfb53d5c2e6": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "HelloWorldFunction" @@ -149,6 +152,8 @@ }, "HelloWorldFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -174,6 +179,8 @@ }, "HelloWorldFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { diff --git a/tests/translator/output/function_with_deployment_and_custom_role.json b/tests/translator/output/function_with_deployment_and_custom_role.json index 8ec847d9d..c73dae738 100644 --- a/tests/translator/output/function_with_deployment_and_custom_role.json +++ b/tests/translator/output/function_with_deployment_and_custom_role.json @@ -2,6 +2,8 @@ "Resources": { "FunctionWithRole": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -25,6 +27,8 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -48,6 +52,8 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -78,6 +84,8 @@ }, "DeploymentRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSCodeDeployRole" @@ -101,8 +109,9 @@ } }, "FunctionWithRoleVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "FunctionWithRole" @@ -208,8 +217,9 @@ } }, "MinimalFunctionVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -218,6 +228,8 @@ }, "FunctionWithRoleAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -243,6 +255,8 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { diff --git a/tests/translator/output/function_with_deployment_no_service_role.json b/tests/translator/output/function_with_deployment_no_service_role.json index ef9ed4aa6..ef4d06a29 100644 --- a/tests/translator/output/function_with_deployment_no_service_role.json +++ b/tests/translator/output/function_with_deployment_no_service_role.json @@ -33,6 +33,8 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -56,6 +58,8 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -85,8 +89,9 @@ } }, "OtherFunctionVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "OtherFunction" @@ -95,6 +100,8 @@ }, "OtherFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -125,6 +132,8 @@ }, "DeploymentRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSCodeDeployRole" @@ -185,8 +194,9 @@ } }, "MinimalFunctionVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -195,6 +205,8 @@ }, "OtherFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -218,6 +230,8 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -243,6 +257,8 @@ }, "OtherFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { diff --git a/tests/translator/output/function_with_deployment_preference.json b/tests/translator/output/function_with_deployment_preference.json index e428000af..37301ac75 100644 --- a/tests/translator/output/function_with_deployment_preference.json +++ b/tests/translator/output/function_with_deployment_preference.json @@ -63,6 +63,8 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -93,6 +95,8 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -145,8 +149,9 @@ } }, "MinimalFunctionVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -155,6 +160,8 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { diff --git a/tests/translator/output/function_with_deployment_preference_alarms_intrinsic_if.json b/tests/translator/output/function_with_deployment_preference_alarms_intrinsic_if.json index 72643d9ca..4d89d7a17 100644 --- a/tests/translator/output/function_with_deployment_preference_alarms_intrinsic_if.json +++ b/tests/translator/output/function_with_deployment_preference_alarms_intrinsic_if.json @@ -10,6 +10,8 @@ "Resources": { "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -33,7 +35,8 @@ }, "MinimalFunctionVersion640128d35d": { "Type": "AWS::Lambda::Version", - "DeletionPolicy": "Retain", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -42,6 +45,8 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -67,6 +72,8 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", diff --git a/tests/translator/output/function_with_deployment_preference_all_parameters.json b/tests/translator/output/function_with_deployment_preference_all_parameters.json index aff72299c..23c025e87 100644 --- a/tests/translator/output/function_with_deployment_preference_all_parameters.json +++ b/tests/translator/output/function_with_deployment_preference_all_parameters.json @@ -2,6 +2,8 @@ "Resources": { "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -25,6 +27,8 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "MySanityTestFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -85,6 +91,8 @@ }, "MyCloudWatchAlarm": { "Type": "AWS::CloudWatch::Alarm", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EvaluationPeriods": 1, "Namespace": "AWS/EC2", @@ -152,6 +160,8 @@ }, "MySanityTestFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "my-bucket", @@ -204,8 +214,9 @@ } }, "MinimalFunctionVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -214,6 +225,8 @@ }, "MyValidationTestFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "my-bucket", @@ -237,6 +250,8 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -268,6 +283,8 @@ }, "MyValidationTestFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -297,7 +314,9 @@ } }, "MySNSTopic": { - "Type": "AWS::SNS::Topic" + "Type": "AWS::SNS::Topic", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" } } } \ No newline at end of file diff --git a/tests/translator/output/function_with_deployment_preference_from_parameters.json b/tests/translator/output/function_with_deployment_preference_from_parameters.json index bba04a56a..011506b06 100644 --- a/tests/translator/output/function_with_deployment_preference_from_parameters.json +++ b/tests/translator/output/function_with_deployment_preference_from_parameters.json @@ -16,6 +16,8 @@ "Resources": { "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -39,6 +41,8 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -69,6 +73,8 @@ }, "MySanityTestFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -99,6 +105,8 @@ }, "MyCloudWatchAlarm": { "Type": "AWS::CloudWatch::Alarm", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EvaluationPeriods": 1, "Namespace": "AWS/EC2", @@ -166,6 +174,8 @@ }, "MySanityTestFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "my-bucket", @@ -218,8 +228,9 @@ } }, "MinimalFunctionVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -228,6 +239,8 @@ }, "MyValidationTestFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "my-bucket", @@ -251,6 +264,8 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -282,6 +297,8 @@ }, "MyValidationTestFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -311,7 +328,9 @@ } }, "MySNSTopic": { - "Type": "AWS::SNS::Topic" + "Type": "AWS::SNS::Topic", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" } } } \ No newline at end of file diff --git a/tests/translator/output/function_with_deployment_preference_multiple_combinations.json b/tests/translator/output/function_with_deployment_preference_multiple_combinations.json index 2ac095373..9d651086b 100644 --- a/tests/translator/output/function_with_deployment_preference_multiple_combinations.json +++ b/tests/translator/output/function_with_deployment_preference_multiple_combinations.json @@ -2,6 +2,8 @@ "Resources": { "MinimalFunctionWithDeploymentPreferenceWithHooksAndAlarms": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -25,6 +27,8 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -78,6 +84,8 @@ }, "MinimalFunctionWithMinimalDeploymentPreferenceRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -108,6 +116,8 @@ }, "MyCloudWatchAlarm": { "Type": "AWS::CloudWatch::Alarm", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EvaluationPeriods": 1, "Namespace": "AWS/EC2", @@ -119,6 +129,8 @@ }, "MinimalFunctionWithMinimalDeploymentPreferenceAliaslivewithdeployment": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -187,8 +199,9 @@ } }, "MinimalFunctionWithMinimalDeploymentPreferenceVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunctionWithMinimalDeploymentPreference" @@ -197,6 +210,8 @@ }, "MinimalFunctionWithDeploymentPreferenceWithHooksAndAlarmsRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -227,6 +242,8 @@ }, "MySanityTestFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -257,6 +274,8 @@ }, "MinimalFunctionWithMinimalDeploymentPreference": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -280,6 +299,8 @@ }, "MySanityTestFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "my-bucket", @@ -302,8 +323,9 @@ } }, "MinimalFunctionWithDeploymentPreferenceWithHooksAndAlarmsVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunctionWithDeploymentPreferenceWithHooksAndAlarms" @@ -375,8 +397,9 @@ } }, "MinimalFunctionVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -385,6 +408,8 @@ }, "MyValidationTestFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -415,6 +440,8 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -430,6 +457,8 @@ }, "MinimalFunctionWithDeploymentPreferenceWithHooksAndAlarmsAliaslivewithdeploymentwithhooksandalarms": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -461,6 +490,8 @@ }, "MyValidationTestFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "my-bucket", diff --git a/tests/translator/output/function_with_disabled_deployment_preference.json b/tests/translator/output/function_with_disabled_deployment_preference.json index 47834b6e8..f44ad3652 100644 --- a/tests/translator/output/function_with_disabled_deployment_preference.json +++ b/tests/translator/output/function_with_disabled_deployment_preference.json @@ -1,8 +1,9 @@ { "Resources": { "MinimalFunctionVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -11,6 +12,8 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -26,6 +29,8 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -49,6 +54,8 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/function_with_dlq.json b/tests/translator/output/function_with_dlq.json index 599656cd9..233830d44 100644 --- a/tests/translator/output/function_with_dlq.json +++ b/tests/translator/output/function_with_dlq.json @@ -2,6 +2,8 @@ "Resources": { "MySnsDlqLambdaFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -47,6 +49,8 @@ }, "MySqsDlqLambdaFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -92,6 +96,8 @@ }, "MySqsDlqLambdaFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -118,6 +124,8 @@ }, "MySnsDlqLambdaFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/function_with_event_dest.json b/tests/translator/output/function_with_event_dest.json index f75a3bfa3..cc1fb8ec9 100644 --- a/tests/translator/output/function_with_event_dest.json +++ b/tests/translator/output/function_with_event_dest.json @@ -49,6 +49,8 @@ "Resources": { "MyTestFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -124,11 +126,15 @@ }, "MyTestFunctionEventInvokeConfigOnSuccessQueue": { "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": {}, "Condition": "NOTQueueCreationDisabled2da03e5b6f" }, "SNSSubscription": { "Type": "AWS::SNS::Subscription", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Endpoint": "example@example.com", "Protocol": "email", @@ -140,6 +146,8 @@ }, "MyTestFunctionEventInvokeConfig": { "Type": "AWS::Lambda::EventInvokeConfig", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "MaximumEventAgeInSeconds": 70, "MaximumRetryAttempts": 1, @@ -178,6 +186,8 @@ }, "MyTestFunction2Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -239,6 +249,8 @@ }, "DestinationLambda": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async (event) => {\n const response = {\n statusCode: 200,\n body: JSON.stringify('Hello from Lambda!'),\n };\n return response;\n};\n" @@ -262,6 +274,8 @@ }, "MyTestFunction2EventInvokeConfig": { "Type": "AWS::Lambda::EventInvokeConfig", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "MaximumEventAgeInSeconds": 70, "MaximumRetryAttempts": 1, @@ -286,6 +300,8 @@ }, "DestinationLambdaRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -316,6 +332,8 @@ }, "MyTestFunction2": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = function(event, context, callback) {\n var event_received_at = new Date().toISOString();\n console.log('Event received at: ' + event_received_at);\n console.log('Received event:', JSON.stringify(event, null, 2));\n\n if (event.Success) {\n console.log(\"Success\");\n context.callbackWaitsForEmptyEventLoop = false;\n callback(null);\n } else {\n console.log(\"Failure\");\n context.callbackWaitsForEmptyEventLoop = false;\n callback(new Error(\"Failure from event, Success = false, I am failing!\"), 'Destination Function Error Thrown');\n }\n}; \n" @@ -339,6 +357,8 @@ }, "MyTestFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = function(event, context, callback) {\n var event_received_at = new Date().toISOString();\n console.log('Event received at: ' + event_received_at);\n console.log('Received event:', JSON.stringify(event, null, 2));\n\n if (event.Success) {\n console.log(\"Success\");\n context.callbackWaitsForEmptyEventLoop = false;\n callback(null);\n } else {\n console.log(\"Failure\");\n context.callbackWaitsForEmptyEventLoop = false;\n callback(new Error(\"Failure from event, Success = false, I am failing!\"), 'Destination Function Error Thrown');\n }\n}; \n" @@ -362,6 +382,8 @@ }, "MyTestFunctionEventInvokeConfigOnFailureTopic": { "Type": "AWS::SNS::Topic", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": {}, "Condition": "TopicCreationEnabled" } diff --git a/tests/translator/output/function_with_event_dest_basic.json b/tests/translator/output/function_with_event_dest_basic.json index e845f151f..881e7e457 100644 --- a/tests/translator/output/function_with_event_dest_basic.json +++ b/tests/translator/output/function_with_event_dest_basic.json @@ -8,10 +8,14 @@ "Resources": { "MyTestFunctionEventInvokeConfigOnSuccessQueue": { "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": {} }, "MyTestFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -73,6 +77,8 @@ }, "MyTestFunctionEventInvokeConfig": { "Type": "AWS::Lambda::EventInvokeConfig", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "MaximumEventAgeInSeconds": 70, "MaximumRetryAttempts": 1, @@ -100,6 +106,8 @@ }, "MyTestFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = function(event, context, callback) {\n var event_received_at = new Date().toISOString();\n console.log('Event received at: ' + event_received_at);\n console.log('Received event:', JSON.stringify(event, null, 2));\n\n if (event.Success) {\n console.log(\"Success\");\n context.callbackWaitsForEmptyEventLoop = false;\n callback(null);\n } else {\n console.log(\"Failure\");\n context.callbackWaitsForEmptyEventLoop = false;\n callback(new Error(\"Failure from event, Success = false, I am failing!\"), 'Destination Function Error Thrown');\n }\n}; \n" @@ -123,6 +131,8 @@ }, "MyTestFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -137,8 +147,9 @@ } }, "MyTestFunctionVersiondaf9da458d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MyTestFunction" diff --git a/tests/translator/output/function_with_event_dest_conditional.json b/tests/translator/output/function_with_event_dest_conditional.json index 8706ccf9f..b778deb18 100644 --- a/tests/translator/output/function_with_event_dest_conditional.json +++ b/tests/translator/output/function_with_event_dest_conditional.json @@ -59,6 +59,8 @@ "Resources": { "DestinationLambdaRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -90,11 +92,15 @@ }, "MyTestFunctionEventInvokeConfigOnSuccessQueue": { "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": {}, "Condition": "FunctionConditionANDNOTQueueCreationDisabled2da03e5b6fe547d4e2d6" }, "MyTestFunctionEventInvokeConfig": { "Type": "AWS::Lambda::EventInvokeConfig", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "MaximumEventAgeInSeconds": 70, "MaximumRetryAttempts": 1, @@ -137,6 +143,8 @@ }, "MyTestFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = function(event, context, callback) {\n var event_received_at = new Date().toISOString();\n console.log('Event received at: ' + event_received_at);\n console.log('Received event:', JSON.stringify(event, null, 2));\n\n if (event.Success) {\n console.log(\"Success\");\n context.callbackWaitsForEmptyEventLoop = false;\n callback(null);\n } else {\n console.log(\"Failure\");\n context.callbackWaitsForEmptyEventLoop = false;\n callback(new Error(\"Failure from event, Success = false, I am failing!\"), 'Destination Function Error Thrown');\n }\n}; \n" @@ -161,6 +169,8 @@ }, "DestinationLambda": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async (event) => {\n const response = {\n statusCode: 200,\n body: JSON.stringify('Hello from Lambda!'),\n };\n return response;\n};\n" @@ -185,6 +195,8 @@ }, "MyTestFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", diff --git a/tests/translator/output/function_with_event_source_mapping.json b/tests/translator/output/function_with_event_source_mapping.json index 2a2f668ef..3888a5f28 100644 --- a/tests/translator/output/function_with_event_source_mapping.json +++ b/tests/translator/output/function_with_event_source_mapping.json @@ -9,13 +9,19 @@ }, "Resources": { "MySqsQueue": { - "Type": "AWS::SQS::Queue" + "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, "MySnsTopic": { - "Type": "AWS::SNS::Topic" + "Type": "AWS::SNS::Topic", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, "MyFunctionForBatchingExampleStream": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "MaximumBatchingWindowInSeconds": 20, "EventSourceArn": { @@ -32,6 +38,8 @@ }, "DynamoDBTable": { "Type": "AWS::DynamoDB::Table", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "KeySchema": [ { @@ -56,6 +64,8 @@ }, "MyFunctionForBatchingExampleRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -147,12 +157,16 @@ }, "KinesisStream1": { "Type": "AWS::Kinesis::Stream", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ShardCount": 1 } }, "MyFunctionForBatchingExampleDynamoDBStreamEvent": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "MaximumBatchingWindowInSeconds": { "Ref": "MyBatchingWindowParam" @@ -188,6 +202,8 @@ }, "MyFunctionForBatchingExample": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -210,6 +226,8 @@ }, "MyFunctionForBatchingExampleStreamEvent": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "MaximumBatchingWindowInSeconds": { "Ref": "MyBatchingWindowParam" @@ -235,6 +253,8 @@ }, "KinesisStream": { "Type": "AWS::Kinesis::Stream", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ShardCount": 1 } diff --git a/tests/translator/output/function_with_file_system_config.json b/tests/translator/output/function_with_file_system_config.json index b9bbcccdc..bc614a6bd 100644 --- a/tests/translator/output/function_with_file_system_config.json +++ b/tests/translator/output/function_with_file_system_config.json @@ -1,10 +1,14 @@ { "Resources": { "EfsFileSystem": { - "Type": "AWS::EFS::FileSystem" + "Type": "AWS::EFS::FileSystem", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, "LambdaFunctionWithEfs": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "const fs = require('fs')\nconst path = require('path')\nconst efsMountPath = '/mnt/efs'\n\nexports.handler = async (event, context, callback) => {\nconst directory = path.join(efsMountPath, event.body)\nconst files = fs.readdirSync(directory)\nreturn files\n}\n" @@ -48,6 +52,8 @@ }, "MountTarget": { "Type": "AWS::EFS::MountTarget", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "SubnetId": "subnet-abc123", "FileSystemId": { @@ -60,6 +66,8 @@ }, "LambdaFunctionWithEfsRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -91,6 +99,8 @@ }, "AccessPoint": { "Type": "AWS::EFS::AccessPoint", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FileSystemId": { "Ref": "EfsFileSystem" diff --git a/tests/translator/output/function_with_global_layers.json b/tests/translator/output/function_with_global_layers.json index b40dcd644..e7cd04986 100644 --- a/tests/translator/output/function_with_global_layers.json +++ b/tests/translator/output/function_with_global_layers.json @@ -2,6 +2,8 @@ "Resources": { "ManyLayersFuncRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -32,6 +34,8 @@ }, "ManyLayersFunc": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/function_with_kmskeyarn.json b/tests/translator/output/function_with_kmskeyarn.json index ef7a69f6c..6fafaf5ed 100644 --- a/tests/translator/output/function_with_kmskeyarn.json +++ b/tests/translator/output/function_with_kmskeyarn.json @@ -2,6 +2,8 @@ "Resources": { "FunctionWithKeyArnRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -32,6 +34,8 @@ }, "FunctionWithReferenceToKeyArnRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -62,6 +66,8 @@ }, "FunctionWithKeyArn": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -86,6 +92,8 @@ }, "myKey": { "Type": "AWS::KMS::Key", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "KeyPolicy": { "Version": "2012-10-17", @@ -109,6 +117,8 @@ }, "FunctionWithReferenceToKeyArn": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/function_with_layers.json b/tests/translator/output/function_with_layers.json index 9d660ef49..0cbb0da86 100644 --- a/tests/translator/output/function_with_layers.json +++ b/tests/translator/output/function_with_layers.json @@ -2,6 +2,8 @@ "Resources": { "MinimalLayerFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Layers": [ "arn:aws:lambda:us-east-1:123456789101:layer:CorpXLayer:1" @@ -26,9 +28,10 @@ "Runtime": "python2.7" } }, - "MyLayera5167acaba": { - "DeletionPolicy": "Retain", + "MyLayer43a7918434": { "Type": "AWS::Lambda::LayerVersion", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "sam-demo-bucket", @@ -39,10 +42,12 @@ }, "FunctionReferencesLayer": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Layers": [ { - "Ref": "MyLayera5167acaba" + "Ref": "MyLayer43a7918434" } ], "Code": { @@ -67,6 +72,8 @@ }, "MinimalLayerFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -97,6 +104,8 @@ }, "FunctionReferencesLayerRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -127,6 +136,8 @@ }, "FunctionLayerWithSubIntrinsic": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Layers": [ { @@ -158,6 +169,8 @@ }, "FunctionNoLayerVersion": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Layers": [ "arn:aws:lambda:us-east-1:123456789101:layer:CorpXLayer:1" @@ -184,6 +197,8 @@ }, "FunctionNoLayerVersionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -214,6 +229,8 @@ }, "FunctionLayerWithSubIntrinsicRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/function_with_many_layers.json b/tests/translator/output/function_with_many_layers.json index 96e64d886..a6a5f5108 100644 --- a/tests/translator/output/function_with_many_layers.json +++ b/tests/translator/output/function_with_many_layers.json @@ -1,8 +1,9 @@ { "Resources": { - "MyLayera5167acaba": { - "DeletionPolicy": "Retain", + "MyLayer43a7918434": { "Type": "AWS::Lambda::LayerVersion", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "sam-demo-bucket", @@ -13,6 +14,8 @@ }, "ManyLayersFuncRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -43,6 +46,8 @@ }, "ManyLayersFunc": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Layers": [ "arn:aws:lambda:us-east-1:123456789101:layer:z:1", @@ -54,7 +59,7 @@ "Fn::Sub": "arn:${AWS::Partition}:lambda:${AWS::Region}:123456789101:layer:c:1" }, { - "Ref": "MyLayera5167acaba" + "Ref": "MyLayer43a7918434" } ], "Code": { diff --git a/tests/translator/output/function_with_permissions_boundary.json b/tests/translator/output/function_with_permissions_boundary.json index 9e77b8781..26e07ca22 100644 --- a/tests/translator/output/function_with_permissions_boundary.json +++ b/tests/translator/output/function_with_permissions_boundary.json @@ -2,6 +2,8 @@ "Resources": { "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -33,6 +35,8 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { diff --git a/tests/translator/output/function_with_policy_templates.json b/tests/translator/output/function_with_policy_templates.json index 05c9057cb..4344de856 100644 --- a/tests/translator/output/function_with_policy_templates.json +++ b/tests/translator/output/function_with_policy_templates.json @@ -7,6 +7,8 @@ "Resources": { "OnePolicyTemplate": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -30,6 +32,8 @@ }, "MultiplePolicyTemplates": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -53,6 +57,8 @@ }, "OnePolicyTemplateRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -118,6 +124,8 @@ }, "MultiplePolicyTemplatesRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -197,6 +205,8 @@ }, "AllCombinations": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -220,6 +230,8 @@ }, "AllCombinationsRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaRole", diff --git a/tests/translator/output/function_with_request_parameters.json b/tests/translator/output/function_with_request_parameters.json index 940a79710..35a38f2e5 100644 --- a/tests/translator/output/function_with_request_parameters.json +++ b/tests/translator/output/function_with_request_parameters.json @@ -2,6 +2,8 @@ "Resources": { "ApiParameterFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "NoApiParameterFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ServerlessRestApiDeployment104b236830": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -65,6 +71,8 @@ }, "ApiParameterFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -95,6 +103,8 @@ }, "NoApiParameterFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -116,6 +126,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment104b236830" @@ -128,6 +140,8 @@ }, "Api": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -167,6 +181,8 @@ }, "ApiParameterFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -186,6 +202,8 @@ }, "ApiDeploymentb45131471b": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "Api" @@ -196,6 +214,8 @@ }, "ApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ApiDeploymentb45131471b" @@ -208,6 +228,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -256,6 +278,8 @@ }, "NoApiParameterFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { diff --git a/tests/translator/output/function_with_resource_refs.json b/tests/translator/output/function_with_resource_refs.json index d331af50a..23091b0de 100644 --- a/tests/translator/output/function_with_resource_refs.json +++ b/tests/translator/output/function_with_resource_refs.json @@ -53,6 +53,8 @@ "Resources": { "FunctionWithoutAlias": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -76,6 +78,8 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -106,6 +110,8 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -129,6 +135,8 @@ }, "FunctionWithoutAliasRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -158,8 +166,9 @@ } }, "MinimalFunctionVersion640128d35d": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -168,6 +177,8 @@ }, "MyBucket": { "Type": "AWS::S3::Bucket", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Name": { "Fn::GetAtt": [ @@ -179,6 +190,8 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ diff --git a/tests/translator/output/function_with_signing_profile.json b/tests/translator/output/function_with_signing_profile.json index 1b878970d..8e933689e 100644 --- a/tests/translator/output/function_with_signing_profile.json +++ b/tests/translator/output/function_with_signing_profile.json @@ -2,6 +2,8 @@ "Resources": { "FunctionWithSigningProfile": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -28,6 +30,8 @@ }, "FunctionWithSigningProfileRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -58,6 +62,8 @@ }, "MySignedFunctionCodeSigningConfig": { "Type": "AWS::Lambda::CodeSigningConfig", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "CodeSigningPolicies": { "UntrustedArtifactOnDeployment": "Enforce" @@ -77,6 +83,8 @@ }, "SigningProfile": { "Type": "AWS::Signer::SigningProfile", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "PlatformId": "AWSLambda-SHA384-ECDSA" } diff --git a/tests/translator/output/function_with_sns_event_source_all_parameters.json b/tests/translator/output/function_with_sns_event_source_all_parameters.json index e999e3eb8..30ff3d554 100644 --- a/tests/translator/output/function_with_sns_event_source_all_parameters.json +++ b/tests/translator/output/function_with_sns_event_source_all_parameters.json @@ -2,6 +2,8 @@ "Resources": { "MyAwesomeFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FilterPolicy": { "store": [ @@ -39,6 +41,8 @@ }, "MyAwesomeFunctionNotificationTopicPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "sns.amazonaws.com", @@ -50,6 +54,8 @@ }, "MyAwesomeFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -80,6 +86,8 @@ }, "MyAwesomeFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/global_handle_path_level_parameter.json b/tests/translator/output/global_handle_path_level_parameter.json index 64abf7bd2..ca499417a 100644 --- a/tests/translator/output/global_handle_path_level_parameter.json +++ b/tests/translator/output/global_handle_path_level_parameter.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -117,6 +123,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -134,6 +142,8 @@ }, "ServerlessRestApiDeploymentdb4b9da82a": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -144,6 +154,8 @@ }, "ExplicitApiSomeStageStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -161,6 +173,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -182,6 +196,8 @@ }, "MyUserPool": { "Type": "AWS::Cognito::UserPool", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "UsernameAttributes": [ "email" @@ -203,6 +219,8 @@ }, "ExplicitApiDeployment9a254aa466": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -213,6 +231,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/globals_for_api.json b/tests/translator/output/globals_for_api.json index 6cb00f73f..99aaeb1de 100644 --- a/tests/translator/output/globals_for_api.json +++ b/tests/translator/output/globals_for_api.json @@ -2,6 +2,8 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -25,6 +27,8 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ServerlessRestApiDeploymentaa32438b68": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -65,6 +71,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -126,6 +134,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -143,6 +153,8 @@ }, "ExplicitApiSomeStageStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -160,6 +172,8 @@ }, "ExplicitApiDeployment43e01e673d": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -170,6 +184,8 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -191,6 +207,8 @@ }, "MyUserPool": { "Type": "AWS::Cognito::UserPool", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "UsernameAttributes": [ "email" @@ -212,6 +230,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/globals_for_function.json b/tests/translator/output/globals_for_function.json index 6174a06d0..e21ebedb9 100644 --- a/tests/translator/output/globals_for_function.json +++ b/tests/translator/output/globals_for_function.json @@ -2,6 +2,8 @@ "Resources": { "FunctionWithOverridesRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -43,6 +45,8 @@ }, "FunctionWithOverrides": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Layers": [ { @@ -104,6 +108,8 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -141,6 +147,8 @@ }, "FunctionWithOverridesAliasprod": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -156,6 +164,8 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Layers": [ { @@ -208,6 +218,8 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -222,8 +234,9 @@ } }, "FunctionWithOverridesVersion096ed3b52b": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "FunctionWithOverrides" @@ -231,8 +244,9 @@ } }, "MinimalFunctionVersion0a06fc8fb1": { - "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" diff --git a/tests/translator/output/globals_for_simpletable.json b/tests/translator/output/globals_for_simpletable.json index 313fd286c..841d324a4 100644 --- a/tests/translator/output/globals_for_simpletable.json +++ b/tests/translator/output/globals_for_simpletable.json @@ -2,6 +2,8 @@ "Resources": { "MinimalTable": { "Type": "AWS::DynamoDB::Table", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BillingMode": "PAY_PER_REQUEST", "SSESpecification": { diff --git a/tests/translator/output/http_api_def_uri.json b/tests/translator/output/http_api_def_uri.json index fd5dedd14..84b1639f3 100644 --- a/tests/translator/output/http_api_def_uri.json +++ b/tests/translator/output/http_api_def_uri.json @@ -2,6 +2,8 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -25,6 +27,8 @@ }, "FunctionApiPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -44,6 +48,8 @@ }, "MyApiStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AutoDeploy": true, "ApiId": { @@ -66,6 +72,8 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -96,6 +104,8 @@ }, "MyApi2ApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AutoDeploy": true, "ApiId": { @@ -109,6 +119,8 @@ }, "MyApi2": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BodyS3Location": { "Version": "version", @@ -119,6 +131,8 @@ }, "FunctionApi2Permission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -140,6 +154,8 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BodyS3Location": { "Bucket": "bucket", diff --git a/tests/translator/output/http_api_description.json b/tests/translator/output/http_api_description.json index fed22b685..700b9d871 100644 --- a/tests/translator/output/http_api_description.json +++ b/tests/translator/output/http_api_description.json @@ -2,6 +2,8 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -25,6 +27,8 @@ }, "FunctionApiPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -44,6 +48,8 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -74,6 +80,8 @@ }, "HttpApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AutoDeploy": true, "ApiId": { @@ -87,6 +95,8 @@ }, "HttpApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "openapi": "3.0.1", diff --git a/tests/translator/output/http_api_existing_openapi.json b/tests/translator/output/http_api_existing_openapi.json index ea696cf89..1e872d43f 100644 --- a/tests/translator/output/http_api_existing_openapi.json +++ b/tests/translator/output/http_api_existing_openapi.json @@ -8,6 +8,8 @@ "Resources": { "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -29,6 +31,8 @@ }, "MyApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -42,6 +46,8 @@ }, "HttpApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.restapi", "Code": { @@ -65,6 +71,8 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -96,6 +104,8 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/http_api_existing_openapi_conditions.json b/tests/translator/output/http_api_existing_openapi_conditions.json index f1a6d177d..1fd8e0300 100644 --- a/tests/translator/output/http_api_existing_openapi_conditions.json +++ b/tests/translator/output/http_api_existing_openapi_conditions.json @@ -10,6 +10,8 @@ "Resources": { "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -32,6 +34,8 @@ }, "MyApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -47,6 +51,8 @@ }, "HttpApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.restapi", "Code": { @@ -71,6 +77,8 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -102,6 +110,8 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/http_api_explicit_stage.json b/tests/translator/output/http_api_explicit_stage.json index 6f827ff3a..1cf23fd55 100644 --- a/tests/translator/output/http_api_explicit_stage.json +++ b/tests/translator/output/http_api_explicit_stage.json @@ -12,6 +12,8 @@ "Resources": { "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -33,6 +35,8 @@ }, "HttpApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.restapi", "Code": { @@ -56,6 +60,8 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AutoDeploy": true, "StageVariables": { @@ -84,6 +90,8 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -114,6 +122,8 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FailOnWarnings": true, "Body": { diff --git a/tests/translator/output/http_api_lambda_auth.json b/tests/translator/output/http_api_lambda_auth.json index ac6d3b4fb..6e75b5187 100644 --- a/tests/translator/output/http_api_lambda_auth.json +++ b/tests/translator/output/http_api_lambda_auth.json @@ -2,6 +2,8 @@ "Resources": { "HttpApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -25,6 +27,8 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -55,6 +59,8 @@ }, "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { @@ -76,6 +82,8 @@ }, "MyAuthFn": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "bucket", @@ -99,6 +107,8 @@ }, "MyAuthFnRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -129,6 +139,8 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "openapi": "3.0.1", @@ -238,6 +250,8 @@ }, "MyApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" diff --git a/tests/translator/output/http_api_lambda_auth_full.json b/tests/translator/output/http_api_lambda_auth_full.json index 20b14e636..cbd1fcf6b 100644 --- a/tests/translator/output/http_api_lambda_auth_full.json +++ b/tests/translator/output/http_api_lambda_auth_full.json @@ -2,6 +2,8 @@ "Resources": { "HttpApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -25,6 +27,8 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -55,6 +59,8 @@ }, "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { @@ -76,6 +82,8 @@ }, "MyAuthFn": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "bucket", @@ -99,6 +107,8 @@ }, "MyAuthFnRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -129,6 +139,8 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "openapi": "3.0.1", @@ -252,6 +264,8 @@ }, "MyApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" diff --git a/tests/translator/output/http_api_with_cors.json b/tests/translator/output/http_api_with_cors.json index a24a91009..ec7fafd33 100644 --- a/tests/translator/output/http_api_with_cors.json +++ b/tests/translator/output/http_api_with_cors.json @@ -10,6 +10,8 @@ "Resources": { "MyApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -23,6 +25,8 @@ }, "ServerlessHttpApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "ServerlessHttpApi" @@ -36,6 +40,8 @@ }, "ServerlessHttpApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -92,6 +98,8 @@ }, "HttpApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -114,6 +122,8 @@ }, "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -135,6 +145,8 @@ }, "HttpApiFunctionImplicitApiPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -156,6 +168,8 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -186,6 +200,8 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/implicit_and_explicit_api_with_conditions.json b/tests/translator/output/implicit_and_explicit_api_with_conditions.json index cc3e91e86..3d079f50e 100644 --- a/tests/translator/output/implicit_and_explicit_api_with_conditions.json +++ b/tests/translator/output/implicit_and_explicit_api_with_conditions.json @@ -39,6 +39,8 @@ "Resources": { "explicithello2": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -64,6 +66,8 @@ }, "implicithello2Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -95,6 +99,8 @@ }, "explicithello1": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -120,6 +126,8 @@ }, "explicitapiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "explicitapiDeployment9fcb053eda" @@ -132,6 +140,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentfa2ce19a90" @@ -145,6 +155,8 @@ }, "explicithello1ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -167,6 +179,8 @@ }, "implicithello2": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -192,6 +206,8 @@ }, "implicithello1ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -214,6 +230,8 @@ }, "explicithello2Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -245,6 +263,8 @@ }, "implicithello1": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -270,6 +290,8 @@ }, "explicithello2ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -292,6 +314,8 @@ }, "ServerlessRestApiDeploymentfa2ce19a90": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -303,6 +327,8 @@ }, "explicitapi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -391,6 +417,8 @@ }, "implicithello2ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -413,6 +441,8 @@ }, "explicithello1Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -444,6 +474,8 @@ }, "explicitapiDeployment9fcb053eda": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "explicitapi" @@ -454,6 +486,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -543,6 +577,8 @@ }, "implicithello1Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/implicit_api.json b/tests/translator/output/implicit_api.json index 6eb61200b..b950333ec 100644 --- a/tests/translator/output/implicit_api.json +++ b/tests/translator/output/implicit_api.json @@ -2,6 +2,8 @@ "Resources": { "RestApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -34,6 +36,8 @@ }, "RestApiFunctionAddItemPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -55,6 +59,8 @@ }, "GetHtmlFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -76,6 +82,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment127e3fb911" @@ -88,6 +96,8 @@ }, "GetHtmlFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -111,6 +121,8 @@ }, "GetHtmlFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -143,6 +155,8 @@ }, "RestApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -166,6 +180,8 @@ }, "ServerlessRestApiDeployment127e3fb911": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -176,6 +192,8 @@ }, "RestApiFunctionGetListPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -197,6 +215,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -261,6 +281,8 @@ }, "RestApiFunctionCompleteItemPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/implicit_api_with_auth_and_conditions_max.json b/tests/translator/output/implicit_api_with_auth_and_conditions_max.json index d83d1eb90..7ba5ebe9d 100644 --- a/tests/translator/output/implicit_api_with_auth_and_conditions_max.json +++ b/tests/translator/output/implicit_api_with_auth_and_conditions_max.json @@ -81,6 +81,8 @@ "Resources": { "MyFunction4": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -105,6 +107,8 @@ }, "MyFunction6": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -129,6 +133,8 @@ }, "MyFunction2WithCognitoMultipleUserPoolsAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -151,6 +157,8 @@ }, "MyFunction3": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -175,6 +183,8 @@ }, "MyFunction2": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -199,6 +209,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentcbc79073ff" @@ -212,6 +224,8 @@ }, "MyFunction5Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -243,6 +257,8 @@ }, "MyFunction2Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -274,6 +290,8 @@ }, "ServerlessRestApiDeploymentcbc79073ff": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -285,6 +303,8 @@ }, "MyFunction4Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -316,6 +336,8 @@ }, "MyFunction5": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -340,6 +362,8 @@ }, "MyFunction6Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -371,6 +395,8 @@ }, "ServerlessRestApiMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -390,6 +416,8 @@ }, "MyFunctionWithNoAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -412,6 +440,8 @@ }, "MyFunction3Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -443,6 +473,8 @@ }, "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -467,6 +499,8 @@ }, "MyFunction4WithLambdaTokenAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -489,6 +523,8 @@ }, "ServerlessRestApiMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -508,6 +544,8 @@ }, "MyFunction5WithLambdaRequestAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -530,6 +568,8 @@ }, "ServerlessRestApiMyLambdaTokenAuthNoneFunctionInvokeRoleAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -549,6 +589,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -580,6 +622,8 @@ }, "MyFunction3WithLambdaTokenAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -602,6 +646,8 @@ }, "MyFunction6WithDefaultAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -624,6 +670,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/implicit_api_with_many_conditions.json b/tests/translator/output/implicit_api_with_many_conditions.json index 5d9b800cf..e274ba50a 100644 --- a/tests/translator/output/implicit_api_with_many_conditions.json +++ b/tests/translator/output/implicit_api_with_many_conditions.json @@ -125,6 +125,8 @@ "Resources": { "helloworld7ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -147,6 +149,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentd229cbabc1" @@ -160,6 +164,8 @@ }, "helloworld1Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -191,6 +197,8 @@ }, "helloworld7": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -216,6 +224,8 @@ }, "helloworld6": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -241,6 +251,8 @@ }, "helloworldRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -272,6 +284,8 @@ }, "helloworld4": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -297,6 +311,8 @@ }, "helloworld3": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -322,6 +338,8 @@ }, "helloworld2": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -347,6 +365,8 @@ }, "helloworld1": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -372,6 +392,8 @@ }, "helloworld9": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -397,6 +419,8 @@ }, "helloApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -419,6 +443,8 @@ }, "helloworld2ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -441,6 +467,8 @@ }, "ServerlessRestApiDeploymentd229cbabc1": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -452,6 +480,8 @@ }, "helloworld3ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -474,6 +504,8 @@ }, "helloworld1ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -496,6 +528,8 @@ }, "helloworld8": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -521,6 +555,8 @@ }, "helloworld6ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -543,6 +579,8 @@ }, "helloworld4Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -574,6 +612,8 @@ }, "helloworldApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -596,6 +636,8 @@ }, "helloworld9Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -627,6 +669,8 @@ }, "helloworld5ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -649,6 +693,8 @@ }, "helloworld8ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -671,6 +717,8 @@ }, "helloRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -702,6 +750,8 @@ }, "helloworld8Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -733,6 +783,8 @@ }, "helloworld": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -758,6 +810,8 @@ }, "helloworld5Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -789,6 +843,8 @@ }, "hello": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -814,6 +870,8 @@ }, "helloworld5": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -839,6 +897,8 @@ }, "helloworld9ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -861,6 +921,8 @@ }, "helloworld6Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -892,6 +954,8 @@ }, "helloworld7Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -923,6 +987,8 @@ }, "helloworld2Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -954,6 +1020,8 @@ }, "helloworld3Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -985,6 +1053,8 @@ }, "helloworld4ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -1007,6 +1077,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/implicit_api_with_serverless_rest_api_resource.json b/tests/translator/output/implicit_api_with_serverless_rest_api_resource.json index 17e8437c5..78239fde0 100644 --- a/tests/translator/output/implicit_api_with_serverless_rest_api_resource.json +++ b/tests/translator/output/implicit_api_with_serverless_rest_api_resource.json @@ -2,6 +2,8 @@ "Resources": { "RestApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -33,6 +35,8 @@ }, "RestApiFunctionAddItemPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -54,6 +58,8 @@ }, "GetHtmlFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -75,6 +81,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment127e3fb911" @@ -87,6 +95,8 @@ }, "GetHtmlFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -110,6 +120,8 @@ }, "GetHtmlFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -141,6 +153,8 @@ }, "RestApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -164,6 +178,8 @@ }, "ServerlessRestApiDeployment127e3fb911": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -174,6 +190,8 @@ }, "RestApiFunctionGetListPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -195,6 +213,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -259,6 +279,8 @@ }, "RestApiFunctionCompleteItemPermissionProd": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/implicit_http_api.json b/tests/translator/output/implicit_http_api.json index 146970cf6..1688f5541 100644 --- a/tests/translator/output/implicit_http_api.json +++ b/tests/translator/output/implicit_http_api.json @@ -2,6 +2,8 @@ "Resources": { "ServerlessHttpApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "ServerlessHttpApi" @@ -15,6 +17,8 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -46,6 +50,8 @@ }, "HttpApiFunction2Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -77,6 +83,8 @@ }, "HttpApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.restapi", "Code": { @@ -100,6 +108,8 @@ }, "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -121,6 +131,8 @@ }, "HttpApiFunction2": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.restapi", "Code": { @@ -144,6 +156,8 @@ }, "ServerlessHttpApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -231,6 +245,8 @@ }, "HttpApiFunction2PathParametersPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -252,6 +268,8 @@ }, "HttpApiFunction2Basic2Permission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/implicit_http_api_auth_and_simple_case.json b/tests/translator/output/implicit_http_api_auth_and_simple_case.json index 4f518881f..bf7e31fff 100644 --- a/tests/translator/output/implicit_http_api_auth_and_simple_case.json +++ b/tests/translator/output/implicit_http_api_auth_and_simple_case.json @@ -2,6 +2,8 @@ "Resources": { "ServerlessHttpApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "ServerlessHttpApi" @@ -15,6 +17,8 @@ }, "RestApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -46,6 +50,8 @@ }, "RestApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.restapi", "Code": { @@ -69,6 +75,8 @@ }, "RestApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -90,6 +98,8 @@ }, "ServerlessHttpApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/implicit_http_api_with_many_conditions.json b/tests/translator/output/implicit_http_api_with_many_conditions.json index c4b9618b8..f9957011b 100644 --- a/tests/translator/output/implicit_http_api_with_many_conditions.json +++ b/tests/translator/output/implicit_http_api_with_many_conditions.json @@ -116,6 +116,8 @@ "Resources": { "helloworld9HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -138,6 +140,8 @@ }, "helloworld9Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -169,6 +173,8 @@ }, "helloworld2HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -191,6 +197,8 @@ }, "ServerlessHttpApi": { "Type": "AWS::ApiGatewayV2::Api", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -683,6 +691,8 @@ }, "helloworld6HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -705,6 +715,8 @@ }, "helloworld1Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -736,6 +748,8 @@ }, "helloworld7": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -761,6 +775,8 @@ }, "helloworld6": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -786,6 +802,8 @@ }, "helloworld5": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -811,6 +829,8 @@ }, "helloworld1099Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -842,6 +862,8 @@ }, "helloworld3": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -867,6 +889,8 @@ }, "helloworld2": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -892,6 +916,8 @@ }, "helloworld1": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -917,6 +943,8 @@ }, "helloworld9": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -942,6 +970,8 @@ }, "hello": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -967,6 +997,8 @@ }, "helloRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -998,6 +1030,8 @@ }, "helloworld7HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -1020,6 +1054,8 @@ }, "helloHttpApiEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -1042,6 +1078,8 @@ }, "helloworld1HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -1064,6 +1102,8 @@ }, "helloworld5Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -1095,6 +1135,8 @@ }, "helloworld4Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -1126,6 +1168,8 @@ }, "helloworld1099HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -1148,6 +1192,8 @@ }, "helloworld5HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -1170,6 +1216,8 @@ }, "helloworld7Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -1201,6 +1249,8 @@ }, "helloworld2Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -1232,6 +1282,8 @@ }, "helloworld8Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -1263,6 +1315,8 @@ }, "helloworld4": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -1288,6 +1342,8 @@ }, "helloworld1099": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -1313,6 +1369,8 @@ }, "helloworld8HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -1335,6 +1393,8 @@ }, "ServerlessHttpApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AutoDeploy": true, "ApiId": { @@ -1373,6 +1433,8 @@ }, "helloworld3Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -1404,6 +1466,8 @@ }, "helloworld8": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -1429,6 +1493,8 @@ }, "helloworld4HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -1451,6 +1517,8 @@ }, "helloworld6Role": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -1482,6 +1550,8 @@ }, "helloworld3HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/inline_precedence.json b/tests/translator/output/inline_precedence.json index 6ea4caaf0..cd75d8dba 100644 --- a/tests/translator/output/inline_precedence.json +++ b/tests/translator/output/inline_precedence.json @@ -2,6 +2,8 @@ "Resources": { "HelloWorldFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -32,6 +34,8 @@ }, "HelloWorldFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.lambda_handler", "Code": { diff --git a/tests/translator/output/intrinsic_functions.json b/tests/translator/output/intrinsic_functions.json index c3bc3542c..da072d990 100644 --- a/tests/translator/output/intrinsic_functions.json +++ b/tests/translator/output/intrinsic_functions.json @@ -32,6 +32,8 @@ "Resources": { "MyExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BodyS3Location": { "Bucket": "sam-demo-bucket", @@ -44,6 +46,8 @@ }, "MyTable": { "Type": "AWS::DynamoDB::Table", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "KeySchema": [ { @@ -67,10 +71,14 @@ } }, "SnsDlqQueue": { - "Type": "AWS::SNS::Topic" + "Type": "AWS::SNS::Topic", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, "MySqsDlqLambdaFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -101,10 +109,14 @@ } }, "SqsDlqQueue": { - "Type": "AWS::SQS::Queue" + "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, "ApiWithExplicitS3Uri": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BodyS3Location": { "Version": "myversion", @@ -116,6 +128,8 @@ }, "MyExplicitApiDeployment7145dd00ce": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyExplicitApi" @@ -126,6 +140,8 @@ }, "FunctionWithExplicitS3Uri": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "stream.ddb_handler", "Code": { @@ -150,6 +166,8 @@ }, "MySnsDlqLambdaFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -197,6 +215,8 @@ }, "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "TracingConfig": { "Mode": { @@ -256,6 +276,8 @@ }, "FunctionWithExplicitS3UriRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -286,6 +308,8 @@ }, "DynamoDBFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -317,6 +341,8 @@ }, "MySnsDlqLambdaFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -345,6 +371,8 @@ }, "MyNewRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -384,6 +412,8 @@ }, "DynamoDBFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "stream.ddb_handler", "Code": { @@ -407,6 +437,8 @@ }, "ApiWithExplicitS3UridevStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ApiWithExplicitS3UriDeploymenta227798f00" @@ -420,6 +452,8 @@ }, "DynamoDBFunctionMyDDBStream": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BatchSize": 200, "EventSourceArn": { @@ -436,6 +470,8 @@ }, "ApiWithExplicitS3UriDeploymenta227798f00": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ApiWithExplicitS3Uri" @@ -447,6 +483,8 @@ }, "MySqsDlqLambdaFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -497,6 +535,8 @@ }, "MyExplicitApidevStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyExplicitApiDeployment7145dd00ce" @@ -523,6 +563,8 @@ }, "MyFunctionMyApiPermissiondev": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/iot_rule.json b/tests/translator/output/iot_rule.json index 0600c3b82..2785cdfce 100644 --- a/tests/translator/output/iot_rule.json +++ b/tests/translator/output/iot_rule.json @@ -4,6 +4,8 @@ "Resources": { "IoTRuleFuncMyIoTRule": { "Type": "AWS::IoT::TopicRule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "TopicRulePayload": { "AwsIotSqlVersion": "beta", @@ -26,6 +28,8 @@ }, "IoTRuleFuncMyOtherIoTRule": { "Type": "AWS::IoT::TopicRule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "TopicRulePayload": { "Actions": [ @@ -47,6 +51,8 @@ }, "IoTRuleFuncMyIoTRulePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -70,6 +76,8 @@ }, "IoTRuleFuncMyOtherIoTRulePermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -93,6 +101,8 @@ }, "IoTRuleFunc": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -119,6 +129,8 @@ }, "IoTRuleFuncRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/layers_all_properties.json b/tests/translator/output/layers_all_properties.json index a99809489..bedbbce3a 100644 --- a/tests/translator/output/layers_all_properties.json +++ b/tests/translator/output/layers_all_properties.json @@ -2,7 +2,7 @@ "Outputs": { "LayerSub": { "Value": { - "Fn::Sub": "${MyLayerd04062b365}" + "Fn::Sub": "${MyLayerf16259d4b8}" } }, "FunctionAtt": { @@ -15,7 +15,7 @@ }, "LayerName": { "Value": { - "Ref": "MyLayerd04062b365" + "Ref": "MyLayerf16259d4b8" } }, "FunctionSub": { @@ -38,10 +38,12 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Layers": [ { - "Ref": "MyLayerd04062b365" + "Ref": "MyLayerf16259d4b8" } ], "Code": { @@ -64,9 +66,10 @@ "Runtime": "python3.6" } }, - "MyLayerd04062b365": { - "DeletionPolicy": "Delete", + "MyLayerf16259d4b8": { "Type": "AWS::Lambda::LayerVersion", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "bucket", @@ -75,9 +78,10 @@ "LayerName": "MyLayer" } }, - "MyLayerWithANamefda8c9ec8c": { - "DeletionPolicy": "Retain", + "MyLayerWithAName0c99fc75b5": { "Type": "AWS::Lambda::LayerVersion", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "bucket", @@ -88,6 +92,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/layers_with_intrinsics.json b/tests/translator/output/layers_with_intrinsics.json index d8bb81b37..9f77987f2 100644 --- a/tests/translator/output/layers_with_intrinsics.json +++ b/tests/translator/output/layers_with_intrinsics.json @@ -17,9 +17,10 @@ } }, "Resources": { - "LayerWithNameIntrinsiccf8baed8b9": { - "DeletionPolicy": "Retain", + "LayerWithNameIntrinsic1935b50dbd": { "Type": "AWS::Lambda::LayerVersion", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "sam-demo-bucket", @@ -28,9 +29,10 @@ "LayerName": "SomeLayerName" } }, - "LayerWithRefNameIntrinsicRegion32bf7198a5": { - "DeletionPolicy": "Retain", + "LayerWithRefNameIntrinsicRegion472f836e5f": { "Type": "AWS::Lambda::LayerVersion", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "sam-demo-bucket", @@ -39,9 +41,10 @@ "LayerName": "ap-southeast-1" } }, - "LayerWithSubNameIntrinsicRegiond71326de24": { - "DeletionPolicy": "Retain", + "LayerWithSubNameIntrinsicRegionf4ccaf8dcb": { "Type": "AWS::Lambda::LayerVersion", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "sam-demo-bucket", @@ -52,9 +55,10 @@ } } }, - "LayerWithRuntimesIntrinsic1a006faa85": { - "DeletionPolicy": "Retain", + "LayerWithRuntimesIntrinsic15bceab8a8": { "Type": "AWS::Lambda::LayerVersion", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "sam-demo-bucket", @@ -66,8 +70,7 @@ } } }, - "LayerWithSingleListRefRuntimesIntrinsic9d7a72f24a": { - "DeletionPolicy": "Retain", + "LayerWithSingleListRefRuntimesIntrinsic3243ec999b": { "Properties": { "CompatibleRuntimes": [ { @@ -80,10 +83,11 @@ }, "LayerName": "LayerWithSingleListRefRuntimesIntrinsic" }, - "Type": "AWS::Lambda::LayerVersion" + "Type": "AWS::Lambda::LayerVersion", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, - "LayerWithMixedListRefRuntimesIntrinsic71fd80f592": { - "DeletionPolicy": "Retain", + "LayerWithMixedListRefRuntimesIntrinsicbd637a121f": { "Properties": { "CompatibleRuntimes": [ { @@ -97,11 +101,14 @@ }, "LayerName": "LayerWithMixedListRefRuntimesIntrinsic" }, - "Type": "AWS::Lambda::LayerVersion" + "Type": "AWS::Lambda::LayerVersion", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, - "LayerWithLicenseIntrinsic965c8d0c9b": { - "DeletionPolicy": "Retain", + "LayerWithLicenseIntrinsicf158772ce9": { "Type": "AWS::Lambda::LayerVersion", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "sam-demo-bucket", @@ -111,9 +118,10 @@ "LicenseInfo": "MIT-0 License" } }, - "LayerWithSubNameIntrinsic6e9b477102": { + "LayerWithSubNameIntrinsic8566d42a51": { "Type": "AWS::Lambda::LayerVersion", - "DeletionPolicy": "Retain", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/no_implicit_api_with_serverless_rest_api_resource.json b/tests/translator/output/no_implicit_api_with_serverless_rest_api_resource.json index 2a4b1979a..7eb50630c 100644 --- a/tests/translator/output/no_implicit_api_with_serverless_rest_api_resource.json +++ b/tests/translator/output/no_implicit_api_with_serverless_rest_api_resource.json @@ -2,6 +2,8 @@ "Resources": { "GetHtmlFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -25,6 +27,8 @@ }, "GetHtmlFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,6 +59,8 @@ }, "ThumbnailFunctionImageBucketPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -68,6 +74,8 @@ }, "RestApiFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -98,6 +106,8 @@ }, "RestApiFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -121,6 +131,8 @@ }, "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -151,6 +163,8 @@ }, "Images": { "Type": "AWS::S3::Bucket", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "NotificationConfiguration": { "LambdaConfigurations": [ @@ -172,6 +186,8 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.generate_thumbails", "Code": { @@ -195,6 +211,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/s3.json b/tests/translator/output/s3.json index 35b92f77c..4cb3d0e8b 100644 --- a/tests/translator/output/s3.json +++ b/tests/translator/output/s3.json @@ -2,6 +2,8 @@ "Resources": { "Images": { "Type": "AWS::S3::Bucket", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "DependsOn": ["ThumbnailFunctionImageBucketPermission"], "Properties": { "NotificationConfiguration": { @@ -21,6 +23,8 @@ }, "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -51,6 +55,8 @@ }, "ThumbnailFunctionImageBucketPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -64,6 +70,8 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/s3_create_remove.json b/tests/translator/output/s3_create_remove.json index 297f01424..53b2500af 100644 --- a/tests/translator/output/s3_create_remove.json +++ b/tests/translator/output/s3_create_remove.json @@ -2,6 +2,8 @@ "Resources": { "Images": { "Type": "AWS::S3::Bucket", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "DependsOn": ["ThumbnailFunctionImageBucketPermission"], "Properties": { "NotificationConfiguration": { @@ -38,6 +40,8 @@ }, "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -68,6 +72,8 @@ }, "ThumbnailFunctionImageBucketPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -81,6 +87,8 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/s3_existing_lambda_notification_configuration.json b/tests/translator/output/s3_existing_lambda_notification_configuration.json index 35b92f77c..4cb3d0e8b 100644 --- a/tests/translator/output/s3_existing_lambda_notification_configuration.json +++ b/tests/translator/output/s3_existing_lambda_notification_configuration.json @@ -2,6 +2,8 @@ "Resources": { "Images": { "Type": "AWS::S3::Bucket", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "DependsOn": ["ThumbnailFunctionImageBucketPermission"], "Properties": { "NotificationConfiguration": { @@ -21,6 +23,8 @@ }, "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -51,6 +55,8 @@ }, "ThumbnailFunctionImageBucketPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -64,6 +70,8 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/s3_existing_other_notification_configuration.json b/tests/translator/output/s3_existing_other_notification_configuration.json index 425051451..7be36e411 100644 --- a/tests/translator/output/s3_existing_other_notification_configuration.json +++ b/tests/translator/output/s3_existing_other_notification_configuration.json @@ -2,6 +2,8 @@ "Resources": { "Images": { "Type": "AWS::S3::Bucket", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "NotificationConfiguration": { "LambdaConfigurations": [ @@ -29,6 +31,8 @@ }, "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,6 +63,8 @@ }, "ThumbnailFunctionImageBucketPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -72,6 +78,8 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.generate_thumbails", "Code": { diff --git a/tests/translator/output/s3_filter.json b/tests/translator/output/s3_filter.json index 7e377d29a..1c4ea4b16 100644 --- a/tests/translator/output/s3_filter.json +++ b/tests/translator/output/s3_filter.json @@ -2,6 +2,8 @@ "Resources": { "Images": { "Type": "AWS::S3::Bucket", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "DependsOn": ["ThumbnailFunctionImageBucketPermission"], "Properties": { "NotificationConfiguration": { @@ -31,6 +33,8 @@ }, "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -61,6 +65,8 @@ }, "ThumbnailFunctionImageBucketPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -74,6 +80,8 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/s3_multiple_events_same_bucket.json b/tests/translator/output/s3_multiple_events_same_bucket.json index 30ec9dbde..3a5ae0946 100644 --- a/tests/translator/output/s3_multiple_events_same_bucket.json +++ b/tests/translator/output/s3_multiple_events_same_bucket.json @@ -2,6 +2,8 @@ "Resources": { "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -32,6 +34,8 @@ }, "ThumbnailFunctionImageBucketCreatesPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -45,6 +49,8 @@ }, "Images": { "Type": "AWS::S3::Bucket", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "DependsOn": ["ThumbnailFunctionImageBucketDeletesPermission", "ThumbnailFunctionImageBucketCreatesPermission"], "Properties": { "NotificationConfiguration": { @@ -83,6 +89,8 @@ }, "ThumbnailFunctionImageBucketDeletesPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -96,6 +104,8 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/s3_multiple_functions.json b/tests/translator/output/s3_multiple_functions.json index fc1d47956..a6d8c3e7d 100644 --- a/tests/translator/output/s3_multiple_functions.json +++ b/tests/translator/output/s3_multiple_functions.json @@ -2,6 +2,8 @@ "Resources": { "FunctionOneRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -32,6 +34,8 @@ }, "FunctionTwoImageBucketPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -45,6 +49,8 @@ }, "Images": { "Type": "AWS::S3::Bucket", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "NotificationConfiguration": { "LambdaConfigurations": [ @@ -82,6 +88,8 @@ }, "FunctionTwoRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -112,6 +120,8 @@ }, "FunctionOneImageBucketPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -125,6 +135,8 @@ }, "FunctionTwo": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -148,6 +160,8 @@ }, "FunctionOne": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/s3_with_condition.json b/tests/translator/output/s3_with_condition.json index 27d891710..e11b44ad8 100644 --- a/tests/translator/output/s3_with_condition.json +++ b/tests/translator/output/s3_with_condition.json @@ -10,6 +10,8 @@ "Resources": { "Images": { "Type": "AWS::S3::Bucket", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "NotificationConfiguration": { "LambdaConfigurations": [ @@ -50,6 +52,8 @@ }, "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -81,6 +85,8 @@ }, "ThumbnailFunctionImageBucketPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -95,6 +101,8 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.generate_thumbails", "Code": { diff --git a/tests/translator/output/s3_with_dependsOn.json b/tests/translator/output/s3_with_dependsOn.json index 2dc415eeb..8d994a5e4 100644 --- a/tests/translator/output/s3_with_dependsOn.json +++ b/tests/translator/output/s3_with_dependsOn.json @@ -1,10 +1,14 @@ { "Resources": { "Topic": { - "Type": "AWS::SNS::Topic" + "Type": "AWS::SNS::Topic", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, "Images": { "Type": "AWS::S3::Bucket", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "DependsOn": [ "ThumbnailFunctionImageBucketPermission", "Topic" @@ -27,6 +31,8 @@ }, "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -57,6 +63,8 @@ }, "ThumbnailFunctionImageBucketPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -70,6 +78,8 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/simple_table_ref_parameter_intrinsic.json b/tests/translator/output/simple_table_ref_parameter_intrinsic.json index f2e511930..6c6f2c3eb 100644 --- a/tests/translator/output/simple_table_ref_parameter_intrinsic.json +++ b/tests/translator/output/simple_table_ref_parameter_intrinsic.json @@ -16,6 +16,8 @@ "Resources": { "MinimalTableRefParamLongForm": { "Type": "AWS::DynamoDB::Table", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ProvisionedThroughput": { "WriteCapacityUnits": { diff --git a/tests/translator/output/simple_table_with_extra_tags.json b/tests/translator/output/simple_table_with_extra_tags.json index a02e088cd..36e580e2f 100644 --- a/tests/translator/output/simple_table_with_extra_tags.json +++ b/tests/translator/output/simple_table_with_extra_tags.json @@ -8,6 +8,8 @@ "Resources": { "MinimalTableWithTags": { "Type": "AWS::DynamoDB::Table", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BillingMode": "PAY_PER_REQUEST", "AttributeDefinitions": [ diff --git a/tests/translator/output/simple_table_with_table_name.json b/tests/translator/output/simple_table_with_table_name.json index 57b9ef7a8..d560f80d8 100644 --- a/tests/translator/output/simple_table_with_table_name.json +++ b/tests/translator/output/simple_table_with_table_name.json @@ -8,6 +8,8 @@ "Resources": { "MinimalTableWithTableName": { "Type": "AWS::DynamoDB::Table", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "TableName": "MySimpleTable", "BillingMode": "PAY_PER_REQUEST", @@ -27,6 +29,8 @@ }, "MinimalTableWithRefTableName": { "Type": "AWS::DynamoDB::Table", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "TableName": { "Ref": "MySimpleTableParameter" @@ -48,6 +52,8 @@ }, "MinimalTableWithSubTableName": { "Type": "AWS::DynamoDB::Table", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "TableName": { "Fn::Sub": "${AWS::StackName}MySimpleTable" diff --git a/tests/translator/output/simpletable.json b/tests/translator/output/simpletable.json index c59f7a660..f26c9fa8f 100644 --- a/tests/translator/output/simpletable.json +++ b/tests/translator/output/simpletable.json @@ -2,6 +2,8 @@ "Resources": { "MinimalTable": { "Type": "AWS::DynamoDB::Table", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BillingMode": "PAY_PER_REQUEST", "AttributeDefinitions": [ @@ -20,6 +22,8 @@ }, "CompleteTable": { "Type": "AWS::DynamoDB::Table", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ProvisionedThroughput": { "WriteCapacityUnits": 10, diff --git a/tests/translator/output/simpletable_with_sse.json b/tests/translator/output/simpletable_with_sse.json index ab4c3d3f5..b8e931fb0 100644 --- a/tests/translator/output/simpletable_with_sse.json +++ b/tests/translator/output/simpletable_with_sse.json @@ -2,6 +2,8 @@ "Resources": { "TableWithSSE": { "Type": "AWS::DynamoDB::Table", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BillingMode": "PAY_PER_REQUEST", "SSESpecification": { diff --git a/tests/translator/output/sns.json b/tests/translator/output/sns.json index 8e895e2e8..1f03a50c7 100644 --- a/tests/translator/output/sns.json +++ b/tests/translator/output/sns.json @@ -1,10 +1,14 @@ { "Resources": { "Notifications": { - "Type": "AWS::SNS::Topic" + "Type": "AWS::SNS::Topic", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, "SaveNotificationFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -35,6 +39,8 @@ }, "SaveNotificationFunctionNotificationTopicPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "sns.amazonaws.com", @@ -48,6 +54,8 @@ }, "SaveNotificationFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -71,6 +79,8 @@ }, "SaveNotificationFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Endpoint": { "Fn::GetAtt": [ diff --git a/tests/translator/output/sns_existing_other_subscription.json b/tests/translator/output/sns_existing_other_subscription.json index 5c28668de..e90235008 100644 --- a/tests/translator/output/sns_existing_other_subscription.json +++ b/tests/translator/output/sns_existing_other_subscription.json @@ -2,6 +2,8 @@ "Resources": { "Notifications": { "Type": "AWS::SNS::Topic", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Subscription": [ { @@ -13,6 +15,8 @@ }, "SaveNotificationFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -43,6 +47,8 @@ }, "SaveNotificationFunctionNotificationTopicPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "sns.amazonaws.com", @@ -56,6 +62,8 @@ }, "SaveNotificationFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -79,6 +87,8 @@ }, "SaveNotificationFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Endpoint": { "Fn::GetAtt": [ diff --git a/tests/translator/output/sns_existing_sqs.json b/tests/translator/output/sns_existing_sqs.json index a0e9728d8..cbcb2afee 100644 --- a/tests/translator/output/sns_existing_sqs.json +++ b/tests/translator/output/sns_existing_sqs.json @@ -1,13 +1,19 @@ { "Resources": { "Queue": { - "Type": "AWS::SQS::Queue" + "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, "Notifications": { - "Type": "AWS::SNS::Topic" + "Type": "AWS::SNS::Topic", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, "NotificationA": { "Type": "AWS::SQS::QueuePolicy", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Queues": [ { @@ -41,6 +47,8 @@ }, "SaveNotificationFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FilterPolicy": { "price_usd": [ @@ -69,6 +77,8 @@ }, "SaveNotificationFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -100,6 +110,8 @@ }, "SaveNotificationFunctionNotificationTopicEventSourceMapping": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BatchSize": 8, "Enabled": true, @@ -116,6 +128,8 @@ }, "SaveNotificationFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.save_notification", "Code": { diff --git a/tests/translator/output/sns_outside_sqs.json b/tests/translator/output/sns_outside_sqs.json index 5761b5cc7..4204cf755 100644 --- a/tests/translator/output/sns_outside_sqs.json +++ b/tests/translator/output/sns_outside_sqs.json @@ -2,6 +2,8 @@ "Resources": { "NotificationB": { "Type": "AWS::SQS::QueuePolicy", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Queues": [ "https://sqs.us-east-1.amazonaws.com/123456789012/MyQueue" @@ -27,10 +29,14 @@ } }, "Notifications": { - "Type": "AWS::SNS::Topic" + "Type": "AWS::SNS::Topic", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, "SaveNotificationFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FilterPolicy": { "price_usd": [ @@ -54,6 +60,8 @@ }, "SaveNotificationFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -85,6 +93,8 @@ }, "SaveNotificationFunctionNotificationTopicEventSourceMapping": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BatchSize": 8, "Enabled": true, @@ -96,6 +106,8 @@ }, "SaveNotificationFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.save_notification", "Code": { diff --git a/tests/translator/output/sns_sqs.json b/tests/translator/output/sns_sqs.json index 4ec300e3d..38665e31e 100644 --- a/tests/translator/output/sns_sqs.json +++ b/tests/translator/output/sns_sqs.json @@ -1,14 +1,20 @@ { "Resources": { "Notifications": { - "Type": "AWS::SNS::Topic" + "Type": "AWS::SNS::Topic", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, "SaveNotificationFunctionNotificationTopicQueue": { "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": {} }, "SaveNotificationFunctionNotificationTopicQueuePolicy": { "Type": "AWS::SQS::QueuePolicy", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Queues": [ { @@ -42,6 +48,8 @@ }, "SaveNotificationFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "FilterPolicy": { "price_usd": [ @@ -70,6 +78,8 @@ }, "SaveNotificationFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -101,6 +111,8 @@ }, "SaveNotificationFunctionNotificationTopicEventSourceMapping": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BatchSize": 10, "Enabled": true, @@ -117,6 +129,8 @@ }, "SaveNotificationFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "index.save_notification", "Code": { diff --git a/tests/translator/output/sns_topic_outside_template.json b/tests/translator/output/sns_topic_outside_template.json index 560270c86..351228749 100644 --- a/tests/translator/output/sns_topic_outside_template.json +++ b/tests/translator/output/sns_topic_outside_template.json @@ -7,6 +7,8 @@ "Resources": { "SaveNotificationFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Endpoint": { "Fn::GetAtt": [ @@ -22,6 +24,8 @@ }, "SaveNotificationFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -52,6 +56,8 @@ }, "SaveNotificationFunctionNotificationTopicPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "sns.amazonaws.com", @@ -65,6 +71,8 @@ }, "SaveNotificationFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", From 3f73ca9972e134331b637cee94e78047c85247b2 Mon Sep 17 00:00:00 2001 From: Qingchuan Ma Date: Mon, 26 Apr 2021 12:58:07 -0700 Subject: [PATCH 21/41] Partially updated test templates (all the ones left) --- tests/translator/input/sqs.yaml | 2 ++ ..._machine_with_api_auth_default_scopes.yaml | 4 +++ .../state_machine_with_api_authorizer.yaml | 4 +++ ...e_machine_with_api_authorizer_maximum.yaml | 4 +++ ...tate_machine_with_api_resource_policy.yaml | 4 +++ .../input/state_machine_with_condition.yaml | 2 ++ ...ate_machine_with_condition_and_events.yaml | 2 ++ .../input/state_machine_with_cwe.yaml | 2 ++ ...ate_machine_with_definition_S3_object.yaml | 4 +++ ...ate_machine_with_definition_S3_string.yaml | 4 +++ ...machine_with_definition_substitutions.yaml | 4 +++ .../input/state_machine_with_eb_dlq.yaml | 2 ++ .../state_machine_with_eb_dlq_generated.yaml | 2 ++ .../state_machine_with_eb_retry_policy.yaml | 2 ++ .../state_machine_with_explicit_api.yaml | 4 +++ .../state_machine_with_express_logging.yaml | 6 +++++ .../state_machine_with_implicit_api.yaml | 2 ++ ...ate_machine_with_implicit_api_globals.yaml | 2 ++ .../state_machine_with_inline_definition.yaml | 2 ++ ...ine_with_inline_definition_intrinsics.yaml | 4 +++ .../state_machine_with_inline_policies.yaml | 4 +++ .../state_machine_with_managed_policy.yaml | 2 ++ ...ate_machine_with_permissions_boundary.yaml | 4 +++ .../input/state_machine_with_role.yaml | 2 ++ ...ate_machine_with_sam_policy_templates.yaml | 12 +++++++++ .../input/state_machine_with_schedule.yaml | 2 ++ ...achine_with_schedule_dlq_retry_policy.yaml | 2 ++ .../state_machine_with_standard_logging.yaml | 6 +++++ .../input/state_machine_with_tags.yaml | 2 ++ .../state_machine_with_xray_policies.yaml | 4 +++ .../input/state_machine_with_xray_role.yaml | 2 ++ tests/translator/input/streams.yaml | 6 +++++ tests/translator/output/aws-cn/sqs.json | 6 +++++ ..._machine_with_api_auth_default_scopes.json | 24 +++++++++++++++++ .../state_machine_with_api_authorizer.json | 22 ++++++++++++++++ ...e_machine_with_api_authorizer_maximum.json | 26 +++++++++++++++++++ ...tate_machine_with_api_resource_policy.json | 16 ++++++++++++ .../aws-cn/state_machine_with_condition.json | 2 ++ ...ate_machine_with_condition_and_events.json | 18 +++++++++++++ .../output/aws-cn/state_machine_with_cwe.json | 6 +++++ ...ate_machine_with_definition_S3_object.json | 8 ++++++ ...ate_machine_with_definition_S3_string.json | 8 ++++++ ...machine_with_definition_substitutions.json | 8 ++++++ .../aws-cn/state_machine_with_eb_dlq.json | 6 +++++ .../state_machine_with_eb_dlq_generated.json | 10 +++++++ .../state_machine_with_eb_retry_policy.json | 6 +++++ .../state_machine_with_explicit_api.json | 12 +++++++++ .../state_machine_with_express_logging.json | 12 ++++++++- .../state_machine_with_implicit_api.json | 12 +++++++++ ...ate_machine_with_implicit_api_globals.json | 12 +++++++++ .../state_machine_with_inline_definition.json | 4 +++ ...ine_with_inline_definition_intrinsics.json | 8 ++++++ .../state_machine_with_inline_policies.json | 8 ++++++ .../state_machine_with_managed_policy.json | 4 +++ ...ate_machine_with_permissions_boundary.json | 24 +++++++++++++++++ .../aws-cn/state_machine_with_role.json | 2 ++ ...ate_machine_with_sam_policy_templates.json | 20 +++++++++++++- .../aws-cn/state_machine_with_schedule.json | 6 +++++ ...achine_with_schedule_dlq_retry_policy.json | 6 +++++ .../state_machine_with_standard_logging.json | 12 ++++++++- .../aws-cn/state_machine_with_tags.json | 4 +++ .../state_machine_with_xray_policies.json | 8 ++++++ .../aws-cn/state_machine_with_xray_role.json | 2 ++ tests/translator/output/aws-cn/streams.json | 18 +++++++++++++ tests/translator/output/aws-us-gov/sqs.json | 6 +++++ ..._machine_with_api_auth_default_scopes.json | 24 +++++++++++++++++ .../state_machine_with_api_authorizer.json | 22 ++++++++++++++++ ...e_machine_with_api_authorizer_maximum.json | 26 +++++++++++++++++++ ...tate_machine_with_api_resource_policy.json | 16 ++++++++++++ .../state_machine_with_condition.json | 2 ++ ...ate_machine_with_condition_and_events.json | 18 +++++++++++++ .../aws-us-gov/state_machine_with_cwe.json | 6 +++++ ...ate_machine_with_definition_S3_object.json | 8 ++++++ ...ate_machine_with_definition_S3_string.json | 8 ++++++ ...machine_with_definition_substitutions.json | 8 ++++++ .../aws-us-gov/state_machine_with_eb_dlq.json | 6 +++++ .../state_machine_with_eb_dlq_generated.json | 10 +++++++ .../state_machine_with_eb_retry_policy.json | 6 +++++ .../state_machine_with_explicit_api.json | 12 +++++++++ .../state_machine_with_express_logging.json | 12 ++++++++- .../state_machine_with_implicit_api.json | 12 +++++++++ ...ate_machine_with_implicit_api_globals.json | 12 +++++++++ .../state_machine_with_inline_definition.json | 4 +++ ...ine_with_inline_definition_intrinsics.json | 8 ++++++ .../state_machine_with_inline_policies.json | 8 ++++++ .../state_machine_with_managed_policy.json | 4 +++ ...ate_machine_with_permissions_boundary.json | 24 +++++++++++++++++ .../aws-us-gov/state_machine_with_role.json | 2 ++ ...ate_machine_with_sam_policy_templates.json | 20 +++++++++++++- .../state_machine_with_schedule.json | 6 +++++ ...achine_with_schedule_dlq_retry_policy.json | 6 +++++ .../state_machine_with_standard_logging.json | 12 ++++++++- .../aws-us-gov/state_machine_with_tags.json | 4 +++ .../state_machine_with_xray_policies.json | 8 ++++++ .../state_machine_with_xray_role.json | 2 ++ .../translator/output/aws-us-gov/streams.json | 18 +++++++++++++ tests/translator/output/sqs.json | 6 +++++ ..._machine_with_api_auth_default_scopes.json | 24 +++++++++++++++++ .../state_machine_with_api_authorizer.json | 22 ++++++++++++++++ ...e_machine_with_api_authorizer_maximum.json | 26 +++++++++++++++++++ ...tate_machine_with_api_resource_policy.json | 16 ++++++++++++ .../output/state_machine_with_condition.json | 2 ++ ...ate_machine_with_condition_and_events.json | 18 +++++++++++++ .../output/state_machine_with_cwe.json | 6 +++++ ...ate_machine_with_definition_S3_object.json | 8 ++++++ ...ate_machine_with_definition_S3_string.json | 8 ++++++ ...machine_with_definition_substitutions.json | 8 ++++++ .../output/state_machine_with_eb_dlq.json | 6 +++++ .../state_machine_with_eb_dlq_generated.json | 10 +++++++ .../state_machine_with_eb_retry_policy.json | 6 +++++ .../state_machine_with_explicit_api.json | 12 +++++++++ .../state_machine_with_express_logging.json | 12 ++++++++- .../state_machine_with_implicit_api.json | 12 +++++++++ ...ate_machine_with_implicit_api_globals.json | 12 +++++++++ .../state_machine_with_inline_definition.json | 4 +++ ...ine_with_inline_definition_intrinsics.json | 8 ++++++ .../state_machine_with_inline_policies.json | 8 ++++++ .../state_machine_with_managed_policy.json | 4 +++ ...ate_machine_with_permissions_boundary.json | 24 +++++++++++++++++ .../output/state_machine_with_role.json | 2 ++ ...ate_machine_with_sam_policy_templates.json | 20 +++++++++++++- .../output/state_machine_with_schedule.json | 6 +++++ ...achine_with_schedule_dlq_retry_policy.json | 6 +++++ .../state_machine_with_standard_logging.json | 12 ++++++++- .../output/state_machine_with_tags.json | 4 +++ .../state_machine_with_xray_policies.json | 8 ++++++ .../output/state_machine_with_xray_role.json | 2 ++ tests/translator/output/streams.json | 18 +++++++++++++ 128 files changed, 1121 insertions(+), 9 deletions(-) diff --git a/tests/translator/input/sqs.yaml b/tests/translator/input/sqs.yaml index 9d45de0a8..1c8653dae 100644 --- a/tests/translator/input/sqs.yaml +++ b/tests/translator/input/sqs.yaml @@ -1,6 +1,8 @@ Resources: SQSFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/queues.zip Handler: queue.sqs_handler diff --git a/tests/translator/input/state_machine_with_api_auth_default_scopes.yaml b/tests/translator/input/state_machine_with_api_auth_default_scopes.yaml index 87cd87030..74c83add4 100644 --- a/tests/translator/input/state_machine_with_api_auth_default_scopes.yaml +++ b/tests/translator/input/state_machine_with_api_auth_default_scopes.yaml @@ -1,6 +1,8 @@ Resources: MyApiWithCognitoAuth: Type: "AWS::Serverless::Api" + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod OpenApiVersion: "3.0.1" @@ -20,6 +22,8 @@ Resources: MyStateMachine: Type: AWS::Serverless::StateMachine + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Name: MyStateMachine Definition: diff --git a/tests/translator/input/state_machine_with_api_authorizer.yaml b/tests/translator/input/state_machine_with_api_authorizer.yaml index 1940b0ed0..ecc0bcffd 100644 --- a/tests/translator/input/state_machine_with_api_authorizer.yaml +++ b/tests/translator/input/state_machine_with_api_authorizer.yaml @@ -1,6 +1,8 @@ Resources: MyApi: Type: "AWS::Serverless::Api" + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -18,6 +20,8 @@ Resources: StateMachine: Type: AWS::Serverless::StateMachine + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Name: MyStateMachine Type: STANDARD diff --git a/tests/translator/input/state_machine_with_api_authorizer_maximum.yaml b/tests/translator/input/state_machine_with_api_authorizer_maximum.yaml index 31b235666..01862a49e 100644 --- a/tests/translator/input/state_machine_with_api_authorizer_maximum.yaml +++ b/tests/translator/input/state_machine_with_api_authorizer_maximum.yaml @@ -1,6 +1,8 @@ Resources: MyApi: Type: "AWS::Serverless::Api" + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -53,6 +55,8 @@ Resources: StateMachine: Type: AWS::Serverless::StateMachine + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Name: MyStateMachine Type: STANDARD diff --git a/tests/translator/input/state_machine_with_api_resource_policy.yaml b/tests/translator/input/state_machine_with_api_resource_policy.yaml index 8ca0bbed1..04d6638b6 100644 --- a/tests/translator/input/state_machine_with_api_resource_policy.yaml +++ b/tests/translator/input/state_machine_with_api_resource_policy.yaml @@ -1,11 +1,15 @@ Resources: ExplicitApi: Type: AWS::Serverless::Api + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod MyStateMachine: Type: AWS::Serverless::StateMachine + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Name: MyStateMachine Definition: diff --git a/tests/translator/input/state_machine_with_condition.yaml b/tests/translator/input/state_machine_with_condition.yaml index 58f2227da..7dde78861 100644 --- a/tests/translator/input/state_machine_with_condition.yaml +++ b/tests/translator/input/state_machine_with_condition.yaml @@ -6,6 +6,8 @@ Conditions: Resources: StateMachine: Type: AWS::Serverless::StateMachine + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Condition: "TestCondition" Properties: Name: MyStateMachine diff --git a/tests/translator/input/state_machine_with_condition_and_events.yaml b/tests/translator/input/state_machine_with_condition_and_events.yaml index 710eb4bd3..efddbbe21 100644 --- a/tests/translator/input/state_machine_with_condition_and_events.yaml +++ b/tests/translator/input/state_machine_with_condition_and_events.yaml @@ -6,6 +6,8 @@ Conditions: Resources: StateMachine: Type: AWS::Serverless::StateMachine + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Condition: "TestCondition" Properties: Name: MyStateMachine diff --git a/tests/translator/input/state_machine_with_cwe.yaml b/tests/translator/input/state_machine_with_cwe.yaml index 488d8dc99..347f7318b 100644 --- a/tests/translator/input/state_machine_with_cwe.yaml +++ b/tests/translator/input/state_machine_with_cwe.yaml @@ -1,6 +1,8 @@ Resources: StateMachine: Type: 'AWS::Serverless::StateMachine' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: DefinitionUri: s3://sam-demo-bucket/my_state_machine.asl.json Role: arn:aws:iam::123456123456:role/service-role/SampleRole diff --git a/tests/translator/input/state_machine_with_definition_S3_object.yaml b/tests/translator/input/state_machine_with_definition_S3_object.yaml index 7a9923f2b..7be132ef7 100644 --- a/tests/translator/input/state_machine_with_definition_S3_object.yaml +++ b/tests/translator/input/state_machine_with_definition_S3_object.yaml @@ -1,6 +1,8 @@ Resources: MyFunction: Type: "AWS::Serverless::Function" + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -9,6 +11,8 @@ Resources: StateMachine: Type: AWS::Serverless::StateMachine + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Name: MyStateMachineWithDefinitionInS3 Type: STANDARD diff --git a/tests/translator/input/state_machine_with_definition_S3_string.yaml b/tests/translator/input/state_machine_with_definition_S3_string.yaml index c26974b90..b370da5bd 100644 --- a/tests/translator/input/state_machine_with_definition_S3_string.yaml +++ b/tests/translator/input/state_machine_with_definition_S3_string.yaml @@ -1,6 +1,8 @@ Resources: MyFunction: Type: "AWS::Serverless::Function" + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -9,6 +11,8 @@ Resources: StateMachine: Type: AWS::Serverless::StateMachine + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Name: MyStateMachineWithDefinitionInS3 Type: STANDARD diff --git a/tests/translator/input/state_machine_with_definition_substitutions.yaml b/tests/translator/input/state_machine_with_definition_substitutions.yaml index 1558eebeb..00509be1c 100644 --- a/tests/translator/input/state_machine_with_definition_substitutions.yaml +++ b/tests/translator/input/state_machine_with_definition_substitutions.yaml @@ -1,6 +1,8 @@ Resources: MyFunction: Type: "AWS::Serverless::Function" + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -8,6 +10,8 @@ Resources: StateMachine: Type: AWS::Serverless::StateMachine + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Definition: Comment: A Hello World example of the Amazon States Language using Pass states diff --git a/tests/translator/input/state_machine_with_eb_dlq.yaml b/tests/translator/input/state_machine_with_eb_dlq.yaml index 90721bd20..4c4c8001f 100644 --- a/tests/translator/input/state_machine_with_eb_dlq.yaml +++ b/tests/translator/input/state_machine_with_eb_dlq.yaml @@ -1,6 +1,8 @@ Resources: StateMachine: Type: 'AWS::Serverless::StateMachine' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: DefinitionUri: s3://sam-demo-bucket/my_state_machine.asl.json Role: arn:aws:iam::123456123456:role/service-role/SampleRole diff --git a/tests/translator/input/state_machine_with_eb_dlq_generated.yaml b/tests/translator/input/state_machine_with_eb_dlq_generated.yaml index 9f8d74677..91ad7149f 100644 --- a/tests/translator/input/state_machine_with_eb_dlq_generated.yaml +++ b/tests/translator/input/state_machine_with_eb_dlq_generated.yaml @@ -1,6 +1,8 @@ Resources: StateMachine: Type: 'AWS::Serverless::StateMachine' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: DefinitionUri: s3://sam-demo-bucket/my_state_machine.asl.json Role: arn:aws:iam::123456123456:role/service-role/SampleRole diff --git a/tests/translator/input/state_machine_with_eb_retry_policy.yaml b/tests/translator/input/state_machine_with_eb_retry_policy.yaml index 21dc2d921..e30b7ff09 100644 --- a/tests/translator/input/state_machine_with_eb_retry_policy.yaml +++ b/tests/translator/input/state_machine_with_eb_retry_policy.yaml @@ -1,6 +1,8 @@ Resources: StateMachine: Type: 'AWS::Serverless::StateMachine' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: DefinitionUri: s3://sam-demo-bucket/my_state_machine.asl.json Role: arn:aws:iam::123456123456:role/service-role/SampleRole diff --git a/tests/translator/input/state_machine_with_explicit_api.yaml b/tests/translator/input/state_machine_with_explicit_api.yaml index 6f07fbba0..8fe160c84 100644 --- a/tests/translator/input/state_machine_with_explicit_api.yaml +++ b/tests/translator/input/state_machine_with_explicit_api.yaml @@ -1,11 +1,15 @@ Resources: MyApi: Type: "AWS::Serverless::Api" + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: StageName: Prod StateMachine: Type: AWS::Serverless::StateMachine + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Name: MyStateMachine Type: STANDARD diff --git a/tests/translator/input/state_machine_with_express_logging.yaml b/tests/translator/input/state_machine_with_express_logging.yaml index 29d253a50..9bf6df588 100644 --- a/tests/translator/input/state_machine_with_express_logging.yaml +++ b/tests/translator/input/state_machine_with_express_logging.yaml @@ -1,6 +1,8 @@ Resources: MyFunction: Type: "AWS::Serverless::Function" + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -8,9 +10,13 @@ Resources: ExpressLogGroup: Type: AWS::Logs::LogGroup + DeletionPolicy: Delete + UpdateReplacePolicy: Retain StateMachine: Type: AWS::Serverless::StateMachine + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Name: MyStandardStateMachineWithLogging Type: EXPRESS diff --git a/tests/translator/input/state_machine_with_implicit_api.yaml b/tests/translator/input/state_machine_with_implicit_api.yaml index 368285562..79655a8dd 100644 --- a/tests/translator/input/state_machine_with_implicit_api.yaml +++ b/tests/translator/input/state_machine_with_implicit_api.yaml @@ -1,6 +1,8 @@ Resources: StateMachine: Type: AWS::Serverless::StateMachine + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Name: MyStateMachine Type: STANDARD diff --git a/tests/translator/input/state_machine_with_implicit_api_globals.yaml b/tests/translator/input/state_machine_with_implicit_api_globals.yaml index 5c1c227c0..38585e9ad 100644 --- a/tests/translator/input/state_machine_with_implicit_api_globals.yaml +++ b/tests/translator/input/state_machine_with_implicit_api_globals.yaml @@ -6,6 +6,8 @@ Globals: Resources: StateMachine: Type: AWS::Serverless::StateMachine + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Name: MyStateMachine Type: STANDARD diff --git a/tests/translator/input/state_machine_with_inline_definition.yaml b/tests/translator/input/state_machine_with_inline_definition.yaml index f77f25a2e..ed383c462 100644 --- a/tests/translator/input/state_machine_with_inline_definition.yaml +++ b/tests/translator/input/state_machine_with_inline_definition.yaml @@ -1,6 +1,8 @@ Resources: StateMachine: Type: AWS::Serverless::StateMachine + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Name: MyBasicStateMachine Type: STANDARD diff --git a/tests/translator/input/state_machine_with_inline_definition_intrinsics.yaml b/tests/translator/input/state_machine_with_inline_definition_intrinsics.yaml index 2949605fb..1eb82519d 100644 --- a/tests/translator/input/state_machine_with_inline_definition_intrinsics.yaml +++ b/tests/translator/input/state_machine_with_inline_definition_intrinsics.yaml @@ -1,6 +1,8 @@ Resources: MyFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -9,6 +11,8 @@ Resources: StateMachine: Type: AWS::Serverless::StateMachine + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Name: MyBasicStateMachine Type: STANDARD diff --git a/tests/translator/input/state_machine_with_inline_policies.yaml b/tests/translator/input/state_machine_with_inline_policies.yaml index 1d68c6b82..aa101c06b 100644 --- a/tests/translator/input/state_machine_with_inline_policies.yaml +++ b/tests/translator/input/state_machine_with_inline_policies.yaml @@ -1,6 +1,8 @@ Resources: MyFunction: Type: "AWS::Serverless::Function" + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -9,6 +11,8 @@ Resources: StateMachine: Type: AWS::Serverless::StateMachine + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Name: MyBasicStateMachine Type: STANDARD diff --git a/tests/translator/input/state_machine_with_managed_policy.yaml b/tests/translator/input/state_machine_with_managed_policy.yaml index 3479983dc..09d4e5285 100644 --- a/tests/translator/input/state_machine_with_managed_policy.yaml +++ b/tests/translator/input/state_machine_with_managed_policy.yaml @@ -1,6 +1,8 @@ Resources: StateMachine: Type: AWS::Serverless::StateMachine + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Name: MyStateMachineWithManagedPolicy Type: STANDARD diff --git a/tests/translator/input/state_machine_with_permissions_boundary.yaml b/tests/translator/input/state_machine_with_permissions_boundary.yaml index 5d86d465b..1eb79903d 100644 --- a/tests/translator/input/state_machine_with_permissions_boundary.yaml +++ b/tests/translator/input/state_machine_with_permissions_boundary.yaml @@ -1,6 +1,8 @@ Resources: MyFunction: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -9,6 +11,8 @@ Resources: StateMachine: Type: AWS::Serverless::StateMachine + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Name: MyStateMachine Events: diff --git a/tests/translator/input/state_machine_with_role.yaml b/tests/translator/input/state_machine_with_role.yaml index 1d0885f5f..1e02f65c6 100644 --- a/tests/translator/input/state_machine_with_role.yaml +++ b/tests/translator/input/state_machine_with_role.yaml @@ -1,6 +1,8 @@ Resources: StateMachine: Type: AWS::Serverless::StateMachine + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Name: MyStateMachineWithRole Type: STANDARD diff --git a/tests/translator/input/state_machine_with_sam_policy_templates.yaml b/tests/translator/input/state_machine_with_sam_policy_templates.yaml index a099fc204..9d5ebf451 100644 --- a/tests/translator/input/state_machine_with_sam_policy_templates.yaml +++ b/tests/translator/input/state_machine_with_sam_policy_templates.yaml @@ -1,6 +1,8 @@ Resources: StarterLambda: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/starter.zip Handler: starter.handler @@ -8,9 +10,13 @@ Resources: ProcessingQueue: Type: AWS::SQS::Queue + DeletionPolicy: Delete + UpdateReplacePolicy: Retain ResolverLambda: Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/resolver.zip Handler: resolver.handler @@ -18,6 +24,8 @@ Resources: NestedWorkflow: Type: AWS::Serverless::StateMachine + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Type: STANDARD Definition: @@ -37,11 +45,15 @@ Resources: OutputStore: Type: AWS::Serverless::SimpleTable + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: TableName: MySimpleTable ProcessingWorkflow: Type: AWS::Serverless::StateMachine + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Type: STANDARD Definition: diff --git a/tests/translator/input/state_machine_with_schedule.yaml b/tests/translator/input/state_machine_with_schedule.yaml index 324ce30f8..d57defefa 100644 --- a/tests/translator/input/state_machine_with_schedule.yaml +++ b/tests/translator/input/state_machine_with_schedule.yaml @@ -1,6 +1,8 @@ Resources: StateMachine: Type: 'AWS::Serverless::StateMachine' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: DefinitionUri: s3://sam-demo-bucket/my_state_machine.asl.json Role: arn:aws:iam::123456123456:role/service-role/SampleRole diff --git a/tests/translator/input/state_machine_with_schedule_dlq_retry_policy.yaml b/tests/translator/input/state_machine_with_schedule_dlq_retry_policy.yaml index 9f7385f90..2973893c9 100644 --- a/tests/translator/input/state_machine_with_schedule_dlq_retry_policy.yaml +++ b/tests/translator/input/state_machine_with_schedule_dlq_retry_policy.yaml @@ -1,6 +1,8 @@ Resources: StateMachine: Type: 'AWS::Serverless::StateMachine' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: DefinitionUri: s3://sam-demo-bucket/my_state_machine.asl.json Role: arn:aws:iam::123456123456:role/service-role/SampleRole diff --git a/tests/translator/input/state_machine_with_standard_logging.yaml b/tests/translator/input/state_machine_with_standard_logging.yaml index 529a1a1dd..70ee10e7a 100644 --- a/tests/translator/input/state_machine_with_standard_logging.yaml +++ b/tests/translator/input/state_machine_with_standard_logging.yaml @@ -1,6 +1,8 @@ Resources: MyFunction: Type: "AWS::Serverless::Function" + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -8,9 +10,13 @@ Resources: StandardLogGroup: Type: AWS::Logs::LogGroup + DeletionPolicy: Delete + UpdateReplacePolicy: Retain StateMachine: Type: AWS::Serverless::StateMachine + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Name: MyStandardStateMachineWithLogging Type: STANDARD diff --git a/tests/translator/input/state_machine_with_tags.yaml b/tests/translator/input/state_machine_with_tags.yaml index dd1e15b12..02415f27f 100644 --- a/tests/translator/input/state_machine_with_tags.yaml +++ b/tests/translator/input/state_machine_with_tags.yaml @@ -1,6 +1,8 @@ Resources: StateMachine: Type: AWS::Serverless::StateMachine + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Name: MyStateMachineWithTags Type: STANDARD diff --git a/tests/translator/input/state_machine_with_xray_policies.yaml b/tests/translator/input/state_machine_with_xray_policies.yaml index 719d5874a..f49036ae0 100644 --- a/tests/translator/input/state_machine_with_xray_policies.yaml +++ b/tests/translator/input/state_machine_with_xray_policies.yaml @@ -1,6 +1,8 @@ Resources: MyFunction: Type: "AWS::Serverless::Function" + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -8,6 +10,8 @@ Resources: StateMachine: Type: AWS::Serverless::StateMachine + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Name: MyBasicStateMachine Type: STANDARD diff --git a/tests/translator/input/state_machine_with_xray_role.yaml b/tests/translator/input/state_machine_with_xray_role.yaml index f5e56e729..1e92bfb91 100644 --- a/tests/translator/input/state_machine_with_xray_role.yaml +++ b/tests/translator/input/state_machine_with_xray_role.yaml @@ -1,6 +1,8 @@ Resources: StateMachine: Type: AWS::Serverless::StateMachine + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: Name: MyStateMachineWithXRayTracing Type: STANDARD diff --git a/tests/translator/input/streams.yaml b/tests/translator/input/streams.yaml index 3ae736b79..5ec2fd296 100644 --- a/tests/translator/input/streams.yaml +++ b/tests/translator/input/streams.yaml @@ -1,6 +1,8 @@ Resources: KinesisFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/streams.zip Handler: stream.kinesis_handler @@ -15,6 +17,8 @@ Resources: Enabled: false DynamoDBFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/streams.zip Handler: stream.ddb_handler @@ -28,6 +32,8 @@ Resources: StartingPosition: LATEST MSKFunction: Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/streams.zip Handler: stream.msk_handler diff --git a/tests/translator/output/aws-cn/sqs.json b/tests/translator/output/aws-cn/sqs.json index cad7b2248..399e78b7a 100644 --- a/tests/translator/output/aws-cn/sqs.json +++ b/tests/translator/output/aws-cn/sqs.json @@ -2,6 +2,8 @@ "Resources": { "SQSFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -31,6 +33,8 @@ }, "SQSFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -52,6 +56,8 @@ }, "SQSFunctionMySqsQueue": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BatchSize": 10, "Enabled": false, diff --git a/tests/translator/output/aws-cn/state_machine_with_api_auth_default_scopes.json b/tests/translator/output/aws-cn/state_machine_with_api_auth_default_scopes.json index 6a466f04a..ab72718f4 100644 --- a/tests/translator/output/aws-cn/state_machine_with_api_auth_default_scopes.json +++ b/tests/translator/output/aws-cn/state_machine_with_api_auth_default_scopes.json @@ -2,6 +2,8 @@ "Resources": { "MyApiWithCognitoAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -367,6 +369,8 @@ }, "MyStateMachineCognitoWithAuthNoneRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -404,6 +408,8 @@ }, "MyStateMachineCognitoDefaultScopesNoneRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -441,6 +447,8 @@ }, "MyStateMachineCognitoDefaultAuthDefaultScopesNoneRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -478,6 +486,8 @@ }, "MyStateMachineCognitoDefaultScopesWithOverwrittenRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -515,6 +525,8 @@ }, "MyApiWithCognitoAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithCognitoAuthDeployment57b57dfc88" @@ -527,6 +539,8 @@ }, "MyApiWithCognitoAuthDeployment57b57dfc88": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithCognitoAuth" @@ -536,6 +550,8 @@ }, "MyStateMachineCognitoDefaultScopesDefaultAuthorizerRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -573,6 +589,8 @@ }, "MyStateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ @@ -614,6 +632,8 @@ }, "MyStateMachineCognitoAuthorizerWithDefaultScopesRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -651,6 +671,8 @@ }, "MyStateMachineCognitoAuthorizerScopesOverwrittenRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -688,6 +710,8 @@ }, "MyStateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", diff --git a/tests/translator/output/aws-cn/state_machine_with_api_authorizer.json b/tests/translator/output/aws-cn/state_machine_with_api_authorizer.json index 859dea489..3596485e7 100644 --- a/tests/translator/output/aws-cn/state_machine_with_api_authorizer.json +++ b/tests/translator/output/aws-cn/state_machine_with_api_authorizer.json @@ -2,6 +2,8 @@ "Resources": { "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ @@ -44,6 +46,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentaaffc688ce" @@ -56,6 +60,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -118,6 +124,8 @@ }, "StateMachineWithLambdaTokenAuthRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -155,6 +163,8 @@ }, "MyApiMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -173,6 +183,8 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -270,6 +282,8 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -313,6 +327,8 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment2d6a709a2a" @@ -325,6 +341,8 @@ }, "ServerlessRestApiDeploymentaaffc688ce": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -335,6 +353,8 @@ }, "StateMachineWithNoAuthorizerRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -372,6 +392,8 @@ }, "MyApiDeployment2d6a709a2a": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" diff --git a/tests/translator/output/aws-cn/state_machine_with_api_authorizer_maximum.json b/tests/translator/output/aws-cn/state_machine_with_api_authorizer_maximum.json index 4755fb316..997556209 100644 --- a/tests/translator/output/aws-cn/state_machine_with_api_authorizer_maximum.json +++ b/tests/translator/output/aws-cn/state_machine_with_api_authorizer_maximum.json @@ -2,6 +2,8 @@ "Resources": { "MyApiMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -20,6 +22,8 @@ }, "StateMachineWithLambdaRequestAuthorizerRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -57,6 +61,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ @@ -99,6 +105,8 @@ }, "StateMachineWithDefaultAuthorizerRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -136,6 +144,8 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -476,6 +486,8 @@ }, "MyApiMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -494,6 +506,8 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -537,6 +551,8 @@ }, "StateMachineWithLambdaTokenAuthorizerRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -574,6 +590,8 @@ }, "MyApiMyLambdaTokenAuthNoneFunctionInvokeRoleAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -592,6 +610,8 @@ }, "MyApiDeployment704a2ea820": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -602,6 +622,8 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment704a2ea820" @@ -614,6 +636,8 @@ }, "StateMachineWithCognitoMultipleUserPoolsAuthorizerRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -651,6 +675,8 @@ }, "StateMachineWithNoAuthorizerRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { diff --git a/tests/translator/output/aws-cn/state_machine_with_api_resource_policy.json b/tests/translator/output/aws-cn/state_machine_with_api_resource_policy.json index f9b4100a5..450ad48c1 100644 --- a/tests/translator/output/aws-cn/state_machine_with_api_resource_policy.json +++ b/tests/translator/output/aws-cn/state_machine_with_api_resource_policy.json @@ -2,6 +2,8 @@ "Resources": { "MyStateMachineGetHtmlRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -39,6 +41,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -300,6 +304,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment17065a95ba" @@ -312,6 +318,8 @@ }, "MyStateMachinePutHtmlRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -349,6 +357,8 @@ }, "MyStateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ @@ -390,6 +400,8 @@ }, "ExplicitApiDeployment17065a95ba": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -400,6 +412,8 @@ }, "MyStateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -443,6 +457,8 @@ }, "MyStateMachinePostHtmlRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { diff --git a/tests/translator/output/aws-cn/state_machine_with_condition.json b/tests/translator/output/aws-cn/state_machine_with_condition.json index 7d67abe1a..756e0dd02 100644 --- a/tests/translator/output/aws-cn/state_machine_with_condition.json +++ b/tests/translator/output/aws-cn/state_machine_with_condition.json @@ -10,6 +10,8 @@ "Resources": { "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "StateMachineName": "MyStateMachine", diff --git a/tests/translator/output/aws-cn/state_machine_with_condition_and_events.json b/tests/translator/output/aws-cn/state_machine_with_condition_and_events.json index 8e0a7a0ab..daaa04767 100644 --- a/tests/translator/output/aws-cn/state_machine_with_condition_and_events.json +++ b/tests/translator/output/aws-cn/state_machine_with_condition_and_events.json @@ -10,6 +10,8 @@ "Resources": { "StateMachineMyApiEventRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -48,6 +50,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "StateMachineName": "MyStateMachine", @@ -67,6 +71,8 @@ }, "StateMachineScheduleEventRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -105,6 +111,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentaeae651245" @@ -118,6 +126,8 @@ }, "StateMachineScheduleEvent": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ScheduleExpression": "rate(1 minute)", "Targets": [ @@ -140,6 +150,8 @@ }, "StateMachineCWEvent": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -167,6 +179,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -254,6 +268,8 @@ }, "ServerlessRestApiDeploymentaeae651245": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -265,6 +281,8 @@ }, "StateMachineCWEventRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { diff --git a/tests/translator/output/aws-cn/state_machine_with_cwe.json b/tests/translator/output/aws-cn/state_machine_with_cwe.json index 04164e943..177fdfe96 100644 --- a/tests/translator/output/aws-cn/state_machine_with_cwe.json +++ b/tests/translator/output/aws-cn/state_machine_with_cwe.json @@ -2,6 +2,8 @@ "Resources": { "StateMachineCWEvent": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -28,6 +30,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "DefinitionS3Location": { @@ -44,6 +48,8 @@ }, "StateMachineCWEventRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { diff --git a/tests/translator/output/aws-cn/state_machine_with_definition_S3_object.json b/tests/translator/output/aws-cn/state_machine_with_definition_S3_object.json index 81caf3cfe..aa9c1bd58 100644 --- a/tests/translator/output/aws-cn/state_machine_with_definition_S3_object.json +++ b/tests/translator/output/aws-cn/state_machine_with_definition_S3_object.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -26,6 +28,8 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -74,6 +78,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -104,6 +110,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Tags": [ { diff --git a/tests/translator/output/aws-cn/state_machine_with_definition_S3_string.json b/tests/translator/output/aws-cn/state_machine_with_definition_S3_string.json index 97b28ece4..062d5c5e1 100644 --- a/tests/translator/output/aws-cn/state_machine_with_definition_S3_string.json +++ b/tests/translator/output/aws-cn/state_machine_with_definition_S3_string.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -26,6 +28,8 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -74,6 +78,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -104,6 +110,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Tags": [ { diff --git a/tests/translator/output/aws-cn/state_machine_with_definition_substitutions.json b/tests/translator/output/aws-cn/state_machine_with_definition_substitutions.json index 0b6ac94f6..5787da02a 100644 --- a/tests/translator/output/aws-cn/state_machine_with_definition_substitutions.json +++ b/tests/translator/output/aws-cn/state_machine_with_definition_substitutions.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -25,6 +27,8 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -73,6 +77,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -103,6 +109,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DefinitionSubstitutions": { "definition_substitution_1": { diff --git a/tests/translator/output/aws-cn/state_machine_with_eb_dlq.json b/tests/translator/output/aws-cn/state_machine_with_eb_dlq.json index e49e64256..47aa3b4f3 100644 --- a/tests/translator/output/aws-cn/state_machine_with_eb_dlq.json +++ b/tests/translator/output/aws-cn/state_machine_with_eb_dlq.json @@ -2,6 +2,8 @@ "Resources": { "StateMachineCWEvent": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -31,6 +33,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "DefinitionS3Location": { @@ -47,6 +51,8 @@ }, "StateMachineCWEventRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { diff --git a/tests/translator/output/aws-cn/state_machine_with_eb_dlq_generated.json b/tests/translator/output/aws-cn/state_machine_with_eb_dlq_generated.json index 7e57f8926..213cea8c0 100644 --- a/tests/translator/output/aws-cn/state_machine_with_eb_dlq_generated.json +++ b/tests/translator/output/aws-cn/state_machine_with_eb_dlq_generated.json @@ -2,10 +2,14 @@ "Resources": { "TestDLQ": { "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": {} }, "StateMachineCWEvent": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -40,6 +44,8 @@ }, "StateMachineCWEventQueuePolicy": { "Type": "AWS::SQS::QueuePolicy", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Queues": [ { @@ -78,6 +84,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "DefinitionS3Location": { @@ -94,6 +102,8 @@ }, "StateMachineCWEventRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { diff --git a/tests/translator/output/aws-cn/state_machine_with_eb_retry_policy.json b/tests/translator/output/aws-cn/state_machine_with_eb_retry_policy.json index bff94e177..3d6af1cfa 100644 --- a/tests/translator/output/aws-cn/state_machine_with_eb_retry_policy.json +++ b/tests/translator/output/aws-cn/state_machine_with_eb_retry_policy.json @@ -2,6 +2,8 @@ "Resources": { "StateMachineCWEvent": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -32,6 +34,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "DefinitionS3Location": { @@ -48,6 +52,8 @@ }, "StateMachineCWEventRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { diff --git a/tests/translator/output/aws-cn/state_machine_with_explicit_api.json b/tests/translator/output/aws-cn/state_machine_with_explicit_api.json index 70ef4676a..3cad7af0f 100644 --- a/tests/translator/output/aws-cn/state_machine_with_explicit_api.json +++ b/tests/translator/output/aws-cn/state_machine_with_explicit_api.json @@ -2,6 +2,8 @@ "Resources": { "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -45,6 +47,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ @@ -87,6 +91,8 @@ }, "MyApiDeployment05bc9f394c": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -97,6 +103,8 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment05bc9f394c" @@ -109,6 +117,8 @@ }, "StateMachineMyApiEventRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -146,6 +156,8 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/state_machine_with_express_logging.json b/tests/translator/output/aws-cn/state_machine_with_express_logging.json index 5a5583bf6..eea4adefa 100644 --- a/tests/translator/output/aws-cn/state_machine_with_express_logging.json +++ b/tests/translator/output/aws-cn/state_machine_with_express_logging.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -25,6 +27,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -55,6 +59,8 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -126,10 +132,14 @@ } }, "ExpressLogGroup": { - "Type": "AWS::Logs::LogGroup" + "Type": "AWS::Logs::LogGroup", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Tags": [ { diff --git a/tests/translator/output/aws-cn/state_machine_with_implicit_api.json b/tests/translator/output/aws-cn/state_machine_with_implicit_api.json index ebb4b1c02..d9f4c7542 100644 --- a/tests/translator/output/aws-cn/state_machine_with_implicit_api.json +++ b/tests/translator/output/aws-cn/state_machine_with_implicit_api.json @@ -2,6 +2,8 @@ "Resources": { "StateMachineMyApiEventRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -39,6 +41,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ @@ -81,6 +85,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment05bc9f394c" @@ -93,6 +99,8 @@ }, "ServerlessRestApiDeployment05bc9f394c": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -103,6 +111,8 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -146,6 +156,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/state_machine_with_implicit_api_globals.json b/tests/translator/output/aws-cn/state_machine_with_implicit_api_globals.json index c28b4704f..0a7dc1ff9 100644 --- a/tests/translator/output/aws-cn/state_machine_with_implicit_api_globals.json +++ b/tests/translator/output/aws-cn/state_machine_with_implicit_api_globals.json @@ -2,6 +2,8 @@ "Resources": { "StateMachineMyApiEventRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -39,6 +41,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ @@ -81,6 +85,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment1f01b589d4" @@ -93,6 +99,8 @@ }, "ServerlessRestApiDeployment1f01b589d4": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -103,6 +111,8 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -146,6 +156,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/state_machine_with_inline_definition.json b/tests/translator/output/aws-cn/state_machine_with_inline_definition.json index 722bc9ec7..52817da2b 100644 --- a/tests/translator/output/aws-cn/state_machine_with_inline_definition.json +++ b/tests/translator/output/aws-cn/state_machine_with_inline_definition.json @@ -2,6 +2,8 @@ "Resources": { "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -45,6 +47,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ diff --git a/tests/translator/output/aws-cn/state_machine_with_inline_definition_intrinsics.json b/tests/translator/output/aws-cn/state_machine_with_inline_definition_intrinsics.json index 0237cf961..87567cec1 100644 --- a/tests/translator/output/aws-cn/state_machine_with_inline_definition_intrinsics.json +++ b/tests/translator/output/aws-cn/state_machine_with_inline_definition_intrinsics.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -26,6 +28,8 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -74,6 +78,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -104,6 +110,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DefinitionString": { "Fn::Join": [ diff --git a/tests/translator/output/aws-cn/state_machine_with_inline_policies.json b/tests/translator/output/aws-cn/state_machine_with_inline_policies.json index 0237cf961..87567cec1 100644 --- a/tests/translator/output/aws-cn/state_machine_with_inline_policies.json +++ b/tests/translator/output/aws-cn/state_machine_with_inline_policies.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -26,6 +28,8 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -74,6 +78,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -104,6 +110,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DefinitionString": { "Fn::Join": [ diff --git a/tests/translator/output/aws-cn/state_machine_with_managed_policy.json b/tests/translator/output/aws-cn/state_machine_with_managed_policy.json index be6090ce9..59e7c9449 100644 --- a/tests/translator/output/aws-cn/state_machine_with_managed_policy.json +++ b/tests/translator/output/aws-cn/state_machine_with_managed_policy.json @@ -2,6 +2,8 @@ "Resources": { "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -32,6 +34,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ diff --git a/tests/translator/output/aws-cn/state_machine_with_permissions_boundary.json b/tests/translator/output/aws-cn/state_machine_with_permissions_boundary.json index 645e7d5a3..a8eba5bae 100644 --- a/tests/translator/output/aws-cn/state_machine_with_permissions_boundary.json +++ b/tests/translator/output/aws-cn/state_machine_with_permissions_boundary.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -26,6 +28,8 @@ }, "StateMachineMyApiEventRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "PermissionsBoundary": "arn:aws:1234:iam:boundary/CustomerCreatedPermissionsBoundary", "Policies": [ @@ -64,6 +68,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ @@ -87,6 +93,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment05bc9f394c" @@ -99,6 +107,8 @@ }, "ServerlessRestApiDeployment05bc9f394c": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -109,6 +119,8 @@ }, "StateMachineCWEvent": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -135,6 +147,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -165,6 +179,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -227,6 +243,8 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -281,6 +299,8 @@ }, "StateMachineScheduleEventRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "PermissionsBoundary": "arn:aws:1234:iam:boundary/CustomerCreatedPermissionsBoundary", "Policies": [ @@ -319,6 +339,8 @@ }, "StateMachineScheduleEvent": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ScheduleExpression": "rate(1 minute)", "Targets": [ @@ -340,6 +362,8 @@ }, "StateMachineCWEventRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "PermissionsBoundary": "arn:aws:1234:iam:boundary/CustomerCreatedPermissionsBoundary", "Policies": [ diff --git a/tests/translator/output/aws-cn/state_machine_with_role.json b/tests/translator/output/aws-cn/state_machine_with_role.json index 0db8c03ab..e929f3e45 100644 --- a/tests/translator/output/aws-cn/state_machine_with_role.json +++ b/tests/translator/output/aws-cn/state_machine_with_role.json @@ -2,6 +2,8 @@ "Resources": { "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "StateMachineName": "MyStateMachineWithRole", diff --git a/tests/translator/output/aws-cn/state_machine_with_sam_policy_templates.json b/tests/translator/output/aws-cn/state_machine_with_sam_policy_templates.json index 17fb1640d..e9dbaaf07 100644 --- a/tests/translator/output/aws-cn/state_machine_with_sam_policy_templates.json +++ b/tests/translator/output/aws-cn/state_machine_with_sam_policy_templates.json @@ -2,6 +2,8 @@ "Resources": { "ResolverLambda": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "resolver.handler", "Code": { @@ -25,6 +27,8 @@ }, "NestedWorkflow": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DefinitionSubstitutions": { "definition_substitution_1": { @@ -71,6 +75,8 @@ }, "StarterLambda": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "starter.handler", "Code": { @@ -94,6 +100,8 @@ }, "ProcessingWorkflow": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DefinitionSubstitutions": { "definition_substitution_4": { @@ -242,6 +250,8 @@ }, "StarterLambdaRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -272,6 +282,8 @@ }, "ProcessingWorkflowRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -437,6 +449,8 @@ }, "OutputStore": { "Type": "AWS::DynamoDB::Table", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "KeySchema": [ { @@ -455,10 +469,14 @@ } }, "ProcessingQueue": { - "Type": "AWS::SQS::Queue" + "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, "ResolverLambdaRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", diff --git a/tests/translator/output/aws-cn/state_machine_with_schedule.json b/tests/translator/output/aws-cn/state_machine_with_schedule.json index 8730521be..76099c10b 100644 --- a/tests/translator/output/aws-cn/state_machine_with_schedule.json +++ b/tests/translator/output/aws-cn/state_machine_with_schedule.json @@ -2,6 +2,8 @@ "Resources": { "StateMachineScheduleEvent": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "State": "DISABLED", "ScheduleExpression": "rate(1 minute)", @@ -25,6 +27,8 @@ }, "StateMachineScheduleEventRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -62,6 +66,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "DefinitionS3Location": { diff --git a/tests/translator/output/aws-cn/state_machine_with_schedule_dlq_retry_policy.json b/tests/translator/output/aws-cn/state_machine_with_schedule_dlq_retry_policy.json index 5d49175a9..fa7f67853 100644 --- a/tests/translator/output/aws-cn/state_machine_with_schedule_dlq_retry_policy.json +++ b/tests/translator/output/aws-cn/state_machine_with_schedule_dlq_retry_policy.json @@ -2,6 +2,8 @@ "Resources": { "StateMachineScheduleEvent": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "State": "DISABLED", "ScheduleExpression": "rate(1 minute)", @@ -32,6 +34,8 @@ }, "StateMachineScheduleEventRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -69,6 +73,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "DefinitionS3Location": { diff --git a/tests/translator/output/aws-cn/state_machine_with_standard_logging.json b/tests/translator/output/aws-cn/state_machine_with_standard_logging.json index 315b60c2f..9b142a7bc 100644 --- a/tests/translator/output/aws-cn/state_machine_with_standard_logging.json +++ b/tests/translator/output/aws-cn/state_machine_with_standard_logging.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -24,10 +26,14 @@ } }, "StandardLogGroup": { - "Type": "AWS::Logs::LogGroup" + "Type": "AWS::Logs::LogGroup", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -100,6 +106,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -130,6 +138,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Tags": [ { diff --git a/tests/translator/output/aws-cn/state_machine_with_tags.json b/tests/translator/output/aws-cn/state_machine_with_tags.json index 6016da420..ba81b1f62 100644 --- a/tests/translator/output/aws-cn/state_machine_with_tags.json +++ b/tests/translator/output/aws-cn/state_machine_with_tags.json @@ -2,6 +2,8 @@ "Resources": { "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -53,6 +55,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ diff --git a/tests/translator/output/aws-cn/state_machine_with_xray_policies.json b/tests/translator/output/aws-cn/state_machine_with_xray_policies.json index c073afdc6..997f543d5 100644 --- a/tests/translator/output/aws-cn/state_machine_with_xray_policies.json +++ b/tests/translator/output/aws-cn/state_machine_with_xray_policies.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -25,6 +27,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -55,6 +59,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DefinitionS3Location": { "Bucket": "sam-demo-bucket", @@ -81,6 +87,8 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", diff --git a/tests/translator/output/aws-cn/state_machine_with_xray_role.json b/tests/translator/output/aws-cn/state_machine_with_xray_role.json index 156d59d44..0ac655a98 100644 --- a/tests/translator/output/aws-cn/state_machine_with_xray_role.json +++ b/tests/translator/output/aws-cn/state_machine_with_xray_role.json @@ -2,6 +2,8 @@ "Resources": { "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Tags": [ { diff --git a/tests/translator/output/aws-cn/streams.json b/tests/translator/output/aws-cn/streams.json index ce73f1a36..8687c9b2e 100644 --- a/tests/translator/output/aws-cn/streams.json +++ b/tests/translator/output/aws-cn/streams.json @@ -2,6 +2,8 @@ "Resources": { "DynamoDBFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -23,6 +25,8 @@ }, "KinesisFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -44,6 +48,8 @@ }, "MSKFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -65,6 +71,8 @@ }, "DynamoDBFunctionMyDDBStream": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BatchSize": 200, "EventSourceArn": "arn:aws:dynamodb:us-west-2:012345678901:table/TestTable/stream/2015-05-11T21:21:33.291", @@ -76,6 +84,8 @@ }, "DynamoDBFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -105,6 +115,8 @@ }, "KinesisFunctionMyKinesisStream": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BatchSize": 100, "Enabled": false, @@ -117,6 +129,8 @@ }, "KinesisFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -146,6 +160,8 @@ }, "MSKFunctionMyMSKStream": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EventSourceArn": "arn:aws:kafka:us-west-2:012345678901:cluster/mycluster/6cc0432b-8618-4f44-bccc-e1fbd8fb7c4d-2", "FunctionName": { @@ -157,6 +173,8 @@ }, "MSKFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", diff --git a/tests/translator/output/aws-us-gov/sqs.json b/tests/translator/output/aws-us-gov/sqs.json index 0d80717ab..bf0e33edd 100644 --- a/tests/translator/output/aws-us-gov/sqs.json +++ b/tests/translator/output/aws-us-gov/sqs.json @@ -2,6 +2,8 @@ "Resources": { "SQSFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -31,6 +33,8 @@ }, "SQSFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -52,6 +56,8 @@ }, "SQSFunctionMySqsQueue": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BatchSize": 10, "Enabled": false, diff --git a/tests/translator/output/aws-us-gov/state_machine_with_api_auth_default_scopes.json b/tests/translator/output/aws-us-gov/state_machine_with_api_auth_default_scopes.json index 6a466f04a..ab72718f4 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_api_auth_default_scopes.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_api_auth_default_scopes.json @@ -2,6 +2,8 @@ "Resources": { "MyApiWithCognitoAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -367,6 +369,8 @@ }, "MyStateMachineCognitoWithAuthNoneRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -404,6 +408,8 @@ }, "MyStateMachineCognitoDefaultScopesNoneRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -441,6 +447,8 @@ }, "MyStateMachineCognitoDefaultAuthDefaultScopesNoneRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -478,6 +486,8 @@ }, "MyStateMachineCognitoDefaultScopesWithOverwrittenRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -515,6 +525,8 @@ }, "MyApiWithCognitoAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithCognitoAuthDeployment57b57dfc88" @@ -527,6 +539,8 @@ }, "MyApiWithCognitoAuthDeployment57b57dfc88": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithCognitoAuth" @@ -536,6 +550,8 @@ }, "MyStateMachineCognitoDefaultScopesDefaultAuthorizerRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -573,6 +589,8 @@ }, "MyStateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ @@ -614,6 +632,8 @@ }, "MyStateMachineCognitoAuthorizerWithDefaultScopesRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -651,6 +671,8 @@ }, "MyStateMachineCognitoAuthorizerScopesOverwrittenRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -688,6 +710,8 @@ }, "MyStateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", diff --git a/tests/translator/output/aws-us-gov/state_machine_with_api_authorizer.json b/tests/translator/output/aws-us-gov/state_machine_with_api_authorizer.json index c7a7a8711..b6af29036 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_api_authorizer.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_api_authorizer.json @@ -2,6 +2,8 @@ "Resources": { "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ @@ -44,6 +46,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentaaffc688ce" @@ -56,6 +60,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -118,6 +124,8 @@ }, "StateMachineWithLambdaTokenAuthRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -155,6 +163,8 @@ }, "MyApiMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -173,6 +183,8 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -216,6 +228,8 @@ }, "MyApiDeployment3c26186470": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -226,6 +240,8 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment3c26186470" @@ -238,6 +254,8 @@ }, "ServerlessRestApiDeploymentaaffc688ce": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -248,6 +266,8 @@ }, "StateMachineWithNoAuthorizerRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -285,6 +305,8 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/state_machine_with_api_authorizer_maximum.json b/tests/translator/output/aws-us-gov/state_machine_with_api_authorizer_maximum.json index 42ad354b4..119be2f8c 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_api_authorizer_maximum.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_api_authorizer_maximum.json @@ -2,6 +2,8 @@ "Resources": { "MyApiMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -20,6 +22,8 @@ }, "StateMachineWithLambdaRequestAuthorizerRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -57,6 +61,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ @@ -99,6 +105,8 @@ }, "MyApiDeployment2120b73f3e": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -109,6 +117,8 @@ }, "StateMachineWithDefaultAuthorizerRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -146,6 +156,8 @@ }, "MyApiMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -164,6 +176,8 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -207,6 +221,8 @@ }, "StateMachineWithLambdaTokenAuthorizerRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -244,6 +260,8 @@ }, "MyApiMyLambdaTokenAuthNoneFunctionInvokeRoleAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -262,6 +280,8 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment2120b73f3e" @@ -274,6 +294,8 @@ }, "StateMachineWithCognitoMultipleUserPoolsAuthorizerRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -311,6 +333,8 @@ }, "StateMachineWithNoAuthorizerRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -348,6 +372,8 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/state_machine_with_api_resource_policy.json b/tests/translator/output/aws-us-gov/state_machine_with_api_resource_policy.json index f9b4100a5..450ad48c1 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_api_resource_policy.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_api_resource_policy.json @@ -2,6 +2,8 @@ "Resources": { "MyStateMachineGetHtmlRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -39,6 +41,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -300,6 +304,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment17065a95ba" @@ -312,6 +318,8 @@ }, "MyStateMachinePutHtmlRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -349,6 +357,8 @@ }, "MyStateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ @@ -390,6 +400,8 @@ }, "ExplicitApiDeployment17065a95ba": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -400,6 +412,8 @@ }, "MyStateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -443,6 +457,8 @@ }, "MyStateMachinePostHtmlRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { diff --git a/tests/translator/output/aws-us-gov/state_machine_with_condition.json b/tests/translator/output/aws-us-gov/state_machine_with_condition.json index 7d67abe1a..756e0dd02 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_condition.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_condition.json @@ -10,6 +10,8 @@ "Resources": { "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "StateMachineName": "MyStateMachine", diff --git a/tests/translator/output/aws-us-gov/state_machine_with_condition_and_events.json b/tests/translator/output/aws-us-gov/state_machine_with_condition_and_events.json index 8e0a7a0ab..daaa04767 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_condition_and_events.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_condition_and_events.json @@ -10,6 +10,8 @@ "Resources": { "StateMachineMyApiEventRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -48,6 +50,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "StateMachineName": "MyStateMachine", @@ -67,6 +71,8 @@ }, "StateMachineScheduleEventRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -105,6 +111,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentaeae651245" @@ -118,6 +126,8 @@ }, "StateMachineScheduleEvent": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ScheduleExpression": "rate(1 minute)", "Targets": [ @@ -140,6 +150,8 @@ }, "StateMachineCWEvent": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -167,6 +179,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -254,6 +268,8 @@ }, "ServerlessRestApiDeploymentaeae651245": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -265,6 +281,8 @@ }, "StateMachineCWEventRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { diff --git a/tests/translator/output/aws-us-gov/state_machine_with_cwe.json b/tests/translator/output/aws-us-gov/state_machine_with_cwe.json index 04164e943..177fdfe96 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_cwe.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_cwe.json @@ -2,6 +2,8 @@ "Resources": { "StateMachineCWEvent": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -28,6 +30,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "DefinitionS3Location": { @@ -44,6 +48,8 @@ }, "StateMachineCWEventRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { diff --git a/tests/translator/output/aws-us-gov/state_machine_with_definition_S3_object.json b/tests/translator/output/aws-us-gov/state_machine_with_definition_S3_object.json index d324146d6..2679a95c0 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_definition_S3_object.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_definition_S3_object.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -26,6 +28,8 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -74,6 +78,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -104,6 +110,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Tags": [ { diff --git a/tests/translator/output/aws-us-gov/state_machine_with_definition_S3_string.json b/tests/translator/output/aws-us-gov/state_machine_with_definition_S3_string.json index 4caed8074..5f6a4faba 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_definition_S3_string.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_definition_S3_string.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -26,6 +28,8 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -74,6 +78,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -104,6 +110,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Tags": [ { diff --git a/tests/translator/output/aws-us-gov/state_machine_with_definition_substitutions.json b/tests/translator/output/aws-us-gov/state_machine_with_definition_substitutions.json index 3695a061e..93680ef48 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_definition_substitutions.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_definition_substitutions.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -25,6 +27,8 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -73,6 +77,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -103,6 +109,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DefinitionSubstitutions": { "definition_substitution_1": { diff --git a/tests/translator/output/aws-us-gov/state_machine_with_eb_dlq.json b/tests/translator/output/aws-us-gov/state_machine_with_eb_dlq.json index e49e64256..47aa3b4f3 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_eb_dlq.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_eb_dlq.json @@ -2,6 +2,8 @@ "Resources": { "StateMachineCWEvent": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -31,6 +33,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "DefinitionS3Location": { @@ -47,6 +51,8 @@ }, "StateMachineCWEventRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { diff --git a/tests/translator/output/aws-us-gov/state_machine_with_eb_dlq_generated.json b/tests/translator/output/aws-us-gov/state_machine_with_eb_dlq_generated.json index 7e57f8926..213cea8c0 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_eb_dlq_generated.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_eb_dlq_generated.json @@ -2,10 +2,14 @@ "Resources": { "TestDLQ": { "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": {} }, "StateMachineCWEvent": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -40,6 +44,8 @@ }, "StateMachineCWEventQueuePolicy": { "Type": "AWS::SQS::QueuePolicy", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Queues": [ { @@ -78,6 +84,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "DefinitionS3Location": { @@ -94,6 +102,8 @@ }, "StateMachineCWEventRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { diff --git a/tests/translator/output/aws-us-gov/state_machine_with_eb_retry_policy.json b/tests/translator/output/aws-us-gov/state_machine_with_eb_retry_policy.json index bff94e177..3d6af1cfa 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_eb_retry_policy.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_eb_retry_policy.json @@ -2,6 +2,8 @@ "Resources": { "StateMachineCWEvent": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -32,6 +34,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "DefinitionS3Location": { @@ -48,6 +52,8 @@ }, "StateMachineCWEventRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { diff --git a/tests/translator/output/aws-us-gov/state_machine_with_explicit_api.json b/tests/translator/output/aws-us-gov/state_machine_with_explicit_api.json index 70ef4676a..3cad7af0f 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_explicit_api.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_explicit_api.json @@ -2,6 +2,8 @@ "Resources": { "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -45,6 +47,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ @@ -87,6 +91,8 @@ }, "MyApiDeployment05bc9f394c": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -97,6 +103,8 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment05bc9f394c" @@ -109,6 +117,8 @@ }, "StateMachineMyApiEventRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -146,6 +156,8 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/state_machine_with_express_logging.json b/tests/translator/output/aws-us-gov/state_machine_with_express_logging.json index 338d3a0e7..7024fdb2e 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_express_logging.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_express_logging.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -25,6 +27,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -55,6 +59,8 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -126,10 +132,14 @@ } }, "ExpressLogGroup": { - "Type": "AWS::Logs::LogGroup" + "Type": "AWS::Logs::LogGroup", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Tags": [ { diff --git a/tests/translator/output/aws-us-gov/state_machine_with_implicit_api.json b/tests/translator/output/aws-us-gov/state_machine_with_implicit_api.json index ebb4b1c02..d9f4c7542 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_implicit_api.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_implicit_api.json @@ -2,6 +2,8 @@ "Resources": { "StateMachineMyApiEventRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -39,6 +41,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ @@ -81,6 +85,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment05bc9f394c" @@ -93,6 +99,8 @@ }, "ServerlessRestApiDeployment05bc9f394c": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -103,6 +111,8 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -146,6 +156,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/state_machine_with_implicit_api_globals.json b/tests/translator/output/aws-us-gov/state_machine_with_implicit_api_globals.json index c28b4704f..0a7dc1ff9 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_implicit_api_globals.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_implicit_api_globals.json @@ -2,6 +2,8 @@ "Resources": { "StateMachineMyApiEventRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -39,6 +41,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ @@ -81,6 +85,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment1f01b589d4" @@ -93,6 +99,8 @@ }, "ServerlessRestApiDeployment1f01b589d4": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -103,6 +111,8 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -146,6 +156,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/state_machine_with_inline_definition.json b/tests/translator/output/aws-us-gov/state_machine_with_inline_definition.json index 722bc9ec7..52817da2b 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_inline_definition.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_inline_definition.json @@ -2,6 +2,8 @@ "Resources": { "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -45,6 +47,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ diff --git a/tests/translator/output/aws-us-gov/state_machine_with_inline_definition_intrinsics.json b/tests/translator/output/aws-us-gov/state_machine_with_inline_definition_intrinsics.json index b3d2b2154..94d09751e 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_inline_definition_intrinsics.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_inline_definition_intrinsics.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -26,6 +28,8 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -74,6 +78,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -104,6 +110,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DefinitionString": { "Fn::Join": [ diff --git a/tests/translator/output/aws-us-gov/state_machine_with_inline_policies.json b/tests/translator/output/aws-us-gov/state_machine_with_inline_policies.json index b3d2b2154..94d09751e 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_inline_policies.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_inline_policies.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -26,6 +28,8 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -74,6 +78,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -104,6 +110,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DefinitionString": { "Fn::Join": [ diff --git a/tests/translator/output/aws-us-gov/state_machine_with_managed_policy.json b/tests/translator/output/aws-us-gov/state_machine_with_managed_policy.json index 496ec9f64..66e47b50e 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_managed_policy.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_managed_policy.json @@ -2,6 +2,8 @@ "Resources": { "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -32,6 +34,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ diff --git a/tests/translator/output/aws-us-gov/state_machine_with_permissions_boundary.json b/tests/translator/output/aws-us-gov/state_machine_with_permissions_boundary.json index 550c0ae53..0f30ad7ac 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_permissions_boundary.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_permissions_boundary.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -26,6 +28,8 @@ }, "StateMachineMyApiEventRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "PermissionsBoundary": "arn:aws:1234:iam:boundary/CustomerCreatedPermissionsBoundary", "Policies": [ @@ -64,6 +68,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ @@ -87,6 +93,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment05bc9f394c" @@ -99,6 +107,8 @@ }, "ServerlessRestApiDeployment05bc9f394c": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -109,6 +119,8 @@ }, "StateMachineCWEvent": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -135,6 +147,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -165,6 +179,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -227,6 +243,8 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -281,6 +299,8 @@ }, "StateMachineScheduleEventRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "PermissionsBoundary": "arn:aws:1234:iam:boundary/CustomerCreatedPermissionsBoundary", "Policies": [ @@ -319,6 +339,8 @@ }, "StateMachineScheduleEvent": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ScheduleExpression": "rate(1 minute)", "Targets": [ @@ -340,6 +362,8 @@ }, "StateMachineCWEventRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "PermissionsBoundary": "arn:aws:1234:iam:boundary/CustomerCreatedPermissionsBoundary", "Policies": [ diff --git a/tests/translator/output/aws-us-gov/state_machine_with_role.json b/tests/translator/output/aws-us-gov/state_machine_with_role.json index 0db8c03ab..e929f3e45 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_role.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_role.json @@ -2,6 +2,8 @@ "Resources": { "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "StateMachineName": "MyStateMachineWithRole", diff --git a/tests/translator/output/aws-us-gov/state_machine_with_sam_policy_templates.json b/tests/translator/output/aws-us-gov/state_machine_with_sam_policy_templates.json index cc8fd1b19..c9ad03bda 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_sam_policy_templates.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_sam_policy_templates.json @@ -2,6 +2,8 @@ "Resources": { "ResolverLambda": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "resolver.handler", "Code": { @@ -25,6 +27,8 @@ }, "NestedWorkflow": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DefinitionSubstitutions": { "definition_substitution_1": { @@ -71,6 +75,8 @@ }, "StarterLambda": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "starter.handler", "Code": { @@ -94,6 +100,8 @@ }, "ProcessingWorkflow": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DefinitionSubstitutions": { "definition_substitution_4": { @@ -242,6 +250,8 @@ }, "StarterLambdaRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -272,6 +282,8 @@ }, "ProcessingWorkflowRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -437,6 +449,8 @@ }, "OutputStore": { "Type": "AWS::DynamoDB::Table", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "KeySchema": [ { @@ -455,10 +469,14 @@ } }, "ProcessingQueue": { - "Type": "AWS::SQS::Queue" + "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, "ResolverLambdaRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", diff --git a/tests/translator/output/aws-us-gov/state_machine_with_schedule.json b/tests/translator/output/aws-us-gov/state_machine_with_schedule.json index 8730521be..76099c10b 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_schedule.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_schedule.json @@ -2,6 +2,8 @@ "Resources": { "StateMachineScheduleEvent": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "State": "DISABLED", "ScheduleExpression": "rate(1 minute)", @@ -25,6 +27,8 @@ }, "StateMachineScheduleEventRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -62,6 +66,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "DefinitionS3Location": { diff --git a/tests/translator/output/aws-us-gov/state_machine_with_schedule_dlq_retry_policy.json b/tests/translator/output/aws-us-gov/state_machine_with_schedule_dlq_retry_policy.json index 5d49175a9..fa7f67853 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_schedule_dlq_retry_policy.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_schedule_dlq_retry_policy.json @@ -2,6 +2,8 @@ "Resources": { "StateMachineScheduleEvent": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "State": "DISABLED", "ScheduleExpression": "rate(1 minute)", @@ -32,6 +34,8 @@ }, "StateMachineScheduleEventRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -69,6 +73,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "DefinitionS3Location": { diff --git a/tests/translator/output/aws-us-gov/state_machine_with_standard_logging.json b/tests/translator/output/aws-us-gov/state_machine_with_standard_logging.json index f351648c4..2cc7aa6e7 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_standard_logging.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_standard_logging.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -24,10 +26,14 @@ } }, "StandardLogGroup": { - "Type": "AWS::Logs::LogGroup" + "Type": "AWS::Logs::LogGroup", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -100,6 +106,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -130,6 +138,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Tags": [ { diff --git a/tests/translator/output/aws-us-gov/state_machine_with_tags.json b/tests/translator/output/aws-us-gov/state_machine_with_tags.json index 6016da420..ba81b1f62 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_tags.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_tags.json @@ -2,6 +2,8 @@ "Resources": { "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -53,6 +55,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ diff --git a/tests/translator/output/aws-us-gov/state_machine_with_xray_policies.json b/tests/translator/output/aws-us-gov/state_machine_with_xray_policies.json index 287d1b626..2dcf0c99c 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_xray_policies.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_xray_policies.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -25,6 +27,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -55,6 +59,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DefinitionS3Location": { "Bucket": "sam-demo-bucket", @@ -81,6 +87,8 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", diff --git a/tests/translator/output/aws-us-gov/state_machine_with_xray_role.json b/tests/translator/output/aws-us-gov/state_machine_with_xray_role.json index 156d59d44..0ac655a98 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_xray_role.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_xray_role.json @@ -2,6 +2,8 @@ "Resources": { "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Tags": [ { diff --git a/tests/translator/output/aws-us-gov/streams.json b/tests/translator/output/aws-us-gov/streams.json index b87115674..9446bff0b 100644 --- a/tests/translator/output/aws-us-gov/streams.json +++ b/tests/translator/output/aws-us-gov/streams.json @@ -2,6 +2,8 @@ "Resources": { "DynamoDBFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -23,6 +25,8 @@ }, "KinesisFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -44,6 +48,8 @@ }, "MSKFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -65,6 +71,8 @@ }, "DynamoDBFunctionMyDDBStream": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BatchSize": 200, "EventSourceArn": "arn:aws:dynamodb:us-west-2:012345678901:table/TestTable/stream/2015-05-11T21:21:33.291", @@ -76,6 +84,8 @@ }, "DynamoDBFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -105,6 +115,8 @@ }, "KinesisFunctionMyKinesisStream": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BatchSize": 100, "Enabled": false, @@ -117,6 +129,8 @@ }, "KinesisFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -146,6 +160,8 @@ }, "MSKFunctionMyMSKStream": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EventSourceArn": "arn:aws:kafka:us-west-2:012345678901:cluster/mycluster/6cc0432b-8618-4f44-bccc-e1fbd8fb7c4d-2", "FunctionName": { @@ -157,6 +173,8 @@ }, "MSKFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", diff --git a/tests/translator/output/sqs.json b/tests/translator/output/sqs.json index 36bcdb1aa..42d1560ac 100644 --- a/tests/translator/output/sqs.json +++ b/tests/translator/output/sqs.json @@ -2,6 +2,8 @@ "Resources": { "SQSFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -31,6 +33,8 @@ }, "SQSFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -52,6 +56,8 @@ }, "SQSFunctionMySqsQueue": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BatchSize": 10, "Enabled": false, diff --git a/tests/translator/output/state_machine_with_api_auth_default_scopes.json b/tests/translator/output/state_machine_with_api_auth_default_scopes.json index 70042db2f..5b5c2f1e2 100644 --- a/tests/translator/output/state_machine_with_api_auth_default_scopes.json +++ b/tests/translator/output/state_machine_with_api_auth_default_scopes.json @@ -2,6 +2,8 @@ "Resources": { "MyApiWithCognitoAuth": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -359,6 +361,8 @@ }, "MyStateMachineCognitoWithAuthNoneRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -396,6 +400,8 @@ }, "MyStateMachineCognitoDefaultScopesNoneRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -433,6 +439,8 @@ }, "MyStateMachineCognitoDefaultAuthDefaultScopesNoneRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -470,6 +478,8 @@ }, "MyStateMachineCognitoDefaultScopesWithOverwrittenRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -507,6 +517,8 @@ }, "MyApiWithCognitoAuthProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithCognitoAuthDeployment57b57dfc88" @@ -519,6 +531,8 @@ }, "MyApiWithCognitoAuthDeployment57b57dfc88": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithCognitoAuth" @@ -528,6 +542,8 @@ }, "MyStateMachineCognitoDefaultScopesDefaultAuthorizerRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -565,6 +581,8 @@ }, "MyStateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ @@ -606,6 +624,8 @@ }, "MyStateMachineCognitoAuthorizerWithDefaultScopesRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -643,6 +663,8 @@ }, "MyStateMachineCognitoAuthorizerScopesOverwrittenRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -680,6 +702,8 @@ }, "MyStateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", diff --git a/tests/translator/output/state_machine_with_api_authorizer.json b/tests/translator/output/state_machine_with_api_authorizer.json index fba1f1847..9414e5005 100644 --- a/tests/translator/output/state_machine_with_api_authorizer.json +++ b/tests/translator/output/state_machine_with_api_authorizer.json @@ -2,6 +2,8 @@ "Resources": { "MyApiMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -20,6 +22,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ @@ -62,6 +66,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentaaffc688ce" @@ -74,6 +80,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -128,6 +136,8 @@ }, "StateMachineWithLambdaTokenAuthRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -165,6 +175,8 @@ }, "MyApiDeploymentc2779253ee": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -175,6 +187,8 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -218,6 +232,8 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeploymentc2779253ee" @@ -230,6 +246,8 @@ }, "ServerlessRestApiDeploymentaaffc688ce": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -240,6 +258,8 @@ }, "StateMachineWithNoAuthorizerRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -277,6 +297,8 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/state_machine_with_api_authorizer_maximum.json b/tests/translator/output/state_machine_with_api_authorizer_maximum.json index f4b6bc22f..d9cd2e041 100644 --- a/tests/translator/output/state_machine_with_api_authorizer_maximum.json +++ b/tests/translator/output/state_machine_with_api_authorizer_maximum.json @@ -2,6 +2,8 @@ "Resources": { "MyApiDeploymentde088eafc3": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -12,6 +14,8 @@ }, "MyApiMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -30,6 +34,8 @@ }, "StateMachineWithLambdaRequestAuthorizerRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -67,6 +73,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ @@ -109,6 +117,8 @@ }, "StateMachineWithDefaultAuthorizerRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -146,6 +156,8 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -478,6 +490,8 @@ }, "MyApiMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -496,6 +510,8 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -539,6 +555,8 @@ }, "StateMachineWithLambdaTokenAuthorizerRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -576,6 +594,8 @@ }, "MyApiMyLambdaTokenAuthNoneFunctionInvokeRoleAuthorizerPermission": { "Type": "AWS::Lambda::Permission", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -594,6 +614,8 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeploymentde088eafc3" @@ -606,6 +628,8 @@ }, "StateMachineWithCognitoMultipleUserPoolsAuthorizerRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -643,6 +667,8 @@ }, "StateMachineWithNoAuthorizerRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { diff --git a/tests/translator/output/state_machine_with_api_resource_policy.json b/tests/translator/output/state_machine_with_api_resource_policy.json index 262ecdf37..3d1ea852c 100644 --- a/tests/translator/output/state_machine_with_api_resource_policy.json +++ b/tests/translator/output/state_machine_with_api_resource_policy.json @@ -2,6 +2,8 @@ "Resources": { "MyStateMachineGetHtmlRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -39,6 +41,8 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -292,6 +296,8 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment17065a95ba" @@ -304,6 +310,8 @@ }, "MyStateMachinePutHtmlRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -341,6 +349,8 @@ }, "MyStateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ @@ -382,6 +392,8 @@ }, "ExplicitApiDeployment17065a95ba": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -392,6 +404,8 @@ }, "MyStateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -435,6 +449,8 @@ }, "MyStateMachinePostHtmlRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { diff --git a/tests/translator/output/state_machine_with_condition.json b/tests/translator/output/state_machine_with_condition.json index 7d67abe1a..756e0dd02 100644 --- a/tests/translator/output/state_machine_with_condition.json +++ b/tests/translator/output/state_machine_with_condition.json @@ -10,6 +10,8 @@ "Resources": { "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "StateMachineName": "MyStateMachine", diff --git a/tests/translator/output/state_machine_with_condition_and_events.json b/tests/translator/output/state_machine_with_condition_and_events.json index 413d4ac37..5bb454a9b 100644 --- a/tests/translator/output/state_machine_with_condition_and_events.json +++ b/tests/translator/output/state_machine_with_condition_and_events.json @@ -10,6 +10,8 @@ "Resources": { "StateMachineMyApiEventRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -48,6 +50,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "StateMachineName": "MyStateMachine", @@ -67,6 +71,8 @@ }, "StateMachineScheduleEventRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -105,6 +111,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentaeae651245" @@ -118,6 +126,8 @@ }, "StateMachineScheduleEvent": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ScheduleExpression": "rate(1 minute)", "Targets": [ @@ -140,6 +150,8 @@ }, "StateMachineCWEvent": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -167,6 +179,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -246,6 +260,8 @@ }, "ServerlessRestApiDeploymentaeae651245": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -257,6 +273,8 @@ }, "StateMachineCWEventRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { diff --git a/tests/translator/output/state_machine_with_cwe.json b/tests/translator/output/state_machine_with_cwe.json index 04164e943..177fdfe96 100644 --- a/tests/translator/output/state_machine_with_cwe.json +++ b/tests/translator/output/state_machine_with_cwe.json @@ -2,6 +2,8 @@ "Resources": { "StateMachineCWEvent": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -28,6 +30,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "DefinitionS3Location": { @@ -44,6 +48,8 @@ }, "StateMachineCWEventRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { diff --git a/tests/translator/output/state_machine_with_definition_S3_object.json b/tests/translator/output/state_machine_with_definition_S3_object.json index e01d31fd6..a1ce2d613 100644 --- a/tests/translator/output/state_machine_with_definition_S3_object.json +++ b/tests/translator/output/state_machine_with_definition_S3_object.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -26,6 +28,8 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -74,6 +78,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -104,6 +110,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Tags": [ { diff --git a/tests/translator/output/state_machine_with_definition_S3_string.json b/tests/translator/output/state_machine_with_definition_S3_string.json index 97f3b26e5..f357214d3 100644 --- a/tests/translator/output/state_machine_with_definition_S3_string.json +++ b/tests/translator/output/state_machine_with_definition_S3_string.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -26,6 +28,8 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -74,6 +78,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -104,6 +110,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Tags": [ { diff --git a/tests/translator/output/state_machine_with_definition_substitutions.json b/tests/translator/output/state_machine_with_definition_substitutions.json index 5bae321ef..f8ade0358 100644 --- a/tests/translator/output/state_machine_with_definition_substitutions.json +++ b/tests/translator/output/state_machine_with_definition_substitutions.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -25,6 +27,8 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -73,6 +77,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -103,6 +109,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DefinitionSubstitutions": { "definition_substitution_1": { diff --git a/tests/translator/output/state_machine_with_eb_dlq.json b/tests/translator/output/state_machine_with_eb_dlq.json index e49e64256..47aa3b4f3 100644 --- a/tests/translator/output/state_machine_with_eb_dlq.json +++ b/tests/translator/output/state_machine_with_eb_dlq.json @@ -2,6 +2,8 @@ "Resources": { "StateMachineCWEvent": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -31,6 +33,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "DefinitionS3Location": { @@ -47,6 +51,8 @@ }, "StateMachineCWEventRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { diff --git a/tests/translator/output/state_machine_with_eb_dlq_generated.json b/tests/translator/output/state_machine_with_eb_dlq_generated.json index 7e57f8926..213cea8c0 100644 --- a/tests/translator/output/state_machine_with_eb_dlq_generated.json +++ b/tests/translator/output/state_machine_with_eb_dlq_generated.json @@ -2,10 +2,14 @@ "Resources": { "TestDLQ": { "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": {} }, "StateMachineCWEvent": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -40,6 +44,8 @@ }, "StateMachineCWEventQueuePolicy": { "Type": "AWS::SQS::QueuePolicy", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Queues": [ { @@ -78,6 +84,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "DefinitionS3Location": { @@ -94,6 +102,8 @@ }, "StateMachineCWEventRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { diff --git a/tests/translator/output/state_machine_with_eb_retry_policy.json b/tests/translator/output/state_machine_with_eb_retry_policy.json index bff94e177..3d6af1cfa 100644 --- a/tests/translator/output/state_machine_with_eb_retry_policy.json +++ b/tests/translator/output/state_machine_with_eb_retry_policy.json @@ -2,6 +2,8 @@ "Resources": { "StateMachineCWEvent": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -32,6 +34,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "DefinitionS3Location": { @@ -48,6 +52,8 @@ }, "StateMachineCWEventRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { diff --git a/tests/translator/output/state_machine_with_explicit_api.json b/tests/translator/output/state_machine_with_explicit_api.json index 59f36f236..177d66744 100644 --- a/tests/translator/output/state_machine_with_explicit_api.json +++ b/tests/translator/output/state_machine_with_explicit_api.json @@ -2,6 +2,8 @@ "Resources": { "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -45,6 +47,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ @@ -87,6 +91,8 @@ }, "MyApiDeployment05bc9f394c": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -97,6 +103,8 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment05bc9f394c" @@ -109,6 +117,8 @@ }, "StateMachineMyApiEventRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -146,6 +156,8 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/state_machine_with_express_logging.json b/tests/translator/output/state_machine_with_express_logging.json index ede760c3a..2dd2a9578 100644 --- a/tests/translator/output/state_machine_with_express_logging.json +++ b/tests/translator/output/state_machine_with_express_logging.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -25,6 +27,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -55,6 +59,8 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -126,10 +132,14 @@ } }, "ExpressLogGroup": { - "Type": "AWS::Logs::LogGroup" + "Type": "AWS::Logs::LogGroup", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Tags": [ { diff --git a/tests/translator/output/state_machine_with_implicit_api.json b/tests/translator/output/state_machine_with_implicit_api.json index 0a76883a3..592ea0ca8 100644 --- a/tests/translator/output/state_machine_with_implicit_api.json +++ b/tests/translator/output/state_machine_with_implicit_api.json @@ -2,6 +2,8 @@ "Resources": { "StateMachineMyApiEventRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -39,6 +41,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ @@ -81,6 +85,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment05bc9f394c" @@ -93,6 +99,8 @@ }, "ServerlessRestApiDeployment05bc9f394c": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -103,6 +111,8 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -146,6 +156,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/state_machine_with_implicit_api_globals.json b/tests/translator/output/state_machine_with_implicit_api_globals.json index b8fb271d4..1acf2aa94 100644 --- a/tests/translator/output/state_machine_with_implicit_api_globals.json +++ b/tests/translator/output/state_machine_with_implicit_api_globals.json @@ -2,6 +2,8 @@ "Resources": { "StateMachineMyApiEventRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -39,6 +41,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ @@ -81,6 +85,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment1f01b589d4" @@ -93,6 +99,8 @@ }, "ServerlessRestApiDeployment1f01b589d4": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -103,6 +111,8 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -146,6 +156,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/state_machine_with_inline_definition.json b/tests/translator/output/state_machine_with_inline_definition.json index 722bc9ec7..52817da2b 100644 --- a/tests/translator/output/state_machine_with_inline_definition.json +++ b/tests/translator/output/state_machine_with_inline_definition.json @@ -2,6 +2,8 @@ "Resources": { "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -45,6 +47,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ diff --git a/tests/translator/output/state_machine_with_inline_definition_intrinsics.json b/tests/translator/output/state_machine_with_inline_definition_intrinsics.json index 7c7f91219..a9e507ace 100644 --- a/tests/translator/output/state_machine_with_inline_definition_intrinsics.json +++ b/tests/translator/output/state_machine_with_inline_definition_intrinsics.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -26,6 +28,8 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -74,6 +78,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -104,6 +110,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DefinitionString": { "Fn::Join": [ diff --git a/tests/translator/output/state_machine_with_inline_policies.json b/tests/translator/output/state_machine_with_inline_policies.json index 7c7f91219..a9e507ace 100644 --- a/tests/translator/output/state_machine_with_inline_policies.json +++ b/tests/translator/output/state_machine_with_inline_policies.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -26,6 +28,8 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -74,6 +78,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -104,6 +110,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DefinitionString": { "Fn::Join": [ diff --git a/tests/translator/output/state_machine_with_managed_policy.json b/tests/translator/output/state_machine_with_managed_policy.json index 82124708d..62876da4f 100644 --- a/tests/translator/output/state_machine_with_managed_policy.json +++ b/tests/translator/output/state_machine_with_managed_policy.json @@ -2,6 +2,8 @@ "Resources": { "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -32,6 +34,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ diff --git a/tests/translator/output/state_machine_with_permissions_boundary.json b/tests/translator/output/state_machine_with_permissions_boundary.json index b3823b73b..781d1e67c 100644 --- a/tests/translator/output/state_machine_with_permissions_boundary.json +++ b/tests/translator/output/state_machine_with_permissions_boundary.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -26,6 +28,8 @@ }, "StateMachineMyApiEventRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "PermissionsBoundary": "arn:aws:1234:iam:boundary/CustomerCreatedPermissionsBoundary", "Policies": [ @@ -64,6 +68,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ @@ -87,6 +93,8 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment05bc9f394c" @@ -99,6 +107,8 @@ }, "ServerlessRestApiDeployment05bc9f394c": { "Type": "AWS::ApiGateway::Deployment", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -109,6 +119,8 @@ }, "StateMachineCWEvent": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -135,6 +147,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -165,6 +179,8 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -219,6 +235,8 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -273,6 +291,8 @@ }, "StateMachineScheduleEventRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "PermissionsBoundary": "arn:aws:1234:iam:boundary/CustomerCreatedPermissionsBoundary", "Policies": [ @@ -311,6 +331,8 @@ }, "StateMachineScheduleEvent": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ScheduleExpression": "rate(1 minute)", "Targets": [ @@ -332,6 +354,8 @@ }, "StateMachineCWEventRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "PermissionsBoundary": "arn:aws:1234:iam:boundary/CustomerCreatedPermissionsBoundary", "Policies": [ diff --git a/tests/translator/output/state_machine_with_role.json b/tests/translator/output/state_machine_with_role.json index 0db8c03ab..e929f3e45 100644 --- a/tests/translator/output/state_machine_with_role.json +++ b/tests/translator/output/state_machine_with_role.json @@ -2,6 +2,8 @@ "Resources": { "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "StateMachineName": "MyStateMachineWithRole", diff --git a/tests/translator/output/state_machine_with_sam_policy_templates.json b/tests/translator/output/state_machine_with_sam_policy_templates.json index c14e8cd07..3580e8eb6 100644 --- a/tests/translator/output/state_machine_with_sam_policy_templates.json +++ b/tests/translator/output/state_machine_with_sam_policy_templates.json @@ -2,6 +2,8 @@ "Resources": { "ResolverLambda": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "resolver.handler", "Code": { @@ -25,6 +27,8 @@ }, "NestedWorkflow": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DefinitionSubstitutions": { "definition_substitution_1": { @@ -71,6 +75,8 @@ }, "StarterLambda": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "starter.handler", "Code": { @@ -94,6 +100,8 @@ }, "ProcessingWorkflow": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DefinitionSubstitutions": { "definition_substitution_4": { @@ -242,6 +250,8 @@ }, "StarterLambdaRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -272,6 +282,8 @@ }, "ProcessingWorkflowRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -437,6 +449,8 @@ }, "OutputStore": { "Type": "AWS::DynamoDB::Table", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "KeySchema": [ { @@ -455,10 +469,14 @@ } }, "ProcessingQueue": { - "Type": "AWS::SQS::Queue" + "Type": "AWS::SQS::Queue", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, "ResolverLambdaRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", diff --git a/tests/translator/output/state_machine_with_schedule.json b/tests/translator/output/state_machine_with_schedule.json index 8730521be..76099c10b 100644 --- a/tests/translator/output/state_machine_with_schedule.json +++ b/tests/translator/output/state_machine_with_schedule.json @@ -2,6 +2,8 @@ "Resources": { "StateMachineScheduleEvent": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "State": "DISABLED", "ScheduleExpression": "rate(1 minute)", @@ -25,6 +27,8 @@ }, "StateMachineScheduleEventRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -62,6 +66,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "DefinitionS3Location": { diff --git a/tests/translator/output/state_machine_with_schedule_dlq_retry_policy.json b/tests/translator/output/state_machine_with_schedule_dlq_retry_policy.json index 5d49175a9..fa7f67853 100644 --- a/tests/translator/output/state_machine_with_schedule_dlq_retry_policy.json +++ b/tests/translator/output/state_machine_with_schedule_dlq_retry_policy.json @@ -2,6 +2,8 @@ "Resources": { "StateMachineScheduleEvent": { "Type": "AWS::Events::Rule", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "State": "DISABLED", "ScheduleExpression": "rate(1 minute)", @@ -32,6 +34,8 @@ }, "StateMachineScheduleEventRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -69,6 +73,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "DefinitionS3Location": { diff --git a/tests/translator/output/state_machine_with_standard_logging.json b/tests/translator/output/state_machine_with_standard_logging.json index 84a2a2e56..4b358bfc7 100644 --- a/tests/translator/output/state_machine_with_standard_logging.json +++ b/tests/translator/output/state_machine_with_standard_logging.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -24,10 +26,14 @@ } }, "StandardLogGroup": { - "Type": "AWS::Logs::LogGroup" + "Type": "AWS::Logs::LogGroup", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete" }, "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -100,6 +106,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -130,6 +138,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Tags": [ { diff --git a/tests/translator/output/state_machine_with_tags.json b/tests/translator/output/state_machine_with_tags.json index 6016da420..ba81b1f62 100644 --- a/tests/translator/output/state_machine_with_tags.json +++ b/tests/translator/output/state_machine_with_tags.json @@ -2,6 +2,8 @@ "Resources": { "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -53,6 +55,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ diff --git a/tests/translator/output/state_machine_with_xray_policies.json b/tests/translator/output/state_machine_with_xray_policies.json index 4d23fc62d..49794218d 100644 --- a/tests/translator/output/state_machine_with_xray_policies.json +++ b/tests/translator/output/state_machine_with_xray_policies.json @@ -2,6 +2,8 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -25,6 +27,8 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -55,6 +59,8 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "DefinitionS3Location": { "Bucket": "sam-demo-bucket", @@ -81,6 +87,8 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", diff --git a/tests/translator/output/state_machine_with_xray_role.json b/tests/translator/output/state_machine_with_xray_role.json index 156d59d44..0ac655a98 100644 --- a/tests/translator/output/state_machine_with_xray_role.json +++ b/tests/translator/output/state_machine_with_xray_role.json @@ -2,6 +2,8 @@ "Resources": { "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Tags": [ { diff --git a/tests/translator/output/streams.json b/tests/translator/output/streams.json index b894b4206..bbb4281d9 100644 --- a/tests/translator/output/streams.json +++ b/tests/translator/output/streams.json @@ -2,6 +2,8 @@ "Resources": { "DynamoDBFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -23,6 +25,8 @@ }, "KinesisFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -44,6 +48,8 @@ }, "MSKFunction": { "Type": "AWS::Lambda::Function", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -65,6 +71,8 @@ }, "DynamoDBFunctionMyDDBStream": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BatchSize": 200, "EventSourceArn": "arn:aws:dynamodb:us-west-2:012345678901:table/TestTable/stream/2015-05-11T21:21:33.291", @@ -76,6 +84,8 @@ }, "DynamoDBFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -105,6 +115,8 @@ }, "KinesisFunctionMyKinesisStream": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "BatchSize": 100, "Enabled": false, @@ -117,6 +129,8 @@ }, "KinesisFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -146,6 +160,8 @@ }, "MSKFunctionMyMSKStream": { "Type": "AWS::Lambda::EventSourceMapping", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "EventSourceArn": "arn:aws:kafka:us-west-2:012345678901:cluster/mycluster/6cc0432b-8618-4f44-bccc-e1fbd8fb7c4d-2", "FunctionName": { @@ -157,6 +173,8 @@ }, "MSKFunctionRole": { "Type": "AWS::IAM::Role", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", From df9b698c70339765cd6bf1cc7b5b8b053dd2aa48 Mon Sep 17 00:00:00 2001 From: Qingchuan Ma Date: Thu, 29 Apr 2021 00:30:50 -0700 Subject: [PATCH 22/41] Prevented passthrough resource attributes from changing layer version hashes --- samtranslator/model/sam_resources.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/samtranslator/model/sam_resources.py b/samtranslator/model/sam_resources.py index d281924c1..a23e6d27d 100644 --- a/samtranslator/model/sam_resources.py +++ b/samtranslator/model/sam_resources.py @@ -1,5 +1,6 @@ """ SAM macro definitions """ from six import string_types +import copy import samtranslator.model.eventsources import samtranslator.model.eventsources.pull @@ -1177,7 +1178,15 @@ def _construct_lambda_layer(self, intrinsics_resolver): attributes["DeletionPolicy"] = retention_policy_value old_logical_id = self.logical_id - new_logical_id = logical_id_generator.LogicalIdGenerator(old_logical_id, self.to_dict()).gen() + + # This is to prevent the passthrough resource attributes to be included for hashing + hash_dict = copy.deepcopy(self.to_dict()) + if "DeletionPolicy" in hash_dict.get(old_logical_id): + del hash_dict[old_logical_id]["DeletionPolicy"] + if "UpdateReplacePolicy" in hash_dict.get(old_logical_id): + del hash_dict[old_logical_id]["UpdateReplacePolicy"] + + new_logical_id = logical_id_generator.LogicalIdGenerator(old_logical_id, hash_dict).gen() self.logical_id = new_logical_id lambda_layer = LambdaLayerVersion(self.logical_id, depends_on=self.depends_on, attributes=attributes) From 5316c84c9de6927b48ada941fe6c9f5496540fa1 Mon Sep 17 00:00:00 2001 From: Qingchuan Ma Date: Thu, 29 Apr 2021 00:32:04 -0700 Subject: [PATCH 23/41] Added test to verify resource passthrough precedence for implicit api --- ...plicit_api_deletion_policy_precedence.yaml | 32 +++ ...plicit_api_deletion_policy_precedence.json | 242 ++++++++++++++++++ ...plicit_api_deletion_policy_precedence.json | 242 ++++++++++++++++++ ...plicit_api_deletion_policy_precedence.json | 234 +++++++++++++++++ tests/translator/test_translator.py | 1 + 5 files changed, 751 insertions(+) create mode 100644 tests/translator/input/implicit_api_deletion_policy_precedence.yaml create mode 100644 tests/translator/output/aws-cn/implicit_api_deletion_policy_precedence.json create mode 100644 tests/translator/output/aws-us-gov/implicit_api_deletion_policy_precedence.json create mode 100644 tests/translator/output/implicit_api_deletion_policy_precedence.json diff --git a/tests/translator/input/implicit_api_deletion_policy_precedence.yaml b/tests/translator/input/implicit_api_deletion_policy_precedence.yaml new file mode 100644 index 000000000..643b9ac47 --- /dev/null +++ b/tests/translator/input/implicit_api_deletion_policy_precedence.yaml @@ -0,0 +1,32 @@ +Resources: + RestApiFunction: + Type: AWS::Serverless::Function + DeletionPolicy: Delete + UpdateReplacePolicy: Retain + Properties: + CodeUri: s3://sam-demo-bucket/todo_list.zip + Handler: index.restapi + Runtime: nodejs12.x + Policies: AmazonDynamoDBFullAccess + Events: + GetHtml: + Type: Api + Properties: + Path: /{proxy+} + Method: any + + GetHtmlFunction: + Type: AWS::Serverless::Function + DeletionPolicy: Retain + UpdateReplacePolicy: Retain + Properties: + CodeUri: s3://sam-demo-bucket/todo_list.zip + Handler: index.gethtml + Runtime: nodejs12.x + Policies: AmazonDynamoDBReadOnlyAccess + Events: + GetHtml: + Type: Api + Properties: + Path: /{proxy++} + Method: any diff --git a/tests/translator/output/aws-cn/implicit_api_deletion_policy_precedence.json b/tests/translator/output/aws-cn/implicit_api_deletion_policy_precedence.json new file mode 100644 index 000000000..51fb94bea --- /dev/null +++ b/tests/translator/output/aws-cn/implicit_api_deletion_policy_precedence.json @@ -0,0 +1,242 @@ +{ + "Resources": { + "RestApiFunction": { + "Type": "AWS::Lambda::Function", + "DeletionPolicy": "Delete", + "UpdateReplacePolicy": "Retain", + "Properties": { + "Code": { + "S3Bucket": "sam-demo-bucket", + "S3Key": "todo_list.zip" + }, + "Handler": "index.restapi", + "Role": { + "Fn::GetAtt": [ + "RestApiFunctionRole", + "Arn" + ] + }, + "Runtime": "nodejs12.x", + "Tags": [ + { + "Key": "lambda:createdBy", + "Value": "SAM" + } + ] + } + }, + "RestApiFunctionRole": { + "Type": "AWS::IAM::Role", + "DeletionPolicy": "Delete", + "UpdateReplacePolicy": "Retain", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Action": [ + "sts:AssumeRole" + ], + "Effect": "Allow", + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + } + } + ] + }, + "ManagedPolicyArns": [ + "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", + "arn:aws-cn:iam::aws:policy/AmazonDynamoDBFullAccess" + ], + "Tags": [ + { + "Key": "lambda:createdBy", + "Value": "SAM" + } + ] + } + }, + "RestApiFunctionGetHtmlPermissionProd": { + "Type": "AWS::Lambda::Permission", + "DeletionPolicy": "Delete", + "UpdateReplacePolicy": "Retain", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Ref": "RestApiFunction" + }, + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Sub": [ + "arn:aws-cn:execute-api:${AWS::Region}:${AWS::AccountId}:${__ApiId__}/${__Stage__}/*/*", + { + "__ApiId__": { + "Ref": "ServerlessRestApi" + }, + "__Stage__": "*" + } + ] + } + } + }, + "GetHtmlFunction": { + "Type": "AWS::Lambda::Function", + "DeletionPolicy": "Retain", + "UpdateReplacePolicy": "Retain", + "Properties": { + "Code": { + "S3Bucket": "sam-demo-bucket", + "S3Key": "todo_list.zip" + }, + "Handler": "index.gethtml", + "Role": { + "Fn::GetAtt": [ + "GetHtmlFunctionRole", + "Arn" + ] + }, + "Runtime": "nodejs12.x", + "Tags": [ + { + "Key": "lambda:createdBy", + "Value": "SAM" + } + ] + } + }, + "GetHtmlFunctionRole": { + "Type": "AWS::IAM::Role", + "DeletionPolicy": "Retain", + "UpdateReplacePolicy": "Retain", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Action": [ + "sts:AssumeRole" + ], + "Effect": "Allow", + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + } + } + ] + }, + "ManagedPolicyArns": [ + "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", + "arn:aws-cn:iam::aws:policy/AmazonDynamoDBReadOnlyAccess" + ], + "Tags": [ + { + "Key": "lambda:createdBy", + "Value": "SAM" + } + ] + } + }, + "GetHtmlFunctionGetHtmlPermissionProd": { + "Type": "AWS::Lambda::Permission", + "DeletionPolicy": "Retain", + "UpdateReplacePolicy": "Retain", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Ref": "GetHtmlFunction" + }, + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Sub": [ + "arn:aws-cn:execute-api:${AWS::Region}:${AWS::AccountId}:${__ApiId__}/${__Stage__}/*/{proxy++}", + { + "__ApiId__": { + "Ref": "ServerlessRestApi" + }, + "__Stage__": "*" + } + ] + } + } + }, + "ServerlessRestApi": { + "Type": "AWS::ApiGateway::RestApi", + "DeletionPolicy": "Retain", + "UpdateReplacePolicy": "Retain", + "Properties": { + "Body": { + "swagger": "2.0", + "info": { + "version": "1.0", + "title": { + "Ref": "AWS::StackName" + } + }, + "paths": { + "/{proxy+}": { + "x-amazon-apigateway-any-method": { + "x-amazon-apigateway-integration": { + "type": "aws_proxy", + "httpMethod": "POST", + "uri": { + "Fn::Sub": "arn:aws-cn:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${RestApiFunction.Arn}/invocations" + } + }, + "responses": {} + } + }, + "/{proxy++}": { + "x-amazon-apigateway-any-method": { + "x-amazon-apigateway-integration": { + "type": "aws_proxy", + "httpMethod": "POST", + "uri": { + "Fn::Sub": "arn:aws-cn:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${GetHtmlFunction.Arn}/invocations" + } + }, + "responses": {} + } + } + } + }, + "EndpointConfiguration": { + "Types": [ + "REGIONAL" + ] + }, + "Parameters": { + "endpointConfigurationTypes": "REGIONAL" + } + } + }, + "ServerlessRestApiDeploymentee5319b7a1": { + "Type": "AWS::ApiGateway::Deployment", + "DeletionPolicy": "Retain", + "UpdateReplacePolicy": "Retain", + "Properties": { + "Description": "RestApi deployment id: ee5319b7a18445ac611d70e4da06cfbd5562d28c", + "RestApiId": { + "Ref": "ServerlessRestApi" + }, + "StageName": "Stage" + } + }, + "ServerlessRestApiProdStage": { + "Type": "AWS::ApiGateway::Stage", + "DeletionPolicy": "Retain", + "UpdateReplacePolicy": "Retain", + "Properties": { + "DeploymentId": { + "Ref": "ServerlessRestApiDeploymentee5319b7a1" + }, + "RestApiId": { + "Ref": "ServerlessRestApi" + }, + "StageName": "Prod" + } + } + } +} \ No newline at end of file diff --git a/tests/translator/output/aws-us-gov/implicit_api_deletion_policy_precedence.json b/tests/translator/output/aws-us-gov/implicit_api_deletion_policy_precedence.json new file mode 100644 index 000000000..091da71cb --- /dev/null +++ b/tests/translator/output/aws-us-gov/implicit_api_deletion_policy_precedence.json @@ -0,0 +1,242 @@ +{ + "Resources": { + "RestApiFunction": { + "Type": "AWS::Lambda::Function", + "DeletionPolicy": "Delete", + "UpdateReplacePolicy": "Retain", + "Properties": { + "Code": { + "S3Bucket": "sam-demo-bucket", + "S3Key": "todo_list.zip" + }, + "Handler": "index.restapi", + "Role": { + "Fn::GetAtt": [ + "RestApiFunctionRole", + "Arn" + ] + }, + "Runtime": "nodejs12.x", + "Tags": [ + { + "Key": "lambda:createdBy", + "Value": "SAM" + } + ] + } + }, + "RestApiFunctionRole": { + "Type": "AWS::IAM::Role", + "DeletionPolicy": "Delete", + "UpdateReplacePolicy": "Retain", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Action": [ + "sts:AssumeRole" + ], + "Effect": "Allow", + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + } + } + ] + }, + "ManagedPolicyArns": [ + "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", + "arn:aws-us-gov:iam::aws:policy/AmazonDynamoDBFullAccess" + ], + "Tags": [ + { + "Key": "lambda:createdBy", + "Value": "SAM" + } + ] + } + }, + "RestApiFunctionGetHtmlPermissionProd": { + "Type": "AWS::Lambda::Permission", + "DeletionPolicy": "Delete", + "UpdateReplacePolicy": "Retain", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Ref": "RestApiFunction" + }, + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Sub": [ + "arn:aws-us-gov:execute-api:${AWS::Region}:${AWS::AccountId}:${__ApiId__}/${__Stage__}/*/*", + { + "__ApiId__": { + "Ref": "ServerlessRestApi" + }, + "__Stage__": "*" + } + ] + } + } + }, + "GetHtmlFunction": { + "Type": "AWS::Lambda::Function", + "DeletionPolicy": "Retain", + "UpdateReplacePolicy": "Retain", + "Properties": { + "Code": { + "S3Bucket": "sam-demo-bucket", + "S3Key": "todo_list.zip" + }, + "Handler": "index.gethtml", + "Role": { + "Fn::GetAtt": [ + "GetHtmlFunctionRole", + "Arn" + ] + }, + "Runtime": "nodejs12.x", + "Tags": [ + { + "Key": "lambda:createdBy", + "Value": "SAM" + } + ] + } + }, + "GetHtmlFunctionRole": { + "Type": "AWS::IAM::Role", + "DeletionPolicy": "Retain", + "UpdateReplacePolicy": "Retain", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Action": [ + "sts:AssumeRole" + ], + "Effect": "Allow", + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + } + } + ] + }, + "ManagedPolicyArns": [ + "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", + "arn:aws-us-gov:iam::aws:policy/AmazonDynamoDBReadOnlyAccess" + ], + "Tags": [ + { + "Key": "lambda:createdBy", + "Value": "SAM" + } + ] + } + }, + "GetHtmlFunctionGetHtmlPermissionProd": { + "Type": "AWS::Lambda::Permission", + "DeletionPolicy": "Retain", + "UpdateReplacePolicy": "Retain", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Ref": "GetHtmlFunction" + }, + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Sub": [ + "arn:aws-us-gov:execute-api:${AWS::Region}:${AWS::AccountId}:${__ApiId__}/${__Stage__}/*/{proxy++}", + { + "__ApiId__": { + "Ref": "ServerlessRestApi" + }, + "__Stage__": "*" + } + ] + } + } + }, + "ServerlessRestApi": { + "Type": "AWS::ApiGateway::RestApi", + "DeletionPolicy": "Retain", + "UpdateReplacePolicy": "Retain", + "Properties": { + "Body": { + "swagger": "2.0", + "info": { + "version": "1.0", + "title": { + "Ref": "AWS::StackName" + } + }, + "paths": { + "/{proxy+}": { + "x-amazon-apigateway-any-method": { + "x-amazon-apigateway-integration": { + "type": "aws_proxy", + "httpMethod": "POST", + "uri": { + "Fn::Sub": "arn:aws-us-gov:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${RestApiFunction.Arn}/invocations" + } + }, + "responses": {} + } + }, + "/{proxy++}": { + "x-amazon-apigateway-any-method": { + "x-amazon-apigateway-integration": { + "type": "aws_proxy", + "httpMethod": "POST", + "uri": { + "Fn::Sub": "arn:aws-us-gov:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${GetHtmlFunction.Arn}/invocations" + } + }, + "responses": {} + } + } + } + }, + "EndpointConfiguration": { + "Types": [ + "REGIONAL" + ] + }, + "Parameters": { + "endpointConfigurationTypes": "REGIONAL" + } + } + }, + "ServerlessRestApiDeploymentee5319b7a1": { + "Type": "AWS::ApiGateway::Deployment", + "DeletionPolicy": "Retain", + "UpdateReplacePolicy": "Retain", + "Properties": { + "Description": "RestApi deployment id: ee5319b7a18445ac611d70e4da06cfbd5562d28c", + "RestApiId": { + "Ref": "ServerlessRestApi" + }, + "StageName": "Stage" + } + }, + "ServerlessRestApiProdStage": { + "Type": "AWS::ApiGateway::Stage", + "DeletionPolicy": "Retain", + "UpdateReplacePolicy": "Retain", + "Properties": { + "DeploymentId": { + "Ref": "ServerlessRestApiDeploymentee5319b7a1" + }, + "RestApiId": { + "Ref": "ServerlessRestApi" + }, + "StageName": "Prod" + } + } + } +} \ No newline at end of file diff --git a/tests/translator/output/implicit_api_deletion_policy_precedence.json b/tests/translator/output/implicit_api_deletion_policy_precedence.json new file mode 100644 index 000000000..c01f89e25 --- /dev/null +++ b/tests/translator/output/implicit_api_deletion_policy_precedence.json @@ -0,0 +1,234 @@ +{ + "Resources": { + "RestApiFunction": { + "Type": "AWS::Lambda::Function", + "DeletionPolicy": "Delete", + "UpdateReplacePolicy": "Retain", + "Properties": { + "Code": { + "S3Bucket": "sam-demo-bucket", + "S3Key": "todo_list.zip" + }, + "Handler": "index.restapi", + "Role": { + "Fn::GetAtt": [ + "RestApiFunctionRole", + "Arn" + ] + }, + "Runtime": "nodejs12.x", + "Tags": [ + { + "Key": "lambda:createdBy", + "Value": "SAM" + } + ] + } + }, + "RestApiFunctionRole": { + "Type": "AWS::IAM::Role", + "DeletionPolicy": "Delete", + "UpdateReplacePolicy": "Retain", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Action": [ + "sts:AssumeRole" + ], + "Effect": "Allow", + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + } + } + ] + }, + "ManagedPolicyArns": [ + "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", + "arn:aws:iam::aws:policy/AmazonDynamoDBFullAccess" + ], + "Tags": [ + { + "Key": "lambda:createdBy", + "Value": "SAM" + } + ] + } + }, + "RestApiFunctionGetHtmlPermissionProd": { + "Type": "AWS::Lambda::Permission", + "DeletionPolicy": "Delete", + "UpdateReplacePolicy": "Retain", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Ref": "RestApiFunction" + }, + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Sub": [ + "arn:aws:execute-api:${AWS::Region}:${AWS::AccountId}:${__ApiId__}/${__Stage__}/*/*", + { + "__ApiId__": { + "Ref": "ServerlessRestApi" + }, + "__Stage__": "*" + } + ] + } + } + }, + "GetHtmlFunction": { + "Type": "AWS::Lambda::Function", + "DeletionPolicy": "Retain", + "UpdateReplacePolicy": "Retain", + "Properties": { + "Code": { + "S3Bucket": "sam-demo-bucket", + "S3Key": "todo_list.zip" + }, + "Handler": "index.gethtml", + "Role": { + "Fn::GetAtt": [ + "GetHtmlFunctionRole", + "Arn" + ] + }, + "Runtime": "nodejs12.x", + "Tags": [ + { + "Key": "lambda:createdBy", + "Value": "SAM" + } + ] + } + }, + "GetHtmlFunctionRole": { + "Type": "AWS::IAM::Role", + "DeletionPolicy": "Retain", + "UpdateReplacePolicy": "Retain", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Action": [ + "sts:AssumeRole" + ], + "Effect": "Allow", + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + } + } + ] + }, + "ManagedPolicyArns": [ + "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", + "arn:aws:iam::aws:policy/AmazonDynamoDBReadOnlyAccess" + ], + "Tags": [ + { + "Key": "lambda:createdBy", + "Value": "SAM" + } + ] + } + }, + "GetHtmlFunctionGetHtmlPermissionProd": { + "Type": "AWS::Lambda::Permission", + "DeletionPolicy": "Retain", + "UpdateReplacePolicy": "Retain", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Ref": "GetHtmlFunction" + }, + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Sub": [ + "arn:aws:execute-api:${AWS::Region}:${AWS::AccountId}:${__ApiId__}/${__Stage__}/*/{proxy++}", + { + "__ApiId__": { + "Ref": "ServerlessRestApi" + }, + "__Stage__": "*" + } + ] + } + } + }, + "ServerlessRestApi": { + "Type": "AWS::ApiGateway::RestApi", + "DeletionPolicy": "Retain", + "UpdateReplacePolicy": "Retain", + "Properties": { + "Body": { + "swagger": "2.0", + "info": { + "version": "1.0", + "title": { + "Ref": "AWS::StackName" + } + }, + "paths": { + "/{proxy+}": { + "x-amazon-apigateway-any-method": { + "x-amazon-apigateway-integration": { + "type": "aws_proxy", + "httpMethod": "POST", + "uri": { + "Fn::Sub": "arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${RestApiFunction.Arn}/invocations" + } + }, + "responses": {} + } + }, + "/{proxy++}": { + "x-amazon-apigateway-any-method": { + "x-amazon-apigateway-integration": { + "type": "aws_proxy", + "httpMethod": "POST", + "uri": { + "Fn::Sub": "arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${GetHtmlFunction.Arn}/invocations" + } + }, + "responses": {} + } + } + } + } + } + }, + "ServerlessRestApiDeploymentee5319b7a1": { + "Type": "AWS::ApiGateway::Deployment", + "DeletionPolicy": "Retain", + "UpdateReplacePolicy": "Retain", + "Properties": { + "Description": "RestApi deployment id: ee5319b7a18445ac611d70e4da06cfbd5562d28c", + "RestApiId": { + "Ref": "ServerlessRestApi" + }, + "StageName": "Stage" + } + }, + "ServerlessRestApiProdStage": { + "Type": "AWS::ApiGateway::Stage", + "DeletionPolicy": "Retain", + "UpdateReplacePolicy": "Retain", + "Properties": { + "DeploymentId": { + "Ref": "ServerlessRestApiDeploymentee5319b7a1" + }, + "RestApiId": { + "Ref": "ServerlessRestApi" + }, + "StageName": "Prod" + } + } + } +} \ No newline at end of file diff --git a/tests/translator/test_translator.py b/tests/translator/test_translator.py index 85252103c..bbdc3fef3 100644 --- a/tests/translator/test_translator.py +++ b/tests/translator/test_translator.py @@ -268,6 +268,7 @@ class TestTranslatorEndToEnd(TestCase): "simple_table_with_extra_tags", "explicit_api_with_invalid_events_config", "no_implicit_api_with_serverless_rest_api_resource", + "implicit_api_deletion_policy_precedence", "implicit_api_with_serverless_rest_api_resource", "implicit_api_with_auth_and_conditions_max", "implicit_api_with_many_conditions", From 46866d04344e1d4d080b67232db72b4c212fcf40 Mon Sep 17 00:00:00 2001 From: Qingchuan Ma Date: Thu, 29 Apr 2021 00:33:16 -0700 Subject: [PATCH 24/41] Modified tests related to lambda layer to revert the hash changes, keeping the hash the same with resource attributes added --- tests/translator/output/aws-cn/basic_layer.json | 8 ++++---- .../output/aws-cn/function_with_layers.json | 4 ++-- .../output/aws-cn/function_with_many_layers.json | 4 ++-- .../output/aws-cn/layers_all_properties.json | 10 +++++----- .../output/aws-cn/layers_with_intrinsics.json | 16 ++++++++-------- .../output/aws-us-gov/basic_layer.json | 8 ++++---- .../output/aws-us-gov/function_with_layers.json | 4 ++-- .../aws-us-gov/function_with_many_layers.json | 4 ++-- .../output/aws-us-gov/layers_all_properties.json | 10 +++++----- .../aws-us-gov/layers_with_intrinsics.json | 16 ++++++++-------- tests/translator/output/basic_layer.json | 8 ++++---- .../translator/output/function_with_layers.json | 4 ++-- .../output/function_with_many_layers.json | 4 ++-- .../translator/output/layers_all_properties.json | 10 +++++----- .../output/layers_with_intrinsics.json | 16 ++++++++-------- 15 files changed, 63 insertions(+), 63 deletions(-) diff --git a/tests/translator/output/aws-cn/basic_layer.json b/tests/translator/output/aws-cn/basic_layer.json index 9c430b9b1..5421d7ca6 100644 --- a/tests/translator/output/aws-cn/basic_layer.json +++ b/tests/translator/output/aws-cn/basic_layer.json @@ -8,7 +8,7 @@ } }, "Resources": { - "LayerWithConditionec24995757": { + "LayerWithCondition7c655e10ea": { "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete", "Type": "AWS::Lambda::LayerVersion", @@ -21,7 +21,7 @@ }, "Condition": "TestCondition" }, - "MinimalLayer7d49517128": { + "MinimalLayer0c7f96cce7": { "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete", "Type": "AWS::Lambda::LayerVersion", @@ -33,7 +33,7 @@ "LayerName": "MinimalLayer" } }, - "CompleteLayer01b64931e6": { + "CompleteLayer5d71a60e81": { "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Retain", "Type": "AWS::Lambda::LayerVersion", @@ -51,7 +51,7 @@ ] } }, - "LayerWithContentUriObject678c9b5427": { + "LayerWithContentUriObjectbdbf1b82ac": { "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete", "Type": "AWS::Lambda::LayerVersion", diff --git a/tests/translator/output/aws-cn/function_with_layers.json b/tests/translator/output/aws-cn/function_with_layers.json index 9fddf9a15..b0400f815 100644 --- a/tests/translator/output/aws-cn/function_with_layers.json +++ b/tests/translator/output/aws-cn/function_with_layers.json @@ -28,7 +28,7 @@ "Runtime": "python2.7" } }, - "MyLayer43a7918434": { + "MyLayera5167acaba": { "Type": "AWS::Lambda::LayerVersion", "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete", @@ -47,7 +47,7 @@ "Properties": { "Layers": [ { - "Ref": "MyLayer43a7918434" + "Ref": "MyLayera5167acaba" } ], "Code": { diff --git a/tests/translator/output/aws-cn/function_with_many_layers.json b/tests/translator/output/aws-cn/function_with_many_layers.json index b93566f5e..ec7de6553 100644 --- a/tests/translator/output/aws-cn/function_with_many_layers.json +++ b/tests/translator/output/aws-cn/function_with_many_layers.json @@ -1,6 +1,6 @@ { "Resources": { - "MyLayer43a7918434": { + "MyLayera5167acaba": { "Type": "AWS::Lambda::LayerVersion", "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete", @@ -59,7 +59,7 @@ "Fn::Sub": "arn:${AWS::Partition}:lambda:${AWS::Region}:123456789101:layer:c:1" }, { - "Ref": "MyLayer43a7918434" + "Ref": "MyLayera5167acaba" } ], "Code": { diff --git a/tests/translator/output/aws-cn/layers_all_properties.json b/tests/translator/output/aws-cn/layers_all_properties.json index 3c45e0cea..760494f88 100644 --- a/tests/translator/output/aws-cn/layers_all_properties.json +++ b/tests/translator/output/aws-cn/layers_all_properties.json @@ -2,7 +2,7 @@ "Outputs": { "LayerSub": { "Value": { - "Fn::Sub": "${MyLayerf16259d4b8}" + "Fn::Sub": "${MyLayerd04062b365}" } }, "FunctionAtt": { @@ -15,7 +15,7 @@ }, "LayerName": { "Value": { - "Ref": "MyLayerf16259d4b8" + "Ref": "MyLayerd04062b365" } }, "FunctionSub": { @@ -43,7 +43,7 @@ "Properties": { "Layers": [ { - "Ref": "MyLayerf16259d4b8" + "Ref": "MyLayerd04062b365" } ], "Code": { @@ -66,7 +66,7 @@ "Runtime": "python3.6" } }, - "MyLayerf16259d4b8": { + "MyLayerd04062b365": { "Type": "AWS::Lambda::LayerVersion", "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete", @@ -78,7 +78,7 @@ "LayerName": "MyLayer" } }, - "MyLayerWithAName0c99fc75b5": { + "MyLayerWithANamefda8c9ec8c": { "Type": "AWS::Lambda::LayerVersion", "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete", diff --git a/tests/translator/output/aws-cn/layers_with_intrinsics.json b/tests/translator/output/aws-cn/layers_with_intrinsics.json index 8353deccb..be1d755cf 100644 --- a/tests/translator/output/aws-cn/layers_with_intrinsics.json +++ b/tests/translator/output/aws-cn/layers_with_intrinsics.json @@ -17,7 +17,7 @@ } }, "Resources": { - "LayerWithNameIntrinsic1935b50dbd": { + "LayerWithNameIntrinsiccf8baed8b9": { "Type": "AWS::Lambda::LayerVersion", "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete", @@ -29,7 +29,7 @@ "LayerName": "SomeLayerName" } }, - "LayerWithRefNameIntrinsicRegion8bb3f168f3": { + "LayerWithRefNameIntrinsicRegion186db7e435": { "Type": "AWS::Lambda::LayerVersion", "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete", @@ -41,7 +41,7 @@ "LayerName": "cn-north-1" } }, - "LayerWithSubNameIntrinsicRegion33dad6e41a": { + "LayerWithSubNameIntrinsicRegionfbc3f9f13d": { "Type": "AWS::Lambda::LayerVersion", "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete", @@ -55,7 +55,7 @@ } } }, - "LayerWithRuntimesIntrinsic15bceab8a8": { + "LayerWithRuntimesIntrinsic1a006faa85": { "Type": "AWS::Lambda::LayerVersion", "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete", @@ -70,7 +70,7 @@ } } }, - "LayerWithSingleListRefRuntimesIntrinsic3243ec999b": { + "LayerWithSingleListRefRuntimesIntrinsic9d7a72f24a": { "Properties": { "CompatibleRuntimes": [ { @@ -87,7 +87,7 @@ "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete" }, - "LayerWithMixedListRefRuntimesIntrinsicbd637a121f": { + "LayerWithMixedListRefRuntimesIntrinsic71fd80f592": { "Properties": { "CompatibleRuntimes": [ { @@ -105,7 +105,7 @@ "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete" }, - "LayerWithLicenseIntrinsicf158772ce9": { + "LayerWithLicenseIntrinsic965c8d0c9b": { "Type": "AWS::Lambda::LayerVersion", "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete", @@ -118,7 +118,7 @@ "LicenseInfo": "MIT-0 License" } }, - "LayerWithSubNameIntrinsic8566d42a51": { + "LayerWithSubNameIntrinsic6e9b477102": { "Type": "AWS::Lambda::LayerVersion", "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete", diff --git a/tests/translator/output/aws-us-gov/basic_layer.json b/tests/translator/output/aws-us-gov/basic_layer.json index 9c430b9b1..5421d7ca6 100644 --- a/tests/translator/output/aws-us-gov/basic_layer.json +++ b/tests/translator/output/aws-us-gov/basic_layer.json @@ -8,7 +8,7 @@ } }, "Resources": { - "LayerWithConditionec24995757": { + "LayerWithCondition7c655e10ea": { "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete", "Type": "AWS::Lambda::LayerVersion", @@ -21,7 +21,7 @@ }, "Condition": "TestCondition" }, - "MinimalLayer7d49517128": { + "MinimalLayer0c7f96cce7": { "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete", "Type": "AWS::Lambda::LayerVersion", @@ -33,7 +33,7 @@ "LayerName": "MinimalLayer" } }, - "CompleteLayer01b64931e6": { + "CompleteLayer5d71a60e81": { "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Retain", "Type": "AWS::Lambda::LayerVersion", @@ -51,7 +51,7 @@ ] } }, - "LayerWithContentUriObject678c9b5427": { + "LayerWithContentUriObjectbdbf1b82ac": { "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete", "Type": "AWS::Lambda::LayerVersion", diff --git a/tests/translator/output/aws-us-gov/function_with_layers.json b/tests/translator/output/aws-us-gov/function_with_layers.json index 9aa736de8..bc7e0dbd0 100644 --- a/tests/translator/output/aws-us-gov/function_with_layers.json +++ b/tests/translator/output/aws-us-gov/function_with_layers.json @@ -28,7 +28,7 @@ "Runtime": "python2.7" } }, - "MyLayer43a7918434": { + "MyLayera5167acaba": { "Type": "AWS::Lambda::LayerVersion", "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete", @@ -47,7 +47,7 @@ "Properties": { "Layers": [ { - "Ref": "MyLayer43a7918434" + "Ref": "MyLayera5167acaba" } ], "Code": { diff --git a/tests/translator/output/aws-us-gov/function_with_many_layers.json b/tests/translator/output/aws-us-gov/function_with_many_layers.json index a5925d80d..259a57785 100644 --- a/tests/translator/output/aws-us-gov/function_with_many_layers.json +++ b/tests/translator/output/aws-us-gov/function_with_many_layers.json @@ -1,6 +1,6 @@ { "Resources": { - "MyLayer43a7918434": { + "MyLayera5167acaba": { "Type": "AWS::Lambda::LayerVersion", "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete", @@ -59,7 +59,7 @@ "Fn::Sub": "arn:${AWS::Partition}:lambda:${AWS::Region}:123456789101:layer:c:1" }, { - "Ref": "MyLayer43a7918434" + "Ref": "MyLayera5167acaba" } ], "Code": { diff --git a/tests/translator/output/aws-us-gov/layers_all_properties.json b/tests/translator/output/aws-us-gov/layers_all_properties.json index 0040589b1..621d4f156 100644 --- a/tests/translator/output/aws-us-gov/layers_all_properties.json +++ b/tests/translator/output/aws-us-gov/layers_all_properties.json @@ -2,7 +2,7 @@ "Outputs": { "LayerSub": { "Value": { - "Fn::Sub": "${MyLayerf16259d4b8}" + "Fn::Sub": "${MyLayerd04062b365}" } }, "FunctionAtt": { @@ -15,7 +15,7 @@ }, "LayerName": { "Value": { - "Ref": "MyLayerf16259d4b8" + "Ref": "MyLayerd04062b365" } }, "FunctionSub": { @@ -43,7 +43,7 @@ "Properties": { "Layers": [ { - "Ref": "MyLayerf16259d4b8" + "Ref": "MyLayerd04062b365" } ], "Code": { @@ -66,7 +66,7 @@ "Runtime": "python3.6" } }, - "MyLayerf16259d4b8": { + "MyLayerd04062b365": { "Type": "AWS::Lambda::LayerVersion", "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete", @@ -78,7 +78,7 @@ "LayerName": "MyLayer" } }, - "MyLayerWithAName0c99fc75b5": { + "MyLayerWithANamefda8c9ec8c": { "Type": "AWS::Lambda::LayerVersion", "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete", diff --git a/tests/translator/output/aws-us-gov/layers_with_intrinsics.json b/tests/translator/output/aws-us-gov/layers_with_intrinsics.json index 0201c2f4a..89546b674 100644 --- a/tests/translator/output/aws-us-gov/layers_with_intrinsics.json +++ b/tests/translator/output/aws-us-gov/layers_with_intrinsics.json @@ -17,7 +17,7 @@ } }, "Resources": { - "LayerWithNameIntrinsic1935b50dbd": { + "LayerWithNameIntrinsiccf8baed8b9": { "Type": "AWS::Lambda::LayerVersion", "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete", @@ -29,7 +29,7 @@ "LayerName": "SomeLayerName" } }, - "LayerWithRefNameIntrinsicRegionf83cde78fb": { + "LayerWithRefNameIntrinsicRegionad31c93c8b": { "Type": "AWS::Lambda::LayerVersion", "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete", @@ -41,7 +41,7 @@ "LayerName": "us-gov-west-1" } }, - "LayerWithSubNameIntrinsicRegion53c39f5768": { + "LayerWithSubNameIntrinsicRegion5b2c74d55e": { "Type": "AWS::Lambda::LayerVersion", "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete", @@ -55,7 +55,7 @@ } } }, - "LayerWithRuntimesIntrinsic15bceab8a8": { + "LayerWithRuntimesIntrinsic1a006faa85": { "Type": "AWS::Lambda::LayerVersion", "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete", @@ -70,7 +70,7 @@ } } }, - "LayerWithSingleListRefRuntimesIntrinsic3243ec999b": { + "LayerWithSingleListRefRuntimesIntrinsic9d7a72f24a": { "Properties": { "CompatibleRuntimes": [ { @@ -87,7 +87,7 @@ "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete" }, - "LayerWithMixedListRefRuntimesIntrinsicbd637a121f": { + "LayerWithMixedListRefRuntimesIntrinsic71fd80f592": { "Properties": { "CompatibleRuntimes": [ { @@ -105,7 +105,7 @@ "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete" }, - "LayerWithLicenseIntrinsicf158772ce9": { + "LayerWithLicenseIntrinsic965c8d0c9b": { "Type": "AWS::Lambda::LayerVersion", "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete", @@ -118,7 +118,7 @@ "LicenseInfo": "MIT-0 License" } }, - "LayerWithSubNameIntrinsic8566d42a51": { + "LayerWithSubNameIntrinsic6e9b477102": { "Type": "AWS::Lambda::LayerVersion", "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete", diff --git a/tests/translator/output/basic_layer.json b/tests/translator/output/basic_layer.json index 9c430b9b1..5421d7ca6 100644 --- a/tests/translator/output/basic_layer.json +++ b/tests/translator/output/basic_layer.json @@ -8,7 +8,7 @@ } }, "Resources": { - "LayerWithConditionec24995757": { + "LayerWithCondition7c655e10ea": { "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete", "Type": "AWS::Lambda::LayerVersion", @@ -21,7 +21,7 @@ }, "Condition": "TestCondition" }, - "MinimalLayer7d49517128": { + "MinimalLayer0c7f96cce7": { "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete", "Type": "AWS::Lambda::LayerVersion", @@ -33,7 +33,7 @@ "LayerName": "MinimalLayer" } }, - "CompleteLayer01b64931e6": { + "CompleteLayer5d71a60e81": { "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Retain", "Type": "AWS::Lambda::LayerVersion", @@ -51,7 +51,7 @@ ] } }, - "LayerWithContentUriObject678c9b5427": { + "LayerWithContentUriObjectbdbf1b82ac": { "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete", "Type": "AWS::Lambda::LayerVersion", diff --git a/tests/translator/output/function_with_layers.json b/tests/translator/output/function_with_layers.json index 0cbb0da86..d21b63450 100644 --- a/tests/translator/output/function_with_layers.json +++ b/tests/translator/output/function_with_layers.json @@ -28,7 +28,7 @@ "Runtime": "python2.7" } }, - "MyLayer43a7918434": { + "MyLayera5167acaba": { "Type": "AWS::Lambda::LayerVersion", "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete", @@ -47,7 +47,7 @@ "Properties": { "Layers": [ { - "Ref": "MyLayer43a7918434" + "Ref": "MyLayera5167acaba" } ], "Code": { diff --git a/tests/translator/output/function_with_many_layers.json b/tests/translator/output/function_with_many_layers.json index a6a5f5108..ab498dc5f 100644 --- a/tests/translator/output/function_with_many_layers.json +++ b/tests/translator/output/function_with_many_layers.json @@ -1,6 +1,6 @@ { "Resources": { - "MyLayer43a7918434": { + "MyLayera5167acaba": { "Type": "AWS::Lambda::LayerVersion", "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete", @@ -59,7 +59,7 @@ "Fn::Sub": "arn:${AWS::Partition}:lambda:${AWS::Region}:123456789101:layer:c:1" }, { - "Ref": "MyLayer43a7918434" + "Ref": "MyLayera5167acaba" } ], "Code": { diff --git a/tests/translator/output/layers_all_properties.json b/tests/translator/output/layers_all_properties.json index bedbbce3a..ffce52071 100644 --- a/tests/translator/output/layers_all_properties.json +++ b/tests/translator/output/layers_all_properties.json @@ -2,7 +2,7 @@ "Outputs": { "LayerSub": { "Value": { - "Fn::Sub": "${MyLayerf16259d4b8}" + "Fn::Sub": "${MyLayerd04062b365}" } }, "FunctionAtt": { @@ -15,7 +15,7 @@ }, "LayerName": { "Value": { - "Ref": "MyLayerf16259d4b8" + "Ref": "MyLayerd04062b365" } }, "FunctionSub": { @@ -43,7 +43,7 @@ "Properties": { "Layers": [ { - "Ref": "MyLayerf16259d4b8" + "Ref": "MyLayerd04062b365" } ], "Code": { @@ -66,7 +66,7 @@ "Runtime": "python3.6" } }, - "MyLayerf16259d4b8": { + "MyLayerd04062b365": { "Type": "AWS::Lambda::LayerVersion", "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete", @@ -78,7 +78,7 @@ "LayerName": "MyLayer" } }, - "MyLayerWithAName0c99fc75b5": { + "MyLayerWithANamefda8c9ec8c": { "Type": "AWS::Lambda::LayerVersion", "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete", diff --git a/tests/translator/output/layers_with_intrinsics.json b/tests/translator/output/layers_with_intrinsics.json index 9f77987f2..e0f76ae9b 100644 --- a/tests/translator/output/layers_with_intrinsics.json +++ b/tests/translator/output/layers_with_intrinsics.json @@ -17,7 +17,7 @@ } }, "Resources": { - "LayerWithNameIntrinsic1935b50dbd": { + "LayerWithNameIntrinsiccf8baed8b9": { "Type": "AWS::Lambda::LayerVersion", "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete", @@ -29,7 +29,7 @@ "LayerName": "SomeLayerName" } }, - "LayerWithRefNameIntrinsicRegion472f836e5f": { + "LayerWithRefNameIntrinsicRegion32bf7198a5": { "Type": "AWS::Lambda::LayerVersion", "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete", @@ -41,7 +41,7 @@ "LayerName": "ap-southeast-1" } }, - "LayerWithSubNameIntrinsicRegionf4ccaf8dcb": { + "LayerWithSubNameIntrinsicRegiond71326de24": { "Type": "AWS::Lambda::LayerVersion", "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete", @@ -55,7 +55,7 @@ } } }, - "LayerWithRuntimesIntrinsic15bceab8a8": { + "LayerWithRuntimesIntrinsic1a006faa85": { "Type": "AWS::Lambda::LayerVersion", "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete", @@ -70,7 +70,7 @@ } } }, - "LayerWithSingleListRefRuntimesIntrinsic3243ec999b": { + "LayerWithSingleListRefRuntimesIntrinsic9d7a72f24a": { "Properties": { "CompatibleRuntimes": [ { @@ -87,7 +87,7 @@ "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete" }, - "LayerWithMixedListRefRuntimesIntrinsicbd637a121f": { + "LayerWithMixedListRefRuntimesIntrinsic71fd80f592": { "Properties": { "CompatibleRuntimes": [ { @@ -105,7 +105,7 @@ "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete" }, - "LayerWithLicenseIntrinsicf158772ce9": { + "LayerWithLicenseIntrinsic965c8d0c9b": { "Type": "AWS::Lambda::LayerVersion", "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete", @@ -118,7 +118,7 @@ "LicenseInfo": "MIT-0 License" } }, - "LayerWithSubNameIntrinsic8566d42a51": { + "LayerWithSubNameIntrinsic6e9b477102": { "Type": "AWS::Lambda::LayerVersion", "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete", From 468084af45459dadb4ead1a5b822ffe162981dc7 Mon Sep 17 00:00:00 2001 From: Mehmet Nuri Deveci <5735811+mndeveci@users.noreply.github.com> Date: Thu, 22 Apr 2021 14:16:42 -0700 Subject: [PATCH 25/41] fix: mutable default values in method definitions (#1997) --- samtranslator/intrinsics/resolver.py | 4 +++- samtranslator/model/apigateway.py | 4 +++- samtranslator/model/intrinsics.py | 4 +++- samtranslator/model/stepfunctions/generators.py | 4 +++- samtranslator/open_api/open_api.py | 4 +++- .../plugins/application/serverless_app_plugin.py | 4 +++- samtranslator/swagger/swagger.py | 4 +++- samtranslator/translator/arn_generator.py | 6 +++--- samtranslator/translator/translator.py | 7 +++++-- tests/intrinsics/test_resolver.py | 5 ----- tests/translator/test_arn_generator.py | 11 ++++------- 11 files changed, 33 insertions(+), 24 deletions(-) diff --git a/samtranslator/intrinsics/resolver.py b/samtranslator/intrinsics/resolver.py index 519f856fe..af79704a9 100644 --- a/samtranslator/intrinsics/resolver.py +++ b/samtranslator/intrinsics/resolver.py @@ -8,7 +8,7 @@ class IntrinsicsResolver(object): - def __init__(self, parameters, supported_intrinsics=DEFAULT_SUPPORTED_INTRINSICS): + def __init__(self, parameters, supported_intrinsics=None): """ Instantiate the resolver :param dict parameters: Map of parameter names to their values @@ -17,6 +17,8 @@ def __init__(self, parameters, supported_intrinsics=DEFAULT_SUPPORTED_INTRINSICS :raises TypeError: If parameters or the supported_intrinsics arguments are invalid """ + if supported_intrinsics is None: + supported_intrinsics = DEFAULT_SUPPORTED_INTRINSICS if parameters is None or not isinstance(parameters, dict): raise InvalidDocumentException( [InvalidTemplateException("'Mappings' or 'Parameters' is either null or not a valid dictionary.")] diff --git a/samtranslator/model/apigateway.py b/samtranslator/model/apigateway.py index 607c38529..0e768918f 100644 --- a/samtranslator/model/apigateway.py +++ b/samtranslator/model/apigateway.py @@ -231,8 +231,10 @@ def __init__( function_payload_type=None, function_invoke_role=None, is_aws_iam_authorizer=False, - authorization_scopes=[], + authorization_scopes=None, ): + if authorization_scopes is None: + authorization_scopes = [] if function_payload_type not in ApiGatewayAuthorizer._VALID_FUNCTION_PAYLOAD_TYPES: raise InvalidResourceException( api_logical_id, diff --git a/samtranslator/model/intrinsics.py b/samtranslator/model/intrinsics.py index c81e40d00..e95a5d6d0 100644 --- a/samtranslator/model/intrinsics.py +++ b/samtranslator/model/intrinsics.py @@ -24,7 +24,9 @@ def fnAnd(argument_list): return {"Fn::And": argument_list} -def make_conditional(condition, true_data, false_data={"Ref": "AWS::NoValue"}): +def make_conditional(condition, true_data, false_data=None): + if false_data is None: + false_data = {"Ref": "AWS::NoValue"} return {"Fn::If": [condition, true_data, false_data]} diff --git a/samtranslator/model/stepfunctions/generators.py b/samtranslator/model/stepfunctions/generators.py index 8e1797c7d..f8431c189 100644 --- a/samtranslator/model/stepfunctions/generators.py +++ b/samtranslator/model/stepfunctions/generators.py @@ -286,7 +286,7 @@ def _replace_dynamic_values_with_substitutions(self, input): location[path[-1]] = sub_key return substitution_map - def _get_paths_to_intrinsics(self, input, path=[]): + def _get_paths_to_intrinsics(self, input, path=None): """ Returns all paths to dynamic values within a dictionary @@ -294,6 +294,8 @@ def _get_paths_to_intrinsics(self, input, path=[]): :param path: Optional list to keep track of the path to the input dictionary :returns list: List of keys that defines the path to a dynamic value within the input dictionary """ + if path is None: + path = [] dynamic_value_paths = [] if isinstance(input, dict): iterator = input.items() diff --git a/samtranslator/open_api/open_api.py b/samtranslator/open_api/open_api.py index fc0f77a26..af6b47e49 100644 --- a/samtranslator/open_api/open_api.py +++ b/samtranslator/open_api/open_api.py @@ -391,7 +391,7 @@ def add_auth_to_method(self, path, method_name, auth, api): if method_authorizer: self._set_method_authorizer(path, method_name, method_authorizer, authorizers, authorization_scopes) - def _set_method_authorizer(self, path, method_name, authorizer_name, authorizers, authorization_scopes=[]): + def _set_method_authorizer(self, path, method_name, authorizer_name, authorizers, authorization_scopes=None): """ Adds the authorizer_name to the security block for each method on this path. This is used to configure the authorizer for individual functions. @@ -402,6 +402,8 @@ def _set_method_authorizer(self, path, method_name, authorizer_name, authorizers authorizers param. :param list authorization_scopes: list of strings that are the auth scopes for this method """ + if authorization_scopes is None: + authorization_scopes = [] normalized_method_name = self._normalize_method_name(method_name) # It is possible that the method could have two definitions in a Fn::If block. for method_definition in self.get_method_contents(self.get_path(path)[normalized_method_name]): diff --git a/samtranslator/plugins/application/serverless_app_plugin.py b/samtranslator/plugins/application/serverless_app_plugin.py index 02333e0f4..05741c5df 100644 --- a/samtranslator/plugins/application/serverless_app_plugin.py +++ b/samtranslator/plugins/application/serverless_app_plugin.py @@ -42,7 +42,7 @@ class ServerlessAppPlugin(BasePlugin): LOCATION_KEY = "Location" TEMPLATE_URL_KEY = "TemplateUrl" - def __init__(self, sar_client=None, wait_for_template_active_status=False, validate_only=False, parameters={}): + def __init__(self, sar_client=None, wait_for_template_active_status=False, validate_only=False, parameters=None): """ Initialize the plugin. @@ -52,6 +52,8 @@ def __init__(self, sar_client=None, wait_for_template_active_status=False, valid :param bool validate_only: Flag to only validate application access (uses get_application API instead) """ super(ServerlessAppPlugin, self).__init__(ServerlessAppPlugin.__name__) + if parameters is None: + parameters = {} self._applications = {} self._in_progress_templates = [] self._sar_client = sar_client diff --git a/samtranslator/swagger/swagger.py b/samtranslator/swagger/swagger.py index 64e6699b8..4345373c0 100644 --- a/samtranslator/swagger/swagger.py +++ b/samtranslator/swagger/swagger.py @@ -698,7 +698,7 @@ def add_auth_to_method(self, path, method_name, auth, api): if method_apikey_required is not None: self._set_method_apikey_handling(path, method_name, method_apikey_required) - def _set_method_authorizer(self, path, method_name, authorizer_name, authorizers={}, method_scopes=None): + def _set_method_authorizer(self, path, method_name, authorizer_name, authorizers=None, method_scopes=None): """ Adds the authorizer_name to the security block for each method on this path. This is used to configure the authorizer for individual functions. @@ -708,6 +708,8 @@ def _set_method_authorizer(self, path, method_name, authorizer_name, authorizers :param string authorizer_name: Name of the authorizer to use. Must be a key in the authorizers param. """ + if authorizers is None: + authorizers = {} normalized_method_name = self._normalize_method_name(method_name) # It is possible that the method could have two definitions in a Fn::If block. for method_definition in self.get_method_contents(self.get_path(path)[normalized_method_name]): diff --git a/samtranslator/translator/arn_generator.py b/samtranslator/translator/arn_generator.py index 9394a6c0a..897661e8d 100644 --- a/samtranslator/translator/arn_generator.py +++ b/samtranslator/translator/arn_generator.py @@ -6,7 +6,7 @@ class NoRegionFound(Exception): class ArnGenerator(object): - class_boto_session = None + BOTO_SESSION_REGION_NAME = None @classmethod def generate_arn(cls, partition, service, resource, include_account_id=True): @@ -50,10 +50,10 @@ def get_partition_name(cls, region=None): # Use Boto3 to get the region where code is running. This uses Boto's regular region resolution # mechanism, starting from AWS_DEFAULT_REGION environment variable. - if ArnGenerator.class_boto_session is None: + if ArnGenerator.BOTO_SESSION_REGION_NAME is None: region = boto3.session.Session().region_name else: - region = ArnGenerator.class_boto_session.region_name + region = ArnGenerator.BOTO_SESSION_REGION_NAME # If region is still None, then we could not find the region. This will only happen # in the local context. When this is deployed, we will be able to find the region like diff --git a/samtranslator/translator/translator.py b/samtranslator/translator/translator.py index e675d99aa..a994e8d8b 100644 --- a/samtranslator/translator/translator.py +++ b/samtranslator/translator/translator.py @@ -45,7 +45,8 @@ def __init__(self, managed_policy_map, sam_parser, plugins=None, boto_session=No self.feature_toggle = None self.boto_session = boto_session - ArnGenerator.class_boto_session = self.boto_session + if self.boto_session: + ArnGenerator.BOTO_SESSION_REGION_NAME = self.boto_session.region_name def _get_function_names(self, resource_dict, intrinsics_resolver): """ @@ -228,7 +229,7 @@ def _get_resources_to_iterate(self, sam_template, macro_resolver): return functions + statemachines + apis + others -def prepare_plugins(plugins, parameters={}): +def prepare_plugins(plugins, parameters=None): """ Creates & returns a plugins object with the given list of plugins installed. In addition to the given plugins, we will also install a few "required" plugins that are necessary to provide complete support for SAM template spec. @@ -238,6 +239,8 @@ def prepare_plugins(plugins, parameters={}): :return samtranslator.plugins.SamPlugins: Instance of `SamPlugins` """ + if parameters is None: + parameters = {} required_plugins = [ DefaultDefinitionBodyPlugin(), make_implicit_rest_api_plugin(), diff --git a/tests/intrinsics/test_resolver.py b/tests/intrinsics/test_resolver.py index 2f62b510f..946307b87 100644 --- a/tests/intrinsics/test_resolver.py +++ b/tests/intrinsics/test_resolver.py @@ -192,11 +192,6 @@ class SomeAction(Action): with self.assertRaises(TypeError): IntrinsicsResolver({}, supported_intrinsics) - def test_configure_supported_intrinsics_must_error_for_none_input(self): - - with self.assertRaises(TypeError): - IntrinsicsResolver({}, None) - def test_configure_supported_intrinsics_must_error_for_non_dict_input(self): with self.assertRaises(TypeError): diff --git a/tests/translator/test_arn_generator.py b/tests/translator/test_arn_generator.py index 461840cdf..200f90414 100644 --- a/tests/translator/test_arn_generator.py +++ b/tests/translator/test_arn_generator.py @@ -1,13 +1,13 @@ from unittest import TestCase from parameterized import parameterized -from mock import Mock, patch +from mock import patch from samtranslator.translator.arn_generator import ArnGenerator, NoRegionFound class TestArnGenerator(TestCase): def setUp(self): - ArnGenerator.class_boto_session = None + ArnGenerator.BOTO_SESSION_REGION_NAME = None @parameterized.expand( [("us-east-1", "aws"), ("cn-east-1", "aws-cn"), ("us-gov-west-1", "aws-us-gov"), ("US-EAST-1", "aws")] @@ -23,13 +23,10 @@ def test_get_partition_name_raise_NoRegionFound(self): ArnGenerator.get_partition_name(None) def test_get_partition_name_from_boto_session(self): - boto_session_mock = Mock() - boto_session_mock.region_name = "us-east-1" - - ArnGenerator.class_boto_session = boto_session_mock + ArnGenerator.BOTO_SESSION_REGION_NAME = "us-east-1" actual = ArnGenerator.get_partition_name() self.assertEqual(actual, "aws") - ArnGenerator.class_boto_session = None + ArnGenerator.BOTO_SESSION_REGION_NAME = None From ec1783bbe827146eaa57bcef572b4756fe75a5ed Mon Sep 17 00:00:00 2001 From: Mehmet Nuri Deveci <5735811+mndeveci@users.noreply.github.com> Date: Thu, 22 Apr 2021 14:23:41 -0700 Subject: [PATCH 26/41] fix: remove explicit logging level set in single module (#1998) --- samtranslator/model/api/api_generator.py | 1 - 1 file changed, 1 deletion(-) diff --git a/samtranslator/model/api/api_generator.py b/samtranslator/model/api/api_generator.py index c6225836c..e0273d08b 100644 --- a/samtranslator/model/api/api_generator.py +++ b/samtranslator/model/api/api_generator.py @@ -26,7 +26,6 @@ from samtranslator.model.tags.resource_tagging import get_tag_list LOG = logging.getLogger(__name__) -LOG.setLevel(logging.INFO) _CORS_WILDCARD = "'*'" CorsProperties = namedtuple( From fb6f45e687518dc27b7610868d0a02bc16efde49 Mon Sep 17 00:00:00 2001 From: Mehmet Nuri Deveci <5735811+mndeveci@users.noreply.github.com> Date: Thu, 29 Apr 2021 19:15:05 -0700 Subject: [PATCH 27/41] run automated tests for resource level attribute support --- tests/translator/input/alexa_skill.yaml | 4 +- .../input/alexa_skill_with_skill_id.yaml | 3 - .../input/all_policy_templates.yaml | 3 - tests/translator/input/api_cache.yaml | 8 +- tests/translator/input/api_description.yaml | 6 - .../input/api_endpoint_configuration.yaml | 4 - ...dpoint_configuration_with_vpcendpoint.yaml | 4 - tests/translator/input/api_request_model.yaml | 4 - .../input/api_request_model_openapi_3.yaml | 4 - .../input/api_with_access_log_setting.yaml | 4 - .../api_with_apikey_default_override.yaml | 8 - .../input/api_with_apikey_required.yaml | 4 - .../api_with_apikey_required_openapi_3.yaml | 4 - .../input/api_with_auth_all_maximum.yaml | 4 - .../api_with_auth_all_maximum_openapi_3.yaml | 4 - .../input/api_with_auth_all_minimum.yaml | 14 -- .../api_with_auth_all_minimum_openapi.yaml | 12 - .../api_with_auth_and_conditions_all_max.yaml | 6 - .../input/api_with_auth_no_default.yaml | 12 - .../api_with_auth_with_default_scopes.yaml | 4 - ...with_auth_with_default_scopes_openapi.yaml | 4 - .../input/api_with_aws_account_blacklist.yaml | 2 - .../input/api_with_aws_account_whitelist.yaml | 2 - .../api_with_aws_iam_auth_overrides.yaml | 22 -- .../input/api_with_basic_custom_domain.yaml | 6 - .../api_with_basic_custom_domain_http.yaml | 4 - ...i_with_basic_custom_domain_intrinsics.yaml | 4 - ...h_basic_custom_domain_intrinsics_http.yaml | 4 - .../input/api_with_binary_media_types.yaml | 4 - ...th_binary_media_types_definition_body.yaml | 4 - .../input/api_with_canary_setting.yaml | 4 - tests/translator/input/api_with_cors.yaml | 8 - ..._with_cors_and_auth_no_preflight_auth.yaml | 6 - ...api_with_cors_and_auth_preflight_auth.yaml | 6 - ...cors_and_conditions_no_definitionbody.yaml | 6 - ..._with_cors_and_only_credentials_false.yaml | 4 - .../input/api_with_cors_and_only_headers.yaml | 4 - .../input/api_with_cors_and_only_maxage.yaml | 4 - .../input/api_with_cors_and_only_methods.yaml | 2 - .../input/api_with_cors_and_only_origins.yaml | 4 - .../api_with_cors_no_definitionbody.yaml | 4 - .../input/api_with_cors_openapi_3.yaml | 8 - .../input/api_with_custom_domain_route53.yaml | 4 - ...ustom_domain_route53_hosted_zone_name.yaml | 4 - ..._domain_route53_hosted_zone_name_http.yaml | 4 - .../api_with_custom_domain_route53_http.yaml | 4 - .../input/api_with_default_aws_iam_auth.yaml | 8 - ...efault_aws_iam_auth_and_no_auth_route.yaml | 4 - .../input/api_with_gateway_responses.yaml | 4 - .../input/api_with_gateway_responses_all.yaml | 4 - ..._with_gateway_responses_all_openapi_3.yaml | 4 - .../api_with_gateway_responses_implicit.yaml | 2 - .../api_with_gateway_responses_minimal.yaml | 4 - ..._gateway_responses_string_status_code.yaml | 4 - ...h_if_conditional_with_resource_policy.yaml | 4 - .../api_with_incompatible_stage_name.yaml | 8 - .../input/api_with_ip_range_blacklist.yaml | 2 - .../input/api_with_ip_range_whitelist.yaml | 2 - .../input/api_with_method_aws_iam_auth.yaml | 4 - .../input/api_with_method_settings.yaml | 4 - .../api_with_minimum_compression_size.yaml | 4 - .../input/api_with_open_api_version.yaml | 4 - .../input/api_with_open_api_version_2.yaml | 4 - ..._with_openapi_definition_body_no_flag.yaml | 6 - .../input/api_with_path_parameters.yaml | 4 - .../input/api_with_resource_policy.yaml | 4 - .../api_with_resource_policy_global.yaml | 6 - ..._with_resource_policy_global_implicit.yaml | 2 - .../input/api_with_resource_refs.yaml | 4 - .../input/api_with_source_vpc_blacklist.yaml | 2 - .../input/api_with_source_vpc_whitelist.yaml | 4 - .../translator/input/api_with_stage_tags.yaml | 2 - ...pi_with_swagger_and_openapi_with_auth.yaml | 6 - .../translator/input/api_with_usageplans.yaml | 12 - .../input/api_with_usageplans_intrinsics.yaml | 8 - .../input/api_with_xray_tracing.yaml | 4 - .../input/application_preparing_state.yaml | 2 - .../input/application_with_intrinsics.yaml | 6 - tests/translator/input/basic_application.yaml | 8 - tests/translator/input/basic_function.yaml | 18 -- .../input/basic_function_with_tags.yaml | 2 - .../input/basic_function_withimageuri.yaml | 14 -- tests/translator/input/basic_layer.yaml | 8 - .../input/cloudwatch_logs_with_ref.yaml | 2 - tests/translator/input/cloudwatchevent.yaml | 4 - tests/translator/input/cloudwatchlog.yaml | 2 - .../input/cognito_userpool_with_event.yaml | 4 - tests/translator/input/depends_on.yaml | 8 - tests/translator/input/eventbridgerule.yaml | 4 - .../eventbridgerule_schedule_properties.yaml | 4 - .../input/eventbridgerule_with_dlq.yaml | 4 - .../eventbridgerule_with_retry_policy.yaml | 4 - tests/translator/input/explicit_api.yaml | 6 - .../input/explicit_api_openapi_3.yaml | 6 - ...plicit_api_with_invalid_events_config.yaml | 4 - tests/translator/input/explicit_http_api.yaml | 6 - .../input/explicit_http_api_minimum.yaml | 4 - .../input/function_concurrency.yaml | 4 - .../input/function_event_conditions.yaml | 10 - .../input/function_managed_inline_policy.yaml | 2 - .../translator/input/function_with_alias.yaml | 2 - .../function_with_alias_and_code_sha256.yaml | 2 - ...function_with_alias_and_event_sources.yaml | 8 - .../input/function_with_alias_intrinsics.yaml | 2 - tests/translator/input/function_with_amq.yaml | 2 - .../input/function_with_amq_kms.yaml | 2 - .../input/function_with_condition.yaml | 2 - ...ction_with_conditional_managed_policy.yaml | 2 - ...ional_managed_policy_and_ref_no_value.yaml | 2 - ...tion_with_conditional_policy_template.yaml | 2 - ...onal_policy_template_and_ref_no_value.yaml | 2 - ...stom_codedeploy_deployment_preference.yaml | 14 -- ...onal_codedeploy_deployment_preference.yaml | 2 - ...ction_with_deployment_and_custom_role.yaml | 6 - ...ction_with_deployment_no_service_role.yaml | 6 - .../function_with_deployment_preference.yaml | 2 - ...oyment_preference_alarms_intrinsic_if.yaml | 2 - ..._deployment_preference_all_parameters.yaml | 12 +- ...deployment_preference_from_parameters.yaml | 12 +- ...ment_preference_multiple_combinations.yaml | 12 - ...n_with_disabled_deployment_preference.yaml | 2 - tests/translator/input/function_with_dlq.yaml | 4 - .../input/function_with_event_dest.yaml | 8 - .../input/function_with_event_dest_basic.yaml | 2 - .../function_with_event_dest_conditional.yaml | 4 - .../function_with_event_source_mapping.yaml | 14 +- .../function_with_file_system_config.yaml | 8 - .../input/function_with_global_layers.yaml | 2 - .../input/function_with_kmskeyarn.yaml | 6 - .../input/function_with_layers.yaml | 10 - .../input/function_with_many_layers.yaml | 4 - .../function_with_permissions_boundary.yaml | 2 - .../input/function_with_policy_templates.yaml | 6 - .../function_with_request_parameters.yaml | 6 - .../input/function_with_resource_refs.yaml | 6 - .../input/function_with_signing_profile.yaml | 6 - ..._with_sns_event_source_all_parameters.yaml | 2 - .../global_handle_path_level_parameter.yaml | 6 - tests/translator/input/globals_for_api.yaml | 6 - .../input/globals_for_function.yaml | 4 - .../input/globals_for_simpletable.yaml | 4 +- tests/translator/input/http_api_def_uri.yaml | 6 - .../input/http_api_description.yaml | 4 - .../input/http_api_existing_openapi.yaml | 4 - .../http_api_existing_openapi_conditions.yaml | 4 - .../input/http_api_explicit_stage.yaml | 4 - .../input/http_api_lambda_auth.yaml | 6 - .../input/http_api_lambda_auth_full.yaml | 6 - .../translator/input/http_api_with_cors.yaml | 4 - ...icit_and_explicit_api_with_conditions.yaml | 10 - tests/translator/input/implicit_api.yaml | 4 - ...icit_api_with_auth_and_conditions_max.yaml | 12 - .../implicit_api_with_many_conditions.yaml | 22 -- ...api_with_serverless_rest_api_resource.yaml | 6 - tests/translator/input/implicit_http_api.yaml | 4 - ...mplicit_http_api_auth_and_simple_case.yaml | 2 - ...mplicit_http_api_with_many_conditions.yaml | 22 -- tests/translator/input/inline_precedence.yaml | 2 - .../translator/input/intrinsic_functions.yaml | 22 -- tests/translator/input/iot_rule.yaml | 2 - .../input/layers_all_properties.yaml | 6 - .../input/layers_with_intrinsics.yaml | 16 -- ...api_with_serverless_rest_api_resource.yaml | 10 - tests/translator/input/s3.yaml | 4 - tests/translator/input/s3_create_remove.yaml | 4 - ...ing_lambda_notification_configuration.yaml | 4 - ...ting_other_notification_configuration.yaml | 4 - tests/translator/input/s3_filter.yaml | 4 - .../input/s3_multiple_events_same_bucket.yaml | 4 - .../input/s3_multiple_functions.yaml | 6 - tests/translator/input/s3_with_condition.yaml | 4 - tests/translator/input/s3_with_dependsOn.yaml | 6 - .../simple_table_ref_parameter_intrinsic.yaml | 2 - .../input/simple_table_with_extra_tags.yaml | 2 - .../input/simple_table_with_table_name.yaml | 6 - tests/translator/input/simpletable.yaml | 4 - .../input/simpletable_with_sse.yaml | 2 - tests/translator/input/sns.yaml | 4 - .../sns_existing_other_subscription.yaml | 4 - tests/translator/input/sns_existing_sqs.yaml | 8 +- tests/translator/input/sns_outside_sqs.yaml | 4 - tests/translator/input/sns_sqs.yaml | 4 - .../input/sns_topic_outside_template.yaml | 2 - tests/translator/input/sqs.yaml | 2 - ..._machine_with_api_auth_default_scopes.yaml | 4 - .../state_machine_with_api_authorizer.yaml | 4 - ...e_machine_with_api_authorizer_maximum.yaml | 4 - ...tate_machine_with_api_resource_policy.yaml | 4 - .../input/state_machine_with_condition.yaml | 2 - ...ate_machine_with_condition_and_events.yaml | 2 - .../input/state_machine_with_cwe.yaml | 2 - ...ate_machine_with_definition_S3_object.yaml | 4 - ...ate_machine_with_definition_S3_string.yaml | 4 - ...machine_with_definition_substitutions.yaml | 4 - .../input/state_machine_with_eb_dlq.yaml | 2 - .../state_machine_with_eb_dlq_generated.yaml | 2 - .../state_machine_with_eb_retry_policy.yaml | 2 - .../state_machine_with_explicit_api.yaml | 4 - .../state_machine_with_express_logging.yaml | 6 - .../state_machine_with_implicit_api.yaml | 2 - ...ate_machine_with_implicit_api_globals.yaml | 2 - .../state_machine_with_inline_definition.yaml | 2 - ...ine_with_inline_definition_intrinsics.yaml | 4 - .../state_machine_with_inline_policies.yaml | 4 - .../state_machine_with_managed_policy.yaml | 2 - ...ate_machine_with_permissions_boundary.yaml | 4 - .../input/state_machine_with_role.yaml | 2 - ...ate_machine_with_sam_policy_templates.yaml | 12 - .../input/state_machine_with_schedule.yaml | 2 - ...achine_with_schedule_dlq_retry_policy.yaml | 2 - .../state_machine_with_standard_logging.yaml | 6 - .../input/state_machine_with_tags.yaml | 2 - .../state_machine_with_xray_policies.yaml | 4 - .../input/state_machine_with_xray_role.yaml | 2 - tests/translator/input/streams.yaml | 6 - tests/translator/output/alexa_skill.json | 9 - .../output/alexa_skill_with_skill_id.json | 9 - .../output/all_policy_templates.json | 6 - tests/translator/output/api_cache.json | 18 -- tests/translator/output/api_description.json | 18 -- .../output/api_endpoint_configuration.json | 18 -- ...dpoint_configuration_with_vpcendpoint.json | 18 -- .../translator/output/api_request_model.json | 12 - .../output/api_request_model_openapi_3.json | 14 -- .../output/api_with_access_log_setting.json | 18 -- .../api_with_apikey_default_override.json | 24 -- .../output/api_with_apikey_required.json | 12 - .../api_with_apikey_required_openapi_3.json | 12 - .../output/api_with_auth_all_maximum.json | 26 --- .../api_with_auth_all_maximum_openapi_3.json | 26 --- .../output/api_with_auth_all_minimum.json | 48 ---- .../api_with_auth_all_minimum_openapi.json | 38 ---- .../api_with_auth_and_conditions_all_max.json | 32 --- .../output/api_with_auth_no_default.json | 38 ---- .../api_with_auth_with_default_scopes.json | 24 -- ...with_auth_with_default_scopes_openapi.json | 24 -- .../api_with_aws_account_blacklist.json | 12 - .../api_with_aws_account_whitelist.json | 12 - .../api_with_aws_iam_auth_overrides.json | 66 ------ .../output/api_with_basic_custom_domain.json | 42 ---- .../api_with_basic_custom_domain_http.json | 18 -- ...i_with_basic_custom_domain_intrinsics.json | 26 --- ...h_basic_custom_domain_intrinsics_http.json | 22 -- .../output/api_with_binary_media_types.json | 18 -- ...th_binary_media_types_definition_body.json | 12 - .../output/api_with_canary_setting.json | 18 -- tests/translator/output/api_with_cors.json | 28 --- ..._with_cors_and_auth_no_preflight_auth.json | 20 -- ...api_with_cors_and_auth_preflight_auth.json | 20 -- ...cors_and_conditions_no_definitionbody.json | 20 -- ..._with_cors_and_only_credentials_false.json | 10 - .../api_with_cors_and_only_headers.json | 20 -- .../output/api_with_cors_and_only_maxage.json | 10 - .../api_with_cors_and_only_methods.json | 12 - .../api_with_cors_and_only_origins.json | 20 -- .../api_with_cors_no_definitionbody.json | 14 -- .../output/api_with_cors_openapi_3.json | 28 --- .../api_with_custom_domain_route53.json | 18 -- ...ustom_domain_route53_hosted_zone_name.json | 18 -- ..._domain_route53_hosted_zone_name_http.json | 16 -- .../api_with_custom_domain_route53_http.json | 16 -- .../output/api_with_default_aws_iam_auth.json | 28 --- ...efault_aws_iam_auth_and_no_auth_route.json | 14 -- .../output/api_with_gateway_responses.json | 12 - .../api_with_gateway_responses_all.json | 12 - ..._with_gateway_responses_all_openapi_3.json | 12 - .../api_with_gateway_responses_implicit.json | 12 - .../api_with_gateway_responses_minimal.json | 12 - ..._gateway_responses_string_status_code.json | 12 - ...h_if_conditional_with_resource_policy.json | 16 -- .../api_with_incompatible_stage_name.json | 24 -- .../output/api_with_ip_range_blacklist.json | 12 - .../output/api_with_ip_range_whitelist.json | 12 - .../output/api_with_method_aws_iam_auth.json | 16 -- .../output/api_with_method_settings.json | 18 -- .../api_with_minimum_compression_size.json | 18 -- .../output/api_with_open_api_version.json | 18 -- .../output/api_with_open_api_version_2.json | 18 -- ..._with_openapi_definition_body_no_flag.json | 20 -- .../output/api_with_path_parameters.json | 12 - .../output/api_with_resource_policy.json | 16 -- .../api_with_resource_policy_global.json | 18 -- ..._with_resource_policy_global_implicit.json | 12 - .../output/api_with_resource_refs.json | 18 -- .../output/api_with_source_vpc_blacklist.json | 12 - .../output/api_with_source_vpc_whitelist.json | 20 -- .../output/api_with_stage_tags.json | 6 - ...pi_with_swagger_and_openapi_with_auth.json | 20 -- .../output/api_with_usageplans.json | 56 ----- .../api_with_usageplans_intrinsics.json | 36 --- .../output/api_with_xray_tracing.json | 12 - .../output/application_preparing_state.json | 2 - .../output/application_with_intrinsics.json | 8 +- .../translator/output/aws-cn/alexa_skill.json | 9 - .../aws-cn/alexa_skill_with_skill_id.json | 9 - .../output/aws-cn/all_policy_templates.json | 6 - tests/translator/output/aws-cn/api_cache.json | 18 -- .../output/aws-cn/api_description.json | 18 -- .../aws-cn/api_endpoint_configuration.json | 18 -- ...dpoint_configuration_with_vpcendpoint.json | 18 -- .../output/aws-cn/api_request_model.json | 12 - .../aws-cn/api_request_model_openapi_3.json | 14 -- .../aws-cn/api_with_access_log_setting.json | 18 -- .../api_with_apikey_default_override.json | 24 -- .../aws-cn/api_with_apikey_required.json | 12 - .../api_with_apikey_required_openapi_3.json | 12 - .../aws-cn/api_with_auth_all_maximum.json | 26 --- .../api_with_auth_all_maximum_openapi_3.json | 26 --- .../aws-cn/api_with_auth_all_minimum.json | 48 ---- .../api_with_auth_all_minimum_openapi.json | 38 ---- .../api_with_auth_and_conditions_all_max.json | 32 --- .../aws-cn/api_with_auth_no_default.json | 38 ---- .../api_with_auth_with_default_scopes.json | 24 -- ...with_auth_with_default_scopes_openapi.json | 24 -- .../api_with_aws_account_blacklist.json | 12 - .../api_with_aws_account_whitelist.json | 12 - .../api_with_aws_iam_auth_overrides.json | 66 ------ .../aws-cn/api_with_basic_custom_domain.json | 42 ---- .../api_with_basic_custom_domain_http.json | 18 -- ...i_with_basic_custom_domain_intrinsics.json | 26 --- ...h_basic_custom_domain_intrinsics_http.json | 22 -- .../aws-cn/api_with_binary_media_types.json | 18 -- ...th_binary_media_types_definition_body.json | 12 - .../aws-cn/api_with_canary_setting.json | 18 -- .../output/aws-cn/api_with_cors.json | 28 --- ..._with_cors_and_auth_no_preflight_auth.json | 20 -- ...api_with_cors_and_auth_preflight_auth.json | 20 -- ...cors_and_conditions_no_definitionbody.json | 20 -- ..._with_cors_and_only_credentials_false.json | 10 - .../api_with_cors_and_only_headers.json | 20 -- .../aws-cn/api_with_cors_and_only_maxage.json | 10 - .../api_with_cors_and_only_methods.json | 12 - .../api_with_cors_and_only_origins.json | 20 -- .../api_with_cors_no_definitionbody.json | 14 -- .../aws-cn/api_with_cors_openapi_3.json | 28 --- .../api_with_custom_domain_route53.json | 18 -- ...ustom_domain_route53_hosted_zone_name.json | 18 -- ..._domain_route53_hosted_zone_name_http.json | 16 -- .../api_with_custom_domain_route53_http.json | 16 -- .../aws-cn/api_with_default_aws_iam_auth.json | 28 --- ...efault_aws_iam_auth_and_no_auth_route.json | 14 -- .../aws-cn/api_with_gateway_responses.json | 12 - .../api_with_gateway_responses_all.json | 12 - ..._with_gateway_responses_all_openapi_3.json | 12 - .../api_with_gateway_responses_implicit.json | 12 - .../api_with_gateway_responses_minimal.json | 12 - ..._gateway_responses_string_status_code.json | 12 - ...h_if_conditional_with_resource_policy.json | 16 -- .../api_with_incompatible_stage_name.json | 24 -- .../aws-cn/api_with_ip_range_blacklist.json | 12 - .../aws-cn/api_with_ip_range_whitelist.json | 12 - .../aws-cn/api_with_method_aws_iam_auth.json | 16 -- .../aws-cn/api_with_method_settings.json | 18 -- .../api_with_minimum_compression_size.json | 18 -- .../aws-cn/api_with_open_api_version.json | 18 -- .../aws-cn/api_with_open_api_version_2.json | 18 -- ..._with_openapi_definition_body_no_flag.json | 20 -- .../aws-cn/api_with_path_parameters.json | 12 - .../aws-cn/api_with_resource_policy.json | 16 -- .../api_with_resource_policy_global.json | 18 -- ..._with_resource_policy_global_implicit.json | 12 - .../output/aws-cn/api_with_resource_refs.json | 18 -- .../aws-cn/api_with_source_vpc_blacklist.json | 12 - .../aws-cn/api_with_source_vpc_whitelist.json | 20 -- .../output/aws-cn/api_with_stage_tags.json | 6 - ...pi_with_swagger_and_openapi_with_auth.json | 20 -- .../output/aws-cn/api_with_usageplans.json | 56 ----- .../api_with_usageplans_intrinsics.json | 36 --- .../output/aws-cn/api_with_xray_tracing.json | 12 - .../aws-cn/application_preparing_state.json | 2 - .../aws-cn/application_with_intrinsics.json | 8 +- .../output/aws-cn/basic_application.json | 8 - .../output/aws-cn/basic_function.json | 30 --- .../aws-cn/basic_function_with_tags.json | 6 - .../aws-cn/basic_function_withimageuri.json | 22 -- .../translator/output/aws-cn/basic_layer.json | 8 +- .../aws-cn/cloudwatch_logs_with_ref.json | 8 - .../output/aws-cn/cloudwatchevent.json | 16 -- .../output/aws-cn/cloudwatchlog.json | 8 - .../aws-cn/cognito_userpool_with_event.json | 8 - .../translator/output/aws-cn/depends_on.json | 16 -- .../output/aws-cn/eventbridgerule.json | 16 -- .../eventbridgerule_schedule_properties.json | 22 +- .../aws-cn/eventbridgerule_with_dlq.json | 20 -- .../eventbridgerule_with_retry_policy.json | 16 -- .../output/aws-cn/explicit_api.json | 18 -- .../output/aws-cn/explicit_api_openapi_3.json | 18 -- ...plicit_api_with_invalid_events_config.json | 12 - .../output/aws-cn/explicit_http_api.json | 16 -- .../aws-cn/explicit_http_api_minimum.json | 14 -- .../output/aws-cn/function_concurrency.json | 8 - .../aws-cn/function_event_conditions.json | 67 +----- .../function_managed_inline_policy.json | 4 - .../output/aws-cn/function_with_alias.json | 9 +- ...function_with_alias_and_event_sources.json | 61 +---- .../function_with_alias_intrinsics.json | 9 +- .../output/aws-cn/function_with_amq.json | 6 - .../output/aws-cn/function_with_amq_kms.json | 6 - .../aws-cn/function_with_condition.json | 4 - ...ction_with_conditional_managed_policy.json | 4 - ...ional_managed_policy_and_ref_no_value.json | 4 - ...tion_with_conditional_policy_template.json | 4 - ...onal_policy_template_and_ref_no_value.json | 4 - ...stom_codedeploy_deployment_preference.json | 65 +----- ...onal_codedeploy_deployment_preference.json | 9 +- ...ction_with_deployment_and_custom_role.json | 20 +- ...ction_with_deployment_no_service_role.json | 22 +- .../function_with_deployment_preference.json | 9 +- ...oyment_preference_alarms_intrinsic_if.json | 9 +- ..._deployment_preference_all_parameters.json | 23 +- ...deployment_preference_from_parameters.json | 23 +- ...ment_preference_multiple_combinations.json | 37 +--- ...n_with_disabled_deployment_preference.json | 11 +- .../output/aws-cn/function_with_dlq.json | 8 - .../aws-cn/function_with_event_dest.json | 22 -- .../function_with_event_dest_basic.json | 13 +- .../function_with_event_dest_conditional.json | 12 - .../function_with_event_source_mapping.json | 24 +- .../function_with_file_system_config.json | 12 +- .../aws-cn/function_with_global_layers.json | 4 - .../aws-cn/function_with_kmskeyarn.json | 10 - .../output/aws-cn/function_with_layers.json | 19 +- .../aws-cn/function_with_many_layers.json | 7 +- .../function_with_permissions_boundary.json | 4 - .../function_with_policy_templates.json | 12 - .../function_with_request_parameters.json | 24 -- .../aws-cn/function_with_resource_refs.json | 15 +- .../aws-cn/function_with_signing_profile.json | 8 - ..._with_sns_event_source_all_parameters.json | 8 - .../global_handle_path_level_parameter.json | 20 -- .../output/aws-cn/globals_for_api.json | 20 -- .../output/aws-cn/globals_for_function.json | 18 +- .../aws-cn/globals_for_simpletable.json | 2 - .../output/aws-cn/http_api_def_uri.json | 16 -- .../output/aws-cn/http_api_description.json | 10 - .../aws-cn/http_api_existing_openapi.json | 10 - .../http_api_existing_openapi_conditions.json | 10 - .../aws-cn/http_api_explicit_stage.json | 10 - .../output/aws-cn/http_api_lambda_auth.json | 14 -- .../aws-cn/http_api_lambda_auth_full.json | 14 -- .../output/aws-cn/http_api_with_cors.json | 16 -- ...icit_and_explicit_api_with_conditions.json | 36 --- .../output/aws-cn/implicit_api.json | 22 -- ...icit_api_with_auth_and_conditions_max.json | 48 ---- .../implicit_api_with_many_conditions.json | 72 ------ ...api_with_serverless_rest_api_resource.json | 22 -- .../output/aws-cn/implicit_http_api.json | 18 -- ...mplicit_http_api_auth_and_simple_case.json | 10 - ...mplicit_http_api_with_many_conditions.json | 70 ------ .../output/aws-cn/inline_precedence.json | 4 - .../output/aws-cn/intrinsic_functions.json | 46 +--- tests/translator/output/aws-cn/iot_rule.json | 12 - .../output/aws-cn/layers_all_properties.json | 10 +- .../output/aws-cn/layers_with_intrinsics.json | 28 +-- ...api_with_serverless_rest_api_resource.json | 18 -- tests/translator/output/aws-cn/s3.json | 8 - .../output/aws-cn/s3_create_remove.json | 8 - ...ing_lambda_notification_configuration.json | 8 - ...ting_other_notification_configuration.json | 8 - tests/translator/output/aws-cn/s3_filter.json | 8 - .../s3_multiple_events_same_bucket.json | 10 - .../output/aws-cn/s3_multiple_functions.json | 14 -- .../output/aws-cn/s3_with_condition.json | 8 - .../output/aws-cn/s3_with_dependsOn.json | 12 +- .../simple_table_ref_parameter_intrinsic.json | 2 - .../aws-cn/simple_table_with_extra_tags.json | 2 - .../aws-cn/simple_table_with_table_name.json | 6 - .../translator/output/aws-cn/simpletable.json | 4 - .../output/aws-cn/simpletable_with_sse.json | 2 - tests/translator/output/aws-cn/sns.json | 12 +- .../sns_existing_other_subscription.json | 10 - .../output/aws-cn/sns_existing_sqs.json | 18 +- .../output/aws-cn/sns_outside_sqs.json | 14 +- tests/translator/output/aws-cn/sns_sqs.json | 16 +- .../aws-cn/sns_topic_outside_template.json | 8 - tests/translator/output/aws-cn/sqs.json | 6 - ..._machine_with_api_auth_default_scopes.json | 24 -- .../state_machine_with_api_authorizer.json | 22 -- ...e_machine_with_api_authorizer_maximum.json | 26 --- ...tate_machine_with_api_resource_policy.json | 16 -- .../aws-cn/state_machine_with_condition.json | 2 - ...ate_machine_with_condition_and_events.json | 18 -- .../output/aws-cn/state_machine_with_cwe.json | 6 - ...ate_machine_with_definition_S3_object.json | 8 - ...ate_machine_with_definition_S3_string.json | 8 - ...machine_with_definition_substitutions.json | 8 - .../aws-cn/state_machine_with_eb_dlq.json | 6 - .../state_machine_with_eb_dlq_generated.json | 10 - .../state_machine_with_eb_retry_policy.json | 6 - .../state_machine_with_explicit_api.json | 12 - .../state_machine_with_express_logging.json | 12 +- .../state_machine_with_implicit_api.json | 12 - ...ate_machine_with_implicit_api_globals.json | 12 - .../state_machine_with_inline_definition.json | 4 - ...ine_with_inline_definition_intrinsics.json | 8 - .../state_machine_with_inline_policies.json | 8 - .../state_machine_with_managed_policy.json | 4 - ...ate_machine_with_permissions_boundary.json | 24 -- .../aws-cn/state_machine_with_role.json | 2 - ...ate_machine_with_sam_policy_templates.json | 20 +- .../aws-cn/state_machine_with_schedule.json | 6 - ...achine_with_schedule_dlq_retry_policy.json | 6 - .../state_machine_with_standard_logging.json | 12 +- .../aws-cn/state_machine_with_tags.json | 4 - .../state_machine_with_xray_policies.json | 8 - .../aws-cn/state_machine_with_xray_role.json | 2 - tests/translator/output/aws-cn/streams.json | 18 -- .../output/aws-us-gov/alexa_skill.json | 9 - .../aws-us-gov/alexa_skill_with_skill_id.json | 9 - .../aws-us-gov/all_policy_templates.json | 6 - .../output/aws-us-gov/api_cache.json | 18 -- .../output/aws-us-gov/api_description.json | 18 -- .../api_endpoint_configuration.json | 18 -- ...dpoint_configuration_with_vpcendpoint.json | 18 -- .../output/aws-us-gov/api_request_model.json | 12 - .../api_request_model_openapi_3.json | 14 -- .../api_with_access_log_setting.json | 18 -- .../api_with_apikey_default_override.json | 24 -- .../aws-us-gov/api_with_apikey_required.json | 12 - .../api_with_apikey_required_openapi_3.json | 12 - .../aws-us-gov/api_with_auth_all_maximum.json | 26 --- .../api_with_auth_all_maximum_openapi_3.json | 26 --- .../aws-us-gov/api_with_auth_all_minimum.json | 48 ---- .../api_with_auth_all_minimum_openapi.json | 38 ---- .../api_with_auth_and_conditions_all_max.json | 32 --- .../aws-us-gov/api_with_auth_no_default.json | 38 ---- .../api_with_auth_with_default_scopes.json | 24 -- ...with_auth_with_default_scopes_openapi.json | 24 -- .../api_with_aws_account_blacklist.json | 12 - .../api_with_aws_account_whitelist.json | 12 - .../api_with_aws_iam_auth_overrides.json | 66 ------ .../api_with_basic_custom_domain.json | 42 ---- .../api_with_basic_custom_domain_http.json | 18 -- ...i_with_basic_custom_domain_intrinsics.json | 26 --- ...h_basic_custom_domain_intrinsics_http.json | 22 -- .../api_with_binary_media_types.json | 18 -- ...th_binary_media_types_definition_body.json | 12 - .../aws-us-gov/api_with_canary_setting.json | 18 -- .../output/aws-us-gov/api_with_cors.json | 28 --- ..._with_cors_and_auth_no_preflight_auth.json | 20 -- ...api_with_cors_and_auth_preflight_auth.json | 20 -- ...cors_and_conditions_no_definitionbody.json | 20 -- ..._with_cors_and_only_credentials_false.json | 10 - .../api_with_cors_and_only_headers.json | 20 -- .../api_with_cors_and_only_maxage.json | 10 - .../api_with_cors_and_only_methods.json | 12 - .../api_with_cors_and_only_origins.json | 20 -- .../api_with_cors_no_definitionbody.json | 14 -- .../aws-us-gov/api_with_cors_openapi_3.json | 28 --- .../api_with_custom_domain_route53.json | 18 -- ...ustom_domain_route53_hosted_zone_name.json | 18 -- ..._domain_route53_hosted_zone_name_http.json | 16 -- .../api_with_custom_domain_route53_http.json | 16 -- .../api_with_default_aws_iam_auth.json | 28 --- ...efault_aws_iam_auth_and_no_auth_route.json | 14 -- .../api_with_gateway_responses.json | 12 - .../api_with_gateway_responses_all.json | 12 - ..._with_gateway_responses_all_openapi_3.json | 12 - .../api_with_gateway_responses_implicit.json | 12 - .../api_with_gateway_responses_minimal.json | 12 - ..._gateway_responses_string_status_code.json | 12 - ...h_if_conditional_with_resource_policy.json | 16 -- .../api_with_incompatible_stage_name.json | 24 -- .../api_with_ip_range_blacklist.json | 12 - .../api_with_ip_range_whitelist.json | 12 - .../api_with_method_aws_iam_auth.json | 16 -- .../aws-us-gov/api_with_method_settings.json | 18 -- .../api_with_minimum_compression_size.json | 18 -- .../aws-us-gov/api_with_open_api_version.json | 18 -- .../api_with_open_api_version_2.json | 18 -- ..._with_openapi_definition_body_no_flag.json | 20 -- .../aws-us-gov/api_with_path_parameters.json | 12 - .../aws-us-gov/api_with_resource_policy.json | 16 -- .../api_with_resource_policy_global.json | 18 -- ..._with_resource_policy_global_implicit.json | 12 - .../aws-us-gov/api_with_resource_refs.json | 18 -- .../api_with_source_vpc_blacklist.json | 12 - .../api_with_source_vpc_whitelist.json | 20 -- .../aws-us-gov/api_with_stage_tags.json | 6 - ...pi_with_swagger_and_openapi_with_auth.json | 20 -- .../aws-us-gov/api_with_usageplans.json | 56 ----- .../api_with_usageplans_intrinsics.json | 36 --- .../aws-us-gov/api_with_xray_tracing.json | 12 - .../application_preparing_state.json | 2 - .../application_with_intrinsics.json | 8 +- .../output/aws-us-gov/basic_application.json | 8 - .../output/aws-us-gov/basic_function.json | 30 --- .../aws-us-gov/basic_function_with_tags.json | 6 - .../basic_function_withimageuri.json | 22 -- .../output/aws-us-gov/basic_layer.json | 8 +- .../aws-us-gov/cloudwatch_logs_with_ref.json | 8 - .../output/aws-us-gov/cloudwatchevent.json | 16 -- .../output/aws-us-gov/cloudwatchlog.json | 8 - .../cognito_userpool_with_event.json | 8 - .../output/aws-us-gov/depends_on.json | 16 -- .../output/aws-us-gov/eventbridgerule.json | 16 -- .../eventbridgerule_schedule_properties.json | 16 -- .../aws-us-gov/eventbridgerule_with_dlq.json | 20 -- .../eventbridgerule_with_retry_policy.json | 16 -- .../output/aws-us-gov/explicit_api.json | 18 -- .../aws-us-gov/explicit_api_openapi_3.json | 18 -- ...plicit_api_with_invalid_events_config.json | 12 - .../output/aws-us-gov/explicit_http_api.json | 16 -- .../aws-us-gov/explicit_http_api_minimum.json | 14 -- .../aws-us-gov/function_concurrency.json | 8 - .../aws-us-gov/function_event_conditions.json | 67 +----- .../function_managed_inline_policy.json | 4 - .../aws-us-gov/function_with_alias.json | 9 +- ...function_with_alias_and_event_sources.json | 61 +---- .../function_with_alias_intrinsics.json | 9 +- .../output/aws-us-gov/function_with_amq.json | 6 - .../aws-us-gov/function_with_amq_kms.json | 6 - .../aws-us-gov/function_with_condition.json | 4 - ...ction_with_conditional_managed_policy.json | 4 - ...ional_managed_policy_and_ref_no_value.json | 4 - ...tion_with_conditional_policy_template.json | 4 - ...onal_policy_template_and_ref_no_value.json | 4 - ...stom_codedeploy_deployment_preference.json | 69 +----- ...onal_codedeploy_deployment_preference.json | 9 +- ...ction_with_deployment_and_custom_role.json | 18 +- ...ction_with_deployment_no_service_role.json | 22 +- .../function_with_deployment_preference.json | 9 +- ...oyment_preference_alarms_intrinsic_if.json | 9 +- ..._deployment_preference_all_parameters.json | 23 +- ...deployment_preference_from_parameters.json | 23 +- ...ment_preference_multiple_combinations.json | 37 +--- ...n_with_disabled_deployment_preference.json | 9 +- .../output/aws-us-gov/function_with_dlq.json | 8 - .../aws-us-gov/function_with_event_dest.json | 22 -- .../function_with_event_dest_basic.json | 13 +- .../function_with_event_dest_conditional.json | 12 - .../function_with_event_source_mapping.json | 24 +- .../function_with_file_system_config.json | 12 +- .../function_with_global_layers.json | 4 - .../aws-us-gov/function_with_kmskeyarn.json | 10 - .../aws-us-gov/function_with_layers.json | 19 +- .../aws-us-gov/function_with_many_layers.json | 7 +- .../function_with_permissions_boundary.json | 4 - .../function_with_policy_templates.json | 12 - .../function_with_request_parameters.json | 24 -- .../function_with_resource_refs.json | 17 +- .../function_with_signing_profile.json | 8 - ..._with_sns_event_source_all_parameters.json | 8 - .../global_handle_path_level_parameter.json | 20 -- .../output/aws-us-gov/globals_for_api.json | 20 -- .../aws-us-gov/globals_for_function.json | 18 +- .../aws-us-gov/globals_for_simpletable.json | 2 - .../output/aws-us-gov/http_api_def_uri.json | 16 -- .../aws-us-gov/http_api_description.json | 10 - .../aws-us-gov/http_api_existing_openapi.json | 10 - .../http_api_existing_openapi_conditions.json | 10 - .../aws-us-gov/http_api_explicit_stage.json | 10 - .../aws-us-gov/http_api_lambda_auth.json | 14 -- .../aws-us-gov/http_api_lambda_auth_full.json | 14 -- .../output/aws-us-gov/http_api_with_cors.json | 16 -- ...icit_and_explicit_api_with_conditions.json | 36 --- .../output/aws-us-gov/implicit_api.json | 22 -- ...icit_api_with_auth_and_conditions_max.json | 48 ---- .../implicit_api_with_many_conditions.json | 72 ------ ...api_with_serverless_rest_api_resource.json | 22 -- .../output/aws-us-gov/implicit_http_api.json | 18 -- ...mplicit_http_api_auth_and_simple_case.json | 10 - ...mplicit_http_api_with_many_conditions.json | 70 ------ .../output/aws-us-gov/inline_precedence.json | 4 - .../aws-us-gov/intrinsic_functions.json | 46 +--- .../output/aws-us-gov/iot_rule.json | 12 - .../aws-us-gov/layers_all_properties.json | 10 +- .../aws-us-gov/layers_with_intrinsics.json | 28 +-- ...api_with_serverless_rest_api_resource.json | 18 -- tests/translator/output/aws-us-gov/s3.json | 8 - .../output/aws-us-gov/s3_create_remove.json | 8 - ...ing_lambda_notification_configuration.json | 8 - ...ting_other_notification_configuration.json | 8 - .../output/aws-us-gov/s3_filter.json | 8 - .../s3_multiple_events_same_bucket.json | 10 - .../aws-us-gov/s3_multiple_functions.json | 14 -- .../output/aws-us-gov/s3_with_condition.json | 8 - .../output/aws-us-gov/s3_with_dependsOn.json | 12 +- .../simple_table_ref_parameter_intrinsic.json | 2 - .../simple_table_with_extra_tags.json | 2 - .../simple_table_with_table_name.json | 6 - .../output/aws-us-gov/simpletable.json | 4 - .../aws-us-gov/simpletable_with_sse.json | 2 - tests/translator/output/aws-us-gov/sns.json | 12 +- .../sns_existing_other_subscription.json | 10 - .../output/aws-us-gov/sns_existing_sqs.json | 18 +- .../output/aws-us-gov/sns_outside_sqs.json | 14 +- .../translator/output/aws-us-gov/sns_sqs.json | 16 +- .../sns_topic_outside_template.json | 8 - tests/translator/output/aws-us-gov/sqs.json | 6 - ..._machine_with_api_auth_default_scopes.json | 24 -- .../state_machine_with_api_authorizer.json | 22 -- ...e_machine_with_api_authorizer_maximum.json | 26 --- ...tate_machine_with_api_resource_policy.json | 16 -- .../state_machine_with_condition.json | 2 - ...ate_machine_with_condition_and_events.json | 18 -- .../aws-us-gov/state_machine_with_cwe.json | 6 - ...ate_machine_with_definition_S3_object.json | 8 - ...ate_machine_with_definition_S3_string.json | 8 - ...machine_with_definition_substitutions.json | 8 - .../aws-us-gov/state_machine_with_eb_dlq.json | 6 - .../state_machine_with_eb_dlq_generated.json | 10 - .../state_machine_with_eb_retry_policy.json | 6 - .../state_machine_with_explicit_api.json | 12 - .../state_machine_with_express_logging.json | 12 +- .../state_machine_with_implicit_api.json | 12 - ...ate_machine_with_implicit_api_globals.json | 12 - .../state_machine_with_inline_definition.json | 4 - ...ine_with_inline_definition_intrinsics.json | 8 - .../state_machine_with_inline_policies.json | 8 - .../state_machine_with_managed_policy.json | 4 - ...ate_machine_with_permissions_boundary.json | 24 -- .../aws-us-gov/state_machine_with_role.json | 2 - ...ate_machine_with_sam_policy_templates.json | 20 +- .../state_machine_with_schedule.json | 6 - ...achine_with_schedule_dlq_retry_policy.json | 6 - .../state_machine_with_standard_logging.json | 12 +- .../aws-us-gov/state_machine_with_tags.json | 4 - .../state_machine_with_xray_policies.json | 8 - .../state_machine_with_xray_role.json | 2 - .../translator/output/aws-us-gov/streams.json | 18 -- .../translator/output/basic_application.json | 8 - tests/translator/output/basic_function.json | 30 --- .../output/basic_function_with_tags.json | 6 - .../output/basic_function_withimageuri.json | 22 -- tests/translator/output/basic_layer.json | 8 +- .../output/cloudwatch_logs_with_ref.json | 8 - tests/translator/output/cloudwatchevent.json | 16 -- tests/translator/output/cloudwatchlog.json | 8 - .../output/cognito_userpool_with_event.json | 8 - tests/translator/output/depends_on.json | 16 -- tests/translator/output/eventbridgerule.json | 16 -- .../eventbridgerule_schedule_properties.json | 16 -- .../output/eventbridgerule_with_dlq.json | 20 -- .../eventbridgerule_with_retry_policy.json | 16 -- tests/translator/output/explicit_api.json | 18 -- .../output/explicit_api_openapi_3.json | 18 -- ...plicit_api_with_invalid_events_config.json | 12 - .../translator/output/explicit_http_api.json | 16 -- .../output/explicit_http_api_minimum.json | 14 -- .../output/function_concurrency.json | 8 - .../output/function_event_conditions.json | 67 +----- .../function_managed_inline_policy.json | 4 - .../output/function_with_alias.json | 9 +- .../function_with_alias_and_code_sha256.json | 11 +- ...function_with_alias_and_event_sources.json | 61 +---- .../function_with_alias_intrinsics.json | 9 +- .../translator/output/function_with_amq.json | 6 - .../output/function_with_amq_kms.json | 6 - .../output/function_with_condition.json | 4 - ...ction_with_conditional_managed_policy.json | 4 - ...ional_managed_policy_and_ref_no_value.json | 4 - ...tion_with_conditional_policy_template.json | 4 - ...onal_policy_template_and_ref_no_value.json | 4 - ...stom_codedeploy_deployment_preference.json | 63 +----- ...onal_codedeploy_deployment_preference.json | 9 +- ...ction_with_deployment_and_custom_role.json | 18 +- ...ction_with_deployment_no_service_role.json | 20 +- .../function_with_deployment_preference.json | 9 +- ...oyment_preference_alarms_intrinsic_if.json | 9 +- ..._deployment_preference_all_parameters.json | 23 +- ...deployment_preference_from_parameters.json | 23 +- ...ment_preference_multiple_combinations.json | 37 +--- ...n_with_disabled_deployment_preference.json | 9 +- .../translator/output/function_with_dlq.json | 8 - .../output/function_with_event_dest.json | 22 -- .../function_with_event_dest_basic.json | 13 +- .../function_with_event_dest_conditional.json | 12 - .../function_with_event_source_mapping.json | 24 +- .../function_with_file_system_config.json | 12 +- .../output/function_with_global_layers.json | 4 - .../output/function_with_kmskeyarn.json | 10 - .../output/function_with_layers.json | 19 +- .../output/function_with_many_layers.json | 7 +- .../function_with_permissions_boundary.json | 4 - .../function_with_policy_templates.json | 12 - .../function_with_request_parameters.json | 24 -- .../output/function_with_resource_refs.json | 15 +- .../output/function_with_signing_profile.json | 8 - ..._with_sns_event_source_all_parameters.json | 8 - .../global_handle_path_level_parameter.json | 20 -- tests/translator/output/globals_for_api.json | 20 -- .../output/globals_for_function.json | 18 +- .../output/globals_for_simpletable.json | 2 - tests/translator/output/http_api_def_uri.json | 16 -- .../output/http_api_description.json | 10 - .../output/http_api_existing_openapi.json | 10 - .../http_api_existing_openapi_conditions.json | 10 - .../output/http_api_explicit_stage.json | 10 - .../output/http_api_lambda_auth.json | 14 -- .../output/http_api_lambda_auth_full.json | 14 -- .../translator/output/http_api_with_cors.json | 16 -- ...icit_and_explicit_api_with_conditions.json | 36 --- tests/translator/output/implicit_api.json | 22 -- ...icit_api_with_auth_and_conditions_max.json | 48 ---- .../implicit_api_with_many_conditions.json | 72 ------ ...api_with_serverless_rest_api_resource.json | 22 -- .../translator/output/implicit_http_api.json | 18 -- ...mplicit_http_api_auth_and_simple_case.json | 10 - ...mplicit_http_api_with_many_conditions.json | 70 ------ .../translator/output/inline_precedence.json | 4 - .../output/intrinsic_functions.json | 46 +--- tests/translator/output/iot_rule.json | 12 - .../output/layers_all_properties.json | 10 +- .../output/layers_with_intrinsics.json | 28 +-- ...api_with_serverless_rest_api_resource.json | 18 -- tests/translator/output/s3.json | 8 - tests/translator/output/s3_create_remove.json | 8 - ...ing_lambda_notification_configuration.json | 8 - ...ting_other_notification_configuration.json | 8 - tests/translator/output/s3_filter.json | 8 - .../s3_multiple_events_same_bucket.json | 10 - .../output/s3_multiple_functions.json | 14 -- .../translator/output/s3_with_condition.json | 8 - .../translator/output/s3_with_dependsOn.json | 12 +- .../simple_table_ref_parameter_intrinsic.json | 2 - .../output/simple_table_with_extra_tags.json | 2 - .../output/simple_table_with_table_name.json | 6 - tests/translator/output/simpletable.json | 4 - .../output/simpletable_with_sse.json | 2 - tests/translator/output/sns.json | 12 +- .../sns_existing_other_subscription.json | 10 - tests/translator/output/sns_existing_sqs.json | 18 +- tests/translator/output/sns_outside_sqs.json | 14 +- tests/translator/output/sns_sqs.json | 16 +- .../output/sns_topic_outside_template.json | 8 - tests/translator/output/sqs.json | 6 - ..._machine_with_api_auth_default_scopes.json | 24 -- .../state_machine_with_api_authorizer.json | 22 -- ...e_machine_with_api_authorizer_maximum.json | 26 --- ...tate_machine_with_api_resource_policy.json | 16 -- .../output/state_machine_with_condition.json | 2 - ...ate_machine_with_condition_and_events.json | 18 -- .../output/state_machine_with_cwe.json | 6 - ...ate_machine_with_definition_S3_object.json | 8 - ...ate_machine_with_definition_S3_string.json | 8 - ...machine_with_definition_substitutions.json | 8 - .../output/state_machine_with_eb_dlq.json | 6 - .../state_machine_with_eb_dlq_generated.json | 10 - .../state_machine_with_eb_retry_policy.json | 6 - .../state_machine_with_explicit_api.json | 12 - .../state_machine_with_express_logging.json | 12 +- .../state_machine_with_implicit_api.json | 12 - ...ate_machine_with_implicit_api_globals.json | 12 - .../state_machine_with_inline_definition.json | 4 - ...ine_with_inline_definition_intrinsics.json | 8 - .../state_machine_with_inline_policies.json | 8 - .../state_machine_with_managed_policy.json | 4 - ...ate_machine_with_permissions_boundary.json | 24 -- .../output/state_machine_with_role.json | 2 - ...ate_machine_with_sam_policy_templates.json | 20 +- .../output/state_machine_with_schedule.json | 6 - ...achine_with_schedule_dlq_retry_policy.json | 6 - .../state_machine_with_standard_logging.json | 12 +- .../output/state_machine_with_tags.json | 4 - .../state_machine_with_xray_policies.json | 8 - .../output/state_machine_with_xray_role.json | 2 - tests/translator/output/streams.json | 18 -- .../test_resource_level_attributes.py | 208 ++++++++++++++++++ tests/translator/test_translator.py | 13 +- 860 files changed, 429 insertions(+), 11351 deletions(-) create mode 100644 tests/translator/test_resource_level_attributes.py diff --git a/tests/translator/input/alexa_skill.yaml b/tests/translator/input/alexa_skill.yaml index bdcf82bc3..b161c6281 100644 --- a/tests/translator/input/alexa_skill.yaml +++ b/tests/translator/input/alexa_skill.yaml @@ -16,6 +16,4 @@ Resources: MemorySize: 1024 Runtime: nodejs12.x Timeout: 3 - DeletionPolicy: Delete - UpdateReplacePolicy: Retain - Condition: Condition1 + diff --git a/tests/translator/input/alexa_skill_with_skill_id.yaml b/tests/translator/input/alexa_skill_with_skill_id.yaml index ba86247df..cf6f00889 100644 --- a/tests/translator/input/alexa_skill_with_skill_id.yaml +++ b/tests/translator/input/alexa_skill_with_skill_id.yaml @@ -18,6 +18,3 @@ Resources: MemorySize: 1024 Runtime: nodejs12.x Timeout: 3 - DeletionPolicy: Delete - UpdateReplacePolicy: Retain - Condition: Condition1 diff --git a/tests/translator/input/all_policy_templates.yaml b/tests/translator/input/all_policy_templates.yaml index c356a4f12..c46cfaecb 100644 --- a/tests/translator/input/all_policy_templates.yaml +++ b/tests/translator/input/all_policy_templates.yaml @@ -174,6 +174,3 @@ Resources: - Route53ChangeResourceRecordSetsPolicy: HostedZoneId: test - DeletionPolicy: Delete - UpdateReplacePolicy: Retain - Condition: Condition1 \ No newline at end of file diff --git a/tests/translator/input/api_cache.yaml b/tests/translator/input/api_cache.yaml index ab9d1338e..d94d72142 100644 --- a/tests/translator/input/api_cache.yaml +++ b/tests/translator/input/api_cache.yaml @@ -12,9 +12,6 @@ Resources: RestApiId: HtmlApi Path: / Method: get - DeletionPolicy: Delete - UpdateReplacePolicy: Retain - Condition: Condition1 HtmlApi: Type: AWS::Serverless::Api @@ -22,7 +19,4 @@ Resources: StageName: Prod DefinitionUri: s3://sam-demo-bucket/webpage_swagger.json CacheClusterEnabled: true - CacheClusterSize: "1.6" - DeletionPolicy: Delete - UpdateReplacePolicy: Retain - Condition: Condition1 \ No newline at end of file + CacheClusterSize: "1.6" \ No newline at end of file diff --git a/tests/translator/input/api_description.yaml b/tests/translator/input/api_description.yaml index feff6745d..c660e785e 100644 --- a/tests/translator/input/api_description.yaml +++ b/tests/translator/input/api_description.yaml @@ -12,9 +12,6 @@ Resources: RestApiId: Api Path: / Method: get - DeletionPolicy: Delete - UpdateReplacePolicy: Retain - Condition: Condition1 Api: Type: AWS::Serverless::Api @@ -22,6 +19,3 @@ Resources: StageName: Prod DefinitionUri: s3://sam-demo-bucket/webpage_swagger.json Description: my description - DeletionPolicy: Delete - UpdateReplacePolicy: Retain - Condition: Condition1 diff --git a/tests/translator/input/api_endpoint_configuration.yaml b/tests/translator/input/api_endpoint_configuration.yaml index 9982e15ee..67dbbdfdb 100644 --- a/tests/translator/input/api_endpoint_configuration.yaml +++ b/tests/translator/input/api_endpoint_configuration.yaml @@ -22,8 +22,6 @@ Resources: Properties: Path: / Method: get - DeletionPolicy: Delete - UpdateReplacePolicy: Retain ExplicitApi: Type: AWS::Serverless::Api @@ -31,5 +29,3 @@ Resources: StageName: Prod DefinitionUri: s3://sam-demo-bucket/webpage_swagger.json EndpointConfiguration: SomeValue - DeletionPolicy: Delete - UpdateReplacePolicy: Retain diff --git a/tests/translator/input/api_endpoint_configuration_with_vpcendpoint.yaml b/tests/translator/input/api_endpoint_configuration_with_vpcendpoint.yaml index e7ebb9e7e..66b7ba02d 100644 --- a/tests/translator/input/api_endpoint_configuration_with_vpcendpoint.yaml +++ b/tests/translator/input/api_endpoint_configuration_with_vpcendpoint.yaml @@ -24,8 +24,6 @@ Resources: Properties: Path: / Method: get - DeletionPolicy: Delete - UpdateReplacePolicy: Retain ExplicitApi: Type: AWS::Serverless::Api @@ -33,5 +31,3 @@ Resources: StageName: Prod DefinitionUri: s3://sam-demo-bucket/webpage_swagger.json EndpointConfiguration: SomeValue - DeletionPolicy: Delete - UpdateReplacePolicy: Retain diff --git a/tests/translator/input/api_request_model.yaml b/tests/translator/input/api_request_model.yaml index 7a3513580..4dc0c5f42 100644 --- a/tests/translator/input/api_request_model.yaml +++ b/tests/translator/input/api_request_model.yaml @@ -1,8 +1,6 @@ Resources: HtmlFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -20,8 +18,6 @@ Resources: HtmlApi: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod Models: diff --git a/tests/translator/input/api_request_model_openapi_3.yaml b/tests/translator/input/api_request_model_openapi_3.yaml index d12a76934..2e9a7d26d 100644 --- a/tests/translator/input/api_request_model_openapi_3.yaml +++ b/tests/translator/input/api_request_model_openapi_3.yaml @@ -1,8 +1,6 @@ Resources: HtmlFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -33,8 +31,6 @@ Resources: HtmlApi: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod OpenApiVersion: 3.0 diff --git a/tests/translator/input/api_with_access_log_setting.yaml b/tests/translator/input/api_with_access_log_setting.yaml index 9893774dd..5dc9b7bdb 100644 --- a/tests/translator/input/api_with_access_log_setting.yaml +++ b/tests/translator/input/api_with_access_log_setting.yaml @@ -7,8 +7,6 @@ Globals: Resources: ImplicitApiFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -22,8 +20,6 @@ Resources: ExplicitApi: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod DefinitionUri: s3://sam-demo-bucket/webpage_swagger.json diff --git a/tests/translator/input/api_with_apikey_default_override.yaml b/tests/translator/input/api_with_apikey_default_override.yaml index 4d4e93e23..51dd683e0 100644 --- a/tests/translator/input/api_with_apikey_default_override.yaml +++ b/tests/translator/input/api_with_apikey_default_override.yaml @@ -1,8 +1,6 @@ Resources: MyApiWithAuth: Type: "AWS::Serverless::Api" - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -10,8 +8,6 @@ Resources: MyFunctionWithApiKeyRequiredDefault: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler @@ -25,8 +21,6 @@ Resources: Method: get MyFunctionWithApiKeyRequiredTrue: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler @@ -42,8 +36,6 @@ Resources: ApiKeyRequired: true MyFunctionWithApiKeyRequiredFalse: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler diff --git a/tests/translator/input/api_with_apikey_required.yaml b/tests/translator/input/api_with_apikey_required.yaml index 18685ec8b..4ae8e5268 100644 --- a/tests/translator/input/api_with_apikey_required.yaml +++ b/tests/translator/input/api_with_apikey_required.yaml @@ -1,15 +1,11 @@ Resources: MyApiWithoutAuth: Type: "AWS::Serverless::Api" - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod MyFunctionWithApiKeyRequired: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler diff --git a/tests/translator/input/api_with_apikey_required_openapi_3.yaml b/tests/translator/input/api_with_apikey_required_openapi_3.yaml index 1f2f27234..e3140b594 100644 --- a/tests/translator/input/api_with_apikey_required_openapi_3.yaml +++ b/tests/translator/input/api_with_apikey_required_openapi_3.yaml @@ -1,16 +1,12 @@ Resources: MyApiWithoutAuth: Type: "AWS::Serverless::Api" - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod OpenApiVersion: '3.0.1' MyFunctionWithApiKeyRequired: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler diff --git a/tests/translator/input/api_with_auth_all_maximum.yaml b/tests/translator/input/api_with_auth_all_maximum.yaml index 344eca619..831425e6d 100644 --- a/tests/translator/input/api_with_auth_all_maximum.yaml +++ b/tests/translator/input/api_with_auth_all_maximum.yaml @@ -1,8 +1,6 @@ Resources: MyApi: Type: "AWS::Serverless::Api" - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -55,8 +53,6 @@ Resources: MyFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/thumbnails.zip Handler: index.handler diff --git a/tests/translator/input/api_with_auth_all_maximum_openapi_3.yaml b/tests/translator/input/api_with_auth_all_maximum_openapi_3.yaml index 7d3b843ca..0012f8bc1 100644 --- a/tests/translator/input/api_with_auth_all_maximum_openapi_3.yaml +++ b/tests/translator/input/api_with_auth_all_maximum_openapi_3.yaml @@ -1,8 +1,6 @@ Resources: MyApi: Type: "AWS::Serverless::Api" - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod OpenApiVersion: '3.0.1' @@ -56,8 +54,6 @@ Resources: MyFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/thumbnails.zip Handler: index.handler diff --git a/tests/translator/input/api_with_auth_all_minimum.yaml b/tests/translator/input/api_with_auth_all_minimum.yaml index 1f6d7523e..b89479219 100644 --- a/tests/translator/input/api_with_auth_all_minimum.yaml +++ b/tests/translator/input/api_with_auth_all_minimum.yaml @@ -1,8 +1,6 @@ Resources: MyApiWithCognitoAuth: Type: "AWS::Serverless::Api" - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -13,8 +11,6 @@ Resources: MyApiWithLambdaTokenAuth: Type: "AWS::Serverless::Api" - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -25,8 +21,6 @@ Resources: MyApiWithLambdaRequestAuth: Type: "AWS::Serverless::Api" - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -41,8 +35,6 @@ Resources: MyApiWithNotCachedLambdaRequestAuth: Type: "AWS::Serverless::Api" - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -56,16 +48,12 @@ Resources: MyAuthFn: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler Runtime: nodejs12.x MyFn: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler @@ -97,8 +85,6 @@ Resources: Path: /not-cached-lambda-request MyUserPool: Type: AWS::Cognito::UserPool - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: UserPoolName: UserPoolName Policies: diff --git a/tests/translator/input/api_with_auth_all_minimum_openapi.yaml b/tests/translator/input/api_with_auth_all_minimum_openapi.yaml index c9f490f2d..486bd1250 100644 --- a/tests/translator/input/api_with_auth_all_minimum_openapi.yaml +++ b/tests/translator/input/api_with_auth_all_minimum_openapi.yaml @@ -4,8 +4,6 @@ Globals: Resources: MyApiWithCognitoAuth: Type: "AWS::Serverless::Api" - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -16,8 +14,6 @@ Resources: MyApiWithLambdaTokenAuth: Type: "AWS::Serverless::Api" - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -28,8 +24,6 @@ Resources: MyApiWithLambdaRequestAuth: Type: "AWS::Serverless::Api" - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -43,16 +37,12 @@ Resources: - Authorization1 MyAuthFn: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucketname/thumbnails.zip Handler: index.handler Runtime: nodejs12.x MyFn: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucketname/thumbnails.zip Handler: index.handler @@ -78,8 +68,6 @@ Resources: Path: /lambda-request MyUserPool: Type: AWS::Cognito::UserPool - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: UserPoolName: UserPoolName Policies: diff --git a/tests/translator/input/api_with_auth_and_conditions_all_max.yaml b/tests/translator/input/api_with_auth_and_conditions_all_max.yaml index 59f200434..a2e5e12b4 100644 --- a/tests/translator/input/api_with_auth_and_conditions_all_max.yaml +++ b/tests/translator/input/api_with_auth_and_conditions_all_max.yaml @@ -6,8 +6,6 @@ Conditions: Resources: MyApi: Type: "AWS::Serverless::Api" - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -59,8 +57,6 @@ Resources: MyFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/thumbnails.zip Handler: index.handler @@ -93,8 +89,6 @@ Resources: MyFunctionWithConditional: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Condition: PathCondition Properties: CodeUri: s3://sam-demo-bucket/thumbnails.zip diff --git a/tests/translator/input/api_with_auth_no_default.yaml b/tests/translator/input/api_with_auth_no_default.yaml index 59ae8b9d8..85d591b06 100644 --- a/tests/translator/input/api_with_auth_no_default.yaml +++ b/tests/translator/input/api_with_auth_no_default.yaml @@ -1,8 +1,6 @@ Resources: MyApiWithCognitoAuth: Type: "AWS::Serverless::Api" - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -12,8 +10,6 @@ Resources: MyApiWithLambdaTokenAuth: Type: "AWS::Serverless::Api" - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -23,8 +19,6 @@ Resources: MyApiWithLambdaRequestAuth: Type: "AWS::Serverless::Api" - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -37,16 +31,12 @@ Resources: - Authorization1 MyAuthFn: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler Runtime: nodejs12.x MyFn: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler @@ -72,8 +62,6 @@ Resources: Path: /lambda-request MyUserPool: Type: AWS::Cognito::UserPool - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: UserPoolName: UserPoolName Policies: diff --git a/tests/translator/input/api_with_auth_with_default_scopes.yaml b/tests/translator/input/api_with_auth_with_default_scopes.yaml index 51673fad9..cd093a462 100644 --- a/tests/translator/input/api_with_auth_with_default_scopes.yaml +++ b/tests/translator/input/api_with_auth_with_default_scopes.yaml @@ -1,8 +1,6 @@ Resources: MyApiWithCognitoAuth: Type: "AWS::Serverless::Api" - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -21,8 +19,6 @@ Resources: MyFn: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler diff --git a/tests/translator/input/api_with_auth_with_default_scopes_openapi.yaml b/tests/translator/input/api_with_auth_with_default_scopes_openapi.yaml index 8cf25d5e3..09031af77 100644 --- a/tests/translator/input/api_with_auth_with_default_scopes_openapi.yaml +++ b/tests/translator/input/api_with_auth_with_default_scopes_openapi.yaml @@ -1,8 +1,6 @@ Resources: MyApiWithCognitoAuth: Type: "AWS::Serverless::Api" - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod OpenApiVersion: '3.0.1' @@ -22,8 +20,6 @@ Resources: MyFn: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler diff --git a/tests/translator/input/api_with_aws_account_blacklist.yaml b/tests/translator/input/api_with_aws_account_blacklist.yaml index a394e5ef7..b93e63d9b 100644 --- a/tests/translator/input/api_with_aws_account_blacklist.yaml +++ b/tests/translator/input/api_with_aws_account_blacklist.yaml @@ -6,8 +6,6 @@ Globals: Resources: MyFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: InlineCode: | exports.handler = async (event) => { diff --git a/tests/translator/input/api_with_aws_account_whitelist.yaml b/tests/translator/input/api_with_aws_account_whitelist.yaml index cacaa1a5d..c69a9b64f 100644 --- a/tests/translator/input/api_with_aws_account_whitelist.yaml +++ b/tests/translator/input/api_with_aws_account_whitelist.yaml @@ -1,8 +1,6 @@ Resources: MyFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: InlineCode: | exports.handler = async (event) => { diff --git a/tests/translator/input/api_with_aws_iam_auth_overrides.yaml b/tests/translator/input/api_with_aws_iam_auth_overrides.yaml index 74450fbc0..c988dd0e3 100644 --- a/tests/translator/input/api_with_aws_iam_auth_overrides.yaml +++ b/tests/translator/input/api_with_aws_iam_auth_overrides.yaml @@ -1,8 +1,6 @@ Resources: MyApiWithAwsIamAuthNoCallerCredentials: Type: "AWS::Serverless::Api" - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -10,8 +8,6 @@ Resources: InvokeRole: NONE MyApiWithAwsIamAuth: Type: "AWS::Serverless::Api" - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -22,8 +18,6 @@ Resources: InvokeRole: arn:aws:iam::123:role/AUTH_AWS_IAM MyFunctionMyCognitoAuth: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler @@ -39,8 +33,6 @@ Resources: Authorizer: MyCognitoAuth MyFunctionWithoutAuth: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler @@ -54,8 +46,6 @@ Resources: Path: /MyFunctionWithoutAuth MyFunctionNoneAuth: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler @@ -71,8 +61,6 @@ Resources: Authorizer: NONE MyFunctionDefaultInvokeRole: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler @@ -89,8 +77,6 @@ Resources: InvokeRole: CALLER_CREDENTIALS MyFunctionCustomInvokeRole: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler @@ -107,8 +93,6 @@ Resources: InvokeRole: arn:aws:iam::456::role/something-else MyFunctionNONEInvokeRole: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler @@ -125,8 +109,6 @@ Resources: InvokeRole: NONE MyFunctionNullInvokeRole: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler @@ -143,8 +125,6 @@ Resources: InvokeRole: null MyFunctionCallerCredentialsOverride: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler @@ -161,8 +141,6 @@ Resources: InvokeRole: CALLER_CREDENTIALS MyFunctionNoCallerCredentials: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler diff --git a/tests/translator/input/api_with_basic_custom_domain.yaml b/tests/translator/input/api_with_basic_custom_domain.yaml index 40b31f4bf..2d8c915b0 100644 --- a/tests/translator/input/api_with_basic_custom_domain.yaml +++ b/tests/translator/input/api_with_basic_custom_domain.yaml @@ -16,8 +16,6 @@ Globals: Resources: MyFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: InlineCode: | exports.handler = async (event) => { @@ -56,8 +54,6 @@ Resources: MyApi: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: OpenApiVersion: 3.0.1 StageName: Prod @@ -74,8 +70,6 @@ Resources: MyAnotherApi: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: OpenApiVersion: 3.0.1 StageName: Prod diff --git a/tests/translator/input/api_with_basic_custom_domain_http.yaml b/tests/translator/input/api_with_basic_custom_domain_http.yaml index ff44f731a..9172c00c1 100644 --- a/tests/translator/input/api_with_basic_custom_domain_http.yaml +++ b/tests/translator/input/api_with_basic_custom_domain_http.yaml @@ -25,8 +25,6 @@ Globals: Resources: HttpApiFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: InlineCode: | exports.handler = async (event) => { @@ -52,8 +50,6 @@ Resources: MyApi: Type: AWS::Serverless::HttpApi - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: DisableExecuteApiEndpoint: true StageName: Prod \ No newline at end of file diff --git a/tests/translator/input/api_with_basic_custom_domain_intrinsics.yaml b/tests/translator/input/api_with_basic_custom_domain_intrinsics.yaml index 99fa2c245..b1d642754 100644 --- a/tests/translator/input/api_with_basic_custom_domain_intrinsics.yaml +++ b/tests/translator/input/api_with_basic_custom_domain_intrinsics.yaml @@ -24,8 +24,6 @@ Resources: MyFunction: Condition: C1 Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: InlineCode: | exports.handler = async (event) => { @@ -53,8 +51,6 @@ Resources: MyApi: Condition: C1 Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: OpenApiVersion: 3.0.1 StageName: Prod diff --git a/tests/translator/input/api_with_basic_custom_domain_intrinsics_http.yaml b/tests/translator/input/api_with_basic_custom_domain_intrinsics_http.yaml index 6a34af94b..b445a3bbb 100644 --- a/tests/translator/input/api_with_basic_custom_domain_intrinsics_http.yaml +++ b/tests/translator/input/api_with_basic_custom_domain_intrinsics_http.yaml @@ -24,8 +24,6 @@ Resources: MyFunction: Condition: C1 Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: InlineCode: | exports.handler = async (event) => { @@ -53,8 +51,6 @@ Resources: MyApi: Condition: C1 Type: AWS::Serverless::HttpApi - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod DisableExecuteApiEndpoint: False diff --git a/tests/translator/input/api_with_binary_media_types.yaml b/tests/translator/input/api_with_binary_media_types.yaml index f06af1993..2a10a2aa1 100644 --- a/tests/translator/input/api_with_binary_media_types.yaml +++ b/tests/translator/input/api_with_binary_media_types.yaml @@ -11,8 +11,6 @@ Globals: Resources: ImplicitApiFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -26,8 +24,6 @@ Resources: ExplicitApi: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod DefinitionUri: s3://sam-demo-bucket/webpage_swagger.json diff --git a/tests/translator/input/api_with_binary_media_types_definition_body.yaml b/tests/translator/input/api_with_binary_media_types_definition_body.yaml index 1e1ef66d6..6730419d4 100644 --- a/tests/translator/input/api_with_binary_media_types_definition_body.yaml +++ b/tests/translator/input/api_with_binary_media_types_definition_body.yaml @@ -12,8 +12,6 @@ Globals: Resources: ExplicitApiManagedSwagger: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod BinaryMediaTypes: @@ -21,8 +19,6 @@ Resources: ExplicitApiDefinitionBody: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod BinaryMediaTypes: diff --git a/tests/translator/input/api_with_canary_setting.yaml b/tests/translator/input/api_with_canary_setting.yaml index a319aa1d4..4503274c9 100644 --- a/tests/translator/input/api_with_canary_setting.yaml +++ b/tests/translator/input/api_with_canary_setting.yaml @@ -10,8 +10,6 @@ Globals: Resources: ImplicitApiFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -25,8 +23,6 @@ Resources: ExplicitApi: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod DefinitionUri: s3://sam-demo-bucket/webpage_swagger.json diff --git a/tests/translator/input/api_with_cors.yaml b/tests/translator/input/api_with_cors.yaml index 866b2ecbc..56b1c0e80 100644 --- a/tests/translator/input/api_with_cors.yaml +++ b/tests/translator/input/api_with_cors.yaml @@ -7,8 +7,6 @@ Globals: Resources: ImplicitApiFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -26,24 +24,18 @@ Resources: Method: any RestApiFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.handler Runtime: nodejs12.x GetHtmlFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.handler Runtime: nodejs12.x ExplicitApi: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod DefinitionBody: { diff --git a/tests/translator/input/api_with_cors_and_auth_no_preflight_auth.yaml b/tests/translator/input/api_with_cors_and_auth_no_preflight_auth.yaml index da1603ca1..e4e494082 100644 --- a/tests/translator/input/api_with_cors_and_auth_no_preflight_auth.yaml +++ b/tests/translator/input/api_with_cors_and_auth_no_preflight_auth.yaml @@ -5,8 +5,6 @@ Globals: Resources: ApiFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -29,8 +27,6 @@ Resources: ServerlessApi: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -46,8 +42,6 @@ Resources: MyAuthFn: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler diff --git a/tests/translator/input/api_with_cors_and_auth_preflight_auth.yaml b/tests/translator/input/api_with_cors_and_auth_preflight_auth.yaml index 47f7c200d..e984428c1 100644 --- a/tests/translator/input/api_with_cors_and_auth_preflight_auth.yaml +++ b/tests/translator/input/api_with_cors_and_auth_preflight_auth.yaml @@ -5,8 +5,6 @@ Globals: Resources: ApiFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -29,8 +27,6 @@ Resources: ServerlessApi: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -45,8 +41,6 @@ Resources: MyAuthFn: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler diff --git a/tests/translator/input/api_with_cors_and_conditions_no_definitionbody.yaml b/tests/translator/input/api_with_cors_and_conditions_no_definitionbody.yaml index e9054eeab..6070b112d 100644 --- a/tests/translator/input/api_with_cors_and_conditions_no_definitionbody.yaml +++ b/tests/translator/input/api_with_cors_and_conditions_no_definitionbody.yaml @@ -14,8 +14,6 @@ Globals: Resources: ImplicitApiFunction2: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -30,8 +28,6 @@ Resources: ImplicitApiFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Condition: MyCondition Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip @@ -55,7 +51,5 @@ Resources: ExplicitApi: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod \ No newline at end of file diff --git a/tests/translator/input/api_with_cors_and_only_credentials_false.yaml b/tests/translator/input/api_with_cors_and_only_credentials_false.yaml index aad04493f..f5fd65d0b 100644 --- a/tests/translator/input/api_with_cors_and_only_credentials_false.yaml +++ b/tests/translator/input/api_with_cors_and_only_credentials_false.yaml @@ -6,16 +6,12 @@ Globals: Resources: ImplicitApiFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml Runtime: nodejs12.x ExplicitApi: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod DefinitionBody: { diff --git a/tests/translator/input/api_with_cors_and_only_headers.yaml b/tests/translator/input/api_with_cors_and_only_headers.yaml index b067bbac7..4619d39b9 100644 --- a/tests/translator/input/api_with_cors_and_only_headers.yaml +++ b/tests/translator/input/api_with_cors_and_only_headers.yaml @@ -8,8 +8,6 @@ Globals: Resources: ImplicitApiFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -30,8 +28,6 @@ Resources: ExplicitApi: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod DefinitionBody: { diff --git a/tests/translator/input/api_with_cors_and_only_maxage.yaml b/tests/translator/input/api_with_cors_and_only_maxage.yaml index 8ce9d10f5..2e1ed30a3 100644 --- a/tests/translator/input/api_with_cors_and_only_maxage.yaml +++ b/tests/translator/input/api_with_cors_and_only_maxage.yaml @@ -7,16 +7,12 @@ Globals: Resources: ImplicitApiFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml Runtime: nodejs12.x ExplicitApi: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod DefinitionBody: { diff --git a/tests/translator/input/api_with_cors_and_only_methods.yaml b/tests/translator/input/api_with_cors_and_only_methods.yaml index 80f3d21dc..1ee2d9288 100644 --- a/tests/translator/input/api_with_cors_and_only_methods.yaml +++ b/tests/translator/input/api_with_cors_and_only_methods.yaml @@ -6,8 +6,6 @@ Globals: Resources: ImplicitApiFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml diff --git a/tests/translator/input/api_with_cors_and_only_origins.yaml b/tests/translator/input/api_with_cors_and_only_origins.yaml index 8f45272be..b8083247e 100644 --- a/tests/translator/input/api_with_cors_and_only_origins.yaml +++ b/tests/translator/input/api_with_cors_and_only_origins.yaml @@ -6,8 +6,6 @@ Globals: Resources: ImplicitApiFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -28,8 +26,6 @@ Resources: ExplicitApi: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod DefinitionBody: { diff --git a/tests/translator/input/api_with_cors_no_definitionbody.yaml b/tests/translator/input/api_with_cors_no_definitionbody.yaml index 1ff2faabe..f8b7bcd52 100644 --- a/tests/translator/input/api_with_cors_no_definitionbody.yaml +++ b/tests/translator/input/api_with_cors_no_definitionbody.yaml @@ -8,8 +8,6 @@ Globals: Resources: ImplicitApiFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -32,7 +30,5 @@ Resources: ExplicitApi: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod \ No newline at end of file diff --git a/tests/translator/input/api_with_cors_openapi_3.yaml b/tests/translator/input/api_with_cors_openapi_3.yaml index 636338b51..31ff41b12 100644 --- a/tests/translator/input/api_with_cors_openapi_3.yaml +++ b/tests/translator/input/api_with_cors_openapi_3.yaml @@ -9,8 +9,6 @@ Globals: Resources: ImplicitApiFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -28,24 +26,18 @@ Resources: Method: any RestApiFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.handler Runtime: nodejs12.x GetHtmlFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.handler Runtime: nodejs12.x ExplicitApi: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod DefinitionBody: { diff --git a/tests/translator/input/api_with_custom_domain_route53.yaml b/tests/translator/input/api_with_custom_domain_route53.yaml index 9f198e351..1d61f37b1 100644 --- a/tests/translator/input/api_with_custom_domain_route53.yaml +++ b/tests/translator/input/api_with_custom_domain_route53.yaml @@ -8,8 +8,6 @@ Parameters: Resources: MyFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: InlineCode: | exports.handler = async (event) => { @@ -31,8 +29,6 @@ Resources: MyApi: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: OpenApiVersion: 3.0.1 StageName: Prod diff --git a/tests/translator/input/api_with_custom_domain_route53_hosted_zone_name.yaml b/tests/translator/input/api_with_custom_domain_route53_hosted_zone_name.yaml index 90084e719..36120739b 100644 --- a/tests/translator/input/api_with_custom_domain_route53_hosted_zone_name.yaml +++ b/tests/translator/input/api_with_custom_domain_route53_hosted_zone_name.yaml @@ -8,8 +8,6 @@ Parameters: Resources: MyFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: InlineCode: | exports.handler = async (event) => { @@ -31,8 +29,6 @@ Resources: MyApi: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: OpenApiVersion: 3.0.1 StageName: Prod diff --git a/tests/translator/input/api_with_custom_domain_route53_hosted_zone_name_http.yaml b/tests/translator/input/api_with_custom_domain_route53_hosted_zone_name_http.yaml index 0f3a8b423..9fbc632a8 100644 --- a/tests/translator/input/api_with_custom_domain_route53_hosted_zone_name_http.yaml +++ b/tests/translator/input/api_with_custom_domain_route53_hosted_zone_name_http.yaml @@ -18,8 +18,6 @@ Globals: Resources: MyFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: InlineCode: | exports.handler = async (event) => { @@ -41,7 +39,5 @@ Resources: MyApi: Type: AWS::Serverless::HttpApi - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod diff --git a/tests/translator/input/api_with_custom_domain_route53_http.yaml b/tests/translator/input/api_with_custom_domain_route53_http.yaml index b63e412f4..f3e91b05d 100644 --- a/tests/translator/input/api_with_custom_domain_route53_http.yaml +++ b/tests/translator/input/api_with_custom_domain_route53_http.yaml @@ -8,8 +8,6 @@ Parameters: Resources: MyFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: InlineCode: | exports.handler = async (event) => { @@ -31,8 +29,6 @@ Resources: MyApi: Type: AWS::Serverless::HttpApi - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod Domain: diff --git a/tests/translator/input/api_with_default_aws_iam_auth.yaml b/tests/translator/input/api_with_default_aws_iam_auth.yaml index 0a4d14db4..2c32c89fd 100644 --- a/tests/translator/input/api_with_default_aws_iam_auth.yaml +++ b/tests/translator/input/api_with_default_aws_iam_auth.yaml @@ -1,8 +1,6 @@ Resources: MyApiWithAwsIamAuthAndDefaultInvokeRole: Type: "AWS::Serverless::Api" - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -10,8 +8,6 @@ Resources: InvokeRole: CALLER_CREDENTIALS MyApiWithAwsIamAuthAndCustomInvokeRole: Type: "AWS::Serverless::Api" - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -19,8 +15,6 @@ Resources: InvokeRole: rn:aws:iam::123:role/AUTH_AWS_IAM MyApiWithAwsIamAuth: Type: "AWS::Serverless::Api" - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -28,8 +22,6 @@ Resources: MyFunctionWithAwsIamAuth: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler diff --git a/tests/translator/input/api_with_default_aws_iam_auth_and_no_auth_route.yaml b/tests/translator/input/api_with_default_aws_iam_auth_and_no_auth_route.yaml index ab5d05435..8bad58788 100644 --- a/tests/translator/input/api_with_default_aws_iam_auth_and_no_auth_route.yaml +++ b/tests/translator/input/api_with_default_aws_iam_auth_and_no_auth_route.yaml @@ -1,8 +1,6 @@ Resources: MyApiWithAwsIamAuth: Type: "AWS::Serverless::Api" - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -10,8 +8,6 @@ Resources: MyFunctionWithAwsIamAuth: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler diff --git a/tests/translator/input/api_with_gateway_responses.yaml b/tests/translator/input/api_with_gateway_responses.yaml index 6c5d1634e..fe90cfaa3 100644 --- a/tests/translator/input/api_with_gateway_responses.yaml +++ b/tests/translator/input/api_with_gateway_responses.yaml @@ -1,8 +1,6 @@ Resources: Function: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -17,8 +15,6 @@ Resources: ExplicitApi: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod GatewayResponses: diff --git a/tests/translator/input/api_with_gateway_responses_all.yaml b/tests/translator/input/api_with_gateway_responses_all.yaml index 6de930637..1ae216968 100644 --- a/tests/translator/input/api_with_gateway_responses_all.yaml +++ b/tests/translator/input/api_with_gateway_responses_all.yaml @@ -1,8 +1,6 @@ Resources: Function: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -17,8 +15,6 @@ Resources: ExplicitApi: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod GatewayResponses: diff --git a/tests/translator/input/api_with_gateway_responses_all_openapi_3.yaml b/tests/translator/input/api_with_gateway_responses_all_openapi_3.yaml index 9d964e7b1..9b32bf2d9 100644 --- a/tests/translator/input/api_with_gateway_responses_all_openapi_3.yaml +++ b/tests/translator/input/api_with_gateway_responses_all_openapi_3.yaml @@ -1,8 +1,6 @@ Resources: Function: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -17,8 +15,6 @@ Resources: ExplicitApi: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod OpenApiVersion: '3.0' diff --git a/tests/translator/input/api_with_gateway_responses_implicit.yaml b/tests/translator/input/api_with_gateway_responses_implicit.yaml index 5139530dc..4c6cdfd24 100644 --- a/tests/translator/input/api_with_gateway_responses_implicit.yaml +++ b/tests/translator/input/api_with_gateway_responses_implicit.yaml @@ -15,8 +15,6 @@ Globals: Resources: Function: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml diff --git a/tests/translator/input/api_with_gateway_responses_minimal.yaml b/tests/translator/input/api_with_gateway_responses_minimal.yaml index 43dba5b67..77879bf42 100644 --- a/tests/translator/input/api_with_gateway_responses_minimal.yaml +++ b/tests/translator/input/api_with_gateway_responses_minimal.yaml @@ -1,8 +1,6 @@ Resources: Function: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -17,8 +15,6 @@ Resources: ExplicitApi: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod GatewayResponses: diff --git a/tests/translator/input/api_with_gateway_responses_string_status_code.yaml b/tests/translator/input/api_with_gateway_responses_string_status_code.yaml index cc624dd1f..b37f6d446 100644 --- a/tests/translator/input/api_with_gateway_responses_string_status_code.yaml +++ b/tests/translator/input/api_with_gateway_responses_string_status_code.yaml @@ -1,8 +1,6 @@ Resources: Function: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -17,8 +15,6 @@ Resources: ExplicitApi: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod GatewayResponses: diff --git a/tests/translator/input/api_with_if_conditional_with_resource_policy.yaml b/tests/translator/input/api_with_if_conditional_with_resource_policy.yaml index 304950b0d..3ffecb9b7 100644 --- a/tests/translator/input/api_with_if_conditional_with_resource_policy.yaml +++ b/tests/translator/input/api_with_if_conditional_with_resource_policy.yaml @@ -6,8 +6,6 @@ Conditions: Resources: ExplicitApi: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -26,8 +24,6 @@ Resources: ExplicitApiFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml diff --git a/tests/translator/input/api_with_incompatible_stage_name.yaml b/tests/translator/input/api_with_incompatible_stage_name.yaml index bc15d4785..d9bb9032f 100644 --- a/tests/translator/input/api_with_incompatible_stage_name.yaml +++ b/tests/translator/input/api_with_incompatible_stage_name.yaml @@ -1,8 +1,6 @@ Resources: HyphenFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -20,8 +18,6 @@ Resources: HyphenApi: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: hoge-fuga Models: @@ -33,8 +29,6 @@ Resources: UnderscoreFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -52,8 +46,6 @@ Resources: UnderscoreApi: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: hoge_fuga Models: diff --git a/tests/translator/input/api_with_ip_range_blacklist.yaml b/tests/translator/input/api_with_ip_range_blacklist.yaml index 638a4a0e4..cc8650fc5 100644 --- a/tests/translator/input/api_with_ip_range_blacklist.yaml +++ b/tests/translator/input/api_with_ip_range_blacklist.yaml @@ -7,8 +7,6 @@ Globals: Resources: MyFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: InlineCode: | exports.handler = async (event) => { diff --git a/tests/translator/input/api_with_ip_range_whitelist.yaml b/tests/translator/input/api_with_ip_range_whitelist.yaml index 876146ab7..a33b0b982 100644 --- a/tests/translator/input/api_with_ip_range_whitelist.yaml +++ b/tests/translator/input/api_with_ip_range_whitelist.yaml @@ -7,8 +7,6 @@ Globals: Resources: MyFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: InlineCode: | exports.handler = async (event) => { diff --git a/tests/translator/input/api_with_method_aws_iam_auth.yaml b/tests/translator/input/api_with_method_aws_iam_auth.yaml index 35f3b5816..8a1c8c6da 100644 --- a/tests/translator/input/api_with_method_aws_iam_auth.yaml +++ b/tests/translator/input/api_with_method_aws_iam_auth.yaml @@ -1,15 +1,11 @@ Resources: MyApiWithoutAuth: Type: "AWS::Serverless::Api" - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod MyFunctionWithAwsIamAuth: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler diff --git a/tests/translator/input/api_with_method_settings.yaml b/tests/translator/input/api_with_method_settings.yaml index fca9d6a5c..251b70c83 100644 --- a/tests/translator/input/api_with_method_settings.yaml +++ b/tests/translator/input/api_with_method_settings.yaml @@ -18,8 +18,6 @@ Globals: Resources: ImplicitApiFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -33,8 +31,6 @@ Resources: ExplicitApi: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod DefinitionUri: s3://sam-demo-bucket/webpage_swagger.json diff --git a/tests/translator/input/api_with_minimum_compression_size.yaml b/tests/translator/input/api_with_minimum_compression_size.yaml index f98ac34d7..cb2ea975c 100644 --- a/tests/translator/input/api_with_minimum_compression_size.yaml +++ b/tests/translator/input/api_with_minimum_compression_size.yaml @@ -5,8 +5,6 @@ Globals: Resources: ImplicitApiFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -20,8 +18,6 @@ Resources: ExplicitApi: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod DefinitionUri: s3://sam-demo-bucket/webpage_swagger.json diff --git a/tests/translator/input/api_with_open_api_version.yaml b/tests/translator/input/api_with_open_api_version.yaml index 504675f4f..1ffd32bd6 100644 --- a/tests/translator/input/api_with_open_api_version.yaml +++ b/tests/translator/input/api_with_open_api_version.yaml @@ -6,8 +6,6 @@ Globals: Resources: ImplicitApiFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -20,7 +18,5 @@ Resources: Method: get ExplicitApi: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod diff --git a/tests/translator/input/api_with_open_api_version_2.yaml b/tests/translator/input/api_with_open_api_version_2.yaml index 1b0daf36d..688344e03 100644 --- a/tests/translator/input/api_with_open_api_version_2.yaml +++ b/tests/translator/input/api_with_open_api_version_2.yaml @@ -6,8 +6,6 @@ Globals: Resources: ImplicitApiFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -20,7 +18,5 @@ Resources: Method: get ExplicitApi: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod diff --git a/tests/translator/input/api_with_openapi_definition_body_no_flag.yaml b/tests/translator/input/api_with_openapi_definition_body_no_flag.yaml index 0bf5ba102..d8ee227be 100644 --- a/tests/translator/input/api_with_openapi_definition_body_no_flag.yaml +++ b/tests/translator/input/api_with_openapi_definition_body_no_flag.yaml @@ -14,8 +14,6 @@ Globals: Resources: ImplicitApiFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -29,8 +27,6 @@ Resources: ExplicitApi: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: SomeStage DefinitionBody: @@ -49,8 +45,6 @@ Resources: MyUserPool: Type: AWS::Cognito::UserPool - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: UserPoolName: UserPoolName Policies: diff --git a/tests/translator/input/api_with_path_parameters.yaml b/tests/translator/input/api_with_path_parameters.yaml index 0189171e3..ac79e312c 100644 --- a/tests/translator/input/api_with_path_parameters.yaml +++ b/tests/translator/input/api_with_path_parameters.yaml @@ -1,8 +1,6 @@ Resources: HtmlFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -17,8 +15,6 @@ Resources: HtmlApi: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod DefinitionUri: s3://sam-demo-bucket/webpage_swagger.json diff --git a/tests/translator/input/api_with_resource_policy.yaml b/tests/translator/input/api_with_resource_policy.yaml index 43ad70d72..fb9071db2 100644 --- a/tests/translator/input/api_with_resource_policy.yaml +++ b/tests/translator/input/api_with_resource_policy.yaml @@ -1,8 +1,6 @@ Resources: ExplicitApi: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -13,8 +11,6 @@ Resources: } ExplicitApiFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml diff --git a/tests/translator/input/api_with_resource_policy_global.yaml b/tests/translator/input/api_with_resource_policy_global.yaml index 7a7932dec..3bb00a4ef 100644 --- a/tests/translator/input/api_with_resource_policy_global.yaml +++ b/tests/translator/input/api_with_resource_policy_global.yaml @@ -23,8 +23,6 @@ Globals: Resources: ExplicitApiFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -40,8 +38,6 @@ Resources: ExplicitApi: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: !Ref StageName DefinitionBody: @@ -66,8 +62,6 @@ Resources: Service: 'lambda.amazonaws.com' AnotherApi: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: !Ref StageName Auth: diff --git a/tests/translator/input/api_with_resource_policy_global_implicit.yaml b/tests/translator/input/api_with_resource_policy_global_implicit.yaml index 7bc19c8f1..d3599c73c 100644 --- a/tests/translator/input/api_with_resource_policy_global_implicit.yaml +++ b/tests/translator/input/api_with_resource_policy_global_implicit.yaml @@ -1,8 +1,6 @@ Resources: MinimalFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler diff --git a/tests/translator/input/api_with_resource_refs.yaml b/tests/translator/input/api_with_resource_refs.yaml index 19ffa2d75..3381677ef 100644 --- a/tests/translator/input/api_with_resource_refs.yaml +++ b/tests/translator/input/api_with_resource_refs.yaml @@ -3,8 +3,6 @@ Resources: MyApi: Type: 'AWS::Serverless::Api' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: foo DefinitionBody: @@ -13,8 +11,6 @@ Resources: MyFunction: Type: "AWS::Serverless::Function" - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler diff --git a/tests/translator/input/api_with_source_vpc_blacklist.yaml b/tests/translator/input/api_with_source_vpc_blacklist.yaml index 82623df15..65073bded 100644 --- a/tests/translator/input/api_with_source_vpc_blacklist.yaml +++ b/tests/translator/input/api_with_source_vpc_blacklist.yaml @@ -6,8 +6,6 @@ Globals: Resources: MyFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: InlineCode: | exports.handler = async (event) => { diff --git a/tests/translator/input/api_with_source_vpc_whitelist.yaml b/tests/translator/input/api_with_source_vpc_whitelist.yaml index 4d1af939c..1cacf3941 100644 --- a/tests/translator/input/api_with_source_vpc_whitelist.yaml +++ b/tests/translator/input/api_with_source_vpc_whitelist.yaml @@ -14,8 +14,6 @@ Globals: Resources: MyFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: InlineCode: | exports.handler = async (event) => { @@ -41,8 +39,6 @@ Resources: MyApi: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod diff --git a/tests/translator/input/api_with_stage_tags.yaml b/tests/translator/input/api_with_stage_tags.yaml index f39b484a8..83473e116 100644 --- a/tests/translator/input/api_with_stage_tags.yaml +++ b/tests/translator/input/api_with_stage_tags.yaml @@ -6,8 +6,6 @@ Parameters: Resources: MyApiWithStageTags: Type: "AWS::Serverless::Api" - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod Tags: diff --git a/tests/translator/input/api_with_swagger_and_openapi_with_auth.yaml b/tests/translator/input/api_with_swagger_and_openapi_with_auth.yaml index 86f49a7a7..af30762da 100644 --- a/tests/translator/input/api_with_swagger_and_openapi_with_auth.yaml +++ b/tests/translator/input/api_with_swagger_and_openapi_with_auth.yaml @@ -14,8 +14,6 @@ Globals: Resources: ImplicitApiFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -29,8 +27,6 @@ Resources: ExplicitApi: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: SomeStage DefinitionBody: @@ -50,8 +46,6 @@ Resources: MyUserPool: Type: AWS::Cognito::UserPool - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: UserPoolName: UserPoolName Policies: diff --git a/tests/translator/input/api_with_usageplans.yaml b/tests/translator/input/api_with_usageplans.yaml index fa5b04a5e..836d98648 100644 --- a/tests/translator/input/api_with_usageplans.yaml +++ b/tests/translator/input/api_with_usageplans.yaml @@ -8,8 +8,6 @@ Globals: Resources: MyApiOne: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -18,8 +16,6 @@ Resources: MyApiTwo: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -43,15 +39,11 @@ Resources: MyApiThree: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod MyFunctionOne: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Handler: index.handler Runtime: nodejs12.x @@ -74,8 +66,6 @@ Resources: MyFunctionTwo: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Handler: index.handler Runtime: nodejs12.x @@ -103,8 +93,6 @@ Resources: MyFunctionThree: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Handler: index.handler Runtime: nodejs12.x diff --git a/tests/translator/input/api_with_usageplans_intrinsics.yaml b/tests/translator/input/api_with_usageplans_intrinsics.yaml index 046d4fe55..7a386b556 100644 --- a/tests/translator/input/api_with_usageplans_intrinsics.yaml +++ b/tests/translator/input/api_with_usageplans_intrinsics.yaml @@ -19,8 +19,6 @@ Globals: Resources: MyApiOne: - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Condition: C1 Type: AWS::Serverless::Api Properties: @@ -29,15 +27,11 @@ Resources: MyApiTwo: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod MyFunctionOne: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Handler: index.handler Runtime: nodejs12.x @@ -60,8 +54,6 @@ Resources: MyFunctionTwo: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Handler: index.handler Runtime: nodejs12.x diff --git a/tests/translator/input/api_with_xray_tracing.yaml b/tests/translator/input/api_with_xray_tracing.yaml index e529fd7e8..8d54a9afc 100644 --- a/tests/translator/input/api_with_xray_tracing.yaml +++ b/tests/translator/input/api_with_xray_tracing.yaml @@ -1,8 +1,6 @@ Resources: HtmlFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -17,8 +15,6 @@ Resources: HtmlApi: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod DefinitionUri: s3://sam-demo-bucket/webpage_swagger.json diff --git a/tests/translator/input/application_preparing_state.yaml b/tests/translator/input/application_preparing_state.yaml index 90123c4f6..91feca133 100644 --- a/tests/translator/input/application_preparing_state.yaml +++ b/tests/translator/input/application_preparing_state.yaml @@ -1,8 +1,6 @@ Resources: PreparingApplication: Type: 'AWS::Serverless::Application' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Location: ApplicationId: preparing diff --git a/tests/translator/input/application_with_intrinsics.yaml b/tests/translator/input/application_with_intrinsics.yaml index 88a59b004..f99a2860a 100644 --- a/tests/translator/input/application_with_intrinsics.yaml +++ b/tests/translator/input/application_with_intrinsics.yaml @@ -21,8 +21,6 @@ Mappings: Resources: ApplicationRefParameter: Type: 'AWS::Serverless::Application' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Location: ApplicationId: !Ref ApplicationIdParam @@ -30,8 +28,6 @@ Resources: ApplicationFindInMap: Type: 'AWS::Serverless::Application' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Location: ApplicationId: !FindInMap @@ -46,5 +42,3 @@ Resources: - !Ref Sns Sns: Type: AWS::SNS::Topic - DeletionPolicy: Delete - UpdateReplacePolicy: Retain diff --git a/tests/translator/input/basic_application.yaml b/tests/translator/input/basic_application.yaml index c508772c5..03e665a41 100644 --- a/tests/translator/input/basic_application.yaml +++ b/tests/translator/input/basic_application.yaml @@ -6,8 +6,6 @@ Conditions: Resources: BasicApplication: Type: 'AWS::Serverless::Application' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Location: ApplicationId: arn:aws:serverlessrepo:us-east-1:123456789012:applications/hello-world @@ -15,8 +13,6 @@ Resources: NormalApplication: Type: 'AWS::Serverless::Application' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Location: ApplicationId: arn:aws:serverlessrepo:us-east-1:123456789012:applications/hello-world @@ -31,8 +27,6 @@ Resources: ApplicationWithLocationUrl: Type: 'AWS::Serverless::Application' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Location: https://s3-us-east-1.amazonaws.com/demo-bucket/template.yaml Tags: @@ -40,8 +34,6 @@ Resources: ApplicationWithCondition: Type: 'AWS::Serverless::Application' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Condition: TestCondition Properties: Location: diff --git a/tests/translator/input/basic_function.yaml b/tests/translator/input/basic_function.yaml index dfa007e66..ae6ba50b4 100644 --- a/tests/translator/input/basic_function.yaml +++ b/tests/translator/input/basic_function.yaml @@ -8,8 +8,6 @@ Parameters: Resources: MinimalFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -17,8 +15,6 @@ Resources: FunctionWithTracing: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -27,8 +23,6 @@ Resources: FunctionWithInlineCode: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: InlineCode: "hello world" Handler: hello.handler @@ -37,8 +31,6 @@ Resources: FunctionWithCodeUriObject: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: Bucket: somebucket @@ -49,8 +41,6 @@ Resources: CompleteFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: FunctionName: MyAwesomeFunction CodeUri: s3://sam-demo-bucket/hello.zip @@ -73,8 +63,6 @@ Resources: Name2: Value2 FunctionWithPolicies: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -82,8 +70,6 @@ Resources: Policies: AmazonDynamoDBFullAccess FunctionWithPolicyDocument: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -95,8 +81,6 @@ Resources: Resource: '*' FunctionWithRoleRef: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -107,8 +91,6 @@ Resources: MyFunctionRole: # This is just some role. Actual role definition might be wrong Type: "AWS::IAM::Role" - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: AssumeRolePolicyDocument: Version: "2012-10-17" diff --git a/tests/translator/input/basic_function_with_tags.yaml b/tests/translator/input/basic_function_with_tags.yaml index 5c337799d..691c1141e 100644 --- a/tests/translator/input/basic_function_with_tags.yaml +++ b/tests/translator/input/basic_function_with_tags.yaml @@ -9,8 +9,6 @@ Parameters: Resources: AlexaSkillFunc: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Description: Created by SAM diff --git a/tests/translator/input/basic_function_withimageuri.yaml b/tests/translator/input/basic_function_withimageuri.yaml index 03a584c4a..897642b55 100644 --- a/tests/translator/input/basic_function_withimageuri.yaml +++ b/tests/translator/input/basic_function_withimageuri.yaml @@ -8,16 +8,12 @@ Parameters: Resources: MinimalImageFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: ImageUri: 123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest PackageType: Image MinimalImageFunctionPackageTypeAndImageConfig: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: ImageUri: 123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest PackageType: Image @@ -28,8 +24,6 @@ Resources: CompleteImageFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: FunctionName: MyAwesomeFunction ImageUri: 123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest @@ -56,8 +50,6 @@ Resources: FunctionWithPolicies: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: ImageUri: 123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest PackageType: Image @@ -65,8 +57,6 @@ Resources: FunctionWithPolicyDocument: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: ImageUri: 123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest PackageType: Image @@ -78,8 +68,6 @@ Resources: FunctionWithRoleRef: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: ImageUri: 123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest PackageType: Image @@ -89,8 +77,6 @@ Resources: MyFunctionRole: # This is just some role. Actual role definition might be wrong Type: "AWS::IAM::Role" - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: AssumeRolePolicyDocument: Version: "2012-10-17" diff --git a/tests/translator/input/basic_layer.yaml b/tests/translator/input/basic_layer.yaml index a9f0448bf..170af09b1 100644 --- a/tests/translator/input/basic_layer.yaml +++ b/tests/translator/input/basic_layer.yaml @@ -7,15 +7,11 @@ Conditions: Resources: MinimalLayer: Type: 'AWS::Serverless::LayerVersion' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: ContentUri: s3://sam-demo-bucket/layer.zip LayerWithContentUriObject: Type: 'AWS::Serverless::LayerVersion' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: ContentUri: Bucket: somebucket @@ -25,8 +21,6 @@ Resources: CompleteLayer: Type: 'AWS::Serverless::LayerVersion' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: LayerName: MyAwesomeLayer ContentUri: s3://sam-demo-bucket/layer.zip @@ -39,8 +33,6 @@ Resources: LayerWithCondition: Type: 'AWS::Serverless::LayerVersion' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Condition: TestCondition Properties: ContentUri: s3://sam-demo-bucket/layer.zip diff --git a/tests/translator/input/cloudwatch_logs_with_ref.yaml b/tests/translator/input/cloudwatch_logs_with_ref.yaml index 5518edf3d..b818b66d8 100644 --- a/tests/translator/input/cloudwatch_logs_with_ref.yaml +++ b/tests/translator/input/cloudwatch_logs_with_ref.yaml @@ -12,8 +12,6 @@ Parameters: Resources: TriggeredFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip?versionId=3Tcgv52_0GaDvhDva4YciYeqRyPnpIcO Handler: hello.handler diff --git a/tests/translator/input/cloudwatchevent.yaml b/tests/translator/input/cloudwatchevent.yaml index 3f49b1563..f14ebcb40 100644 --- a/tests/translator/input/cloudwatchevent.yaml +++ b/tests/translator/input/cloudwatchevent.yaml @@ -1,8 +1,6 @@ Resources: ScheduledFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip?versionId=3Tcgv52_0GaDvhDva4YciYeqRyPnpIcO Handler: hello.handler @@ -14,8 +12,6 @@ Resources: Schedule: 'rate(1 minute)' TriggeredFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip?versionId=3Tcgv52_0GaDvhDva4YciYeqRyPnpIcO Handler: hello.handler diff --git a/tests/translator/input/cloudwatchlog.yaml b/tests/translator/input/cloudwatchlog.yaml index 3ee844c55..42b2f7715 100644 --- a/tests/translator/input/cloudwatchlog.yaml +++ b/tests/translator/input/cloudwatchlog.yaml @@ -1,8 +1,6 @@ Resources: TriggeredFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip?versionId=3Tcgv52_0GaDvhDva4YciYeqRyPnpIcO Handler: hello.handler diff --git a/tests/translator/input/cognito_userpool_with_event.yaml b/tests/translator/input/cognito_userpool_with_event.yaml index ecd303127..97cf8a597 100644 --- a/tests/translator/input/cognito_userpool_with_event.yaml +++ b/tests/translator/input/cognito_userpool_with_event.yaml @@ -1,15 +1,11 @@ Resources: UserPool: Type: AWS::Cognito::UserPool - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: LambdaConfig: PreAuthentication: "Test" ImplicitApiFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml diff --git a/tests/translator/input/depends_on.yaml b/tests/translator/input/depends_on.yaml index 3245b4568..34d914a49 100644 --- a/tests/translator/input/depends_on.yaml +++ b/tests/translator/input/depends_on.yaml @@ -3,8 +3,6 @@ Resources: MyFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain DependsOn: ["MyExplicitApi", "MySamTable"] Properties: CodeUri: s3://sam-demo-bucket/code.zip @@ -20,8 +18,6 @@ Resources: MyExplicitApi: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain DependsOn: "MySamTable" Properties: DefinitionUri: s3://sam-translator-tests-dont-delete/swagger-http.json @@ -30,15 +26,11 @@ Resources: MySamTable: Type: AWS::Serverless::SimpleTable - DeletionPolicy: Delete - UpdateReplacePolicy: Retain MyOtherTable: # Test DependsOn property a non-SAM resource Type: AWS::DynamoDB::Table - DeletionPolicy: Delete - UpdateReplacePolicy: Retain DependsOn: "MySamTable" Properties: diff --git a/tests/translator/input/eventbridgerule.yaml b/tests/translator/input/eventbridgerule.yaml index d88d7c875..e9006a464 100644 --- a/tests/translator/input/eventbridgerule.yaml +++ b/tests/translator/input/eventbridgerule.yaml @@ -1,8 +1,6 @@ Resources: ScheduledFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip?versionId=3Tcgv52_0GaDvhDva4YciYeqRyPnpIcO Handler: hello.handler @@ -14,8 +12,6 @@ Resources: Schedule: 'rate(1 minute)' TriggeredFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip?versionId=3Tcgv52_0GaDvhDva4YciYeqRyPnpIcO Handler: hello.handler diff --git a/tests/translator/input/eventbridgerule_schedule_properties.yaml b/tests/translator/input/eventbridgerule_schedule_properties.yaml index 1e91adf2a..0c947dfc8 100644 --- a/tests/translator/input/eventbridgerule_schedule_properties.yaml +++ b/tests/translator/input/eventbridgerule_schedule_properties.yaml @@ -1,8 +1,6 @@ Resources: ScheduledFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip?versionId=3Tcgv52_0GaDvhDva4YciYeqRyPnpIcO Handler: hello.handler @@ -18,8 +16,6 @@ Resources: TriggeredFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip?versionId=3Tcgv52_0GaDvhDva4YciYeqRyPnpIcO Handler: hello.handler diff --git a/tests/translator/input/eventbridgerule_with_dlq.yaml b/tests/translator/input/eventbridgerule_with_dlq.yaml index 39c996622..7bb7dc59d 100644 --- a/tests/translator/input/eventbridgerule_with_dlq.yaml +++ b/tests/translator/input/eventbridgerule_with_dlq.yaml @@ -1,8 +1,6 @@ Resources: ScheduledFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip?versionId=3Tcgv52_0GaDvhDva4YciYeqRyPnpIcO Handler: hello.handler @@ -16,8 +14,6 @@ Resources: Type: SQS TriggeredFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip?versionId=3Tcgv52_0GaDvhDva4YciYeqRyPnpIcO Handler: hello.handler diff --git a/tests/translator/input/eventbridgerule_with_retry_policy.yaml b/tests/translator/input/eventbridgerule_with_retry_policy.yaml index f3e32a74a..ed66964af 100644 --- a/tests/translator/input/eventbridgerule_with_retry_policy.yaml +++ b/tests/translator/input/eventbridgerule_with_retry_policy.yaml @@ -1,8 +1,6 @@ Resources: ScheduledFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip?versionId=3Tcgv52_0GaDvhDva4YciYeqRyPnpIcO Handler: hello.handler @@ -16,8 +14,6 @@ Resources: MaximumRetryAttempts: 3 TriggeredFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip?versionId=3Tcgv52_0GaDvhDva4YciYeqRyPnpIcO Handler: hello.handler diff --git a/tests/translator/input/explicit_api.yaml b/tests/translator/input/explicit_api.yaml index 17008e799..a2057640c 100644 --- a/tests/translator/input/explicit_api.yaml +++ b/tests/translator/input/explicit_api.yaml @@ -9,8 +9,6 @@ Parameters: Resources: GetHtmlFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: Bucket: sam-demo-bucket @@ -29,8 +27,6 @@ Resources: GetHtmlApi: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Name: MyGetApi StageName: @@ -45,8 +41,6 @@ Resources: ApiWithInlineSwagger: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Ref: MyStageName diff --git a/tests/translator/input/explicit_api_openapi_3.yaml b/tests/translator/input/explicit_api_openapi_3.yaml index f1fb7f3ca..a6f00e5e0 100644 --- a/tests/translator/input/explicit_api_openapi_3.yaml +++ b/tests/translator/input/explicit_api_openapi_3.yaml @@ -9,8 +9,6 @@ Parameters: Resources: GetHtmlFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: Bucket: sam-demo-bucket @@ -29,8 +27,6 @@ Resources: GetHtmlApi: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Name: MyGetApi StageName: @@ -45,8 +41,6 @@ Resources: ApiWithInlineSwagger: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Ref: MyStageName diff --git a/tests/translator/input/explicit_api_with_invalid_events_config.yaml b/tests/translator/input/explicit_api_with_invalid_events_config.yaml index d350c6244..2866b5f0c 100644 --- a/tests/translator/input/explicit_api_with_invalid_events_config.yaml +++ b/tests/translator/input/explicit_api_with_invalid_events_config.yaml @@ -8,8 +8,6 @@ Resources: MyFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/todo_list.zip Handler: index.restapi @@ -26,8 +24,6 @@ Resources: ApiWithInlineSwagger: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod DefinitionBody: { diff --git a/tests/translator/input/explicit_http_api.yaml b/tests/translator/input/explicit_http_api.yaml index 4a19efef9..2d5063051 100644 --- a/tests/translator/input/explicit_http_api.yaml +++ b/tests/translator/input/explicit_http_api.yaml @@ -1,8 +1,6 @@ Resources: HttpApiFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/todo_list.zip Handler: index.restapi @@ -20,8 +18,6 @@ Resources: Method: get MyApi: Type: AWS::Serverless::HttpApi - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: FailOnWarnings: True Auth: @@ -38,8 +34,6 @@ Resources: MyApi2: Type: AWS::Serverless::HttpApi - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Auth: Authorizers: diff --git a/tests/translator/input/explicit_http_api_minimum.yaml b/tests/translator/input/explicit_http_api_minimum.yaml index 0b6e2eebd..9a968d22a 100644 --- a/tests/translator/input/explicit_http_api_minimum.yaml +++ b/tests/translator/input/explicit_http_api_minimum.yaml @@ -1,12 +1,8 @@ Resources: Api: Type: AWS::Serverless::HttpApi - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Function: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Handler: index.handler CodeUri: s3://bucket/key diff --git a/tests/translator/input/function_concurrency.yaml b/tests/translator/input/function_concurrency.yaml index e862f50b8..ff39277a4 100644 --- a/tests/translator/input/function_concurrency.yaml +++ b/tests/translator/input/function_concurrency.yaml @@ -5,8 +5,6 @@ Parameters: Resources: ConcurrentFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -15,8 +13,6 @@ Resources: AnotherFunction: Type: "AWS::Serverless::Function" - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler diff --git a/tests/translator/input/function_event_conditions.yaml b/tests/translator/input/function_event_conditions.yaml index 5139bf2d9..f30751333 100644 --- a/tests/translator/input/function_event_conditions.yaml +++ b/tests/translator/input/function_event_conditions.yaml @@ -9,8 +9,6 @@ Resources: # S3 Event without condition, using same bucket FunctionOne: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/thumbnails.zip Handler: index.generate_thumbails @@ -26,8 +24,6 @@ Resources: # All Event Types MyAwesomeFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Condition: MyCondition Properties: CodeUri: s3://sam-demo-bucket/hello.zip @@ -116,16 +112,10 @@ Resources: Notifications: Condition: MyCondition Type: AWS::SNS::Topic - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Images: Type: AWS::S3::Bucket - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Queue: Condition: MyCondition Type: AWS::SQS::Queue - DeletionPolicy: Delete - UpdateReplacePolicy: Retain diff --git a/tests/translator/input/function_managed_inline_policy.yaml b/tests/translator/input/function_managed_inline_policy.yaml index 4a0757e91..538d5f3c6 100644 --- a/tests/translator/input/function_managed_inline_policy.yaml +++ b/tests/translator/input/function_managed_inline_policy.yaml @@ -5,8 +5,6 @@ Parameters: Resources: Function: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler diff --git a/tests/translator/input/function_with_alias.yaml b/tests/translator/input/function_with_alias.yaml index 1563344a3..4a2defb45 100644 --- a/tests/translator/input/function_with_alias.yaml +++ b/tests/translator/input/function_with_alias.yaml @@ -1,8 +1,6 @@ Resources: MinimalFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler diff --git a/tests/translator/input/function_with_alias_and_code_sha256.yaml b/tests/translator/input/function_with_alias_and_code_sha256.yaml index fe1c1513e..bec283db1 100644 --- a/tests/translator/input/function_with_alias_and_code_sha256.yaml +++ b/tests/translator/input/function_with_alias_and_code_sha256.yaml @@ -7,8 +7,6 @@ Parameters: Resources: MinimalFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler diff --git a/tests/translator/input/function_with_alias_and_event_sources.yaml b/tests/translator/input/function_with_alias_and_event_sources.yaml index d8f60a36e..41a6bc27c 100644 --- a/tests/translator/input/function_with_alias_and_event_sources.yaml +++ b/tests/translator/input/function_with_alias_and_event_sources.yaml @@ -8,8 +8,6 @@ Parameters: Resources: MyAwesomeFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -94,18 +92,12 @@ Resources: Notifications: Type: AWS::SNS::Topic - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Images: Type: AWS::S3::Bucket - DeletionPolicy: Delete - UpdateReplacePolicy: Retain GetHtmlApi: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Name: MyGetApi StageName: diff --git a/tests/translator/input/function_with_alias_intrinsics.yaml b/tests/translator/input/function_with_alias_intrinsics.yaml index 60f59c1ee..99327286b 100644 --- a/tests/translator/input/function_with_alias_intrinsics.yaml +++ b/tests/translator/input/function_with_alias_intrinsics.yaml @@ -6,8 +6,6 @@ Parameters: Resources: MinimalFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler diff --git a/tests/translator/input/function_with_amq.yaml b/tests/translator/input/function_with_amq.yaml index 22f481317..00d28b841 100644 --- a/tests/translator/input/function_with_amq.yaml +++ b/tests/translator/input/function_with_amq.yaml @@ -1,8 +1,6 @@ Resources: MQFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/queues.zip Handler: queue.mq_handler diff --git a/tests/translator/input/function_with_amq_kms.yaml b/tests/translator/input/function_with_amq_kms.yaml index 10a0332f8..7ea02c2df 100644 --- a/tests/translator/input/function_with_amq_kms.yaml +++ b/tests/translator/input/function_with_amq_kms.yaml @@ -1,8 +1,6 @@ Resources: MQFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/queues.zip Handler: queue.mq_handler diff --git a/tests/translator/input/function_with_condition.yaml b/tests/translator/input/function_with_condition.yaml index 0f05eda79..059ea737b 100644 --- a/tests/translator/input/function_with_condition.yaml +++ b/tests/translator/input/function_with_condition.yaml @@ -6,8 +6,6 @@ Conditions: Resources: ConditionFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Condition: "TestCondition" Properties: CodeUri: s3://sam-demo-bucket/hello.zip diff --git a/tests/translator/input/function_with_conditional_managed_policy.yaml b/tests/translator/input/function_with_conditional_managed_policy.yaml index 81ec262cd..6bfed9d07 100644 --- a/tests/translator/input/function_with_conditional_managed_policy.yaml +++ b/tests/translator/input/function_with_conditional_managed_policy.yaml @@ -5,8 +5,6 @@ Conditions: Resources: FunctionWithConditionalPolicy: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Description: A function that has Fn::If in the policies property Handler: hello.handler diff --git a/tests/translator/input/function_with_conditional_managed_policy_and_ref_no_value.yaml b/tests/translator/input/function_with_conditional_managed_policy_and_ref_no_value.yaml index b2d536f43..62f952801 100644 --- a/tests/translator/input/function_with_conditional_managed_policy_and_ref_no_value.yaml +++ b/tests/translator/input/function_with_conditional_managed_policy_and_ref_no_value.yaml @@ -5,8 +5,6 @@ Conditions: Resources: FunctionWithConditionalPolicy: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Description: A function that has Fn::If in the policies property Handler: hello.handler diff --git a/tests/translator/input/function_with_conditional_policy_template.yaml b/tests/translator/input/function_with_conditional_policy_template.yaml index f19197f9b..4b7a0b8fe 100644 --- a/tests/translator/input/function_with_conditional_policy_template.yaml +++ b/tests/translator/input/function_with_conditional_policy_template.yaml @@ -5,8 +5,6 @@ Conditions: Resources: FunctionWithConditionalPolicy: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Description: A function that has Fn::If in the policies property Handler: hello.handler diff --git a/tests/translator/input/function_with_conditional_policy_template_and_ref_no_value.yaml b/tests/translator/input/function_with_conditional_policy_template_and_ref_no_value.yaml index e9756c9ba..432b4db2a 100644 --- a/tests/translator/input/function_with_conditional_policy_template_and_ref_no_value.yaml +++ b/tests/translator/input/function_with_conditional_policy_template_and_ref_no_value.yaml @@ -5,8 +5,6 @@ Conditions: Resources: FunctionWithConditionalPolicy: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Description: A function that has Fn::If in the policies property Handler: hello.handler diff --git a/tests/translator/input/function_with_custom_codedeploy_deployment_preference.yaml b/tests/translator/input/function_with_custom_codedeploy_deployment_preference.yaml index 5653638c6..1a6a8606a 100644 --- a/tests/translator/input/function_with_custom_codedeploy_deployment_preference.yaml +++ b/tests/translator/input/function_with_custom_codedeploy_deployment_preference.yaml @@ -27,8 +27,6 @@ Conditions: Resources: MinimalFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -39,8 +37,6 @@ Resources: CustomWithFindInMap: # Doesn't work Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -51,8 +47,6 @@ Resources: CustomWithCondition: # Works Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -63,8 +57,6 @@ Resources: CustomWithCondition2: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -75,8 +67,6 @@ Resources: NormalWithSub: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -87,8 +77,6 @@ Resources: CustomWithSub: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -99,8 +87,6 @@ Resources: NormalWithRef: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler diff --git a/tests/translator/input/function_with_custom_conditional_codedeploy_deployment_preference.yaml b/tests/translator/input/function_with_custom_conditional_codedeploy_deployment_preference.yaml index 93472b202..50bb95e6d 100644 --- a/tests/translator/input/function_with_custom_conditional_codedeploy_deployment_preference.yaml +++ b/tests/translator/input/function_with_custom_conditional_codedeploy_deployment_preference.yaml @@ -10,8 +10,6 @@ Conditions: Resources: HelloWorldFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Handler: index.handler Runtime: nodejs12.x diff --git a/tests/translator/input/function_with_deployment_and_custom_role.yaml b/tests/translator/input/function_with_deployment_and_custom_role.yaml index 034c9a9a4..448b0fdc0 100644 --- a/tests/translator/input/function_with_deployment_and_custom_role.yaml +++ b/tests/translator/input/function_with_deployment_and_custom_role.yaml @@ -8,8 +8,6 @@ Resources: MinimalFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -17,8 +15,6 @@ Resources: FunctionWithRole: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -27,8 +23,6 @@ Resources: DeploymentRole: Type: AWS::IAM::Role - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: ManagedPolicyArns: - arn:aws:iam::aws:policy/service-role/AWSCodeDeployRole diff --git a/tests/translator/input/function_with_deployment_no_service_role.yaml b/tests/translator/input/function_with_deployment_no_service_role.yaml index 69095188f..ae40a6a00 100644 --- a/tests/translator/input/function_with_deployment_no_service_role.yaml +++ b/tests/translator/input/function_with_deployment_no_service_role.yaml @@ -9,8 +9,6 @@ Resources: MinimalFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -18,8 +16,6 @@ Resources: OtherFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -27,8 +23,6 @@ Resources: DeploymentRole: Type: AWS::IAM::Role - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: ManagedPolicyArns: - arn:aws:iam::aws:policy/service-role/AWSCodeDeployRole diff --git a/tests/translator/input/function_with_deployment_preference.yaml b/tests/translator/input/function_with_deployment_preference.yaml index 61ba3c8e1..d3d5f47d2 100644 --- a/tests/translator/input/function_with_deployment_preference.yaml +++ b/tests/translator/input/function_with_deployment_preference.yaml @@ -15,8 +15,6 @@ Conditions: Resources: MinimalFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler diff --git a/tests/translator/input/function_with_deployment_preference_alarms_intrinsic_if.yaml b/tests/translator/input/function_with_deployment_preference_alarms_intrinsic_if.yaml index e8e022b9b..f392f1062 100644 --- a/tests/translator/input/function_with_deployment_preference_alarms_intrinsic_if.yaml +++ b/tests/translator/input/function_with_deployment_preference_alarms_intrinsic_if.yaml @@ -6,8 +6,6 @@ Conditions: Resources: MinimalFunction: Type: "AWS::Serverless::Function" - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler diff --git a/tests/translator/input/function_with_deployment_preference_all_parameters.yaml b/tests/translator/input/function_with_deployment_preference_all_parameters.yaml index 05f42158a..cbbc80e5f 100644 --- a/tests/translator/input/function_with_deployment_preference_all_parameters.yaml +++ b/tests/translator/input/function_with_deployment_preference_all_parameters.yaml @@ -1,8 +1,6 @@ Resources: MinimalFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -25,8 +23,6 @@ Resources: MySanityTestFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Handler: hello.handler Runtime: python2.7 @@ -36,8 +32,6 @@ Resources: MyValidationTestFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Handler: hello.handler Runtime: python2.7 @@ -47,8 +41,6 @@ Resources: MyCloudWatchAlarm: Type: AWS::CloudWatch::Alarm - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: ComparisonOperator: GreaterThanThreshold EvaluationPeriods: 1 @@ -58,6 +50,4 @@ Resources: Threshold: 10 MySNSTopic: - Type: AWS::SNS::Topic - DeletionPolicy: Delete - UpdateReplacePolicy: Retain \ No newline at end of file + Type: AWS::SNS::Topic \ No newline at end of file diff --git a/tests/translator/input/function_with_deployment_preference_from_parameters.yaml b/tests/translator/input/function_with_deployment_preference_from_parameters.yaml index fcb0a6699..b77580f9b 100644 --- a/tests/translator/input/function_with_deployment_preference_from_parameters.yaml +++ b/tests/translator/input/function_with_deployment_preference_from_parameters.yaml @@ -12,8 +12,6 @@ Parameters: Resources: MinimalFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -36,8 +34,6 @@ Resources: MySanityTestFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Handler: hello.handler Runtime: python2.7 @@ -47,8 +43,6 @@ Resources: MyValidationTestFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Handler: hello.handler Runtime: python2.7 @@ -58,8 +52,6 @@ Resources: MyCloudWatchAlarm: Type: AWS::CloudWatch::Alarm - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: ComparisonOperator: GreaterThanThreshold EvaluationPeriods: 1 @@ -69,6 +61,4 @@ Resources: Threshold: 10 MySNSTopic: - Type: AWS::SNS::Topic - DeletionPolicy: Delete - UpdateReplacePolicy: Retain \ No newline at end of file + Type: AWS::SNS::Topic \ No newline at end of file diff --git a/tests/translator/input/function_with_deployment_preference_multiple_combinations.yaml b/tests/translator/input/function_with_deployment_preference_multiple_combinations.yaml index c4f8b7b44..9cc5703d8 100644 --- a/tests/translator/input/function_with_deployment_preference_multiple_combinations.yaml +++ b/tests/translator/input/function_with_deployment_preference_multiple_combinations.yaml @@ -1,8 +1,6 @@ Resources: MinimalFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -11,8 +9,6 @@ Resources: MinimalFunctionWithMinimalDeploymentPreference: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -23,8 +19,6 @@ Resources: MinimalFunctionWithDeploymentPreferenceWithHooksAndAlarms: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -40,8 +34,6 @@ Resources: MySanityTestFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Handler: hello.handler Runtime: python2.7 @@ -51,8 +43,6 @@ Resources: MyValidationTestFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Handler: hello.handler Runtime: python2.7 @@ -62,8 +52,6 @@ Resources: MyCloudWatchAlarm: Type: AWS::CloudWatch::Alarm - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: ComparisonOperator: GreaterThanThreshold EvaluationPeriods: 1 diff --git a/tests/translator/input/function_with_disabled_deployment_preference.yaml b/tests/translator/input/function_with_disabled_deployment_preference.yaml index a1f87ff26..26b7dc8e1 100644 --- a/tests/translator/input/function_with_disabled_deployment_preference.yaml +++ b/tests/translator/input/function_with_disabled_deployment_preference.yaml @@ -1,8 +1,6 @@ Resources: MinimalFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler diff --git a/tests/translator/input/function_with_dlq.yaml b/tests/translator/input/function_with_dlq.yaml index 7c33091da..217777345 100644 --- a/tests/translator/input/function_with_dlq.yaml +++ b/tests/translator/input/function_with_dlq.yaml @@ -2,8 +2,6 @@ Transform: "AWS::Serverless-2016-10-31" Resources: MySnsDlqLambdaFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Handler: index.handler Runtime: python2.7 @@ -14,8 +12,6 @@ Resources: MySqsDlqLambdaFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Handler: index.handler Runtime: python2.7 diff --git a/tests/translator/input/function_with_event_dest.yaml b/tests/translator/input/function_with_event_dest.yaml index 60173cdf3..23e1a7524 100644 --- a/tests/translator/input/function_with_event_dest.yaml +++ b/tests/translator/input/function_with_event_dest.yaml @@ -20,8 +20,6 @@ Conditions: Resources: MyTestFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: EventInvokeConfig: MaximumEventAgeInSeconds: 70 @@ -54,8 +52,6 @@ Resources: MemorySize: 1024 MyTestFunction2: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: EventInvokeConfig: MaximumEventAgeInSeconds: 70 @@ -89,8 +85,6 @@ Resources: DestinationLambda: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: InlineCode: | exports.handler = async (event) => { @@ -105,8 +99,6 @@ Resources: MemorySize: 1024 SNSSubscription: Type: AWS::SNS::Subscription - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Condition: TopicCreationEnabled Properties: Endpoint: example@example.com diff --git a/tests/translator/input/function_with_event_dest_basic.yaml b/tests/translator/input/function_with_event_dest_basic.yaml index 341965eb2..e26b32059 100644 --- a/tests/translator/input/function_with_event_dest_basic.yaml +++ b/tests/translator/input/function_with_event_dest_basic.yaml @@ -18,8 +18,6 @@ Globals: Resources: MyTestFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: InlineCode: | exports.handler = function(event, context, callback) { diff --git a/tests/translator/input/function_with_event_dest_conditional.yaml b/tests/translator/input/function_with_event_dest_conditional.yaml index 3d65cd1e7..45e1b69e1 100644 --- a/tests/translator/input/function_with_event_dest_conditional.yaml +++ b/tests/translator/input/function_with_event_dest_conditional.yaml @@ -15,8 +15,6 @@ Conditions: Resources: MyTestFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Condition: FunctionCondition Properties: EventInvokeConfig: @@ -50,8 +48,6 @@ Resources: MemorySize: 1024 DestinationLambda: Condition: FunctionInlineEnabled - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Type: AWS::Serverless::Function Properties: InlineCode: | diff --git a/tests/translator/input/function_with_event_source_mapping.yaml b/tests/translator/input/function_with_event_source_mapping.yaml index 336a44031..edea3e214 100644 --- a/tests/translator/input/function_with_event_source_mapping.yaml +++ b/tests/translator/input/function_with_event_source_mapping.yaml @@ -10,8 +10,6 @@ Parameters: Resources: MyFunctionForBatchingExample: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Handler: index.handler InlineCode: | @@ -64,21 +62,15 @@ Resources: KinesisStream: Type: AWS::Kinesis::Stream - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: ShardCount: 1 KinesisStream1: Type: AWS::Kinesis::Stream - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: ShardCount: 1 DynamoDBTable: Type: AWS::DynamoDB::Table - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: AttributeDefinitions: - AttributeName: id @@ -94,9 +86,5 @@ Resources: MySqsQueue: Type: AWS::SQS::Queue - DeletionPolicy: Delete - UpdateReplacePolicy: Retain MySnsTopic: - Type: AWS::SNS::Topic - DeletionPolicy: Delete - UpdateReplacePolicy: Retain \ No newline at end of file + Type: AWS::SNS::Topic \ No newline at end of file diff --git a/tests/translator/input/function_with_file_system_config.yaml b/tests/translator/input/function_with_file_system_config.yaml index f6a453aea..46864d092 100644 --- a/tests/translator/input/function_with_file_system_config.yaml +++ b/tests/translator/input/function_with_file_system_config.yaml @@ -15,13 +15,9 @@ Parameters: Resources: EfsFileSystem: Type: AWS::EFS::FileSystem - DeletionPolicy: Delete - UpdateReplacePolicy: Retain MountTarget: Type: AWS::EFS::MountTarget - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: FileSystemId: !Ref EfsFileSystem SubnetId: subnet-abc123 @@ -29,15 +25,11 @@ Resources: AccessPoint: Type: AWS::EFS::AccessPoint - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: FileSystemId: !Ref EfsFileSystem LambdaFunctionWithEfs: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: InlineCode: | const fs = require('fs') diff --git a/tests/translator/input/function_with_global_layers.yaml b/tests/translator/input/function_with_global_layers.yaml index 035662d66..2b4d6eb32 100644 --- a/tests/translator/input/function_with_global_layers.yaml +++ b/tests/translator/input/function_with_global_layers.yaml @@ -8,8 +8,6 @@ Globals: Resources: ManyLayersFunc: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler diff --git a/tests/translator/input/function_with_kmskeyarn.yaml b/tests/translator/input/function_with_kmskeyarn.yaml index 0229dcad7..4679b19a0 100644 --- a/tests/translator/input/function_with_kmskeyarn.yaml +++ b/tests/translator/input/function_with_kmskeyarn.yaml @@ -1,8 +1,6 @@ Resources: FunctionWithKeyArn: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -11,8 +9,6 @@ Resources: FunctionWithReferenceToKeyArn: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -22,8 +18,6 @@ Resources: myKey: Type: "AWS::KMS::Key" - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Description: "A sample key" KeyPolicy: diff --git a/tests/translator/input/function_with_layers.yaml b/tests/translator/input/function_with_layers.yaml index 78b2aa6e5..1e34324d0 100644 --- a/tests/translator/input/function_with_layers.yaml +++ b/tests/translator/input/function_with_layers.yaml @@ -1,8 +1,6 @@ Resources: MinimalLayerFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -12,8 +10,6 @@ Resources: FunctionNoLayerVersion: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -23,8 +19,6 @@ Resources: FunctionLayerWithSubIntrinsic: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -35,8 +29,6 @@ Resources: FunctionReferencesLayer: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -46,7 +38,5 @@ Resources: MyLayer: Type: 'AWS::Serverless::LayerVersion' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: ContentUri: s3://sam-demo-bucket/layer.zip diff --git a/tests/translator/input/function_with_many_layers.yaml b/tests/translator/input/function_with_many_layers.yaml index fda5c89e5..78ba2bc4a 100644 --- a/tests/translator/input/function_with_many_layers.yaml +++ b/tests/translator/input/function_with_many_layers.yaml @@ -1,8 +1,6 @@ Resources: ManyLayersFunc: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -16,7 +14,5 @@ Resources: MyLayer: Type: 'AWS::Serverless::LayerVersion' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: ContentUri: s3://sam-demo-bucket/layer.zip diff --git a/tests/translator/input/function_with_permissions_boundary.yaml b/tests/translator/input/function_with_permissions_boundary.yaml index 811fcd32e..5cad58b7f 100644 --- a/tests/translator/input/function_with_permissions_boundary.yaml +++ b/tests/translator/input/function_with_permissions_boundary.yaml @@ -1,8 +1,6 @@ Resources: MinimalFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler diff --git a/tests/translator/input/function_with_policy_templates.yaml b/tests/translator/input/function_with_policy_templates.yaml index 054fe9db2..34fd86683 100644 --- a/tests/translator/input/function_with_policy_templates.yaml +++ b/tests/translator/input/function_with_policy_templates.yaml @@ -6,8 +6,6 @@ Resources: OnePolicyTemplate: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -23,8 +21,6 @@ Resources: MultiplePolicyTemplates: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -37,8 +33,6 @@ Resources: AllCombinations: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler diff --git a/tests/translator/input/function_with_request_parameters.yaml b/tests/translator/input/function_with_request_parameters.yaml index 754d1d725..2875457c5 100644 --- a/tests/translator/input/function_with_request_parameters.yaml +++ b/tests/translator/input/function_with_request_parameters.yaml @@ -2,15 +2,11 @@ Resources: Api: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod ApiParameterFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -29,8 +25,6 @@ Resources: NoApiParameterFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml diff --git a/tests/translator/input/function_with_resource_refs.yaml b/tests/translator/input/function_with_resource_refs.yaml index de64caeb2..02732661c 100644 --- a/tests/translator/input/function_with_resource_refs.yaml +++ b/tests/translator/input/function_with_resource_refs.yaml @@ -7,8 +7,6 @@ Resources: MinimalFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -17,8 +15,6 @@ Resources: FunctionWithoutAlias: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -26,8 +22,6 @@ Resources: MyBucket: Type: AWS::S3::Bucket - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Name: Fn::GetAtt: ["MinimalFunction.Alias", "Name"] diff --git a/tests/translator/input/function_with_signing_profile.yaml b/tests/translator/input/function_with_signing_profile.yaml index 6b83178dd..09a032367 100644 --- a/tests/translator/input/function_with_signing_profile.yaml +++ b/tests/translator/input/function_with_signing_profile.yaml @@ -2,8 +2,6 @@ Resources: FunctionWithSigningProfile: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -12,8 +10,6 @@ Resources: MySignedFunctionCodeSigningConfig: Type: AWS::Lambda::CodeSigningConfig - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Description: "Code Signing for MySignedLambdaFunction" AllowedPublishers: @@ -24,7 +20,5 @@ Resources: SigningProfile: Type: AWS::Signer::SigningProfile - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: PlatformId: AWSLambda-SHA384-ECDSA \ No newline at end of file diff --git a/tests/translator/input/function_with_sns_event_source_all_parameters.yaml b/tests/translator/input/function_with_sns_event_source_all_parameters.yaml index d35e9a079..65711e733 100644 --- a/tests/translator/input/function_with_sns_event_source_all_parameters.yaml +++ b/tests/translator/input/function_with_sns_event_source_all_parameters.yaml @@ -1,8 +1,6 @@ Resources: MyAwesomeFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler diff --git a/tests/translator/input/global_handle_path_level_parameter.yaml b/tests/translator/input/global_handle_path_level_parameter.yaml index aff2212e4..0b8e642f1 100644 --- a/tests/translator/input/global_handle_path_level_parameter.yaml +++ b/tests/translator/input/global_handle_path_level_parameter.yaml @@ -14,8 +14,6 @@ Globals: Resources: ImplicitApiFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -29,8 +27,6 @@ Resources: ExplicitApi: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: SomeStage DefinitionBody: @@ -55,8 +51,6 @@ Resources: MyUserPool: Type: AWS::Cognito::UserPool - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: UserPoolName: UserPoolName Policies: diff --git a/tests/translator/input/globals_for_api.yaml b/tests/translator/input/globals_for_api.yaml index 3c02882f9..e68eddfcf 100644 --- a/tests/translator/input/globals_for_api.yaml +++ b/tests/translator/input/globals_for_api.yaml @@ -15,8 +15,6 @@ Globals: Resources: ImplicitApiFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.gethtml @@ -30,8 +28,6 @@ Resources: ExplicitApi: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: SomeStage DefinitionBody: @@ -50,8 +46,6 @@ Resources: MyUserPool: Type: AWS::Cognito::UserPool - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: UserPoolName: UserPoolName Policies: diff --git a/tests/translator/input/globals_for_function.yaml b/tests/translator/input/globals_for_function.yaml index 6836c46f9..d16829df4 100644 --- a/tests/translator/input/globals_for_function.yaml +++ b/tests/translator/input/globals_for_function.yaml @@ -26,13 +26,9 @@ Globals: Resources: MinimalFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain FunctionWithOverrides: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: index.handler diff --git a/tests/translator/input/globals_for_simpletable.yaml b/tests/translator/input/globals_for_simpletable.yaml index 49b583a17..6a03a75ed 100644 --- a/tests/translator/input/globals_for_simpletable.yaml +++ b/tests/translator/input/globals_for_simpletable.yaml @@ -5,6 +5,4 @@ Globals: Resources: MinimalTable: - Type: AWS::Serverless::SimpleTable - DeletionPolicy: Delete - UpdateReplacePolicy: Retain \ No newline at end of file + Type: AWS::Serverless::SimpleTable \ No newline at end of file diff --git a/tests/translator/input/http_api_def_uri.yaml b/tests/translator/input/http_api_def_uri.yaml index e0332d9ee..0182af394 100644 --- a/tests/translator/input/http_api_def_uri.yaml +++ b/tests/translator/input/http_api_def_uri.yaml @@ -6,8 +6,6 @@ Globals: Resources: MyApi: Type: AWS::Serverless::HttpApi - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: DefinitionUri: s3://bucket/key StageName: !Join ["", ["Stage", "Name"]] @@ -16,8 +14,6 @@ Resources: MyApi2: Type: AWS::Serverless::HttpApi - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: DefinitionUri: Bucket: bucket @@ -26,8 +22,6 @@ Resources: Function: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Runtime: python3.7 Handler: index.handler diff --git a/tests/translator/input/http_api_description.yaml b/tests/translator/input/http_api_description.yaml index 780ff5c2f..268584d89 100644 --- a/tests/translator/input/http_api_description.yaml +++ b/tests/translator/input/http_api_description.yaml @@ -1,8 +1,6 @@ Resources: HttpApi: Type: AWS::Serverless::HttpApi - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: DefinitionBody: openapi: "3.0.1" @@ -12,8 +10,6 @@ Resources: Function: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Runtime: python3.7 Handler: index.handler diff --git a/tests/translator/input/http_api_existing_openapi.yaml b/tests/translator/input/http_api_existing_openapi.yaml index 956d8d2c7..891d9199e 100644 --- a/tests/translator/input/http_api_existing_openapi.yaml +++ b/tests/translator/input/http_api_existing_openapi.yaml @@ -17,8 +17,6 @@ Globals: Resources: HttpApiFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/todo_list.zip Handler: index.restapi @@ -46,8 +44,6 @@ Resources: Method: GET MyApi: Type: AWS::Serverless::HttpApi - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CorsConfiguration: AllowOrigins: diff --git a/tests/translator/input/http_api_existing_openapi_conditions.yaml b/tests/translator/input/http_api_existing_openapi_conditions.yaml index d48eed442..6b9c91c5f 100644 --- a/tests/translator/input/http_api_existing_openapi_conditions.yaml +++ b/tests/translator/input/http_api_existing_openapi_conditions.yaml @@ -7,8 +7,6 @@ Resources: HttpApiFunction: Condition: condition Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/todo_list.zip Handler: index.restapi @@ -37,8 +35,6 @@ Resources: ApiId: !Ref MyApi MyApi: Type: AWS::Serverless::HttpApi - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Tags: Tag1: value1 diff --git a/tests/translator/input/http_api_explicit_stage.yaml b/tests/translator/input/http_api_explicit_stage.yaml index ba78ec424..576ab3a6a 100644 --- a/tests/translator/input/http_api_explicit_stage.yaml +++ b/tests/translator/input/http_api_explicit_stage.yaml @@ -16,8 +16,6 @@ Globals: Resources: HttpApiFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/todo_list.zip Handler: index.restapi @@ -34,8 +32,6 @@ Resources: MyApi: Type: AWS::Serverless::HttpApi - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod StageVariables: diff --git a/tests/translator/input/http_api_lambda_auth.yaml b/tests/translator/input/http_api_lambda_auth.yaml index d217cd941..04bd02d60 100644 --- a/tests/translator/input/http_api_lambda_auth.yaml +++ b/tests/translator/input/http_api_lambda_auth.yaml @@ -1,8 +1,6 @@ Resources: HttpApiFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/todo_list.zip Handler: index.restapi @@ -28,8 +26,6 @@ Resources: MyAuthFn: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler @@ -37,8 +33,6 @@ Resources: MyApi: Type: AWS::Serverless::HttpApi - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Tags: Tag1: value1 diff --git a/tests/translator/input/http_api_lambda_auth_full.yaml b/tests/translator/input/http_api_lambda_auth_full.yaml index 0844b32d8..5a5b976fa 100644 --- a/tests/translator/input/http_api_lambda_auth_full.yaml +++ b/tests/translator/input/http_api_lambda_auth_full.yaml @@ -1,8 +1,6 @@ Resources: HttpApiFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/todo_list.zip Handler: index.restapi @@ -28,8 +26,6 @@ Resources: MyAuthFn: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: index.handler @@ -37,8 +33,6 @@ Resources: MyApi: Type: AWS::Serverless::HttpApi - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Tags: Tag1: value1 diff --git a/tests/translator/input/http_api_with_cors.yaml b/tests/translator/input/http_api_with_cors.yaml index 87036a682..0c0ebee49 100644 --- a/tests/translator/input/http_api_with_cors.yaml +++ b/tests/translator/input/http_api_with_cors.yaml @@ -22,8 +22,6 @@ Globals: Resources: HttpApiFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: InlineCode: | exports.handler = async (event) => { @@ -46,8 +44,6 @@ Resources: MyApi: Type: AWS::Serverless::HttpApi - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: DefinitionBody: info: diff --git a/tests/translator/input/implicit_and_explicit_api_with_conditions.yaml b/tests/translator/input/implicit_and_explicit_api_with_conditions.yaml index 661f78c9c..aaae92b6a 100644 --- a/tests/translator/input/implicit_and_explicit_api_with_conditions.yaml +++ b/tests/translator/input/implicit_and_explicit_api_with_conditions.yaml @@ -22,8 +22,6 @@ Conditions: Resources: implicithello1: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Condition: implicithello1condition Properties: Handler: index.handler @@ -40,8 +38,6 @@ Resources: Method: get implicithello2: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Condition: implicithello2condition Properties: Handler: index.handler @@ -59,14 +55,10 @@ Resources: explicitapi: Type: 'AWS::Serverless::Api' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod explicithello1: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Condition: explicithello1condition Properties: Handler: index.handler @@ -84,8 +76,6 @@ Resources: Method: get explicithello2: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Condition: explicithello2condition Properties: Handler: index.handler diff --git a/tests/translator/input/implicit_api.yaml b/tests/translator/input/implicit_api.yaml index 55fd7a9d1..bb4e5a287 100644 --- a/tests/translator/input/implicit_api.yaml +++ b/tests/translator/input/implicit_api.yaml @@ -1,8 +1,6 @@ Resources: RestApiFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/todo_list.zip Handler: index.restapi @@ -27,8 +25,6 @@ Resources: GetHtmlFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/todo_list.zip Handler: index.gethtml diff --git a/tests/translator/input/implicit_api_with_auth_and_conditions_max.yaml b/tests/translator/input/implicit_api_with_auth_and_conditions_max.yaml index cd9783ec7..e32f9206e 100644 --- a/tests/translator/input/implicit_api_with_auth_and_conditions_max.yaml +++ b/tests/translator/input/implicit_api_with_auth_and_conditions_max.yaml @@ -76,8 +76,6 @@ Conditions: Resources: MyFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Condition: FunctionCondition Properties: CodeUri: s3://sam-demo-bucket/thumbnails.zip @@ -93,8 +91,6 @@ Resources: Authorizer: NONE MyFunction2: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Condition: FunctionCondition2 Properties: CodeUri: s3://sam-demo-bucket/thumbnails.zip @@ -110,8 +106,6 @@ Resources: Authorizer: MyCognitoAuthMultipleUserPools MyFunction3: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Condition: FunctionCondition3 Properties: CodeUri: s3://sam-demo-bucket/thumbnails.zip @@ -127,8 +121,6 @@ Resources: Authorizer: MyLambdaTokenAuth MyFunction4: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Condition: FunctionCondition4 Properties: CodeUri: s3://sam-demo-bucket/thumbnails.zip @@ -144,8 +136,6 @@ Resources: Authorizer: MyLambdaTokenAuthNoneFunctionInvokeRole MyFunction5: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Condition: FunctionCondition5 Properties: CodeUri: s3://sam-demo-bucket/thumbnails.zip @@ -161,8 +151,6 @@ Resources: Authorizer: MyLambdaRequestAuth MyFunction6: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Condition: FunctionCondition6 Properties: CodeUri: s3://sam-demo-bucket/thumbnails.zip diff --git a/tests/translator/input/implicit_api_with_many_conditions.yaml b/tests/translator/input/implicit_api_with_many_conditions.yaml index 347c059fe..4c0b926cb 100644 --- a/tests/translator/input/implicit_api_with_many_conditions.yaml +++ b/tests/translator/input/implicit_api_with_many_conditions.yaml @@ -50,8 +50,6 @@ Conditions: Resources: hello: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Condition: MyCondition Properties: Handler: index.handler @@ -68,8 +66,6 @@ Resources: Method: get helloworld: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Condition: Cond Properties: Handler: index.handler @@ -86,8 +82,6 @@ Resources: Method: post helloworld1: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Condition: Cond1 Properties: Handler: index.handler @@ -104,8 +98,6 @@ Resources: Method: post helloworld2: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Condition: Cond2 Properties: Handler: index.handler @@ -122,8 +114,6 @@ Resources: Method: post helloworld3: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Condition: Cond3 Properties: Handler: index.handler @@ -140,8 +130,6 @@ Resources: Method: post helloworld4: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Condition: Cond4 Properties: Handler: index.handler @@ -158,8 +146,6 @@ Resources: Method: post helloworld5: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Condition: Cond5 Properties: Handler: index.handler @@ -176,8 +162,6 @@ Resources: Method: post helloworld6: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Condition: Cond6 Properties: Handler: index.handler @@ -194,8 +178,6 @@ Resources: Method: post helloworld7: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Condition: Cond7 Properties: Handler: index.handler @@ -212,8 +194,6 @@ Resources: Method: post helloworld8: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Condition: Cond8 Properties: Handler: index.handler @@ -230,8 +210,6 @@ Resources: Method: post helloworld9: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Condition: Cond9 Properties: Handler: index.handler diff --git a/tests/translator/input/implicit_api_with_serverless_rest_api_resource.yaml b/tests/translator/input/implicit_api_with_serverless_rest_api_resource.yaml index 4f4946854..1b6497808 100644 --- a/tests/translator/input/implicit_api_with_serverless_rest_api_resource.yaml +++ b/tests/translator/input/implicit_api_with_serverless_rest_api_resource.yaml @@ -1,8 +1,6 @@ Resources: RestApiFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/todo_list.zip Handler: index.restapi @@ -27,8 +25,6 @@ Resources: GetHtmlFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/todo_list.zip Handler: index.gethtml @@ -43,8 +39,6 @@ Resources: ServerlessRestApi: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler diff --git a/tests/translator/input/implicit_http_api.yaml b/tests/translator/input/implicit_http_api.yaml index eaea54691..ee141d7d5 100644 --- a/tests/translator/input/implicit_http_api.yaml +++ b/tests/translator/input/implicit_http_api.yaml @@ -1,8 +1,6 @@ Resources: HttpApiFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/todo_list.zip Handler: index.restapi @@ -19,8 +17,6 @@ Resources: HttpApiFunction2: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/todo_list.zip Handler: index.restapi diff --git a/tests/translator/input/implicit_http_api_auth_and_simple_case.yaml b/tests/translator/input/implicit_http_api_auth_and_simple_case.yaml index e932297c5..944e7c840 100644 --- a/tests/translator/input/implicit_http_api_auth_and_simple_case.yaml +++ b/tests/translator/input/implicit_http_api_auth_and_simple_case.yaml @@ -1,8 +1,6 @@ Resources: RestApiFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/todo_list.zip Handler: index.restapi diff --git a/tests/translator/input/implicit_http_api_with_many_conditions.yaml b/tests/translator/input/implicit_http_api_with_many_conditions.yaml index 4aab32adb..47dad4bd6 100644 --- a/tests/translator/input/implicit_http_api_with_many_conditions.yaml +++ b/tests/translator/input/implicit_http_api_with_many_conditions.yaml @@ -64,8 +64,6 @@ Globals: Resources: hello: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Condition: MyCondition Properties: Handler: index.handler @@ -84,8 +82,6 @@ Resources: Method: get helloworld1099: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Condition: Cond Properties: Handler: index.handler @@ -109,8 +105,6 @@ Resources: Method: get helloworld1: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Condition: Cond1 Properties: Handler: index.handler @@ -127,8 +121,6 @@ Resources: Method: post helloworld2: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Condition: Cond2 Properties: Handler: index.handler @@ -145,8 +137,6 @@ Resources: Method: post helloworld3: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Condition: Cond3 Properties: Handler: index.handler @@ -163,8 +153,6 @@ Resources: Method: post helloworld4: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Condition: Cond4 Properties: Handler: index.handler @@ -181,8 +169,6 @@ Resources: Method: post helloworld5: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Condition: Cond5 Properties: Handler: index.handler @@ -199,8 +185,6 @@ Resources: Method: post helloworld6: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Condition: Cond6 Properties: Handler: index.handler @@ -217,8 +201,6 @@ Resources: Method: post helloworld7: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Condition: Cond7 Properties: Handler: index.handler @@ -235,8 +217,6 @@ Resources: Method: post helloworld8: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Condition: Cond8 Properties: Handler: index.handler @@ -253,8 +233,6 @@ Resources: Method: post helloworld9: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Condition: Cond9 Properties: Handler: index.handler diff --git a/tests/translator/input/inline_precedence.yaml b/tests/translator/input/inline_precedence.yaml index 103074754..04812fb29 100644 --- a/tests/translator/input/inline_precedence.yaml +++ b/tests/translator/input/inline_precedence.yaml @@ -1,8 +1,6 @@ Resources: HelloWorldFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: InlineCode: | "def lambda_handler(): diff --git a/tests/translator/input/intrinsic_functions.yaml b/tests/translator/input/intrinsic_functions.yaml index deeccd19f..723cb273b 100644 --- a/tests/translator/input/intrinsic_functions.yaml +++ b/tests/translator/input/intrinsic_functions.yaml @@ -26,8 +26,6 @@ Conditions: Resources: MyFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: FunctionName: Fn::Sub: ${FunctionName} @@ -62,8 +60,6 @@ Resources: MyExplicitApi: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Name: Ref: MyExplicitApiName @@ -77,8 +73,6 @@ Resources: FunctionWithExplicitS3Uri: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Handler: stream.ddb_handler Runtime: python2.7 @@ -89,8 +83,6 @@ Resources: ApiWithExplicitS3Uri: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Condition: TrueCondition Properties: StageName: dev @@ -101,8 +93,6 @@ Resources: DynamoDBFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/streams.zip Handler: stream.ddb_handler @@ -118,8 +108,6 @@ Resources: MyTable: Type: AWS::DynamoDB::Table - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: AttributeDefinitions: @@ -137,8 +125,6 @@ Resources: MySqsDlqLambdaFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Handler: index.handler Runtime: python2.7 @@ -152,13 +138,9 @@ Resources: SqsDlqQueue: Type: AWS::SQS::Queue - DeletionPolicy: Delete - UpdateReplacePolicy: Retain MySnsDlqLambdaFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Handler: index.handler Runtime: python2.7 @@ -170,13 +152,9 @@ Resources: SnsDlqQueue: Type: AWS::SNS::Topic - DeletionPolicy: Delete - UpdateReplacePolicy: Retain MyNewRole: Type: AWS::IAM::Role - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: AssumeRolePolicyDocument: Statement: diff --git a/tests/translator/input/iot_rule.yaml b/tests/translator/input/iot_rule.yaml index d21754f0d..b6c1f9846 100644 --- a/tests/translator/input/iot_rule.yaml +++ b/tests/translator/input/iot_rule.yaml @@ -6,8 +6,6 @@ Parameters: {} Resources: IoTRuleFunc: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Description: Created by SAM diff --git a/tests/translator/input/layers_all_properties.yaml b/tests/translator/input/layers_all_properties.yaml index 444194a3e..03fef5dbc 100644 --- a/tests/translator/input/layers_all_properties.yaml +++ b/tests/translator/input/layers_all_properties.yaml @@ -6,24 +6,18 @@ Parameters: Resources: MyLayer: Type: 'AWS::Serverless::LayerVersion' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: ContentUri: s3://bucket/key RetentionPolicy: !Ref LayerDeleteParam MyLayerWithAName: Type: 'AWS::Serverless::LayerVersion' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: ContentUri: s3://bucket/key LayerName: DifferentLayerName MyFunction: Type: "AWS::Serverless::Function" - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://bucket/key Handler: app.handler diff --git a/tests/translator/input/layers_with_intrinsics.yaml b/tests/translator/input/layers_with_intrinsics.yaml index 36d0249fe..21afcde88 100644 --- a/tests/translator/input/layers_with_intrinsics.yaml +++ b/tests/translator/input/layers_with_intrinsics.yaml @@ -14,16 +14,12 @@ Parameters: Resources: LayerWithLicenseIntrinsic: Type: 'AWS::Serverless::LayerVersion' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: ContentUri: s3://sam-demo-bucket/layer.zip LicenseInfo: !Ref LayerLicenseInfo LayerWithRuntimesIntrinsic: Type: 'AWS::Serverless::LayerVersion' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: ContentUri: s3://sam-demo-bucket/layer.zip CompatibleRuntimes: @@ -31,8 +27,6 @@ Resources: LayerWithSingleListRefRuntimesIntrinsic: Type: 'AWS::Serverless::LayerVersion' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: ContentUri: s3://sam-demo-bucket/layer.zip CompatibleRuntimes: @@ -40,8 +34,6 @@ Resources: LayerWithMixedListRefRuntimesIntrinsic: Type: 'AWS::Serverless::LayerVersion' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: ContentUri: s3://sam-demo-bucket/layer.zip CompatibleRuntimes: @@ -50,32 +42,24 @@ Resources: LayerWithNameIntrinsic: Type: AWS::Serverless::LayerVersion - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: ContentUri: s3://sam-demo-bucket/layer.zip LayerName: !Ref LayerNameParam LayerWithSubNameIntrinsic: Type: AWS::Serverless::LayerVersion - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: ContentUri: s3://sam-demo-bucket/layer.zip LayerName: !Sub layer-${LayerNameParam} LayerWithRefNameIntrinsicRegion: Type: AWS::Serverless::LayerVersion - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: ContentUri: s3://sam-demo-bucket/layer.zip LayerName: !Ref 'AWS::Region' LayerWithSubNameIntrinsicRegion: Type: AWS::Serverless::LayerVersion - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: ContentUri: s3://sam-demo-bucket/layer.zip LayerName: !Sub 'layer-${AWS::Region}' diff --git a/tests/translator/input/no_implicit_api_with_serverless_rest_api_resource.yaml b/tests/translator/input/no_implicit_api_with_serverless_rest_api_resource.yaml index 58ea6e6a5..84e478a3b 100644 --- a/tests/translator/input/no_implicit_api_with_serverless_rest_api_resource.yaml +++ b/tests/translator/input/no_implicit_api_with_serverless_rest_api_resource.yaml @@ -1,8 +1,6 @@ Resources: ThumbnailFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/thumbnails.zip Handler: index.generate_thumbails @@ -17,8 +15,6 @@ Resources: ServerlessRestApi: Type: AWS::ApiGateway::RestApi - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Body: info: @@ -62,13 +58,9 @@ Resources: Images: Type: AWS::S3::Bucket - DeletionPolicy: Delete - UpdateReplacePolicy: Retain RestApiFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -76,8 +68,6 @@ Resources: GetHtmlFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler diff --git a/tests/translator/input/s3.yaml b/tests/translator/input/s3.yaml index d410701b0..69e100da5 100644 --- a/tests/translator/input/s3.yaml +++ b/tests/translator/input/s3.yaml @@ -1,8 +1,6 @@ Resources: ThumbnailFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/thumbnails.zip Handler: index.generate_thumbails @@ -17,5 +15,3 @@ Resources: Images: Type: AWS::S3::Bucket - DeletionPolicy: Delete - UpdateReplacePolicy: Retain diff --git a/tests/translator/input/s3_create_remove.yaml b/tests/translator/input/s3_create_remove.yaml index ae64d07e2..f14cf2a4f 100644 --- a/tests/translator/input/s3_create_remove.yaml +++ b/tests/translator/input/s3_create_remove.yaml @@ -1,8 +1,6 @@ Resources: ThumbnailFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/thumbnails.zip Handler: index.generate_thumbails @@ -19,8 +17,6 @@ Resources: Images: Type: AWS::S3::Bucket - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: BucketName: "BucketNameParameter" BucketEncryption: diff --git a/tests/translator/input/s3_existing_lambda_notification_configuration.yaml b/tests/translator/input/s3_existing_lambda_notification_configuration.yaml index 90997c26d..045381426 100644 --- a/tests/translator/input/s3_existing_lambda_notification_configuration.yaml +++ b/tests/translator/input/s3_existing_lambda_notification_configuration.yaml @@ -1,8 +1,6 @@ Resources: ThumbnailFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/thumbnails.zip Handler: index.generate_thumbails @@ -17,8 +15,6 @@ Resources: Images: Type: AWS::S3::Bucket - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: NotificationConfiguration: LambdaConfigurations: diff --git a/tests/translator/input/s3_existing_other_notification_configuration.yaml b/tests/translator/input/s3_existing_other_notification_configuration.yaml index 191995b90..a4bd945a6 100644 --- a/tests/translator/input/s3_existing_other_notification_configuration.yaml +++ b/tests/translator/input/s3_existing_other_notification_configuration.yaml @@ -1,8 +1,6 @@ Resources: ThumbnailFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/thumbnails.zip Handler: index.generate_thumbails @@ -17,8 +15,6 @@ Resources: Images: Type: AWS::S3::Bucket - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: NotificationConfiguration: TopicConfigurations: diff --git a/tests/translator/input/s3_filter.yaml b/tests/translator/input/s3_filter.yaml index d622b7c28..0f6acefd5 100644 --- a/tests/translator/input/s3_filter.yaml +++ b/tests/translator/input/s3_filter.yaml @@ -1,8 +1,6 @@ Resources: ThumbnailFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/thumbnails.zip Handler: index.generate_thumbails @@ -22,5 +20,3 @@ Resources: Images: Type: AWS::S3::Bucket - DeletionPolicy: Delete - UpdateReplacePolicy: Retain diff --git a/tests/translator/input/s3_multiple_events_same_bucket.yaml b/tests/translator/input/s3_multiple_events_same_bucket.yaml index 9daf49386..63c396d62 100644 --- a/tests/translator/input/s3_multiple_events_same_bucket.yaml +++ b/tests/translator/input/s3_multiple_events_same_bucket.yaml @@ -1,8 +1,6 @@ Resources: ThumbnailFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/thumbnails.zip Handler: index.generate_thumbails @@ -28,5 +26,3 @@ Resources: Images: Type: AWS::S3::Bucket - DeletionPolicy: Delete - UpdateReplacePolicy: Retain diff --git a/tests/translator/input/s3_multiple_functions.yaml b/tests/translator/input/s3_multiple_functions.yaml index 8cb79c5d0..75c356975 100644 --- a/tests/translator/input/s3_multiple_functions.yaml +++ b/tests/translator/input/s3_multiple_functions.yaml @@ -1,8 +1,6 @@ Resources: FunctionOne: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/thumbnails.zip Handler: index.generate_thumbails @@ -17,8 +15,6 @@ Resources: FunctionTwo: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/thumbnails.zip Handler: index.generate_thumbails @@ -33,8 +29,6 @@ Resources: Images: Type: AWS::S3::Bucket - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: PublicAccessBlockConfiguration: BlockPublicAcls: true diff --git a/tests/translator/input/s3_with_condition.yaml b/tests/translator/input/s3_with_condition.yaml index d1ce4089a..c15f4dff8 100644 --- a/tests/translator/input/s3_with_condition.yaml +++ b/tests/translator/input/s3_with_condition.yaml @@ -6,8 +6,6 @@ Conditions: Resources: ThumbnailFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Condition: MyCondition Properties: CodeUri: s3://sam-demo-bucket/thumbnails.zip @@ -23,5 +21,3 @@ Resources: Images: Type: AWS::S3::Bucket - DeletionPolicy: Delete - UpdateReplacePolicy: Retain diff --git a/tests/translator/input/s3_with_dependsOn.yaml b/tests/translator/input/s3_with_dependsOn.yaml index e2b3f6bc6..6d41122b4 100644 --- a/tests/translator/input/s3_with_dependsOn.yaml +++ b/tests/translator/input/s3_with_dependsOn.yaml @@ -1,13 +1,9 @@ Resources: Topic: Type: AWS::SNS::Topic - DeletionPolicy: Delete - UpdateReplacePolicy: Retain ThumbnailFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/thumbnails.zip Handler: index.generate_thumbails @@ -22,6 +18,4 @@ Resources: Images: Type: AWS::S3::Bucket - DeletionPolicy: Delete - UpdateReplacePolicy: Retain DependsOn: Topic diff --git a/tests/translator/input/simple_table_ref_parameter_intrinsic.yaml b/tests/translator/input/simple_table_ref_parameter_intrinsic.yaml index bb9b18001..55fcfdec8 100644 --- a/tests/translator/input/simple_table_ref_parameter_intrinsic.yaml +++ b/tests/translator/input/simple_table_ref_parameter_intrinsic.yaml @@ -11,8 +11,6 @@ Parameters: Resources: MinimalTableRefParamLongForm: Type: 'AWS::Serverless::SimpleTable' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: ProvisionedThroughput: ReadCapacityUnits: diff --git a/tests/translator/input/simple_table_with_extra_tags.yaml b/tests/translator/input/simple_table_with_extra_tags.yaml index 547ae7fcf..d8daa60c0 100644 --- a/tests/translator/input/simple_table_with_extra_tags.yaml +++ b/tests/translator/input/simple_table_with_extra_tags.yaml @@ -6,8 +6,6 @@ Parameters: Resources: MinimalTableWithTags: Type: 'AWS::Serverless::SimpleTable' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Tags: TagKey1: TagValue1 diff --git a/tests/translator/input/simple_table_with_table_name.yaml b/tests/translator/input/simple_table_with_table_name.yaml index 5db127ab5..8055c0d70 100644 --- a/tests/translator/input/simple_table_with_table_name.yaml +++ b/tests/translator/input/simple_table_with_table_name.yaml @@ -6,23 +6,17 @@ Parameters: Resources: MinimalTableWithTableName: Type: 'AWS::Serverless::SimpleTable' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: TableName: MySimpleTable MinimalTableWithRefTableName: Type: 'AWS::Serverless::SimpleTable' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: TableName: Ref: MySimpleTableParameter MinimalTableWithSubTableName: Type: 'AWS::Serverless::SimpleTable' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: TableName: Fn::Sub: "${AWS::StackName}MySimpleTable" \ No newline at end of file diff --git a/tests/translator/input/simpletable.yaml b/tests/translator/input/simpletable.yaml index 607530571..cfa0b3913 100644 --- a/tests/translator/input/simpletable.yaml +++ b/tests/translator/input/simpletable.yaml @@ -1,12 +1,8 @@ Resources: MinimalTable: Type: 'AWS::Serverless::SimpleTable' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain CompleteTable: Type: 'AWS::Serverless::SimpleTable' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: PrimaryKey: Name: member-number diff --git a/tests/translator/input/simpletable_with_sse.yaml b/tests/translator/input/simpletable_with_sse.yaml index 6421fe244..b9c6560e8 100644 --- a/tests/translator/input/simpletable_with_sse.yaml +++ b/tests/translator/input/simpletable_with_sse.yaml @@ -1,8 +1,6 @@ Resources: TableWithSSE: Type: 'AWS::Serverless::SimpleTable' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: SSESpecification: SSEEnabled: true \ No newline at end of file diff --git a/tests/translator/input/sns.yaml b/tests/translator/input/sns.yaml index dfa542075..510e60786 100644 --- a/tests/translator/input/sns.yaml +++ b/tests/translator/input/sns.yaml @@ -1,8 +1,6 @@ Resources: SaveNotificationFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/notifications.zip Handler: index.save_notification @@ -16,5 +14,3 @@ Resources: Notifications: Type: AWS::SNS::Topic - DeletionPolicy: Delete - UpdateReplacePolicy: Retain diff --git a/tests/translator/input/sns_existing_other_subscription.yaml b/tests/translator/input/sns_existing_other_subscription.yaml index 1ae338b08..0555028eb 100644 --- a/tests/translator/input/sns_existing_other_subscription.yaml +++ b/tests/translator/input/sns_existing_other_subscription.yaml @@ -1,8 +1,6 @@ Resources: SaveNotificationFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/notifications.zip Handler: index.save_notification @@ -16,8 +14,6 @@ Resources: Notifications: Type: AWS::SNS::Topic - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Subscription: - Endpoint: my-queue-arn diff --git a/tests/translator/input/sns_existing_sqs.yaml b/tests/translator/input/sns_existing_sqs.yaml index a5b86b061..bbd2c77f2 100644 --- a/tests/translator/input/sns_existing_sqs.yaml +++ b/tests/translator/input/sns_existing_sqs.yaml @@ -1,8 +1,6 @@ Resources: SaveNotificationFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/notifications.zip Handler: index.save_notification @@ -28,10 +26,6 @@ Resources: Notifications: Type: AWS::SNS::Topic - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Queue: - Type: AWS::SQS::Queue - DeletionPolicy: Delete - UpdateReplacePolicy: Retain \ No newline at end of file + Type: AWS::SQS::Queue \ No newline at end of file diff --git a/tests/translator/input/sns_outside_sqs.yaml b/tests/translator/input/sns_outside_sqs.yaml index 0a353ee6d..08436c1ae 100644 --- a/tests/translator/input/sns_outside_sqs.yaml +++ b/tests/translator/input/sns_outside_sqs.yaml @@ -1,8 +1,6 @@ Resources: SaveNotificationFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/notifications.zip Handler: index.save_notification @@ -28,5 +26,3 @@ Resources: Notifications: Type: AWS::SNS::Topic - DeletionPolicy: Delete - UpdateReplacePolicy: Retain diff --git a/tests/translator/input/sns_sqs.yaml b/tests/translator/input/sns_sqs.yaml index ebe43d858..dad81363e 100644 --- a/tests/translator/input/sns_sqs.yaml +++ b/tests/translator/input/sns_sqs.yaml @@ -1,8 +1,6 @@ Resources: SaveNotificationFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/notifications.zip Handler: index.save_notification @@ -23,5 +21,3 @@ Resources: Notifications: Type: AWS::SNS::Topic - DeletionPolicy: Delete - UpdateReplacePolicy: Retain diff --git a/tests/translator/input/sns_topic_outside_template.yaml b/tests/translator/input/sns_topic_outside_template.yaml index 8611a2fbc..539a2357f 100644 --- a/tests/translator/input/sns_topic_outside_template.yaml +++ b/tests/translator/input/sns_topic_outside_template.yaml @@ -4,8 +4,6 @@ Parameters: Resources: SaveNotificationFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/notifications.zip Handler: index.save_notification diff --git a/tests/translator/input/sqs.yaml b/tests/translator/input/sqs.yaml index 1c8653dae..9d45de0a8 100644 --- a/tests/translator/input/sqs.yaml +++ b/tests/translator/input/sqs.yaml @@ -1,8 +1,6 @@ Resources: SQSFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/queues.zip Handler: queue.sqs_handler diff --git a/tests/translator/input/state_machine_with_api_auth_default_scopes.yaml b/tests/translator/input/state_machine_with_api_auth_default_scopes.yaml index 74c83add4..87cd87030 100644 --- a/tests/translator/input/state_machine_with_api_auth_default_scopes.yaml +++ b/tests/translator/input/state_machine_with_api_auth_default_scopes.yaml @@ -1,8 +1,6 @@ Resources: MyApiWithCognitoAuth: Type: "AWS::Serverless::Api" - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod OpenApiVersion: "3.0.1" @@ -22,8 +20,6 @@ Resources: MyStateMachine: Type: AWS::Serverless::StateMachine - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Name: MyStateMachine Definition: diff --git a/tests/translator/input/state_machine_with_api_authorizer.yaml b/tests/translator/input/state_machine_with_api_authorizer.yaml index ecc0bcffd..1940b0ed0 100644 --- a/tests/translator/input/state_machine_with_api_authorizer.yaml +++ b/tests/translator/input/state_machine_with_api_authorizer.yaml @@ -1,8 +1,6 @@ Resources: MyApi: Type: "AWS::Serverless::Api" - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -20,8 +18,6 @@ Resources: StateMachine: Type: AWS::Serverless::StateMachine - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Name: MyStateMachine Type: STANDARD diff --git a/tests/translator/input/state_machine_with_api_authorizer_maximum.yaml b/tests/translator/input/state_machine_with_api_authorizer_maximum.yaml index 01862a49e..31b235666 100644 --- a/tests/translator/input/state_machine_with_api_authorizer_maximum.yaml +++ b/tests/translator/input/state_machine_with_api_authorizer_maximum.yaml @@ -1,8 +1,6 @@ Resources: MyApi: Type: "AWS::Serverless::Api" - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod Auth: @@ -55,8 +53,6 @@ Resources: StateMachine: Type: AWS::Serverless::StateMachine - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Name: MyStateMachine Type: STANDARD diff --git a/tests/translator/input/state_machine_with_api_resource_policy.yaml b/tests/translator/input/state_machine_with_api_resource_policy.yaml index 04d6638b6..8ca0bbed1 100644 --- a/tests/translator/input/state_machine_with_api_resource_policy.yaml +++ b/tests/translator/input/state_machine_with_api_resource_policy.yaml @@ -1,15 +1,11 @@ Resources: ExplicitApi: Type: AWS::Serverless::Api - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod MyStateMachine: Type: AWS::Serverless::StateMachine - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Name: MyStateMachine Definition: diff --git a/tests/translator/input/state_machine_with_condition.yaml b/tests/translator/input/state_machine_with_condition.yaml index 7dde78861..58f2227da 100644 --- a/tests/translator/input/state_machine_with_condition.yaml +++ b/tests/translator/input/state_machine_with_condition.yaml @@ -6,8 +6,6 @@ Conditions: Resources: StateMachine: Type: AWS::Serverless::StateMachine - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Condition: "TestCondition" Properties: Name: MyStateMachine diff --git a/tests/translator/input/state_machine_with_condition_and_events.yaml b/tests/translator/input/state_machine_with_condition_and_events.yaml index efddbbe21..710eb4bd3 100644 --- a/tests/translator/input/state_machine_with_condition_and_events.yaml +++ b/tests/translator/input/state_machine_with_condition_and_events.yaml @@ -6,8 +6,6 @@ Conditions: Resources: StateMachine: Type: AWS::Serverless::StateMachine - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Condition: "TestCondition" Properties: Name: MyStateMachine diff --git a/tests/translator/input/state_machine_with_cwe.yaml b/tests/translator/input/state_machine_with_cwe.yaml index 347f7318b..488d8dc99 100644 --- a/tests/translator/input/state_machine_with_cwe.yaml +++ b/tests/translator/input/state_machine_with_cwe.yaml @@ -1,8 +1,6 @@ Resources: StateMachine: Type: 'AWS::Serverless::StateMachine' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: DefinitionUri: s3://sam-demo-bucket/my_state_machine.asl.json Role: arn:aws:iam::123456123456:role/service-role/SampleRole diff --git a/tests/translator/input/state_machine_with_definition_S3_object.yaml b/tests/translator/input/state_machine_with_definition_S3_object.yaml index 7be132ef7..7a9923f2b 100644 --- a/tests/translator/input/state_machine_with_definition_S3_object.yaml +++ b/tests/translator/input/state_machine_with_definition_S3_object.yaml @@ -1,8 +1,6 @@ Resources: MyFunction: Type: "AWS::Serverless::Function" - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -11,8 +9,6 @@ Resources: StateMachine: Type: AWS::Serverless::StateMachine - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Name: MyStateMachineWithDefinitionInS3 Type: STANDARD diff --git a/tests/translator/input/state_machine_with_definition_S3_string.yaml b/tests/translator/input/state_machine_with_definition_S3_string.yaml index b370da5bd..c26974b90 100644 --- a/tests/translator/input/state_machine_with_definition_S3_string.yaml +++ b/tests/translator/input/state_machine_with_definition_S3_string.yaml @@ -1,8 +1,6 @@ Resources: MyFunction: Type: "AWS::Serverless::Function" - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -11,8 +9,6 @@ Resources: StateMachine: Type: AWS::Serverless::StateMachine - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Name: MyStateMachineWithDefinitionInS3 Type: STANDARD diff --git a/tests/translator/input/state_machine_with_definition_substitutions.yaml b/tests/translator/input/state_machine_with_definition_substitutions.yaml index 00509be1c..1558eebeb 100644 --- a/tests/translator/input/state_machine_with_definition_substitutions.yaml +++ b/tests/translator/input/state_machine_with_definition_substitutions.yaml @@ -1,8 +1,6 @@ Resources: MyFunction: Type: "AWS::Serverless::Function" - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -10,8 +8,6 @@ Resources: StateMachine: Type: AWS::Serverless::StateMachine - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Definition: Comment: A Hello World example of the Amazon States Language using Pass states diff --git a/tests/translator/input/state_machine_with_eb_dlq.yaml b/tests/translator/input/state_machine_with_eb_dlq.yaml index 4c4c8001f..90721bd20 100644 --- a/tests/translator/input/state_machine_with_eb_dlq.yaml +++ b/tests/translator/input/state_machine_with_eb_dlq.yaml @@ -1,8 +1,6 @@ Resources: StateMachine: Type: 'AWS::Serverless::StateMachine' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: DefinitionUri: s3://sam-demo-bucket/my_state_machine.asl.json Role: arn:aws:iam::123456123456:role/service-role/SampleRole diff --git a/tests/translator/input/state_machine_with_eb_dlq_generated.yaml b/tests/translator/input/state_machine_with_eb_dlq_generated.yaml index 91ad7149f..9f8d74677 100644 --- a/tests/translator/input/state_machine_with_eb_dlq_generated.yaml +++ b/tests/translator/input/state_machine_with_eb_dlq_generated.yaml @@ -1,8 +1,6 @@ Resources: StateMachine: Type: 'AWS::Serverless::StateMachine' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: DefinitionUri: s3://sam-demo-bucket/my_state_machine.asl.json Role: arn:aws:iam::123456123456:role/service-role/SampleRole diff --git a/tests/translator/input/state_machine_with_eb_retry_policy.yaml b/tests/translator/input/state_machine_with_eb_retry_policy.yaml index e30b7ff09..21dc2d921 100644 --- a/tests/translator/input/state_machine_with_eb_retry_policy.yaml +++ b/tests/translator/input/state_machine_with_eb_retry_policy.yaml @@ -1,8 +1,6 @@ Resources: StateMachine: Type: 'AWS::Serverless::StateMachine' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: DefinitionUri: s3://sam-demo-bucket/my_state_machine.asl.json Role: arn:aws:iam::123456123456:role/service-role/SampleRole diff --git a/tests/translator/input/state_machine_with_explicit_api.yaml b/tests/translator/input/state_machine_with_explicit_api.yaml index 8fe160c84..6f07fbba0 100644 --- a/tests/translator/input/state_machine_with_explicit_api.yaml +++ b/tests/translator/input/state_machine_with_explicit_api.yaml @@ -1,15 +1,11 @@ Resources: MyApi: Type: "AWS::Serverless::Api" - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: StageName: Prod StateMachine: Type: AWS::Serverless::StateMachine - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Name: MyStateMachine Type: STANDARD diff --git a/tests/translator/input/state_machine_with_express_logging.yaml b/tests/translator/input/state_machine_with_express_logging.yaml index 9bf6df588..29d253a50 100644 --- a/tests/translator/input/state_machine_with_express_logging.yaml +++ b/tests/translator/input/state_machine_with_express_logging.yaml @@ -1,8 +1,6 @@ Resources: MyFunction: Type: "AWS::Serverless::Function" - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -10,13 +8,9 @@ Resources: ExpressLogGroup: Type: AWS::Logs::LogGroup - DeletionPolicy: Delete - UpdateReplacePolicy: Retain StateMachine: Type: AWS::Serverless::StateMachine - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Name: MyStandardStateMachineWithLogging Type: EXPRESS diff --git a/tests/translator/input/state_machine_with_implicit_api.yaml b/tests/translator/input/state_machine_with_implicit_api.yaml index 79655a8dd..368285562 100644 --- a/tests/translator/input/state_machine_with_implicit_api.yaml +++ b/tests/translator/input/state_machine_with_implicit_api.yaml @@ -1,8 +1,6 @@ Resources: StateMachine: Type: AWS::Serverless::StateMachine - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Name: MyStateMachine Type: STANDARD diff --git a/tests/translator/input/state_machine_with_implicit_api_globals.yaml b/tests/translator/input/state_machine_with_implicit_api_globals.yaml index 38585e9ad..5c1c227c0 100644 --- a/tests/translator/input/state_machine_with_implicit_api_globals.yaml +++ b/tests/translator/input/state_machine_with_implicit_api_globals.yaml @@ -6,8 +6,6 @@ Globals: Resources: StateMachine: Type: AWS::Serverless::StateMachine - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Name: MyStateMachine Type: STANDARD diff --git a/tests/translator/input/state_machine_with_inline_definition.yaml b/tests/translator/input/state_machine_with_inline_definition.yaml index ed383c462..f77f25a2e 100644 --- a/tests/translator/input/state_machine_with_inline_definition.yaml +++ b/tests/translator/input/state_machine_with_inline_definition.yaml @@ -1,8 +1,6 @@ Resources: StateMachine: Type: AWS::Serverless::StateMachine - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Name: MyBasicStateMachine Type: STANDARD diff --git a/tests/translator/input/state_machine_with_inline_definition_intrinsics.yaml b/tests/translator/input/state_machine_with_inline_definition_intrinsics.yaml index 1eb82519d..2949605fb 100644 --- a/tests/translator/input/state_machine_with_inline_definition_intrinsics.yaml +++ b/tests/translator/input/state_machine_with_inline_definition_intrinsics.yaml @@ -1,8 +1,6 @@ Resources: MyFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -11,8 +9,6 @@ Resources: StateMachine: Type: AWS::Serverless::StateMachine - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Name: MyBasicStateMachine Type: STANDARD diff --git a/tests/translator/input/state_machine_with_inline_policies.yaml b/tests/translator/input/state_machine_with_inline_policies.yaml index aa101c06b..1d68c6b82 100644 --- a/tests/translator/input/state_machine_with_inline_policies.yaml +++ b/tests/translator/input/state_machine_with_inline_policies.yaml @@ -1,8 +1,6 @@ Resources: MyFunction: Type: "AWS::Serverless::Function" - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -11,8 +9,6 @@ Resources: StateMachine: Type: AWS::Serverless::StateMachine - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Name: MyBasicStateMachine Type: STANDARD diff --git a/tests/translator/input/state_machine_with_managed_policy.yaml b/tests/translator/input/state_machine_with_managed_policy.yaml index 09d4e5285..3479983dc 100644 --- a/tests/translator/input/state_machine_with_managed_policy.yaml +++ b/tests/translator/input/state_machine_with_managed_policy.yaml @@ -1,8 +1,6 @@ Resources: StateMachine: Type: AWS::Serverless::StateMachine - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Name: MyStateMachineWithManagedPolicy Type: STANDARD diff --git a/tests/translator/input/state_machine_with_permissions_boundary.yaml b/tests/translator/input/state_machine_with_permissions_boundary.yaml index 1eb79903d..5d86d465b 100644 --- a/tests/translator/input/state_machine_with_permissions_boundary.yaml +++ b/tests/translator/input/state_machine_with_permissions_boundary.yaml @@ -1,8 +1,6 @@ Resources: MyFunction: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -11,8 +9,6 @@ Resources: StateMachine: Type: AWS::Serverless::StateMachine - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Name: MyStateMachine Events: diff --git a/tests/translator/input/state_machine_with_role.yaml b/tests/translator/input/state_machine_with_role.yaml index 1e02f65c6..1d0885f5f 100644 --- a/tests/translator/input/state_machine_with_role.yaml +++ b/tests/translator/input/state_machine_with_role.yaml @@ -1,8 +1,6 @@ Resources: StateMachine: Type: AWS::Serverless::StateMachine - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Name: MyStateMachineWithRole Type: STANDARD diff --git a/tests/translator/input/state_machine_with_sam_policy_templates.yaml b/tests/translator/input/state_machine_with_sam_policy_templates.yaml index 9d5ebf451..a099fc204 100644 --- a/tests/translator/input/state_machine_with_sam_policy_templates.yaml +++ b/tests/translator/input/state_machine_with_sam_policy_templates.yaml @@ -1,8 +1,6 @@ Resources: StarterLambda: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/starter.zip Handler: starter.handler @@ -10,13 +8,9 @@ Resources: ProcessingQueue: Type: AWS::SQS::Queue - DeletionPolicy: Delete - UpdateReplacePolicy: Retain ResolverLambda: Type: AWS::Serverless::Function - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/resolver.zip Handler: resolver.handler @@ -24,8 +18,6 @@ Resources: NestedWorkflow: Type: AWS::Serverless::StateMachine - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Type: STANDARD Definition: @@ -45,15 +37,11 @@ Resources: OutputStore: Type: AWS::Serverless::SimpleTable - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: TableName: MySimpleTable ProcessingWorkflow: Type: AWS::Serverless::StateMachine - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Type: STANDARD Definition: diff --git a/tests/translator/input/state_machine_with_schedule.yaml b/tests/translator/input/state_machine_with_schedule.yaml index d57defefa..324ce30f8 100644 --- a/tests/translator/input/state_machine_with_schedule.yaml +++ b/tests/translator/input/state_machine_with_schedule.yaml @@ -1,8 +1,6 @@ Resources: StateMachine: Type: 'AWS::Serverless::StateMachine' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: DefinitionUri: s3://sam-demo-bucket/my_state_machine.asl.json Role: arn:aws:iam::123456123456:role/service-role/SampleRole diff --git a/tests/translator/input/state_machine_with_schedule_dlq_retry_policy.yaml b/tests/translator/input/state_machine_with_schedule_dlq_retry_policy.yaml index 2973893c9..9f7385f90 100644 --- a/tests/translator/input/state_machine_with_schedule_dlq_retry_policy.yaml +++ b/tests/translator/input/state_machine_with_schedule_dlq_retry_policy.yaml @@ -1,8 +1,6 @@ Resources: StateMachine: Type: 'AWS::Serverless::StateMachine' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: DefinitionUri: s3://sam-demo-bucket/my_state_machine.asl.json Role: arn:aws:iam::123456123456:role/service-role/SampleRole diff --git a/tests/translator/input/state_machine_with_standard_logging.yaml b/tests/translator/input/state_machine_with_standard_logging.yaml index 70ee10e7a..529a1a1dd 100644 --- a/tests/translator/input/state_machine_with_standard_logging.yaml +++ b/tests/translator/input/state_machine_with_standard_logging.yaml @@ -1,8 +1,6 @@ Resources: MyFunction: Type: "AWS::Serverless::Function" - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -10,13 +8,9 @@ Resources: StandardLogGroup: Type: AWS::Logs::LogGroup - DeletionPolicy: Delete - UpdateReplacePolicy: Retain StateMachine: Type: AWS::Serverless::StateMachine - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Name: MyStandardStateMachineWithLogging Type: STANDARD diff --git a/tests/translator/input/state_machine_with_tags.yaml b/tests/translator/input/state_machine_with_tags.yaml index 02415f27f..dd1e15b12 100644 --- a/tests/translator/input/state_machine_with_tags.yaml +++ b/tests/translator/input/state_machine_with_tags.yaml @@ -1,8 +1,6 @@ Resources: StateMachine: Type: AWS::Serverless::StateMachine - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Name: MyStateMachineWithTags Type: STANDARD diff --git a/tests/translator/input/state_machine_with_xray_policies.yaml b/tests/translator/input/state_machine_with_xray_policies.yaml index f49036ae0..719d5874a 100644 --- a/tests/translator/input/state_machine_with_xray_policies.yaml +++ b/tests/translator/input/state_machine_with_xray_policies.yaml @@ -1,8 +1,6 @@ Resources: MyFunction: Type: "AWS::Serverless::Function" - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/hello.zip Handler: hello.handler @@ -10,8 +8,6 @@ Resources: StateMachine: Type: AWS::Serverless::StateMachine - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Name: MyBasicStateMachine Type: STANDARD diff --git a/tests/translator/input/state_machine_with_xray_role.yaml b/tests/translator/input/state_machine_with_xray_role.yaml index 1e92bfb91..f5e56e729 100644 --- a/tests/translator/input/state_machine_with_xray_role.yaml +++ b/tests/translator/input/state_machine_with_xray_role.yaml @@ -1,8 +1,6 @@ Resources: StateMachine: Type: AWS::Serverless::StateMachine - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: Name: MyStateMachineWithXRayTracing Type: STANDARD diff --git a/tests/translator/input/streams.yaml b/tests/translator/input/streams.yaml index 5ec2fd296..3ae736b79 100644 --- a/tests/translator/input/streams.yaml +++ b/tests/translator/input/streams.yaml @@ -1,8 +1,6 @@ Resources: KinesisFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/streams.zip Handler: stream.kinesis_handler @@ -17,8 +15,6 @@ Resources: Enabled: false DynamoDBFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/streams.zip Handler: stream.ddb_handler @@ -32,8 +28,6 @@ Resources: StartingPosition: LATEST MSKFunction: Type: 'AWS::Serverless::Function' - DeletionPolicy: Delete - UpdateReplacePolicy: Retain Properties: CodeUri: s3://sam-demo-bucket/streams.zip Handler: stream.msk_handler diff --git a/tests/translator/output/alexa_skill.json b/tests/translator/output/alexa_skill.json index b60a78e92..bb86ba2be 100644 --- a/tests/translator/output/alexa_skill.json +++ b/tests/translator/output/alexa_skill.json @@ -4,9 +4,6 @@ "Resources": { "AlexaSkillFuncRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -37,9 +34,6 @@ }, "AlexaSkillFuncAlexaSkillEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { @@ -50,9 +44,6 @@ }, "AlexaSkillFunc": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/alexa_skill_with_skill_id.json b/tests/translator/output/alexa_skill_with_skill_id.json index e2320d2cc..a02b881ab 100644 --- a/tests/translator/output/alexa_skill_with_skill_id.json +++ b/tests/translator/output/alexa_skill_with_skill_id.json @@ -4,9 +4,6 @@ "Resources": { "AlexaSkillFuncRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -37,9 +34,6 @@ }, "AlexaSkillFuncAlexaSkillEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { @@ -51,9 +45,6 @@ }, "AlexaSkillFunc": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/all_policy_templates.json b/tests/translator/output/all_policy_templates.json index 4285b28e9..a751bff43 100644 --- a/tests/translator/output/all_policy_templates.json +++ b/tests/translator/output/all_policy_templates.json @@ -2,9 +2,6 @@ "Resources": { "KitchenSinkFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "Handler": "hello.handler", "Code": { @@ -28,9 +25,6 @@ }, "KitchenSinkFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", diff --git a/tests/translator/output/api_cache.json b/tests/translator/output/api_cache.json index 62afb0ac4..08bcea21a 100644 --- a/tests/translator/output/api_cache.json +++ b/tests/translator/output/api_cache.json @@ -2,9 +2,6 @@ "Resources": { "HtmlFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -35,9 +32,6 @@ }, "HtmlApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "CacheClusterEnabled": true, "DeploymentId": { @@ -52,9 +46,6 @@ }, "HtmlFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -74,9 +65,6 @@ }, "HtmlApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "RestApiId": { "Ref": "HtmlApi" @@ -87,9 +75,6 @@ }, "HtmlApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "BodyS3Location": { "Bucket": "sam-demo-bucket", @@ -99,9 +84,6 @@ }, "HtmlFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/api_description.json b/tests/translator/output/api_description.json index d371f5e78..31cf8ed03 100644 --- a/tests/translator/output/api_description.json +++ b/tests/translator/output/api_description.json @@ -2,9 +2,6 @@ "Resources": { "FunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -35,9 +32,6 @@ }, "ApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "DeploymentId": { "Ref": "ApiDeploymentf117c932f7" @@ -50,9 +44,6 @@ }, "FunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -72,9 +63,6 @@ }, "ApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "RestApiId": { "Ref": "Api" @@ -85,9 +73,6 @@ }, "Api": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "BodyS3Location": { "Bucket": "sam-demo-bucket", @@ -98,9 +83,6 @@ }, "Function": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/api_endpoint_configuration.json b/tests/translator/output/api_endpoint_configuration.json index 963f5358a..68e3d0828 100644 --- a/tests/translator/output/api_endpoint_configuration.json +++ b/tests/translator/output/api_endpoint_configuration.json @@ -7,8 +7,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -32,8 +30,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -64,8 +60,6 @@ }, "ExplicitApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -76,8 +70,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -99,8 +91,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -118,8 +108,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentf117c932f7" @@ -132,8 +120,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment62b96c1a61" @@ -146,8 +132,6 @@ }, "ServerlessRestApiDeployment62b96c1a61": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -158,8 +142,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_endpoint_configuration_with_vpcendpoint.json b/tests/translator/output/api_endpoint_configuration_with_vpcendpoint.json index a72dc6efd..3fd972822 100644 --- a/tests/translator/output/api_endpoint_configuration_with_vpcendpoint.json +++ b/tests/translator/output/api_endpoint_configuration_with_vpcendpoint.json @@ -10,8 +10,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -35,8 +33,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -67,8 +63,6 @@ }, "ExplicitApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -79,8 +73,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -102,8 +94,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -121,8 +111,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentf117c932f7" @@ -135,8 +123,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment62b96c1a61" @@ -149,8 +135,6 @@ }, "ServerlessRestApiDeployment62b96c1a61": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -161,8 +145,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_request_model.json b/tests/translator/output/api_request_model.json index 563f40a14..681e277e0 100644 --- a/tests/translator/output/api_request_model.json +++ b/tests/translator/output/api_request_model.json @@ -2,8 +2,6 @@ "Resources": { "HtmlFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -34,8 +32,6 @@ }, "HtmlApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "HtmlApiDeploymentdd6198efe6" @@ -48,8 +44,6 @@ }, "HtmlFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -69,8 +63,6 @@ }, "HtmlApiDeploymentdd6198efe6": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "HtmlApi" @@ -81,8 +73,6 @@ }, "HtmlApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -131,8 +121,6 @@ }, "HtmlFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/api_request_model_openapi_3.json b/tests/translator/output/api_request_model_openapi_3.json index 724e8dcce..807a0b23a 100644 --- a/tests/translator/output/api_request_model_openapi_3.json +++ b/tests/translator/output/api_request_model_openapi_3.json @@ -2,8 +2,6 @@ "Resources": { "HtmlFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -34,8 +32,6 @@ }, "HtmlApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "HtmlApiDeployment59eeb787ee" @@ -48,8 +44,6 @@ }, "HtmlFunctionIamPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -71,8 +65,6 @@ }, "HtmlApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -159,8 +151,6 @@ }, "HtmlApiDeployment59eeb787ee": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "HtmlApi" @@ -170,8 +160,6 @@ }, "HtmlFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -191,8 +179,6 @@ }, "HtmlFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { diff --git a/tests/translator/output/api_with_access_log_setting.json b/tests/translator/output/api_with_access_log_setting.json index fc0ad71d7..1b3659eda 100644 --- a/tests/translator/output/api_with_access_log_setting.json +++ b/tests/translator/output/api_with_access_log_setting.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ExplicitApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -71,8 +65,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -94,8 +86,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BodyS3Location": { "Bucket": "sam-demo-bucket", @@ -105,8 +95,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AccessLogSetting": { "DestinationArn": "arn:aws:logs:us-west-2:012345678901/API-Gateway-Execution-Logs_0123456789/prod:log-stream:12345678910", @@ -123,8 +111,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AccessLogSetting": { "DestinationArn": "arn:aws:logs:us-west-2:012345678901/API-Gateway-Execution-Logs_0123456789/prod:log-stream:12345678910", @@ -141,8 +127,6 @@ }, "ServerlessRestApiDeployment62b96c1a61": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -153,8 +137,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_with_apikey_default_override.json b/tests/translator/output/api_with_apikey_default_override.json index e600c039d..7152b7c9a 100644 --- a/tests/translator/output/api_with_apikey_default_override.json +++ b/tests/translator/output/api_with_apikey_default_override.json @@ -2,8 +2,6 @@ "Resources": { "MyApiWithAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithAuthDeployment054e605502" @@ -16,8 +14,6 @@ }, "MyFunctionWithApiKeyRequiredTrueMyApiWithApiKeyRequiredTruePermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -39,8 +35,6 @@ }, "MyFunctionWithApiKeyRequiredFalseMyApiWithApiKeyRequiredFalsePermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -62,8 +56,6 @@ }, "MyFunctionWithApiKeyRequiredTrue": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -87,8 +79,6 @@ }, "MyFunctionWithApiKeyRequiredDefault": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -112,8 +102,6 @@ }, "MyFunctionWithApiKeyRequiredDefaultMyApiWithApiKeyRequiredDefaultPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -135,8 +123,6 @@ }, "MyApiWithAuthDeployment054e605502": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithAuth" @@ -147,8 +133,6 @@ }, "MyFunctionWithApiKeyRequiredFalse": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -172,8 +156,6 @@ }, "MyFunctionWithApiKeyRequiredFalseRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -204,8 +186,6 @@ }, "MyFunctionWithApiKeyRequiredDefaultRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -236,8 +216,6 @@ }, "MyFunctionWithApiKeyRequiredTrueRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -268,8 +246,6 @@ }, "MyApiWithAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_with_apikey_required.json b/tests/translator/output/api_with_apikey_required.json index f4e49654d..94759d029 100644 --- a/tests/translator/output/api_with_apikey_required.json +++ b/tests/translator/output/api_with_apikey_required.json @@ -2,8 +2,6 @@ "Resources": { "MyFunctionWithApiKeyRequiredRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -34,8 +32,6 @@ }, "MyApiWithoutAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -76,8 +72,6 @@ }, "MyApiWithoutAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithoutAuthDeployment3ab9d13134" @@ -90,8 +84,6 @@ }, "MyFunctionWithApiKeyRequiredMyApiWithApiKeyRequiredPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -113,8 +105,6 @@ }, "MyFunctionWithApiKeyRequired": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -138,8 +128,6 @@ }, "MyApiWithoutAuthDeployment3ab9d13134": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithoutAuth" diff --git a/tests/translator/output/api_with_apikey_required_openapi_3.json b/tests/translator/output/api_with_apikey_required_openapi_3.json index 8411653cd..119728b18 100644 --- a/tests/translator/output/api_with_apikey_required_openapi_3.json +++ b/tests/translator/output/api_with_apikey_required_openapi_3.json @@ -2,8 +2,6 @@ "Resources": { "MyFunctionWithApiKeyRequiredRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -34,8 +32,6 @@ }, "MyApiWithoutAuthDeployment8770e31c42": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithoutAuth" @@ -45,8 +41,6 @@ }, "MyApiWithoutAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -89,8 +83,6 @@ }, "MyApiWithoutAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithoutAuthDeployment8770e31c42" @@ -103,8 +95,6 @@ }, "MyFunctionWithApiKeyRequiredMyApiWithApiKeyRequiredPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -126,8 +116,6 @@ }, "MyFunctionWithApiKeyRequired": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { diff --git a/tests/translator/output/api_with_auth_all_maximum.json b/tests/translator/output/api_with_auth_all_maximum.json index 29e601382..9615a989f 100644 --- a/tests/translator/output/api_with_auth_all_maximum.json +++ b/tests/translator/output/api_with_auth_all_maximum.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -27,8 +25,6 @@ }, "MyFunctionWithLambdaTokenAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -50,8 +46,6 @@ }, "MyApiMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -70,8 +64,6 @@ }, "MyFunctionWithCognitoMultipleUserPoolsAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -93,8 +85,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -125,8 +115,6 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -329,8 +317,6 @@ }, "MyApiMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -349,8 +335,6 @@ }, "MyFunctionWithLambdaRequestAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -372,8 +356,6 @@ }, "MyApiDeployment0cec4886a5": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -384,8 +366,6 @@ }, "MyApiMyLambdaTokenAuthNoneFunctionInvokeRoleAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -404,8 +384,6 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment0cec4886a5" @@ -418,8 +396,6 @@ }, "MyFunctionWithNoAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -441,8 +417,6 @@ }, "MyFunctionWithDefaultAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/api_with_auth_all_maximum_openapi_3.json b/tests/translator/output/api_with_auth_all_maximum_openapi_3.json index 11956d39f..2a80fd35f 100644 --- a/tests/translator/output/api_with_auth_all_maximum_openapi_3.json +++ b/tests/translator/output/api_with_auth_all_maximum_openapi_3.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -27,8 +25,6 @@ }, "MyFunctionWithLambdaTokenAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -50,8 +46,6 @@ }, "MyApiMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -70,8 +64,6 @@ }, "MyFunctionWithCognitoMultipleUserPoolsAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -93,8 +85,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -125,8 +115,6 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -331,8 +319,6 @@ }, "MyApiMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -351,8 +337,6 @@ }, "MyFunctionWithLambdaRequestAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -374,8 +358,6 @@ }, "MyApiMyLambdaTokenAuthNoneFunctionInvokeRoleAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -394,8 +376,6 @@ }, "MyApiDeployment98ad824f7d": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -405,8 +385,6 @@ }, "MyFunctionWithNoAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -428,8 +406,6 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment98ad824f7d" @@ -442,8 +418,6 @@ }, "MyFunctionWithDefaultAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/api_with_auth_all_minimum.json b/tests/translator/output/api_with_auth_all_minimum.json index 3f1c65c9c..4a4dbe937 100644 --- a/tests/translator/output/api_with_auth_all_minimum.json +++ b/tests/translator/output/api_with_auth_all_minimum.json @@ -2,8 +2,6 @@ "Resources": { "MyApiWithCognitoAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -56,8 +54,6 @@ }, "MyApiWithLambdaRequestAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithLambdaRequestAuthDeployment6e52add211" @@ -70,8 +66,6 @@ }, "MyApiWithNotCachedLambdaRequestAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithNotCachedLambdaRequestAuthDeployment444f67cd7c" @@ -84,8 +78,6 @@ }, "MyApiWithLambdaTokenAuthMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -109,8 +101,6 @@ }, "MyApiWithCognitoAuthDeployment62312fa971": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithCognitoAuth" @@ -121,8 +111,6 @@ }, "MyAuthFn": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -146,8 +134,6 @@ }, "MyFnRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -178,8 +164,6 @@ }, "MyApiWithCognitoAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithCognitoAuthDeployment62312fa971" @@ -192,8 +176,6 @@ }, "MyFnCognitoPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -215,8 +197,6 @@ }, "MyApiWithLambdaRequestAuthMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -240,8 +220,6 @@ }, "MyApiWithNotCachedLambdaRequestAuthMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -265,8 +243,6 @@ }, "MyFnLambdaTokenPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -288,8 +264,6 @@ }, "MyApiWithLambdaRequestAuthDeployment6e52add211": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithLambdaRequestAuth" @@ -300,8 +274,6 @@ }, "MyApiWithNotCachedLambdaRequestAuthDeployment444f67cd7c": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithNotCachedLambdaRequestAuth" @@ -312,8 +284,6 @@ }, "MyFnLambdaRequestPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -335,8 +305,6 @@ }, "MyFnLambdaNotCachedRequestPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -358,8 +326,6 @@ }, "MyApiWithLambdaTokenAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -417,8 +383,6 @@ }, "MyUserPool": { "Type": "AWS::Cognito::UserPool", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "UsernameAttributes": [ "email" @@ -440,8 +404,6 @@ }, "MyFn": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -465,8 +427,6 @@ }, "MyApiWithLambdaTokenAuthDeployment445c6c96e7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithLambdaTokenAuth" @@ -477,8 +437,6 @@ }, "MyAuthFnRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -509,8 +467,6 @@ }, "MyApiWithLambdaTokenAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithLambdaTokenAuthDeployment445c6c96e7" @@ -523,8 +479,6 @@ }, "MyApiWithLambdaRequestAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -583,8 +537,6 @@ }, "MyApiWithNotCachedLambdaRequestAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_with_auth_all_minimum_openapi.json b/tests/translator/output/api_with_auth_all_minimum_openapi.json index 4eef9c9bd..ecee37eda 100644 --- a/tests/translator/output/api_with_auth_all_minimum_openapi.json +++ b/tests/translator/output/api_with_auth_all_minimum_openapi.json @@ -2,8 +2,6 @@ "Resources": { "MyApiWithCognitoAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -58,8 +56,6 @@ }, "MyApiWithLambdaRequestAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithLambdaRequestAuthDeployment14ab3ddf12" @@ -72,8 +68,6 @@ }, "MyApiWithLambdaTokenAuthMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -97,8 +91,6 @@ }, "MyAuthFn": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -122,8 +114,6 @@ }, "MyFnRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -154,8 +144,6 @@ }, "MyApiWithLambdaRequestAuthDeployment14ab3ddf12": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithLambdaRequestAuth" @@ -165,8 +153,6 @@ }, "MyApiWithCognitoAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithCognitoAuthDeployment87cdbda651" @@ -179,8 +165,6 @@ }, "MyFnCognitoPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -202,8 +186,6 @@ }, "MyApiWithLambdaRequestAuthMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -227,8 +209,6 @@ }, "MyFnLambdaTokenPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -250,8 +230,6 @@ }, "MyFnLambdaRequestPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -273,8 +251,6 @@ }, "MyApiWithLambdaTokenAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -334,8 +310,6 @@ }, "MyUserPool": { "Type": "AWS::Cognito::UserPool", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "UsernameAttributes": [ "email" @@ -357,8 +331,6 @@ }, "MyFn": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -382,8 +354,6 @@ }, "MyAuthFnRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -414,8 +384,6 @@ }, "MyApiWithLambdaTokenAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithLambdaTokenAuthDeployment4fdb5f4e3c" @@ -428,8 +396,6 @@ }, "MyApiWithCognitoAuthDeployment87cdbda651": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithCognitoAuth" @@ -439,8 +405,6 @@ }, "MyApiWithLambdaRequestAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -501,8 +465,6 @@ }, "MyApiWithLambdaTokenAuthDeployment4fdb5f4e3c": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithLambdaTokenAuth" diff --git a/tests/translator/output/api_with_auth_and_conditions_all_max.json b/tests/translator/output/api_with_auth_and_conditions_all_max.json index 719892634..06f9a6434 100644 --- a/tests/translator/output/api_with_auth_and_conditions_all_max.json +++ b/tests/translator/output/api_with_auth_and_conditions_all_max.json @@ -10,8 +10,6 @@ "Resources": { "MyFunctionWithLambdaTokenAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -33,8 +31,6 @@ }, "MyApiMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -53,8 +49,6 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeploymentf5a2efce75" @@ -67,8 +61,6 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -314,8 +306,6 @@ }, "MyApiMyLambdaTokenAuthNoneFunctionInvokeRoleAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -334,8 +324,6 @@ }, "MyFunctionWithNoAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -357,8 +345,6 @@ }, "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -382,8 +368,6 @@ }, "MyFunctionWithCognitoMultipleUserPoolsAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -405,8 +389,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -437,8 +419,6 @@ }, "MyFunctionWithConditionalWithLambdaTokenAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -461,8 +441,6 @@ }, "MyFunctionWithConditionalWithLambdaRequestAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -485,8 +463,6 @@ }, "MyApiMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -505,8 +481,6 @@ }, "MyFunctionWithConditional": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -531,8 +505,6 @@ }, "MyApiDeploymentf5a2efce75": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -543,8 +515,6 @@ }, "MyFunctionWithConditionalWithDefaultAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -567,8 +537,6 @@ }, "MyFunctionWithConditionalRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/api_with_auth_no_default.json b/tests/translator/output/api_with_auth_no_default.json index 1fab38c04..48d756acc 100644 --- a/tests/translator/output/api_with_auth_no_default.json +++ b/tests/translator/output/api_with_auth_no_default.json @@ -2,8 +2,6 @@ "Resources": { "MyApiWithCognitoAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -51,8 +49,6 @@ }, "MyApiWithLambdaRequestAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithLambdaRequestAuthDeployment7d0d103fdf" @@ -65,8 +61,6 @@ }, "MyApiWithLambdaTokenAuthMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -90,8 +84,6 @@ }, "MyAuthFn": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -115,8 +107,6 @@ }, "MyFnRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -147,8 +137,6 @@ }, "MyApiWithCognitoAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithCognitoAuthDeployment039b508d89" @@ -161,8 +149,6 @@ }, "MyFnCognitoPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -184,8 +170,6 @@ }, "MyApiWithCognitoAuthDeployment039b508d89": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithCognitoAuth" @@ -196,8 +180,6 @@ }, "MyApiWithLambdaRequestAuthMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -221,8 +203,6 @@ }, "MyApiWithLambdaRequestAuthDeployment7d0d103fdf": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithLambdaRequestAuth" @@ -233,8 +213,6 @@ }, "MyFnLambdaTokenPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -256,8 +234,6 @@ }, "MyFnLambdaRequestPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -279,8 +255,6 @@ }, "MyApiWithLambdaTokenAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -333,8 +307,6 @@ }, "MyApiWithLambdaTokenAuthDeployment50695ee60b": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithLambdaTokenAuth" @@ -345,8 +317,6 @@ }, "MyUserPool": { "Type": "AWS::Cognito::UserPool", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "UsernameAttributes": [ "email" @@ -368,8 +338,6 @@ }, "MyFn": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -393,8 +361,6 @@ }, "MyAuthFnRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -425,8 +391,6 @@ }, "MyApiWithLambdaTokenAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithLambdaTokenAuthDeployment50695ee60b" @@ -439,8 +403,6 @@ }, "MyApiWithLambdaRequestAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_with_auth_with_default_scopes.json b/tests/translator/output/api_with_auth_with_default_scopes.json index c0374a394..ba1c3d108 100644 --- a/tests/translator/output/api_with_auth_with_default_scopes.json +++ b/tests/translator/output/api_with_auth_with_default_scopes.json @@ -2,8 +2,6 @@ "Resources": { "MyApiWithCognitoAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -177,8 +175,6 @@ }, "MyFnCognitoDefaultScopesNonePermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -200,8 +196,6 @@ }, "MyApiWithCognitoAuthDeployment442cfe5207": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithCognitoAuth" @@ -212,8 +206,6 @@ }, "MyFnCognitoDefaultAuthDefaultScopesNonePermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -235,8 +227,6 @@ }, "MyFnCognitoAuthorizerWithDefaultScopesPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -258,8 +248,6 @@ }, "MyFnCognitoDefaultScopesDefaultAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -281,8 +269,6 @@ }, "MyFnCognitoAuthorizerScopesOverwrittenPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -304,8 +290,6 @@ }, "MyFnRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -336,8 +320,6 @@ }, "MyFnCognitoWithAuthNonePermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -359,8 +341,6 @@ }, "MyApiWithCognitoAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithCognitoAuthDeployment442cfe5207" @@ -373,8 +353,6 @@ }, "MyFn": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -398,8 +376,6 @@ }, "MyFnCognitoDefaultScopesWithOverwrittenPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/api_with_auth_with_default_scopes_openapi.json b/tests/translator/output/api_with_auth_with_default_scopes_openapi.json index 4f7b7460e..a70e837e6 100644 --- a/tests/translator/output/api_with_auth_with_default_scopes_openapi.json +++ b/tests/translator/output/api_with_auth_with_default_scopes_openapi.json @@ -2,8 +2,6 @@ "Resources": { "MyApiWithCognitoAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -179,8 +177,6 @@ }, "MyFnCognitoDefaultScopesNonePermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -202,8 +198,6 @@ }, "MyFnCognitoDefaultAuthDefaultScopesNonePermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -225,8 +219,6 @@ }, "MyFnCognitoAuthorizerWithDefaultScopesPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -248,8 +240,6 @@ }, "MyFnCognitoDefaultScopesDefaultAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -271,8 +261,6 @@ }, "MyFnCognitoAuthorizerScopesOverwrittenPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -294,8 +282,6 @@ }, "MyApiWithCognitoAuthDeployment85cd9eefb8": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithCognitoAuth" @@ -305,8 +291,6 @@ }, "MyFnRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -337,8 +321,6 @@ }, "MyFnCognitoWithAuthNonePermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -360,8 +342,6 @@ }, "MyApiWithCognitoAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithCognitoAuthDeployment85cd9eefb8" @@ -374,8 +354,6 @@ }, "MyFn": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -399,8 +377,6 @@ }, "MyFnCognitoDefaultScopesWithOverwrittenPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/api_with_aws_account_blacklist.json b/tests/translator/output/api_with_aws_account_blacklist.json index 64182585f..41e8598c6 100644 --- a/tests/translator/output/api_with_aws_account_blacklist.json +++ b/tests/translator/output/api_with_aws_account_blacklist.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -26,8 +24,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment58caafe4ca" @@ -40,8 +36,6 @@ }, "ServerlessRestApiDeployment58caafe4ca": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -52,8 +46,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -84,8 +76,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -136,8 +126,6 @@ }, "MyFunctionApiPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/api_with_aws_account_whitelist.json b/tests/translator/output/api_with_aws_account_whitelist.json index 4b47755e7..3972c4599 100644 --- a/tests/translator/output/api_with_aws_account_whitelist.json +++ b/tests/translator/output/api_with_aws_account_whitelist.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -26,8 +24,6 @@ }, "ServerlessRestApiDeployment3727797069": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -38,8 +34,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment3727797069" @@ -52,8 +46,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -84,8 +76,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -157,8 +147,6 @@ }, "MyFunctionApiPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/api_with_aws_iam_auth_overrides.json b/tests/translator/output/api_with_aws_iam_auth_overrides.json index 40fad853b..59174643a 100644 --- a/tests/translator/output/api_with_aws_iam_auth_overrides.json +++ b/tests/translator/output/api_with_aws_iam_auth_overrides.json @@ -2,8 +2,6 @@ "Resources": { "MyFunctionCustomInvokeRole": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -27,8 +25,6 @@ }, "MyFunctionNoneAuth": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -52,8 +48,6 @@ }, "MyFunctionNullInvokeRole": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -77,8 +71,6 @@ }, "MyApiWithAwsIamAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithAwsIamAuthDeployment3bec5f30f2" @@ -91,8 +83,6 @@ }, "MyFunctionWithoutAuthRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -123,8 +113,6 @@ }, "MyFunctionCustomInvokeRoleAPI3PermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -146,8 +134,6 @@ }, "MyFunctionMyCognitoAuthAPI1PermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -169,8 +155,6 @@ }, "MyApiWithAwsIamAuthNoCallerCredentials": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -228,8 +212,6 @@ }, "MyFunctionWithoutAuthAPI2PermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -251,8 +233,6 @@ }, "MyFunctionDefaultInvokeRoleAPI3PermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -274,8 +254,6 @@ }, "MyFunctionMyCognitoAuth": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -299,8 +277,6 @@ }, "MyFunctionNullInvokeRoleRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -331,8 +307,6 @@ }, "MyFunctionNONEInvokeRole": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -356,8 +330,6 @@ }, "MyFunctionNoCallerCredentialsAPI3PermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -379,8 +351,6 @@ }, "MyFunctionNoneAuthRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -411,8 +381,6 @@ }, "MyFunctionCustomInvokeRoleRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -443,8 +411,6 @@ }, "MyApiWithAwsIamAuthDeployment3bec5f30f2": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithAwsIamAuth" @@ -455,8 +421,6 @@ }, "MyApiWithAwsIamAuthNoCallerCredentialsDeployment38c75afec1": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithAwsIamAuthNoCallerCredentials" @@ -467,8 +431,6 @@ }, "MyFunctionCallerCredentialsOverrideAPI3PermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -490,8 +452,6 @@ }, "MyFunctionCallerCredentialsOverride": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -515,8 +475,6 @@ }, "MyFunctionWithoutAuth": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -540,8 +498,6 @@ }, "MyFunctionNullInvokeRoleAPI3PermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -563,8 +519,6 @@ }, "MyFunctionNONEInvokeRoleAPI3PermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -586,8 +540,6 @@ }, "MyFunctionNoCallerCredentialsRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -618,8 +570,6 @@ }, "MyFunctionDefaultInvokeRoleRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -650,8 +600,6 @@ }, "MyFunctionCallerCredentialsOverrideRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -682,8 +630,6 @@ }, "MyFunctionMyCognitoAuthRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -714,8 +660,6 @@ }, "MyApiWithAwsIamAuthNoCallerCredentialsProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithAwsIamAuthNoCallerCredentialsDeployment38c75afec1" @@ -728,8 +672,6 @@ }, "MyFunctionDefaultInvokeRole": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -753,8 +695,6 @@ }, "MyFunctionNoCallerCredentials": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -778,8 +718,6 @@ }, "MyApiWithAwsIamAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -938,8 +876,6 @@ }, "MyFunctionNoneAuthAPI3PermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -961,8 +897,6 @@ }, "MyFunctionNONEInvokeRoleRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/api_with_basic_custom_domain.json b/tests/translator/output/api_with_basic_custom_domain.json index 7a913b1fd..4ed229a5a 100644 --- a/tests/translator/output/api_with_basic_custom_domain.json +++ b/tests/translator/output/api_with_basic_custom_domain.json @@ -12,8 +12,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -36,8 +34,6 @@ }, "MyFunctionAnotherGetPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -59,8 +55,6 @@ }, "ApiGatewayDomainName23cdccdf9c": { "Type": "AWS::ApiGateway::DomainName", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "CertificateArn": "my-api-cert-arn", "EndpointConfiguration": { @@ -78,8 +72,6 @@ }, "MyFunctionImplicitGetPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -101,8 +93,6 @@ }, "MyAnotherApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyAnotherApiDeployment48a61be119" @@ -115,8 +105,6 @@ }, "MyFunctionFetchPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -138,8 +126,6 @@ }, "MyAnotherApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -168,8 +154,6 @@ }, "MyApifetchBasePathMapping": { "Type": "AWS::ApiGateway::BasePathMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BasePath": "fetch", "DomainName": { @@ -185,8 +169,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -217,8 +199,6 @@ }, "MyApigetBasePathMapping": { "Type": "AWS::ApiGateway::BasePathMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BasePath": "get", "DomainName": { @@ -234,8 +214,6 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -276,8 +254,6 @@ }, "MyAnotherApiBasePathMapping": { "Type": "AWS::ApiGateway::BasePathMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DomainName": { "Ref": "ApiGatewayDomainNameeab65c1531" @@ -292,8 +268,6 @@ }, "ApiGatewayDomainNameeab65c1531": { "Type": "AWS::ApiGateway::DomainName", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -306,8 +280,6 @@ }, "ServerlessRestApiDeployment3c44da8ffd": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -318,8 +290,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment3c44da8ffd" @@ -332,8 +302,6 @@ }, "MyApiDeployment347043ff9e": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -343,8 +311,6 @@ }, "ServerlessRestApiBasePathMapping": { "Type": "AWS::ApiGateway::BasePathMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DomainName": { "Ref": "ApiGatewayDomainNameeab65c1531" @@ -359,8 +325,6 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment347043ff9e" @@ -373,8 +337,6 @@ }, "MyAnotherApiDeployment48a61be119": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyAnotherApi" @@ -384,8 +346,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -414,8 +374,6 @@ }, "MyFunctionApiPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/api_with_basic_custom_domain_http.json b/tests/translator/output/api_with_basic_custom_domain_http.json index e5ddd8ec3..f99b2c682 100644 --- a/tests/translator/output/api_with_basic_custom_domain_http.json +++ b/tests/translator/output/api_with_basic_custom_domain_http.json @@ -12,8 +12,6 @@ "Resources": { "MyApibasicApiMapping": { "Type": "AWS::ApiGatewayV2::ApiMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -29,8 +27,6 @@ }, "ApiGatewayDomainNameV22dbf35af54": { "Type": "AWS::ApiGatewayV2::DomainName", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DomainName": "sam-example.com", "DomainNameConfigurations": [ @@ -51,8 +47,6 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -66,8 +60,6 @@ }, "HttpApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -90,8 +82,6 @@ }, "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -113,8 +103,6 @@ }, "MyApibeginhereApiMapping": { "Type": "AWS::ApiGatewayV2::ApiMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -130,8 +118,6 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -162,8 +148,6 @@ }, "RecordSetGroup1f4f569a7e": { "Type": "AWS::Route53::RecordSetGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "HostedZoneName": "sam-example.com.", "RecordSets": [ @@ -190,8 +174,6 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_with_basic_custom_domain_intrinsics.json b/tests/translator/output/api_with_basic_custom_domain_intrinsics.json index 257412734..09d694c4e 100644 --- a/tests/translator/output/api_with_basic_custom_domain_intrinsics.json +++ b/tests/translator/output/api_with_basic_custom_domain_intrinsics.json @@ -28,8 +28,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -53,8 +51,6 @@ }, "MyFunctionImplicitGetPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -77,8 +73,6 @@ }, "ApiGatewayDomainNamec0ed6fae34": { "Type": "AWS::ApiGateway::DomainName", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -99,8 +93,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment43c34b4e46" @@ -114,8 +106,6 @@ }, "MyApifetchBasePathMapping": { "Type": "AWS::ApiGateway::BasePathMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BasePath": "fetch", "DomainName": { @@ -132,8 +122,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -165,8 +153,6 @@ }, "MyApigetBasePathMapping": { "Type": "AWS::ApiGateway::BasePathMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BasePath": "get", "DomainName": { @@ -183,8 +169,6 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -238,8 +222,6 @@ }, "ServerlessRestApiDeployment43c34b4e46": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -251,8 +233,6 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment19c8cf5c63" @@ -266,8 +246,6 @@ }, "MyApiDeployment19c8cf5c63": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -278,8 +256,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -333,8 +309,6 @@ }, "MyFunctionApiPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/api_with_basic_custom_domain_intrinsics_http.json b/tests/translator/output/api_with_basic_custom_domain_intrinsics_http.json index 3ef74b787..8bc0ecf8b 100644 --- a/tests/translator/output/api_with_basic_custom_domain_intrinsics_http.json +++ b/tests/translator/output/api_with_basic_custom_domain_intrinsics_http.json @@ -28,8 +28,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -53,8 +51,6 @@ }, "ServerlessHttpApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -115,8 +111,6 @@ }, "MyFunctionImplicitGetPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -139,8 +133,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -172,8 +164,6 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -241,8 +231,6 @@ }, "MyFunctionApiPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -265,8 +253,6 @@ }, "MyApigetApiMapping": { "Type": "AWS::ApiGatewayV2::ApiMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -283,8 +269,6 @@ }, "ApiGatewayDomainNameV2c0ed6fae34": { "Type": "AWS::ApiGatewayV2::DomainName", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DomainName": { "Fn::Sub": "example-ap-southeast-1.com" @@ -308,8 +292,6 @@ }, "ServerlessHttpApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "ServerlessHttpApi" @@ -324,8 +306,6 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -340,8 +320,6 @@ }, "MyApifetchApiMapping": { "Type": "AWS::ApiGatewayV2::ApiMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" diff --git a/tests/translator/output/api_with_binary_media_types.json b/tests/translator/output/api_with_binary_media_types.json index 91fa959c5..54540a60e 100644 --- a/tests/translator/output/api_with_binary_media_types.json +++ b/tests/translator/output/api_with_binary_media_types.json @@ -8,8 +8,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -33,8 +31,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -65,8 +61,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -88,8 +82,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BinaryMediaTypes": [ "image~1gif", @@ -113,8 +105,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentf117c932f7" @@ -127,8 +117,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment4f3fcf6bd1" @@ -141,8 +129,6 @@ }, "ExplicitApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -153,8 +139,6 @@ }, "ServerlessRestApiDeployment4f3fcf6bd1": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -165,8 +149,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_with_binary_media_types_definition_body.json b/tests/translator/output/api_with_binary_media_types_definition_body.json index f3d2e11ff..6a9e500f8 100644 --- a/tests/translator/output/api_with_binary_media_types_definition_body.json +++ b/tests/translator/output/api_with_binary_media_types_definition_body.json @@ -8,8 +8,6 @@ "Resources": { "ExplicitApiManagedSwaggerProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiManagedSwaggerDeploymentfe9c2c09a2" @@ -22,8 +20,6 @@ }, "ExplicitApiManagedSwaggerDeploymentfe9c2c09a2": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApiManagedSwagger" @@ -34,8 +30,6 @@ }, "ExplicitApiDefinitionBody": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "paths": {}, @@ -73,8 +67,6 @@ }, "ExplicitApiDefinitionBodyDeployment1f26996adb": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApiDefinitionBody" @@ -85,8 +77,6 @@ }, "ExplicitApiDefinitionBodyProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDefinitionBodyDeployment1f26996adb" @@ -99,8 +89,6 @@ }, "ExplicitApiManagedSwagger": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_with_canary_setting.json b/tests/translator/output/api_with_canary_setting.json index 97c219fdd..34a785874 100644 --- a/tests/translator/output/api_with_canary_setting.json +++ b/tests/translator/output/api_with_canary_setting.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ExplicitApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -71,8 +65,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -94,8 +86,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BodyS3Location": { "Bucket": "sam-demo-bucket", @@ -105,8 +95,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "CanarySetting": { "PercentTraffic": 100, @@ -127,8 +115,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "CanarySetting": { "PercentTraffic": 100, @@ -149,8 +135,6 @@ }, "ServerlessRestApiDeployment62b96c1a61": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -161,8 +145,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_with_cors.json b/tests/translator/output/api_with_cors.json index 4ffa1323b..cfba9bdc4 100644 --- a/tests/translator/output/api_with_cors.json +++ b/tests/translator/output/api_with_cors.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ImplicitApiFunctionAnyApiPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -82,8 +76,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -220,8 +212,6 @@ }, "GetHtmlFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -252,8 +242,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymente13d39e2d1" @@ -266,8 +254,6 @@ }, "ServerlessRestApiDeploymente13d39e2d1": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -278,8 +264,6 @@ }, "RestApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -310,8 +294,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -333,8 +315,6 @@ }, "ExplicitApiDeployment3a5a78688c": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -345,8 +325,6 @@ }, "RestApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -370,8 +348,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment3a5a78688c" @@ -384,8 +360,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -522,8 +496,6 @@ }, "GetHtmlFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { diff --git a/tests/translator/output/api_with_cors_and_auth_no_preflight_auth.json b/tests/translator/output/api_with_cors_and_auth_no_preflight_auth.json index 90393f242..678e33d5d 100644 --- a/tests/translator/output/api_with_cors_and_auth_no_preflight_auth.json +++ b/tests/translator/output/api_with_cors_and_auth_no_preflight_auth.json @@ -2,8 +2,6 @@ "Resources": { "ServerlessApiDeploymente70e322247": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessApi" @@ -14,8 +12,6 @@ }, "ServerlessApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -129,8 +125,6 @@ }, "ApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -161,8 +155,6 @@ }, "ApiFunctionPostHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -184,8 +176,6 @@ }, "ServerlessApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessApiDeploymente70e322247" @@ -198,8 +188,6 @@ }, "ApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -221,8 +209,6 @@ }, "ApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -246,8 +232,6 @@ }, "MyAuthFn": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -271,8 +255,6 @@ }, "MyAuthFnRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -303,8 +285,6 @@ }, "ServerlessApiMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/api_with_cors_and_auth_preflight_auth.json b/tests/translator/output/api_with_cors_and_auth_preflight_auth.json index 4db7fa6ff..9dc875a08 100644 --- a/tests/translator/output/api_with_cors_and_auth_preflight_auth.json +++ b/tests/translator/output/api_with_cors_and_auth_preflight_auth.json @@ -2,8 +2,6 @@ "Resources": { "ServerlessApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -122,8 +120,6 @@ }, "ServerlessApiDeployment5355b9449d": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessApi" @@ -134,8 +130,6 @@ }, "ApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -166,8 +160,6 @@ }, "ApiFunctionPostHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -189,8 +181,6 @@ }, "ServerlessApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessApiDeployment5355b9449d" @@ -203,8 +193,6 @@ }, "ApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -226,8 +214,6 @@ }, "ApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -251,8 +237,6 @@ }, "MyAuthFn": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -276,8 +260,6 @@ }, "MyAuthFnRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -308,8 +290,6 @@ }, "ServerlessApiMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/api_with_cors_and_conditions_no_definitionbody.json b/tests/translator/output/api_with_cors_and_conditions_no_definitionbody.json index 9126c33c3..432861ca3 100644 --- a/tests/translator/output/api_with_cors_and_conditions_no_definitionbody.json +++ b/tests/translator/output/api_with_cors_and_conditions_no_definitionbody.json @@ -11,8 +11,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -37,8 +35,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -70,8 +66,6 @@ }, "ImplicitApiFunctionPostHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -94,8 +88,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentae0b2acf4c" @@ -108,8 +100,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -230,8 +220,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -254,8 +242,6 @@ }, "ExplicitApiDeploymentae0b2acf4c": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -266,8 +252,6 @@ }, "ImplicitApiFunction2Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -298,8 +282,6 @@ }, "ImplicitApiFunction2DeleteHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -321,8 +303,6 @@ }, "ImplicitApiFunction2": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { diff --git a/tests/translator/output/api_with_cors_and_only_credentials_false.json b/tests/translator/output/api_with_cors_and_only_credentials_false.json index 5c49334b5..f7ba8c842 100644 --- a/tests/translator/output/api_with_cors_and_only_credentials_false.json +++ b/tests/translator/output/api_with_cors_and_only_credentials_false.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment398246867a" @@ -73,8 +67,6 @@ }, "ExplicitApiDeployment398246867a": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -85,8 +77,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_with_cors_and_only_headers.json b/tests/translator/output/api_with_cors_and_only_headers.json index ff2dafb0c..ff15ff8ee 100644 --- a/tests/translator/output/api_with_cors_and_only_headers.json +++ b/tests/translator/output/api_with_cors_and_only_headers.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ImplicitApiFunctionPostHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -82,8 +76,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment03e65d7ea2" @@ -96,8 +88,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment602730b2df" @@ -110,8 +100,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -240,8 +228,6 @@ }, "ExplicitApiDeployment03e65d7ea2": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -252,8 +238,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -275,8 +259,6 @@ }, "ServerlessRestApiDeployment602730b2df": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -287,8 +269,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_with_cors_and_only_maxage.json b/tests/translator/output/api_with_cors_and_only_maxage.json index cb0f054de..24d3d89f7 100644 --- a/tests/translator/output/api_with_cors_and_only_maxage.json +++ b/tests/translator/output/api_with_cors_and_only_maxage.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ExplicitApiDeploymentb61cfb7d60": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -71,8 +65,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentb61cfb7d60" @@ -85,8 +77,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_with_cors_and_only_methods.json b/tests/translator/output/api_with_cors_and_only_methods.json index dc070b52a..860e79702 100644 --- a/tests/translator/output/api_with_cors_and_only_methods.json +++ b/tests/translator/output/api_with_cors_and_only_methods.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -82,8 +76,6 @@ }, "ServerlessRestApiDeploymentfd83ca0941": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -94,8 +86,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentfd83ca0941" @@ -108,8 +98,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_with_cors_and_only_origins.json b/tests/translator/output/api_with_cors_and_only_origins.json index 42bbe195a..c3bd97b70 100644 --- a/tests/translator/output/api_with_cors_and_only_origins.json +++ b/tests/translator/output/api_with_cors_and_only_origins.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ExplicitApiDeploymenta7a992bbb6": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -71,8 +65,6 @@ }, "ImplicitApiFunctionPostHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -94,8 +86,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymenta7a992bbb6" @@ -108,8 +98,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment4be3cdc28b" @@ -122,8 +110,6 @@ }, "ServerlessRestApiDeployment4be3cdc28b": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -134,8 +120,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -256,8 +240,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -279,8 +261,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_with_cors_no_definitionbody.json b/tests/translator/output/api_with_cors_no_definitionbody.json index 4e46c096d..4adbce835 100644 --- a/tests/translator/output/api_with_cors_no_definitionbody.json +++ b/tests/translator/output/api_with_cors_no_definitionbody.json @@ -3,8 +3,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -26,8 +24,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -56,8 +52,6 @@ }, "ImplicitApiFunctionPostHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -79,8 +73,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -102,8 +94,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -182,8 +172,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment4be3cdc28b" @@ -196,8 +184,6 @@ }, "ExplicitApiDeployment4be3cdc28b": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" diff --git a/tests/translator/output/api_with_cors_openapi_3.json b/tests/translator/output/api_with_cors_openapi_3.json index df0e2b17e..c23c96f36 100644 --- a/tests/translator/output/api_with_cors_openapi_3.json +++ b/tests/translator/output/api_with_cors_openapi_3.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ImplicitApiFunctionAnyApiPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -82,8 +76,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -220,8 +212,6 @@ }, "GetHtmlFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -252,8 +242,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymente3fd36e910" @@ -266,8 +254,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment8cc53ffaa5" @@ -280,8 +266,6 @@ }, "RestApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -312,8 +296,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -335,8 +317,6 @@ }, "ExplicitApiDeployment8cc53ffaa5": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -346,8 +326,6 @@ }, "ServerlessRestApiDeploymente3fd36e910": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -357,8 +335,6 @@ }, "RestApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -382,8 +358,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -516,8 +490,6 @@ }, "GetHtmlFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { diff --git a/tests/translator/output/api_with_custom_domain_route53.json b/tests/translator/output/api_with_custom_domain_route53.json index f2efcd556..6dc75456e 100644 --- a/tests/translator/output/api_with_custom_domain_route53.json +++ b/tests/translator/output/api_with_custom_domain_route53.json @@ -12,8 +12,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -36,8 +34,6 @@ }, "MyFunctionFetchPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -59,8 +55,6 @@ }, "ApiGatewayDomainName0caaf24ab1": { "Type": "AWS::ApiGateway::DomainName", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "CertificateArn": "cert-arn-in-us-east-1", "EndpointConfiguration": { @@ -73,8 +67,6 @@ }, "RecordSetGroupbd00d962a4": { "Type": "AWS::Route53::RecordSetGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "HostedZoneId": "ZQ1UAL4EFZVME", "RecordSets": [ @@ -109,8 +101,6 @@ }, "MyApiDeploymentf643ef7f59": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -120,8 +110,6 @@ }, "MyApioneBasePathMapping": { "Type": "AWS::ApiGateway::BasePathMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BasePath": "one", "DomainName": { @@ -137,8 +125,6 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeploymentf643ef7f59" @@ -151,8 +137,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -183,8 +167,6 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_with_custom_domain_route53_hosted_zone_name.json b/tests/translator/output/api_with_custom_domain_route53_hosted_zone_name.json index 9d12c5440..85799af33 100644 --- a/tests/translator/output/api_with_custom_domain_route53_hosted_zone_name.json +++ b/tests/translator/output/api_with_custom_domain_route53_hosted_zone_name.json @@ -12,8 +12,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -36,8 +34,6 @@ }, "MyFunctionFetchPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -59,8 +55,6 @@ }, "ApiGatewayDomainName0caaf24ab1": { "Type": "AWS::ApiGateway::DomainName", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "CertificateArn": "cert-arn-in-us-east-1", "EndpointConfiguration": { @@ -73,8 +67,6 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeploymenteb58d7577a" @@ -87,8 +79,6 @@ }, "MyApioneBasePathMapping": { "Type": "AWS::ApiGateway::BasePathMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BasePath": "one", "DomainName": { @@ -104,8 +94,6 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -134,8 +122,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -166,8 +152,6 @@ }, "RecordSetGroup456ebaf280": { "Type": "AWS::Route53::RecordSetGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "HostedZoneName": "www.my-domain.com.", "RecordSets": [ @@ -202,8 +186,6 @@ }, "MyApiDeploymenteb58d7577a": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" diff --git a/tests/translator/output/api_with_custom_domain_route53_hosted_zone_name_http.json b/tests/translator/output/api_with_custom_domain_route53_hosted_zone_name_http.json index 710fd4c78..d9ffc5aac 100644 --- a/tests/translator/output/api_with_custom_domain_route53_hosted_zone_name_http.json +++ b/tests/translator/output/api_with_custom_domain_route53_hosted_zone_name_http.json @@ -12,8 +12,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -36,8 +34,6 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -51,8 +47,6 @@ }, "MyApioneApiMapping": { "Type": "AWS::ApiGatewayV2::ApiMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -68,8 +62,6 @@ }, "ApiGatewayDomainNameV20caaf24ab1": { "Type": "AWS::ApiGatewayV2::DomainName", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DomainName": "example.com", "DomainNameConfigurations": [ @@ -85,8 +77,6 @@ }, "RecordSetGroup456ebaf280": { "Type": "AWS::Route53::RecordSetGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "HostedZoneName": "www.my-domain.com.", "RecordSets": [ @@ -113,8 +103,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -145,8 +133,6 @@ }, "MyFunctionFetchPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -168,8 +154,6 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_with_custom_domain_route53_http.json b/tests/translator/output/api_with_custom_domain_route53_http.json index d30fd6cce..54e445611 100644 --- a/tests/translator/output/api_with_custom_domain_route53_http.json +++ b/tests/translator/output/api_with_custom_domain_route53_http.json @@ -12,8 +12,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -36,8 +34,6 @@ }, "MyApioneApiMapping": { "Type": "AWS::ApiGatewayV2::ApiMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -53,8 +49,6 @@ }, "RecordSetGroupbd00d962a4": { "Type": "AWS::Route53::RecordSetGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "HostedZoneId": "ZQ1UAL4EFZVME", "RecordSets": [ @@ -99,8 +93,6 @@ }, "ApiGatewayDomainNameV20caaf24ab1": { "Type": "AWS::ApiGatewayV2::DomainName", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DomainName": "example.com", "DomainNameConfigurations": [ @@ -116,8 +108,6 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -131,8 +121,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -163,8 +151,6 @@ }, "MyFunctionFetchPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -186,8 +172,6 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_with_default_aws_iam_auth.json b/tests/translator/output/api_with_default_aws_iam_auth.json index 1c013d873..2e805e8af 100644 --- a/tests/translator/output/api_with_default_aws_iam_auth.json +++ b/tests/translator/output/api_with_default_aws_iam_auth.json @@ -2,8 +2,6 @@ "Resources": { "MyApiWithAwsIamAuthDeployment3364487a57": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithAwsIamAuth" @@ -14,8 +12,6 @@ }, "MyFunctionWithAwsIamAuth": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -39,8 +35,6 @@ }, "MyFunctionWithAwsIamAuthMyApiWithAwsIamAuthPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -62,8 +56,6 @@ }, "MyApiWithAwsIamAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithAwsIamAuthDeployment3364487a57" @@ -76,8 +68,6 @@ }, "MyApiWithAwsIamAuthAndDefaultInvokeRoleDeployment1edb95497c": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithAwsIamAuthAndDefaultInvokeRole" @@ -88,8 +78,6 @@ }, "MyFunctionWithAwsIamAuthMyApiWithAwsIamAuthAndDefaultInvokeRolePermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -111,8 +99,6 @@ }, "MyApiWithAwsIamAuthAndCustomInvokeRoleDeployment61108120cf": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithAwsIamAuthAndCustomInvokeRole" @@ -123,8 +109,6 @@ }, "MyApiWithAwsIamAuthAndCustomInvokeRole": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -167,8 +151,6 @@ }, "MyApiWithAwsIamAuthAndDefaultInvokeRoleProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithAwsIamAuthAndDefaultInvokeRoleDeployment1edb95497c" @@ -181,8 +163,6 @@ }, "MyApiWithAwsIamAuthAndCustomInvokeRoleProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithAwsIamAuthAndCustomInvokeRoleDeployment61108120cf" @@ -195,8 +175,6 @@ }, "MyApiWithAwsIamAuthAndDefaultInvokeRole": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -239,8 +217,6 @@ }, "MyApiWithAwsIamAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -283,8 +259,6 @@ }, "MyFunctionWithAwsIamAuthMyApiWithAwsIamAuthAndCustomInvokeRolePermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -306,8 +280,6 @@ }, "MyFunctionWithAwsIamAuthRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/api_with_default_aws_iam_auth_and_no_auth_route.json b/tests/translator/output/api_with_default_aws_iam_auth_and_no_auth_route.json index a9a72ad91..0f4214ea7 100644 --- a/tests/translator/output/api_with_default_aws_iam_auth_and_no_auth_route.json +++ b/tests/translator/output/api_with_default_aws_iam_auth_and_no_auth_route.json @@ -2,8 +2,6 @@ "Resources": { "MyFunctionWithAwsIamAuth": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -27,8 +25,6 @@ }, "MyFunctionWithAwsIamAuthMyApiWithNoAuthPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -50,8 +46,6 @@ }, "MyFunctionWithAwsIamAuthMyApiWithAwsIamAuthPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -73,8 +67,6 @@ }, "MyApiWithAwsIamAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -132,8 +124,6 @@ }, "MyApiWithAwsIamAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithAwsIamAuthDeploymentd4892df344" @@ -146,8 +136,6 @@ }, "MyApiWithAwsIamAuthDeploymentd4892df344": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithAwsIamAuth" @@ -158,8 +146,6 @@ }, "MyFunctionWithAwsIamAuthRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/api_with_gateway_responses.json b/tests/translator/output/api_with_gateway_responses.json index d6ae20c93..21cec903c 100644 --- a/tests/translator/output/api_with_gateway_responses.json +++ b/tests/translator/output/api_with_gateway_responses.json @@ -2,8 +2,6 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -100,8 +94,6 @@ }, "ExplicitApiDeploymentf63e40e7e8": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -112,8 +104,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentf63e40e7e8" @@ -126,8 +116,6 @@ }, "FunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/api_with_gateway_responses_all.json b/tests/translator/output/api_with_gateway_responses_all.json index 39b8a8bd4..2df229446 100644 --- a/tests/translator/output/api_with_gateway_responses_all.json +++ b/tests/translator/output/api_with_gateway_responses_all.json @@ -2,8 +2,6 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -109,8 +103,6 @@ }, "ExplicitApiDeploymentedbd8aa001": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -121,8 +113,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentedbd8aa001" @@ -135,8 +125,6 @@ }, "FunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/api_with_gateway_responses_all_openapi_3.json b/tests/translator/output/api_with_gateway_responses_all_openapi_3.json index c267080d5..3b90ab13e 100644 --- a/tests/translator/output/api_with_gateway_responses_all_openapi_3.json +++ b/tests/translator/output/api_with_gateway_responses_all_openapi_3.json @@ -2,8 +2,6 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ExplicitApiDeploymenta8fcf1dd74": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -70,8 +64,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -120,8 +112,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymenta8fcf1dd74" @@ -134,8 +124,6 @@ }, "FunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/api_with_gateway_responses_implicit.json b/tests/translator/output/api_with_gateway_responses_implicit.json index 0035e8470..f2ac689f1 100644 --- a/tests/translator/output/api_with_gateway_responses_implicit.json +++ b/tests/translator/output/api_with_gateway_responses_implicit.json @@ -2,8 +2,6 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "ServerlessRestApiDeploymentf63e40e7e8": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -39,8 +35,6 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -71,8 +65,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentf63e40e7e8" @@ -85,8 +77,6 @@ }, "FunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -108,8 +98,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_with_gateway_responses_minimal.json b/tests/translator/output/api_with_gateway_responses_minimal.json index eabdaae88..7ce2bfc30 100644 --- a/tests/translator/output/api_with_gateway_responses_minimal.json +++ b/tests/translator/output/api_with_gateway_responses_minimal.json @@ -2,8 +2,6 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -95,8 +89,6 @@ }, "ExplicitApiDeployment43cede1065": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -107,8 +99,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment43cede1065" @@ -121,8 +111,6 @@ }, "FunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/api_with_gateway_responses_string_status_code.json b/tests/translator/output/api_with_gateway_responses_string_status_code.json index d6ae20c93..21cec903c 100644 --- a/tests/translator/output/api_with_gateway_responses_string_status_code.json +++ b/tests/translator/output/api_with_gateway_responses_string_status_code.json @@ -2,8 +2,6 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -100,8 +94,6 @@ }, "ExplicitApiDeploymentf63e40e7e8": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -112,8 +104,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentf63e40e7e8" @@ -126,8 +116,6 @@ }, "FunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/api_with_if_conditional_with_resource_policy.json b/tests/translator/output/api_with_if_conditional_with_resource_policy.json index 685b59d75..74572a17f 100644 --- a/tests/translator/output/api_with_if_conditional_with_resource_policy.json +++ b/tests/translator/output/api_with_if_conditional_with_resource_policy.json @@ -10,8 +10,6 @@ "Resources": { "ExplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -35,8 +33,6 @@ }, "ExplicitApiFunctionPutHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -58,8 +54,6 @@ }, "ExplicitApiDeploymenta1d4cfbf94": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -70,8 +64,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -141,8 +133,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymenta1d4cfbf94" @@ -155,8 +145,6 @@ }, "ExplicitApiFunctionPostHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -178,8 +166,6 @@ }, "ExplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -210,8 +196,6 @@ }, "ExplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/api_with_incompatible_stage_name.json b/tests/translator/output/api_with_incompatible_stage_name.json index cec8421f0..892f19474 100644 --- a/tests/translator/output/api_with_incompatible_stage_name.json +++ b/tests/translator/output/api_with_incompatible_stage_name.json @@ -2,8 +2,6 @@ "Resources": { "HyphenApiDeployment19b8787883": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "HyphenApi" @@ -14,8 +12,6 @@ }, "UnderscoreApiStageb34d3ad84e": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "UnderscoreApiDeploymentc6c2bbcee6" @@ -28,8 +24,6 @@ }, "UnderscoreApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -78,8 +72,6 @@ }, "UnderscoreFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -110,8 +102,6 @@ }, "UnderscoreApiDeploymentc6c2bbcee6": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "UnderscoreApi" @@ -122,8 +112,6 @@ }, "HyphenFunctionGetHtmlPermission0c8ecc62cb": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -143,8 +131,6 @@ }, "HyphenApiStage0c8ecc62cb": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "HyphenApiDeployment19b8787883" @@ -157,8 +143,6 @@ }, "UnderscoreFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -182,8 +166,6 @@ }, "UnderscoreFunctionGetHtmlPermissionb34d3ad84e": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -203,8 +185,6 @@ }, "HyphenFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -228,8 +208,6 @@ }, "HyphenApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -278,8 +256,6 @@ }, "HyphenFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/api_with_ip_range_blacklist.json b/tests/translator/output/api_with_ip_range_blacklist.json index c211c3bfd..ae55e7870 100644 --- a/tests/translator/output/api_with_ip_range_blacklist.json +++ b/tests/translator/output/api_with_ip_range_blacklist.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -26,8 +24,6 @@ }, "ServerlessRestApiDeploymentd123ec976c": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -38,8 +34,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentd123ec976c" @@ -52,8 +46,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -84,8 +76,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -175,8 +165,6 @@ }, "MyFunctionApiPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/api_with_ip_range_whitelist.json b/tests/translator/output/api_with_ip_range_whitelist.json index fe8670a50..3093550ef 100644 --- a/tests/translator/output/api_with_ip_range_whitelist.json +++ b/tests/translator/output/api_with_ip_range_whitelist.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -26,8 +24,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment864f081ed8" @@ -40,8 +36,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -72,8 +66,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -166,8 +158,6 @@ }, "ServerlessRestApiDeployment864f081ed8": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -178,8 +168,6 @@ }, "MyFunctionApiPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/api_with_method_aws_iam_auth.json b/tests/translator/output/api_with_method_aws_iam_auth.json index d93e19f93..09de6a24d 100644 --- a/tests/translator/output/api_with_method_aws_iam_auth.json +++ b/tests/translator/output/api_with_method_aws_iam_auth.json @@ -2,8 +2,6 @@ "Resources": { "MyFunctionWithAwsIamAuthMyApiWithAwsIamAuthPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -25,8 +23,6 @@ }, "MyFunctionWithAwsIamAuthMyApiWithAwsIamAuthAndCustomInvokeRolePermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -48,8 +44,6 @@ }, "MyApiWithoutAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -124,8 +118,6 @@ }, "MyFunctionWithAwsIamAuthMyApiWithAwsIamAuthAndDefaultInvokeRolePermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -147,8 +139,6 @@ }, "MyFunctionWithAwsIamAuth": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -172,8 +162,6 @@ }, "MyApiWithoutAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithoutAuthDeployment0cf1ab8c4c" @@ -186,8 +174,6 @@ }, "MyApiWithoutAuthDeployment0cf1ab8c4c": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithoutAuth" @@ -198,8 +184,6 @@ }, "MyFunctionWithAwsIamAuthRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/api_with_method_settings.json b/tests/translator/output/api_with_method_settings.json index 750d5f1c3..4f6c874ed 100644 --- a/tests/translator/output/api_with_method_settings.json +++ b/tests/translator/output/api_with_method_settings.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ExplicitApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -71,8 +65,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -94,8 +86,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BodyS3Location": { "Bucket": "sam-demo-bucket", @@ -105,8 +95,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "MethodSettings": [ { @@ -128,8 +116,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "MethodSettings": [ { @@ -151,8 +137,6 @@ }, "ServerlessRestApiDeployment62b96c1a61": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -163,8 +147,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_with_minimum_compression_size.json b/tests/translator/output/api_with_minimum_compression_size.json index cb966a430..dba335192 100644 --- a/tests/translator/output/api_with_minimum_compression_size.json +++ b/tests/translator/output/api_with_minimum_compression_size.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ExplicitApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -71,8 +65,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -94,8 +86,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "MinimumCompressionSize": 256, "BodyS3Location": { @@ -106,8 +96,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentf117c932f7" @@ -120,8 +108,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment62b96c1a61" @@ -134,8 +120,6 @@ }, "ServerlessRestApiDeployment62b96c1a61": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -146,8 +130,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_with_open_api_version.json b/tests/translator/output/api_with_open_api_version.json index da99127d6..165c18aa8 100644 --- a/tests/translator/output/api_with_open_api_version.json +++ b/tests/translator/output/api_with_open_api_version.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ServerlessRestApiDeployment1471b71104": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -70,8 +64,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -93,8 +85,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -110,8 +100,6 @@ }, "ExplicitApiDeploymentd9a0f2ae4f": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -121,8 +109,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment1471b71104" @@ -135,8 +121,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentd9a0f2ae4f" @@ -149,8 +133,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_with_open_api_version_2.json b/tests/translator/output/api_with_open_api_version_2.json index ab9fbd285..b357135d6 100644 --- a/tests/translator/output/api_with_open_api_version_2.json +++ b/tests/translator/output/api_with_open_api_version_2.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -82,8 +76,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -99,8 +91,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment4154e1c30c" @@ -113,8 +103,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment32f05a472e" @@ -127,8 +115,6 @@ }, "ServerlessRestApiDeployment32f05a472e": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -138,8 +124,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -208,8 +192,6 @@ }, "ExplicitApiDeployment4154e1c30c": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" diff --git a/tests/translator/output/api_with_openapi_definition_body_no_flag.json b/tests/translator/output/api_with_openapi_definition_body_no_flag.json index e4da950ae..2cf200b3b 100644 --- a/tests/translator/output/api_with_openapi_definition_body_no_flag.json +++ b/tests/translator/output/api_with_openapi_definition_body_no_flag.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ExplicitApiDeployment9252467a1e": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -71,8 +65,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -128,8 +120,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -147,8 +137,6 @@ }, "ServerlessRestApiDeploymentdb4b9da82a": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -159,8 +147,6 @@ }, "ExplicitApiSomeStageStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -178,8 +164,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -201,8 +185,6 @@ }, "MyUserPool": { "Type": "AWS::Cognito::UserPool", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "UsernameAttributes": [ "email" @@ -224,8 +206,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_with_path_parameters.json b/tests/translator/output/api_with_path_parameters.json index 1fd1507c5..7415250d2 100644 --- a/tests/translator/output/api_with_path_parameters.json +++ b/tests/translator/output/api_with_path_parameters.json @@ -2,8 +2,6 @@ "Resources": { "HtmlFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -34,8 +32,6 @@ }, "HtmlApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "HtmlApiDeploymentf117c932f7" @@ -48,8 +44,6 @@ }, "HtmlFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -69,8 +63,6 @@ }, "HtmlApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "HtmlApi" @@ -81,8 +73,6 @@ }, "HtmlApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BodyS3Location": { "Bucket": "sam-demo-bucket", @@ -92,8 +82,6 @@ }, "HtmlFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/api_with_resource_policy.json b/tests/translator/output/api_with_resource_policy.json index e93a78e9e..4fd6e00f6 100644 --- a/tests/translator/output/api_with_resource_policy.json +++ b/tests/translator/output/api_with_resource_policy.json @@ -2,8 +2,6 @@ "Resources": { "ExplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "ExplicitApiFunctionPutHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -50,8 +46,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -113,8 +107,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment215ee6137d" @@ -127,8 +119,6 @@ }, "ExplicitApiFunctionPostHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -150,8 +140,6 @@ }, "ExplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -182,8 +170,6 @@ }, "ExplicitApiDeployment215ee6137d": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -194,8 +180,6 @@ }, "ExplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/api_with_resource_policy_global.json b/tests/translator/output/api_with_resource_policy_global.json index 666d7f525..15b8d9910 100644 --- a/tests/translator/output/api_with_resource_policy_global.json +++ b/tests/translator/output/api_with_resource_policy_global.json @@ -16,8 +16,6 @@ "Resources": { "AnotherApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -53,8 +51,6 @@ }, "ExplicitApiDeploymenta5a5c4e3ff": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -65,8 +61,6 @@ }, "ExplicitApiStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymenta5a5c4e3ff" @@ -81,8 +75,6 @@ }, "ExplicitApiFunctionGetHtmlPermissionStage": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -104,8 +96,6 @@ }, "AnotherApiDeploymentfdf1387e0a": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "AnotherApi" @@ -116,8 +106,6 @@ }, "ExplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -141,8 +129,6 @@ }, "ExplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -173,8 +159,6 @@ }, "AnotherApiStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "AnotherApiDeploymentfdf1387e0a" @@ -189,8 +173,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_with_resource_policy_global_implicit.json b/tests/translator/output/api_with_resource_policy_global_implicit.json index 991838ecb..b8a576235 100644 --- a/tests/translator/output/api_with_resource_policy_global_implicit.json +++ b/tests/translator/output/api_with_resource_policy_global_implicit.json @@ -2,8 +2,6 @@ "Resources": { "MinimalFunctionAddItemPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -25,8 +23,6 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -57,8 +53,6 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -82,8 +76,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment1ecad21e32" @@ -96,8 +88,6 @@ }, "ServerlessRestApiDeployment1ecad21e32": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -108,8 +98,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_with_resource_refs.json b/tests/translator/output/api_with_resource_refs.json index 73bcfea74..2765deb4e 100644 --- a/tests/translator/output/api_with_resource_refs.json +++ b/tests/translator/output/api_with_resource_refs.json @@ -24,8 +24,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -49,8 +47,6 @@ }, "MyApiDeployment359f256a3b": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -61,8 +57,6 @@ }, "MyApifooStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment359f256a3b" @@ -75,8 +69,6 @@ }, "ServerlessRestApiDeploymente468b80e17": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -87,8 +79,6 @@ }, "MyFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -110,8 +100,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymente468b80e17" @@ -124,8 +112,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -156,8 +142,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -186,8 +170,6 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "this": "is", diff --git a/tests/translator/output/api_with_source_vpc_blacklist.json b/tests/translator/output/api_with_source_vpc_blacklist.json index 39b9a5406..3923d1d60 100644 --- a/tests/translator/output/api_with_source_vpc_blacklist.json +++ b/tests/translator/output/api_with_source_vpc_blacklist.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -26,8 +24,6 @@ }, "ServerlessRestApiDeployment0e25d06cd3": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -38,8 +34,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment0e25d06cd3" @@ -52,8 +46,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -84,8 +76,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -156,8 +146,6 @@ }, "MyFunctionApiPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/api_with_source_vpc_whitelist.json b/tests/translator/output/api_with_source_vpc_whitelist.json index 0ab3b0649..715b18831 100644 --- a/tests/translator/output/api_with_source_vpc_whitelist.json +++ b/tests/translator/output/api_with_source_vpc_whitelist.json @@ -8,8 +8,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -32,8 +30,6 @@ }, "MyFunctionFetchPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -55,8 +51,6 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment5332c373d4" @@ -69,8 +63,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment276f3672ac" @@ -83,8 +75,6 @@ }, "MyApiDeployment5332c373d4": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -95,8 +85,6 @@ }, "ServerlessRestApiDeployment276f3672ac": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -107,8 +95,6 @@ }, "MyFunctionApiPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -130,8 +116,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -162,8 +146,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -285,8 +267,6 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/api_with_stage_tags.json b/tests/translator/output/api_with_stage_tags.json index 2bfc01383..702a6b181 100644 --- a/tests/translator/output/api_with_stage_tags.json +++ b/tests/translator/output/api_with_stage_tags.json @@ -8,8 +8,6 @@ "Resources": { "MyApiWithStageTagsDeployment5332c373d4": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithStageTags" @@ -20,8 +18,6 @@ }, "MyApiWithStageTags": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -37,8 +33,6 @@ }, "MyApiWithStageTagsProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithStageTagsDeployment5332c373d4" diff --git a/tests/translator/output/api_with_swagger_and_openapi_with_auth.json b/tests/translator/output/api_with_swagger_and_openapi_with_auth.json index 663be750d..03c070ad7 100644 --- a/tests/translator/output/api_with_swagger_and_openapi_with_auth.json +++ b/tests/translator/output/api_with_swagger_and_openapi_with_auth.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -115,8 +109,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -134,8 +126,6 @@ }, "ServerlessRestApiDeploymentdb4b9da82a": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -146,8 +136,6 @@ }, "ExplicitApiSomeStageStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -165,8 +153,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -188,8 +174,6 @@ }, "MyUserPool": { "Type": "AWS::Cognito::UserPool", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "UsernameAttributes": [ "email" @@ -211,8 +195,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -266,8 +248,6 @@ }, "ExplicitApiDeployment7c4f7dda23": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" diff --git a/tests/translator/output/api_with_usageplans.json b/tests/translator/output/api_with_usageplans.json index 536495525..488548465 100644 --- a/tests/translator/output/api_with_usageplans.json +++ b/tests/translator/output/api_with_usageplans.json @@ -40,8 +40,6 @@ "Resources": { "MyFunctionThreeRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -72,8 +70,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment7a26848ac9" @@ -86,8 +82,6 @@ }, "MyApiTwoUsagePlanKey": { "Type": "AWS::ApiGateway::UsagePlanKey", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "KeyType": "API_KEY", "KeyId": { @@ -103,8 +97,6 @@ }, "MyApiThree": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -145,8 +137,6 @@ }, "ServerlessRestApiDeployment7a26848ac9": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -157,8 +147,6 @@ }, "MyFunctionThreeApiKeyPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -180,8 +168,6 @@ }, "MyFunctionTwo": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -204,8 +190,6 @@ }, "MyFunctionOneApiKeyPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -227,8 +211,6 @@ }, "MyApiOneDeployment46fb22a429": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiOne" @@ -239,8 +221,6 @@ }, "MyFunctionTwoApiKeyPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -262,8 +242,6 @@ }, "MyFunctionOneRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -294,8 +272,6 @@ }, "MyApiTwo": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -336,8 +312,6 @@ }, "MyFunctionTwoRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -368,8 +342,6 @@ }, "MyFunctionOne": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -392,8 +364,6 @@ }, "ServerlessUsagePlan": { "Type": "AWS::ApiGateway::UsagePlan", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiStages": [ { @@ -421,8 +391,6 @@ }, "MyApiTwoUsagePlan": { "Type": "AWS::ApiGateway::UsagePlan", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiStages": [ { @@ -462,8 +430,6 @@ }, "MyApiThreeDeployment1d9cff47dc": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiThree" @@ -474,8 +440,6 @@ }, "MyFunctionTwoImplicitApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -497,8 +461,6 @@ }, "MyApiTwoProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiTwoDeploymente9d97923b9" @@ -511,8 +473,6 @@ }, "MyApiOneProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiOneDeployment46fb22a429" @@ -525,8 +485,6 @@ }, "MyApiTwoDeploymente9d97923b9": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiTwo" @@ -537,8 +495,6 @@ }, "MyFunctionThree": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -561,8 +517,6 @@ }, "MyApiThreeProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiThreeDeployment1d9cff47dc" @@ -575,8 +529,6 @@ }, "ServerlessUsagePlanKey": { "Type": "AWS::ApiGateway::UsagePlanKey", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "KeyType": "API_KEY", "KeyId": { @@ -592,8 +544,6 @@ }, "MyApiOne": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -634,8 +584,6 @@ }, "ServerlessApiKey": { "Type": "AWS::ApiGateway::ApiKey", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Enabled": true, "StageKeys": [ @@ -663,8 +611,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -705,8 +651,6 @@ }, "MyApiTwoApiKey": { "Type": "AWS::ApiGateway::ApiKey", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Enabled": true, "StageKeys": [ diff --git a/tests/translator/output/api_with_usageplans_intrinsics.json b/tests/translator/output/api_with_usageplans_intrinsics.json index 2026da551..ce2e5413d 100644 --- a/tests/translator/output/api_with_usageplans_intrinsics.json +++ b/tests/translator/output/api_with_usageplans_intrinsics.json @@ -30,8 +30,6 @@ "Resources": { "MyApiTwoUsagePlanKey": { "Type": "AWS::ApiGateway::UsagePlanKey", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "KeyType": "API_KEY", "KeyId": { @@ -47,8 +45,6 @@ }, "MyApiTwoDeploymenta78b9db9dd": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiTwo" @@ -58,8 +54,6 @@ }, "MyApiOneUsagePlan": { "Type": "AWS::ApiGateway::UsagePlan", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiStages": [ { @@ -79,8 +73,6 @@ }, "MyApiTwoUsagePlan": { "Type": "AWS::ApiGateway::UsagePlan", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiStages": [ { @@ -99,8 +91,6 @@ }, "MyApiTwoProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiTwoDeploymenta78b9db9dd" @@ -113,8 +103,6 @@ }, "MyApiOneDeployment37a3a51a0f": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiOne" @@ -125,8 +113,6 @@ }, "MyApiOneProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiOneDeployment37a3a51a0f" @@ -140,8 +126,6 @@ }, "MyApiOneApiKey": { "Type": "AWS::ApiGateway::ApiKey", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Enabled": true, "StageKeys": [ @@ -162,8 +146,6 @@ }, "MyFunctionTwoRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -194,8 +176,6 @@ }, "MyApiOneUsagePlanKey": { "Type": "AWS::ApiGateway::UsagePlanKey", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "KeyType": "API_KEY", "KeyId": { @@ -212,8 +192,6 @@ }, "MyApiTwoApiKey": { "Type": "AWS::ApiGateway::ApiKey", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Enabled": true, "StageKeys": [ @@ -233,8 +211,6 @@ }, "MyFunctionOneApiKeyPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -256,8 +232,6 @@ }, "MyFunctionTwo": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -280,8 +254,6 @@ }, "MyFunctionTwoApiKeyPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -303,8 +275,6 @@ }, "MyFunctionOneRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -335,8 +305,6 @@ }, "MyApiTwo": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -379,8 +347,6 @@ }, "MyApiOne": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -424,8 +390,6 @@ }, "MyFunctionOne": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { diff --git a/tests/translator/output/api_with_xray_tracing.json b/tests/translator/output/api_with_xray_tracing.json index adf696219..04fb1acb4 100644 --- a/tests/translator/output/api_with_xray_tracing.json +++ b/tests/translator/output/api_with_xray_tracing.json @@ -2,8 +2,6 @@ "Resources": { "HtmlFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -34,8 +32,6 @@ }, "HtmlApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "HtmlApiDeploymentf117c932f7" @@ -49,8 +45,6 @@ }, "HtmlFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -70,8 +64,6 @@ }, "HtmlApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "HtmlApi" @@ -82,8 +74,6 @@ }, "HtmlApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BodyS3Location": { "Bucket": "sam-demo-bucket", @@ -93,8 +83,6 @@ }, "HtmlFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/application_preparing_state.json b/tests/translator/output/application_preparing_state.json index bfb82c032..92fe7cc8d 100644 --- a/tests/translator/output/application_preparing_state.json +++ b/tests/translator/output/application_preparing_state.json @@ -2,8 +2,6 @@ "Resources": { "PreparingApplication": { "Type": "AWS::CloudFormation::Stack", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "TemplateURL": "https://awsserverlessrepo-changesets-xxx.s3.amazonaws.com/signed-url", "Tags": [ diff --git a/tests/translator/output/application_with_intrinsics.json b/tests/translator/output/application_with_intrinsics.json index d72f4513d..d0fa43411 100644 --- a/tests/translator/output/application_with_intrinsics.json +++ b/tests/translator/output/application_with_intrinsics.json @@ -28,8 +28,6 @@ "Resources": { "ApplicationFindInMap": { "Type": "AWS::CloudFormation::Stack", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "NotificationARNs": [ { @@ -55,8 +53,6 @@ }, "ApplicationRefParameter": { "Type": "AWS::CloudFormation::Stack", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "TemplateURL": "https://awsserverlessrepo-changesets-xxx.s3.amazonaws.com/signed-url", "Tags": [ @@ -76,9 +72,7 @@ } }, "Sns": { - "Type": "AWS::SNS::Topic", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::SNS::Topic" } } } diff --git a/tests/translator/output/aws-cn/alexa_skill.json b/tests/translator/output/aws-cn/alexa_skill.json index 77d8f6071..73a380102 100644 --- a/tests/translator/output/aws-cn/alexa_skill.json +++ b/tests/translator/output/aws-cn/alexa_skill.json @@ -4,9 +4,6 @@ "Resources": { "AlexaSkillFuncRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -37,9 +34,6 @@ }, "AlexaSkillFuncAlexaSkillEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { @@ -50,9 +44,6 @@ }, "AlexaSkillFunc": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-cn/alexa_skill_with_skill_id.json b/tests/translator/output/aws-cn/alexa_skill_with_skill_id.json index 41006ae00..c623420fa 100644 --- a/tests/translator/output/aws-cn/alexa_skill_with_skill_id.json +++ b/tests/translator/output/aws-cn/alexa_skill_with_skill_id.json @@ -4,9 +4,6 @@ "Resources": { "AlexaSkillFuncRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -37,9 +34,6 @@ }, "AlexaSkillFuncAlexaSkillEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { @@ -51,9 +45,6 @@ }, "AlexaSkillFunc": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-cn/all_policy_templates.json b/tests/translator/output/aws-cn/all_policy_templates.json index 4664a956b..7ba527e40 100644 --- a/tests/translator/output/aws-cn/all_policy_templates.json +++ b/tests/translator/output/aws-cn/all_policy_templates.json @@ -2,9 +2,6 @@ "Resources": { "KitchenSinkFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "Handler": "hello.handler", "Code": { @@ -28,9 +25,6 @@ }, "KitchenSinkFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", diff --git a/tests/translator/output/aws-cn/api_cache.json b/tests/translator/output/aws-cn/api_cache.json index ff361179b..c087e4721 100644 --- a/tests/translator/output/aws-cn/api_cache.json +++ b/tests/translator/output/aws-cn/api_cache.json @@ -2,9 +2,6 @@ "Resources": { "HtmlFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -35,9 +32,6 @@ }, "HtmlApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "CacheClusterEnabled": true, "DeploymentId": { @@ -52,9 +46,6 @@ }, "HtmlFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -74,9 +65,6 @@ }, "HtmlApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "RestApiId": { "Ref": "HtmlApi" @@ -87,9 +75,6 @@ }, "HtmlApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "EndpointConfiguration": { "Types": [ @@ -107,9 +92,6 @@ }, "HtmlFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-cn/api_description.json b/tests/translator/output/aws-cn/api_description.json index bc6d6c05c..f5277b61d 100644 --- a/tests/translator/output/aws-cn/api_description.json +++ b/tests/translator/output/aws-cn/api_description.json @@ -2,9 +2,6 @@ "Resources": { "FunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -35,9 +32,6 @@ }, "ApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "DeploymentId": { "Ref": "ApiDeploymentf117c932f7" @@ -50,9 +44,6 @@ }, "FunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -72,9 +63,6 @@ }, "ApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "RestApiId": { "Ref": "Api" @@ -85,9 +73,6 @@ }, "Api": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "BodyS3Location": { "Bucket": "sam-demo-bucket", @@ -106,9 +91,6 @@ }, "Function": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-cn/api_endpoint_configuration.json b/tests/translator/output/aws-cn/api_endpoint_configuration.json index 495e7ec23..443bee42d 100644 --- a/tests/translator/output/aws-cn/api_endpoint_configuration.json +++ b/tests/translator/output/aws-cn/api_endpoint_configuration.json @@ -7,8 +7,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -32,8 +30,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -64,8 +60,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -87,8 +81,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -106,8 +98,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentf117c932f7" @@ -120,8 +110,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentcb4fb12558" @@ -134,8 +122,6 @@ }, "ServerlessRestApiDeploymentcb4fb12558": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -146,8 +132,6 @@ }, "ExplicitApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -158,8 +142,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_endpoint_configuration_with_vpcendpoint.json b/tests/translator/output/aws-cn/api_endpoint_configuration_with_vpcendpoint.json index 3d81fccc0..865c90473 100644 --- a/tests/translator/output/aws-cn/api_endpoint_configuration_with_vpcendpoint.json +++ b/tests/translator/output/aws-cn/api_endpoint_configuration_with_vpcendpoint.json @@ -10,8 +10,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -35,8 +33,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -67,8 +63,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -90,8 +84,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -109,8 +101,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentf117c932f7" @@ -123,8 +113,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentcb4fb12558" @@ -137,8 +125,6 @@ }, "ServerlessRestApiDeploymentcb4fb12558": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -149,8 +135,6 @@ }, "ExplicitApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -161,8 +145,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_request_model.json b/tests/translator/output/aws-cn/api_request_model.json index caf9a0b47..1e9c27cef 100644 --- a/tests/translator/output/aws-cn/api_request_model.json +++ b/tests/translator/output/aws-cn/api_request_model.json @@ -2,8 +2,6 @@ "Resources": { "HtmlFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -34,8 +32,6 @@ }, "HtmlApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "HtmlApiDeploymentd7bcfbe715" @@ -48,8 +44,6 @@ }, "HtmlFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -69,8 +63,6 @@ }, "HtmlApiDeploymentd7bcfbe715": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "HtmlApi" @@ -81,8 +73,6 @@ }, "HtmlApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -139,8 +129,6 @@ }, "HtmlFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-cn/api_request_model_openapi_3.json b/tests/translator/output/aws-cn/api_request_model_openapi_3.json index 37c03342e..df8c77769 100644 --- a/tests/translator/output/aws-cn/api_request_model_openapi_3.json +++ b/tests/translator/output/aws-cn/api_request_model_openapi_3.json @@ -2,8 +2,6 @@ "Resources": { "HtmlApiDeployment5ae7e42cea": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "HtmlApi" @@ -13,8 +11,6 @@ }, "HtmlFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -45,8 +41,6 @@ }, "HtmlApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "HtmlApiDeployment5ae7e42cea" @@ -59,8 +53,6 @@ }, "HtmlFunctionIamPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -82,8 +74,6 @@ }, "HtmlApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -178,8 +168,6 @@ }, "HtmlFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -199,8 +187,6 @@ }, "HtmlFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { diff --git a/tests/translator/output/aws-cn/api_with_access_log_setting.json b/tests/translator/output/aws-cn/api_with_access_log_setting.json index 7aecf82b6..06436e91f 100644 --- a/tests/translator/output/aws-cn/api_with_access_log_setting.json +++ b/tests/translator/output/aws-cn/api_with_access_log_setting.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -82,8 +76,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -101,8 +93,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AccessLogSetting": { "DestinationArn": "arn:aws:logs:us-west-2:012345678901/API-Gateway-Execution-Logs_0123456789/prod:log-stream:12345678910", @@ -119,8 +109,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AccessLogSetting": { "DestinationArn": "arn:aws:logs:us-west-2:012345678901/API-Gateway-Execution-Logs_0123456789/prod:log-stream:12345678910", @@ -137,8 +125,6 @@ }, "ServerlessRestApiDeploymentcb4fb12558": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -149,8 +135,6 @@ }, "ExplicitApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -161,8 +145,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_apikey_default_override.json b/tests/translator/output/aws-cn/api_with_apikey_default_override.json index e8409b139..3369f0776 100644 --- a/tests/translator/output/aws-cn/api_with_apikey_default_override.json +++ b/tests/translator/output/aws-cn/api_with_apikey_default_override.json @@ -2,8 +2,6 @@ "Resources": { "MyApiWithAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithAuthDeployment12e3363002" @@ -16,8 +14,6 @@ }, "MyFunctionWithApiKeyRequiredTrueMyApiWithApiKeyRequiredTruePermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -39,8 +35,6 @@ }, "MyFunctionWithApiKeyRequiredFalseMyApiWithApiKeyRequiredFalsePermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -62,8 +56,6 @@ }, "MyFunctionWithApiKeyRequiredTrue": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -87,8 +79,6 @@ }, "MyFunctionWithApiKeyRequiredDefault": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -112,8 +102,6 @@ }, "MyFunctionWithApiKeyRequiredDefaultMyApiWithApiKeyRequiredDefaultPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -135,8 +123,6 @@ }, "MyApiWithAuthDeployment12e3363002": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithAuth" @@ -147,8 +133,6 @@ }, "MyFunctionWithApiKeyRequiredFalse": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -172,8 +156,6 @@ }, "MyFunctionWithApiKeyRequiredFalseRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -204,8 +186,6 @@ }, "MyFunctionWithApiKeyRequiredDefaultRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -236,8 +216,6 @@ }, "MyFunctionWithApiKeyRequiredTrueRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -268,8 +246,6 @@ }, "MyApiWithAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_apikey_required.json b/tests/translator/output/aws-cn/api_with_apikey_required.json index f141b004e..3738c9ec9 100644 --- a/tests/translator/output/aws-cn/api_with_apikey_required.json +++ b/tests/translator/output/aws-cn/api_with_apikey_required.json @@ -2,8 +2,6 @@ "Resources": { "MyFunctionWithApiKeyRequiredRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -34,8 +32,6 @@ }, "MyApiWithoutAuthDeploymentcc6d6fc40a": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithoutAuth" @@ -46,8 +42,6 @@ }, "MyApiWithoutAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -96,8 +90,6 @@ }, "MyApiWithoutAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithoutAuthDeploymentcc6d6fc40a" @@ -110,8 +102,6 @@ }, "MyFunctionWithApiKeyRequiredMyApiWithApiKeyRequiredPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -133,8 +123,6 @@ }, "MyFunctionWithApiKeyRequired": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { diff --git a/tests/translator/output/aws-cn/api_with_apikey_required_openapi_3.json b/tests/translator/output/aws-cn/api_with_apikey_required_openapi_3.json index afc396801..0d683135f 100644 --- a/tests/translator/output/aws-cn/api_with_apikey_required_openapi_3.json +++ b/tests/translator/output/aws-cn/api_with_apikey_required_openapi_3.json @@ -2,8 +2,6 @@ "Resources": { "MyFunctionWithApiKeyRequiredRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -34,8 +32,6 @@ }, "MyApiWithoutAuthDeployment44fb9ac597": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithoutAuth" @@ -45,8 +41,6 @@ }, "MyApiWithoutAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -97,8 +91,6 @@ }, "MyApiWithoutAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithoutAuthDeployment44fb9ac597" @@ -111,8 +103,6 @@ }, "MyFunctionWithApiKeyRequiredMyApiWithApiKeyRequiredPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -134,8 +124,6 @@ }, "MyFunctionWithApiKeyRequired": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { diff --git a/tests/translator/output/aws-cn/api_with_auth_all_maximum.json b/tests/translator/output/aws-cn/api_with_auth_all_maximum.json index 9b26fa4fc..8ecb38ec8 100644 --- a/tests/translator/output/aws-cn/api_with_auth_all_maximum.json +++ b/tests/translator/output/aws-cn/api_with_auth_all_maximum.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -27,8 +25,6 @@ }, "MyFunctionWithLambdaTokenAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -50,8 +46,6 @@ }, "MyApiMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -70,8 +64,6 @@ }, "MyFunctionWithCognitoMultipleUserPoolsAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -93,8 +85,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -125,8 +115,6 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -337,8 +325,6 @@ }, "MyApiMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -357,8 +343,6 @@ }, "MyFunctionWithLambdaRequestAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -380,8 +364,6 @@ }, "MyApiMyLambdaTokenAuthNoneFunctionInvokeRoleAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -400,8 +382,6 @@ }, "MyApiDeployment2b4f028142": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -412,8 +392,6 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment2b4f028142" @@ -426,8 +404,6 @@ }, "MyFunctionWithNoAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -449,8 +425,6 @@ }, "MyFunctionWithDefaultAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-cn/api_with_auth_all_maximum_openapi_3.json b/tests/translator/output/aws-cn/api_with_auth_all_maximum_openapi_3.json index dbe85ae8a..b170e1769 100644 --- a/tests/translator/output/aws-cn/api_with_auth_all_maximum_openapi_3.json +++ b/tests/translator/output/aws-cn/api_with_auth_all_maximum_openapi_3.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -27,8 +25,6 @@ }, "MyFunctionWithLambdaTokenAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -50,8 +46,6 @@ }, "MyApiMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -70,8 +64,6 @@ }, "MyFunctionWithCognitoMultipleUserPoolsAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -93,8 +85,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -125,8 +115,6 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -339,8 +327,6 @@ }, "MyApiMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -359,8 +345,6 @@ }, "MyFunctionWithLambdaRequestAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -382,8 +366,6 @@ }, "MyApiDeploymentcc3ee70601": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -393,8 +375,6 @@ }, "MyApiMyLambdaTokenAuthNoneFunctionInvokeRoleAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -413,8 +393,6 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeploymentcc3ee70601" @@ -427,8 +405,6 @@ }, "MyFunctionWithNoAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -450,8 +426,6 @@ }, "MyFunctionWithDefaultAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-cn/api_with_auth_all_minimum.json b/tests/translator/output/aws-cn/api_with_auth_all_minimum.json index 60328a6a3..c072d8df8 100644 --- a/tests/translator/output/aws-cn/api_with_auth_all_minimum.json +++ b/tests/translator/output/aws-cn/api_with_auth_all_minimum.json @@ -2,8 +2,6 @@ "Resources": { "MyApiWithCognitoAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -64,8 +62,6 @@ }, "MyApiWithLambdaRequestAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithLambdaRequestAuthDeploymentd3ee2721bc" @@ -78,8 +74,6 @@ }, "MyApiWithNotCachedLambdaRequestAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithNotCachedLambdaRequestAuthDeployment234e92eab4" @@ -92,8 +86,6 @@ }, "MyApiWithLambdaTokenAuthMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -117,8 +109,6 @@ }, "MyAuthFn": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -142,8 +132,6 @@ }, "MyFnRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -174,8 +162,6 @@ }, "MyApiWithCognitoAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithCognitoAuthDeploymenta9cf768eaa" @@ -188,8 +174,6 @@ }, "MyFnCognitoPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -211,8 +195,6 @@ }, "MyApiWithLambdaRequestAuthMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -236,8 +218,6 @@ }, "MyApiWithNotCachedLambdaRequestAuthMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -261,8 +241,6 @@ }, "MyApiWithLambdaTokenAuthDeploymenta48b731095": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithLambdaTokenAuth" @@ -273,8 +251,6 @@ }, "MyApiWithNotCachedLambdaRequestAuthDeployment234e92eab4": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithNotCachedLambdaRequestAuth" @@ -285,8 +261,6 @@ }, "MyFnLambdaTokenPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -308,8 +282,6 @@ }, "MyFnLambdaRequestPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -331,8 +303,6 @@ }, "MyFnLambdaNotCachedRequestPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -354,8 +324,6 @@ }, "MyApiWithLambdaTokenAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -421,8 +389,6 @@ }, "MyApiWithCognitoAuthDeploymenta9cf768eaa": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithCognitoAuth" @@ -433,8 +399,6 @@ }, "MyApiWithLambdaRequestAuthDeploymentd3ee2721bc": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithLambdaRequestAuth" @@ -445,8 +409,6 @@ }, "MyUserPool": { "Type": "AWS::Cognito::UserPool", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "UsernameAttributes": [ "email" @@ -468,8 +430,6 @@ }, "MyFn": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -493,8 +453,6 @@ }, "MyAuthFnRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -525,8 +483,6 @@ }, "MyApiWithLambdaTokenAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithLambdaTokenAuthDeploymenta48b731095" @@ -539,8 +495,6 @@ }, "MyApiWithLambdaRequestAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -607,8 +561,6 @@ }, "MyApiWithNotCachedLambdaRequestAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_auth_all_minimum_openapi.json b/tests/translator/output/aws-cn/api_with_auth_all_minimum_openapi.json index 5d23af2f0..1dcfe3d15 100644 --- a/tests/translator/output/aws-cn/api_with_auth_all_minimum_openapi.json +++ b/tests/translator/output/aws-cn/api_with_auth_all_minimum_openapi.json @@ -2,8 +2,6 @@ "Resources": { "MyApiWithCognitoAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -66,8 +64,6 @@ }, "MyApiWithCognitoAuthDeployment1ecccf8f28": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithCognitoAuth" @@ -77,8 +73,6 @@ }, "MyApiWithLambdaRequestAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithLambdaRequestAuthDeployment81b8e9784c" @@ -91,8 +85,6 @@ }, "MyApiWithLambdaTokenAuthMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -116,8 +108,6 @@ }, "MyAuthFn": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -141,8 +131,6 @@ }, "MyFnRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -173,8 +161,6 @@ }, "MyApiWithCognitoAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithCognitoAuthDeployment1ecccf8f28" @@ -187,8 +173,6 @@ }, "MyApiWithLambdaRequestAuthMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -212,8 +196,6 @@ }, "MyFnCognitoPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -235,8 +217,6 @@ }, "MyApiWithLambdaRequestAuthDeployment81b8e9784c": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithLambdaRequestAuth" @@ -246,8 +226,6 @@ }, "MyApiWithLambdaTokenAuthDeployment53baac2c0b": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithLambdaTokenAuth" @@ -257,8 +235,6 @@ }, "MyFnLambdaTokenPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -280,8 +256,6 @@ }, "MyFnLambdaRequestPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -303,8 +277,6 @@ }, "MyApiWithLambdaTokenAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -372,8 +344,6 @@ }, "MyUserPool": { "Type": "AWS::Cognito::UserPool", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "UsernameAttributes": [ "email" @@ -395,8 +365,6 @@ }, "MyFn": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -420,8 +388,6 @@ }, "MyAuthFnRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -452,8 +418,6 @@ }, "MyApiWithLambdaTokenAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithLambdaTokenAuthDeployment53baac2c0b" @@ -466,8 +430,6 @@ }, "MyApiWithLambdaRequestAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_auth_and_conditions_all_max.json b/tests/translator/output/aws-cn/api_with_auth_and_conditions_all_max.json index 5213fa2b3..2e0e8352d 100644 --- a/tests/translator/output/aws-cn/api_with_auth_and_conditions_all_max.json +++ b/tests/translator/output/aws-cn/api_with_auth_and_conditions_all_max.json @@ -10,8 +10,6 @@ "Resources": { "MyFunctionWithLambdaTokenAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -33,8 +31,6 @@ }, "MyApiMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -53,8 +49,6 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeploymentfcb8b173a9" @@ -67,8 +61,6 @@ }, "MyApiDeploymentfcb8b173a9": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -79,8 +71,6 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -334,8 +324,6 @@ }, "MyApiMyLambdaTokenAuthNoneFunctionInvokeRoleAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -354,8 +342,6 @@ }, "MyFunctionWithNoAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -377,8 +363,6 @@ }, "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -402,8 +386,6 @@ }, "MyFunctionWithCognitoMultipleUserPoolsAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -425,8 +407,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -457,8 +437,6 @@ }, "MyFunctionWithConditionalWithLambdaTokenAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -481,8 +459,6 @@ }, "MyFunctionWithConditionalWithLambdaRequestAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -505,8 +481,6 @@ }, "MyApiMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -525,8 +499,6 @@ }, "MyFunctionWithConditionalWithDefaultAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -549,8 +521,6 @@ }, "MyFunctionWithConditionalRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -582,8 +552,6 @@ }, "MyFunctionWithConditional": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { diff --git a/tests/translator/output/aws-cn/api_with_auth_no_default.json b/tests/translator/output/aws-cn/api_with_auth_no_default.json index f21111cb7..727875379 100644 --- a/tests/translator/output/aws-cn/api_with_auth_no_default.json +++ b/tests/translator/output/aws-cn/api_with_auth_no_default.json @@ -2,8 +2,6 @@ "Resources": { "MyApiWithCognitoAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -59,8 +57,6 @@ }, "MyFnLambdaRequestPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -82,8 +78,6 @@ }, "MyApiWithCognitoAuthDeployment6a169547ee": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithCognitoAuth" @@ -94,8 +88,6 @@ }, "MyApiWithLambdaRequestAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithLambdaRequestAuthDeployment93e0147508" @@ -108,8 +100,6 @@ }, "MyApiWithLambdaTokenAuthMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -133,8 +123,6 @@ }, "MyAuthFn": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -158,8 +146,6 @@ }, "MyFnRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -190,8 +176,6 @@ }, "MyApiWithCognitoAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithCognitoAuthDeployment6a169547ee" @@ -204,8 +188,6 @@ }, "MyApiWithLambdaTokenAuthDeploymente838608f2f": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithLambdaTokenAuth" @@ -216,8 +198,6 @@ }, "MyFnCognitoPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -239,8 +219,6 @@ }, "MyApiWithLambdaRequestAuthMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -264,8 +242,6 @@ }, "MyFnLambdaTokenPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -287,8 +263,6 @@ }, "MyApiWithLambdaRequestAuthDeployment93e0147508": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithLambdaRequestAuth" @@ -299,8 +273,6 @@ }, "MyApiWithLambdaTokenAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -361,8 +333,6 @@ }, "MyUserPool": { "Type": "AWS::Cognito::UserPool", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "UsernameAttributes": [ "email" @@ -384,8 +354,6 @@ }, "MyFn": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -409,8 +377,6 @@ }, "MyAuthFnRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -441,8 +407,6 @@ }, "MyApiWithLambdaTokenAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithLambdaTokenAuthDeploymente838608f2f" @@ -455,8 +419,6 @@ }, "MyApiWithLambdaRequestAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_auth_with_default_scopes.json b/tests/translator/output/aws-cn/api_with_auth_with_default_scopes.json index a7ca562e6..71565997a 100644 --- a/tests/translator/output/aws-cn/api_with_auth_with_default_scopes.json +++ b/tests/translator/output/aws-cn/api_with_auth_with_default_scopes.json @@ -2,8 +2,6 @@ "Resources": { "MyApiWithCognitoAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -185,8 +183,6 @@ }, "MyFnCognitoDefaultScopesNonePermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -208,8 +204,6 @@ }, "MyFnCognitoDefaultAuthDefaultScopesNonePermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -231,8 +225,6 @@ }, "MyFnCognitoAuthorizerWithDefaultScopesPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -254,8 +246,6 @@ }, "MyApiWithCognitoAuthDeploymentcddf4840d1": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithCognitoAuth" @@ -266,8 +256,6 @@ }, "MyFnCognitoDefaultScopesDefaultAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -289,8 +277,6 @@ }, "MyFnCognitoAuthorizerScopesOverwrittenPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -312,8 +298,6 @@ }, "MyFnRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -344,8 +328,6 @@ }, "MyFnCognitoWithAuthNonePermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -367,8 +349,6 @@ }, "MyApiWithCognitoAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithCognitoAuthDeploymentcddf4840d1" @@ -381,8 +361,6 @@ }, "MyFn": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -406,8 +384,6 @@ }, "MyFnCognitoDefaultScopesWithOverwrittenPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-cn/api_with_auth_with_default_scopes_openapi.json b/tests/translator/output/aws-cn/api_with_auth_with_default_scopes_openapi.json index 69cfcda6d..29382f090 100644 --- a/tests/translator/output/aws-cn/api_with_auth_with_default_scopes_openapi.json +++ b/tests/translator/output/aws-cn/api_with_auth_with_default_scopes_openapi.json @@ -2,8 +2,6 @@ "Resources": { "MyApiWithCognitoAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -187,8 +185,6 @@ }, "MyFnCognitoDefaultScopesNonePermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -210,8 +206,6 @@ }, "MyFnCognitoDefaultAuthDefaultScopesNonePermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -233,8 +227,6 @@ }, "MyFnCognitoAuthorizerWithDefaultScopesPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -256,8 +248,6 @@ }, "MyFnCognitoDefaultScopesDefaultAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -279,8 +269,6 @@ }, "MyFnCognitoAuthorizerScopesOverwrittenPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -302,8 +290,6 @@ }, "MyApiWithCognitoAuthDeployment815f0fba0e": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithCognitoAuth" @@ -313,8 +299,6 @@ }, "MyFnRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -345,8 +329,6 @@ }, "MyFnCognitoWithAuthNonePermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -368,8 +350,6 @@ }, "MyApiWithCognitoAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithCognitoAuthDeployment815f0fba0e" @@ -382,8 +362,6 @@ }, "MyFn": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -407,8 +385,6 @@ }, "MyFnCognitoDefaultScopesWithOverwrittenPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-cn/api_with_aws_account_blacklist.json b/tests/translator/output/aws-cn/api_with_aws_account_blacklist.json index 15c819e80..54412b7fe 100644 --- a/tests/translator/output/aws-cn/api_with_aws_account_blacklist.json +++ b/tests/translator/output/aws-cn/api_with_aws_account_blacklist.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -26,8 +24,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentc4450d906c" @@ -40,8 +36,6 @@ }, "ServerlessRestApiDeploymentc4450d906c": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -52,8 +46,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -84,8 +76,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -144,8 +134,6 @@ }, "MyFunctionApiPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-cn/api_with_aws_account_whitelist.json b/tests/translator/output/aws-cn/api_with_aws_account_whitelist.json index ffc66eb5b..fc12df61c 100644 --- a/tests/translator/output/aws-cn/api_with_aws_account_whitelist.json +++ b/tests/translator/output/aws-cn/api_with_aws_account_whitelist.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -26,8 +24,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment441a70783b" @@ -40,8 +36,6 @@ }, "MyFunctionApiPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -63,8 +57,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -95,8 +87,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -176,8 +166,6 @@ }, "ServerlessRestApiDeployment441a70783b": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" diff --git a/tests/translator/output/aws-cn/api_with_aws_iam_auth_overrides.json b/tests/translator/output/aws-cn/api_with_aws_iam_auth_overrides.json index d47bc9b78..4636278e7 100644 --- a/tests/translator/output/aws-cn/api_with_aws_iam_auth_overrides.json +++ b/tests/translator/output/aws-cn/api_with_aws_iam_auth_overrides.json @@ -2,8 +2,6 @@ "Resources": { "MyFunctionCustomInvokeRole": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -27,8 +25,6 @@ }, "MyFunctionNoneAuth": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -52,8 +48,6 @@ }, "MyFunctionNullInvokeRole": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -77,8 +71,6 @@ }, "MyApiWithAwsIamAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithAwsIamAuthDeployment4253f994cd" @@ -91,8 +83,6 @@ }, "MyApiWithAwsIamAuthDeployment4253f994cd": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithAwsIamAuth" @@ -103,8 +93,6 @@ }, "MyFunctionWithoutAuthRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -135,8 +123,6 @@ }, "MyFunctionCustomInvokeRoleAPI3PermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -158,8 +144,6 @@ }, "MyFunctionMyCognitoAuthAPI1PermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -181,8 +165,6 @@ }, "MyApiWithAwsIamAuthNoCallerCredentialsDeployment07ee28f86e": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithAwsIamAuthNoCallerCredentials" @@ -193,8 +175,6 @@ }, "MyApiWithAwsIamAuthNoCallerCredentials": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -260,8 +240,6 @@ }, "MyFunctionWithoutAuthAPI2PermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -283,8 +261,6 @@ }, "MyFunctionDefaultInvokeRoleAPI3PermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -306,8 +282,6 @@ }, "MyFunctionMyCognitoAuth": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -331,8 +305,6 @@ }, "MyFunctionNullInvokeRoleRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -363,8 +335,6 @@ }, "MyFunctionNONEInvokeRole": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -388,8 +358,6 @@ }, "MyFunctionNoCallerCredentialsAPI3PermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -411,8 +379,6 @@ }, "MyFunctionNoneAuthRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -443,8 +409,6 @@ }, "MyFunctionCustomInvokeRoleRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -475,8 +439,6 @@ }, "MyFunctionCallerCredentialsOverrideAPI3PermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -498,8 +460,6 @@ }, "MyFunctionCallerCredentialsOverride": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -523,8 +483,6 @@ }, "MyFunctionWithoutAuth": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -548,8 +506,6 @@ }, "MyFunctionNullInvokeRoleAPI3PermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -571,8 +527,6 @@ }, "MyFunctionNONEInvokeRoleAPI3PermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -594,8 +548,6 @@ }, "MyFunctionNoCallerCredentialsRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -626,8 +578,6 @@ }, "MyFunctionDefaultInvokeRoleRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -658,8 +608,6 @@ }, "MyFunctionCallerCredentialsOverrideRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -690,8 +638,6 @@ }, "MyFunctionMyCognitoAuthRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -722,8 +668,6 @@ }, "MyApiWithAwsIamAuthNoCallerCredentialsProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithAwsIamAuthNoCallerCredentialsDeployment07ee28f86e" @@ -736,8 +680,6 @@ }, "MyFunctionDefaultInvokeRole": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -761,8 +703,6 @@ }, "MyFunctionNoCallerCredentials": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -786,8 +726,6 @@ }, "MyApiWithAwsIamAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -954,8 +892,6 @@ }, "MyFunctionNoneAuthAPI3PermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -977,8 +913,6 @@ }, "MyFunctionNONEInvokeRoleRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-cn/api_with_basic_custom_domain.json b/tests/translator/output/aws-cn/api_with_basic_custom_domain.json index 769577d2e..88e64e6a8 100644 --- a/tests/translator/output/aws-cn/api_with_basic_custom_domain.json +++ b/tests/translator/output/aws-cn/api_with_basic_custom_domain.json @@ -12,8 +12,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -36,8 +34,6 @@ }, "MyFunctionAnotherGetPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -59,8 +55,6 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment92d6d51a5e" @@ -73,8 +67,6 @@ }, "MyFunctionImplicitGetPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -96,8 +88,6 @@ }, "MyAnotherApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyAnotherApiDeployment989ae20f23" @@ -110,8 +100,6 @@ }, "MyFunctionFetchPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -133,8 +121,6 @@ }, "MyAnotherApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -171,8 +157,6 @@ }, "MyApifetchBasePathMapping": { "Type": "AWS::ApiGateway::BasePathMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BasePath": "fetch", "DomainName": { @@ -188,8 +172,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -220,8 +202,6 @@ }, "MyApigetBasePathMapping": { "Type": "AWS::ApiGateway::BasePathMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BasePath": "get", "DomainName": { @@ -237,8 +217,6 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -287,8 +265,6 @@ }, "MyAnotherApiBasePathMapping": { "Type": "AWS::ApiGateway::BasePathMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DomainName": { "Ref": "ApiGatewayDomainNameeab65c1531" @@ -303,8 +279,6 @@ }, "ApiGatewayDomainNameeab65c1531": { "Type": "AWS::ApiGateway::DomainName", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -317,8 +291,6 @@ }, "ApiGatewayDomainName23cdccdf9c": { "Type": "AWS::ApiGateway::DomainName", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "CertificateArn": "my-api-cert-arn", "EndpointConfiguration": { @@ -336,8 +308,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment6aef2b756e" @@ -350,8 +320,6 @@ }, "MyApiDeployment92d6d51a5e": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -361,8 +329,6 @@ }, "ServerlessRestApiBasePathMapping": { "Type": "AWS::ApiGateway::BasePathMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DomainName": { "Ref": "ApiGatewayDomainNameeab65c1531" @@ -377,8 +343,6 @@ }, "ServerlessRestApiDeployment6aef2b756e": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -389,8 +353,6 @@ }, "MyAnotherApiDeployment989ae20f23": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyAnotherApi" @@ -400,8 +362,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -438,8 +398,6 @@ }, "MyFunctionApiPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-cn/api_with_basic_custom_domain_http.json b/tests/translator/output/aws-cn/api_with_basic_custom_domain_http.json index bb11197a8..72b8198b2 100644 --- a/tests/translator/output/aws-cn/api_with_basic_custom_domain_http.json +++ b/tests/translator/output/aws-cn/api_with_basic_custom_domain_http.json @@ -12,8 +12,6 @@ "Resources": { "MyApibasicApiMapping": { "Type": "AWS::ApiGatewayV2::ApiMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -29,8 +27,6 @@ }, "ApiGatewayDomainNameV22dbf35af54": { "Type": "AWS::ApiGatewayV2::DomainName", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DomainName": "sam-example.com", "DomainNameConfigurations": [ @@ -51,8 +47,6 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -66,8 +60,6 @@ }, "HttpApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -90,8 +82,6 @@ }, "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -113,8 +103,6 @@ }, "MyApibeginhereApiMapping": { "Type": "AWS::ApiGatewayV2::ApiMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -130,8 +118,6 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -162,8 +148,6 @@ }, "RecordSetGroup1f4f569a7e": { "Type": "AWS::Route53::RecordSetGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "HostedZoneName": "sam-example.com.", "RecordSets": [ @@ -190,8 +174,6 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_basic_custom_domain_intrinsics.json b/tests/translator/output/aws-cn/api_with_basic_custom_domain_intrinsics.json index 54118259d..a7c6e267e 100644 --- a/tests/translator/output/aws-cn/api_with_basic_custom_domain_intrinsics.json +++ b/tests/translator/output/aws-cn/api_with_basic_custom_domain_intrinsics.json @@ -28,8 +28,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -53,8 +51,6 @@ }, "MyFunctionImplicitGetPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -77,8 +73,6 @@ }, "MyApifetchBasePathMapping": { "Type": "AWS::ApiGateway::BasePathMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BasePath": "fetch", "DomainName": { @@ -95,8 +89,6 @@ }, "MyApiDeployment4f2c19d290": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -107,8 +99,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment599c0b434d" @@ -122,8 +112,6 @@ }, "ServerlessRestApiDeployment599c0b434d": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -135,8 +123,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -168,8 +154,6 @@ }, "MyApigetBasePathMapping": { "Type": "AWS::ApiGateway::BasePathMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BasePath": "get", "DomainName": { @@ -186,8 +170,6 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -249,8 +231,6 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment4f2c19d290" @@ -264,8 +244,6 @@ }, "ApiGatewayDomainNamec0cd2d9dfc": { "Type": "AWS::ApiGateway::DomainName", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -286,8 +264,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -349,8 +325,6 @@ }, "MyFunctionApiPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-cn/api_with_basic_custom_domain_intrinsics_http.json b/tests/translator/output/aws-cn/api_with_basic_custom_domain_intrinsics_http.json index 0cbac3f19..c0df26d42 100644 --- a/tests/translator/output/aws-cn/api_with_basic_custom_domain_intrinsics_http.json +++ b/tests/translator/output/aws-cn/api_with_basic_custom_domain_intrinsics_http.json @@ -28,8 +28,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -53,8 +51,6 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -69,8 +65,6 @@ }, "ServerlessHttpApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -131,8 +125,6 @@ }, "MyFunctionImplicitGetPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -155,8 +147,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -188,8 +178,6 @@ }, "ApiGatewayDomainNameV2c0cd2d9dfc": { "Type": "AWS::ApiGatewayV2::DomainName", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DomainNameConfigurations": [ { @@ -213,8 +201,6 @@ }, "MyFunctionApiPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -237,8 +223,6 @@ }, "MyApigetApiMapping": { "Type": "AWS::ApiGatewayV2::ApiMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -255,8 +239,6 @@ }, "ServerlessHttpApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "ServerlessHttpApi" @@ -271,8 +253,6 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -340,8 +320,6 @@ }, "MyApifetchApiMapping": { "Type": "AWS::ApiGatewayV2::ApiMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" diff --git a/tests/translator/output/aws-cn/api_with_binary_media_types.json b/tests/translator/output/aws-cn/api_with_binary_media_types.json index 182075cb8..d9703bd9e 100644 --- a/tests/translator/output/aws-cn/api_with_binary_media_types.json +++ b/tests/translator/output/aws-cn/api_with_binary_media_types.json @@ -8,8 +8,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -33,8 +31,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -65,8 +61,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -88,8 +82,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BinaryMediaTypes": [ "image~1gif", @@ -121,8 +113,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentf117c932f7" @@ -135,8 +125,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentcc75b253a7" @@ -149,8 +137,6 @@ }, "ServerlessRestApiDeploymentcc75b253a7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -161,8 +147,6 @@ }, "ExplicitApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -173,8 +157,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_binary_media_types_definition_body.json b/tests/translator/output/aws-cn/api_with_binary_media_types_definition_body.json index 1b308c002..75b031c54 100644 --- a/tests/translator/output/aws-cn/api_with_binary_media_types_definition_body.json +++ b/tests/translator/output/aws-cn/api_with_binary_media_types_definition_body.json @@ -8,8 +8,6 @@ "Resources": { "ExplicitApiManagedSwaggerProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiManagedSwaggerDeploymentfe9c2c09a2" @@ -22,8 +20,6 @@ }, "ExplicitApiManagedSwaggerDeploymentfe9c2c09a2": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApiManagedSwagger" @@ -34,8 +30,6 @@ }, "ExplicitApiDefinitionBody": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "paths": {}, @@ -81,8 +75,6 @@ }, "ExplicitApiDefinitionBodyDeployment1f26996adb": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApiDefinitionBody" @@ -93,8 +85,6 @@ }, "ExplicitApiDefinitionBodyProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDefinitionBodyDeployment1f26996adb" @@ -107,8 +97,6 @@ }, "ExplicitApiManagedSwagger": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_canary_setting.json b/tests/translator/output/aws-cn/api_with_canary_setting.json index 5364aadf4..412da24e1 100644 --- a/tests/translator/output/aws-cn/api_with_canary_setting.json +++ b/tests/translator/output/aws-cn/api_with_canary_setting.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -82,8 +76,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -101,8 +93,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "CanarySetting": { "PercentTraffic": 100, @@ -123,8 +113,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "CanarySetting": { "PercentTraffic": 100, @@ -145,8 +133,6 @@ }, "ServerlessRestApiDeploymentcb4fb12558": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -157,8 +143,6 @@ }, "ExplicitApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -169,8 +153,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_cors.json b/tests/translator/output/aws-cn/api_with_cors.json index 6d1d75eeb..0abca4a3b 100644 --- a/tests/translator/output/aws-cn/api_with_cors.json +++ b/tests/translator/output/aws-cn/api_with_cors.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ImplicitApiFunctionAnyApiPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -82,8 +76,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -228,8 +220,6 @@ }, "GetHtmlFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -260,8 +250,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentdb43b8746d" @@ -274,8 +262,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment3a5a78688c" @@ -288,8 +274,6 @@ }, "RestApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -320,8 +304,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -343,8 +325,6 @@ }, "ExplicitApiDeployment3a5a78688c": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -355,8 +335,6 @@ }, "RestApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -380,8 +358,6 @@ }, "ServerlessRestApiDeploymentdb43b8746d": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -392,8 +368,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -538,8 +512,6 @@ }, "GetHtmlFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { diff --git a/tests/translator/output/aws-cn/api_with_cors_and_auth_no_preflight_auth.json b/tests/translator/output/aws-cn/api_with_cors_and_auth_no_preflight_auth.json index 2960d274f..7c24e8b01 100644 --- a/tests/translator/output/aws-cn/api_with_cors_and_auth_no_preflight_auth.json +++ b/tests/translator/output/aws-cn/api_with_cors_and_auth_no_preflight_auth.json @@ -2,8 +2,6 @@ "Resources": { "ServerlessApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -125,8 +123,6 @@ }, "ServerlessApiDeployment6050a96a0f": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessApi" @@ -137,8 +133,6 @@ }, "ApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -169,8 +163,6 @@ }, "ApiFunctionPostHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -192,8 +184,6 @@ }, "ServerlessApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessApiDeployment6050a96a0f" @@ -206,8 +196,6 @@ }, "ApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -229,8 +217,6 @@ }, "ApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -254,8 +240,6 @@ }, "MyAuthFn": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -279,8 +263,6 @@ }, "MyAuthFnRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -311,8 +293,6 @@ }, "ServerlessApiMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-cn/api_with_cors_and_auth_preflight_auth.json b/tests/translator/output/aws-cn/api_with_cors_and_auth_preflight_auth.json index 09ecf35b9..a6f758d87 100644 --- a/tests/translator/output/aws-cn/api_with_cors_and_auth_preflight_auth.json +++ b/tests/translator/output/aws-cn/api_with_cors_and_auth_preflight_auth.json @@ -2,8 +2,6 @@ "Resources": { "ServerlessApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -130,8 +128,6 @@ }, "ApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -162,8 +158,6 @@ }, "ServerlessApiDeployment25b7a1be29": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessApi" @@ -174,8 +168,6 @@ }, "ApiFunctionPostHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -197,8 +189,6 @@ }, "ServerlessApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessApiDeployment25b7a1be29" @@ -211,8 +201,6 @@ }, "ApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -234,8 +222,6 @@ }, "ApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -259,8 +245,6 @@ }, "MyAuthFn": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -284,8 +268,6 @@ }, "MyAuthFnRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -316,8 +298,6 @@ }, "ServerlessApiMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-cn/api_with_cors_and_conditions_no_definitionbody.json b/tests/translator/output/aws-cn/api_with_cors_and_conditions_no_definitionbody.json index 25e1ec642..7ecad73f6 100644 --- a/tests/translator/output/aws-cn/api_with_cors_and_conditions_no_definitionbody.json +++ b/tests/translator/output/aws-cn/api_with_cors_and_conditions_no_definitionbody.json @@ -11,8 +11,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -37,8 +35,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -70,8 +66,6 @@ }, "ImplicitApiFunctionPostHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -94,8 +88,6 @@ }, "ExplicitApiDeployment7ad5aed108": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -106,8 +98,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -236,8 +226,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -260,8 +248,6 @@ }, "ImplicitApiFunction2Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -292,8 +278,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment7ad5aed108" @@ -306,8 +290,6 @@ }, "ImplicitApiFunction2DeleteHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -329,8 +311,6 @@ }, "ImplicitApiFunction2": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { diff --git a/tests/translator/output/aws-cn/api_with_cors_and_only_credentials_false.json b/tests/translator/output/aws-cn/api_with_cors_and_only_credentials_false.json index 92b5c6d3d..81a665c79 100644 --- a/tests/translator/output/aws-cn/api_with_cors_and_only_credentials_false.json +++ b/tests/translator/output/aws-cn/api_with_cors_and_only_credentials_false.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment398246867a" @@ -73,8 +67,6 @@ }, "ExplicitApiDeployment398246867a": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -85,8 +77,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_cors_and_only_headers.json b/tests/translator/output/aws-cn/api_with_cors_and_only_headers.json index fbdc9ab07..2512bfc95 100644 --- a/tests/translator/output/aws-cn/api_with_cors_and_only_headers.json +++ b/tests/translator/output/aws-cn/api_with_cors_and_only_headers.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ImplicitApiFunctionPostHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -82,8 +76,6 @@ }, "ServerlessRestApiDeployment9467cf1cd5": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -94,8 +86,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment9467cf1cd5" @@ -108,8 +98,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -246,8 +234,6 @@ }, "ExplicitApiDeployment03e65d7ea2": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -258,8 +244,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -281,8 +265,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment03e65d7ea2" @@ -295,8 +277,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_cors_and_only_maxage.json b/tests/translator/output/aws-cn/api_with_cors_and_only_maxage.json index 79593d466..d778140c0 100644 --- a/tests/translator/output/aws-cn/api_with_cors_and_only_maxage.json +++ b/tests/translator/output/aws-cn/api_with_cors_and_only_maxage.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ExplicitApiDeploymentb61cfb7d60": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -71,8 +65,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentb61cfb7d60" @@ -85,8 +77,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_cors_and_only_methods.json b/tests/translator/output/aws-cn/api_with_cors_and_only_methods.json index 590412ab7..1d5a9b27d 100644 --- a/tests/translator/output/aws-cn/api_with_cors_and_only_methods.json +++ b/tests/translator/output/aws-cn/api_with_cors_and_only_methods.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -82,8 +76,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment06ae8f0cfb" @@ -96,8 +88,6 @@ }, "ServerlessRestApiDeployment06ae8f0cfb": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -108,8 +98,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_cors_and_only_origins.json b/tests/translator/output/aws-cn/api_with_cors_and_only_origins.json index e8af91349..3e9e0a4ab 100644 --- a/tests/translator/output/aws-cn/api_with_cors_and_only_origins.json +++ b/tests/translator/output/aws-cn/api_with_cors_and_only_origins.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ExplicitApiDeploymenta7a992bbb6": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -71,8 +65,6 @@ }, "ImplicitApiFunctionPostHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -94,8 +86,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymenta7a992bbb6" @@ -108,8 +98,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentb4ba0b8ae8" @@ -122,8 +110,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -252,8 +238,6 @@ }, "ServerlessRestApiDeploymentb4ba0b8ae8": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -264,8 +248,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -287,8 +269,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_cors_no_definitionbody.json b/tests/translator/output/aws-cn/api_with_cors_no_definitionbody.json index 673769189..978abf900 100644 --- a/tests/translator/output/aws-cn/api_with_cors_no_definitionbody.json +++ b/tests/translator/output/aws-cn/api_with_cors_no_definitionbody.json @@ -3,8 +3,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -26,8 +24,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -56,8 +52,6 @@ }, "ImplicitApiFunctionPostHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -79,8 +73,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -102,8 +94,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -190,8 +180,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentb4ba0b8ae8" @@ -204,8 +192,6 @@ }, "ExplicitApiDeploymentb4ba0b8ae8": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" diff --git a/tests/translator/output/aws-cn/api_with_cors_openapi_3.json b/tests/translator/output/aws-cn/api_with_cors_openapi_3.json index 18d2c7665..e814d0d1c 100644 --- a/tests/translator/output/aws-cn/api_with_cors_openapi_3.json +++ b/tests/translator/output/aws-cn/api_with_cors_openapi_3.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ServerlessRestApiDeployment147347629d": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -70,8 +64,6 @@ }, "ImplicitApiFunctionAnyApiPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -93,8 +85,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -239,8 +229,6 @@ }, "GetHtmlFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -271,8 +259,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment147347629d" @@ -285,8 +271,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment8cc53ffaa5" @@ -299,8 +283,6 @@ }, "RestApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -331,8 +313,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -354,8 +334,6 @@ }, "ExplicitApiDeployment8cc53ffaa5": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -365,8 +343,6 @@ }, "RestApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -390,8 +366,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -532,8 +506,6 @@ }, "GetHtmlFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { diff --git a/tests/translator/output/aws-cn/api_with_custom_domain_route53.json b/tests/translator/output/aws-cn/api_with_custom_domain_route53.json index e74aee747..8637e03b3 100644 --- a/tests/translator/output/aws-cn/api_with_custom_domain_route53.json +++ b/tests/translator/output/aws-cn/api_with_custom_domain_route53.json @@ -12,8 +12,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -36,8 +34,6 @@ }, "MyFunctionFetchPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -59,8 +55,6 @@ }, "ApiGatewayDomainName0caaf24ab1": { "Type": "AWS::ApiGateway::DomainName", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "CertificateArn": "cert-arn-in-us-east-1", "EndpointConfiguration": { @@ -73,8 +67,6 @@ }, "RecordSetGroupbd00d962a4": { "Type": "AWS::Route53::RecordSetGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "HostedZoneId": "ZQ1UAL4EFZVME", "RecordSets": [ @@ -109,8 +101,6 @@ }, "MyApioneBasePathMapping": { "Type": "AWS::ApiGateway::BasePathMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BasePath": "one", "DomainName": { @@ -126,8 +116,6 @@ }, "MyApiDeploymentfb330328f1": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -137,8 +125,6 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeploymentfb330328f1" @@ -151,8 +137,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -183,8 +167,6 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_custom_domain_route53_hosted_zone_name.json b/tests/translator/output/aws-cn/api_with_custom_domain_route53_hosted_zone_name.json index 9179107a3..98a21b9e2 100644 --- a/tests/translator/output/aws-cn/api_with_custom_domain_route53_hosted_zone_name.json +++ b/tests/translator/output/aws-cn/api_with_custom_domain_route53_hosted_zone_name.json @@ -12,8 +12,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -36,8 +34,6 @@ }, "MyFunctionFetchPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -59,8 +55,6 @@ }, "ApiGatewayDomainName0caaf24ab1": { "Type": "AWS::ApiGateway::DomainName", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "CertificateArn": "cert-arn-in-us-east-1", "EndpointConfiguration": { @@ -73,8 +67,6 @@ }, "MyApiDeployment9239fa9a13": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -84,8 +76,6 @@ }, "MyApioneBasePathMapping": { "Type": "AWS::ApiGateway::BasePathMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BasePath": "one", "DomainName": { @@ -101,8 +91,6 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment9239fa9a13" @@ -115,8 +103,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -147,8 +133,6 @@ }, "RecordSetGroup456ebaf280": { "Type": "AWS::Route53::RecordSetGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "HostedZoneName": "www.my-domain.com.", "RecordSets": [ @@ -183,8 +167,6 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_custom_domain_route53_hosted_zone_name_http.json b/tests/translator/output/aws-cn/api_with_custom_domain_route53_hosted_zone_name_http.json index 5c1103f7a..351eeedb8 100644 --- a/tests/translator/output/aws-cn/api_with_custom_domain_route53_hosted_zone_name_http.json +++ b/tests/translator/output/aws-cn/api_with_custom_domain_route53_hosted_zone_name_http.json @@ -12,8 +12,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -36,8 +34,6 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -51,8 +47,6 @@ }, "MyApioneApiMapping": { "Type": "AWS::ApiGatewayV2::ApiMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -68,8 +62,6 @@ }, "ApiGatewayDomainNameV20caaf24ab1": { "Type": "AWS::ApiGatewayV2::DomainName", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DomainName": "example.com", "DomainNameConfigurations": [ @@ -85,8 +77,6 @@ }, "RecordSetGroup456ebaf280": { "Type": "AWS::Route53::RecordSetGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "HostedZoneName": "www.my-domain.com.", "RecordSets": [ @@ -113,8 +103,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -145,8 +133,6 @@ }, "MyFunctionFetchPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -168,8 +154,6 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_custom_domain_route53_http.json b/tests/translator/output/aws-cn/api_with_custom_domain_route53_http.json index 5207014f2..34e7a8e9d 100644 --- a/tests/translator/output/aws-cn/api_with_custom_domain_route53_http.json +++ b/tests/translator/output/aws-cn/api_with_custom_domain_route53_http.json @@ -12,8 +12,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -36,8 +34,6 @@ }, "MyApioneApiMapping": { "Type": "AWS::ApiGatewayV2::ApiMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -53,8 +49,6 @@ }, "RecordSetGroupbd00d962a4": { "Type": "AWS::Route53::RecordSetGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "HostedZoneId": "ZQ1UAL4EFZVME", "RecordSets": [ @@ -99,8 +93,6 @@ }, "ApiGatewayDomainNameV20caaf24ab1": { "Type": "AWS::ApiGatewayV2::DomainName", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DomainName": "example.com", "DomainNameConfigurations": [ @@ -116,8 +108,6 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -131,8 +121,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -163,8 +151,6 @@ }, "MyFunctionFetchPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -186,8 +172,6 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_default_aws_iam_auth.json b/tests/translator/output/aws-cn/api_with_default_aws_iam_auth.json index dbdcae116..4173a6f21 100644 --- a/tests/translator/output/aws-cn/api_with_default_aws_iam_auth.json +++ b/tests/translator/output/aws-cn/api_with_default_aws_iam_auth.json @@ -2,8 +2,6 @@ "Resources": { "MyFunctionWithAwsIamAuth": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -27,8 +25,6 @@ }, "MyApiWithAwsIamAuthAndDefaultInvokeRoleDeploymentd0103947f7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithAwsIamAuthAndDefaultInvokeRole" @@ -39,8 +35,6 @@ }, "MyFunctionWithAwsIamAuthMyApiWithAwsIamAuthPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -62,8 +56,6 @@ }, "MyApiWithAwsIamAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithAwsIamAuthDeploymentc8adfb74cf" @@ -76,8 +68,6 @@ }, "MyApiWithAwsIamAuthAndDefaultInvokeRoleProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithAwsIamAuthAndDefaultInvokeRoleDeploymentd0103947f7" @@ -90,8 +80,6 @@ }, "MyFunctionWithAwsIamAuthMyApiWithAwsIamAuthAndDefaultInvokeRolePermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -113,8 +101,6 @@ }, "MyApiWithAwsIamAuthDeploymentc8adfb74cf": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithAwsIamAuth" @@ -125,8 +111,6 @@ }, "MyApiWithAwsIamAuthAndCustomInvokeRole": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -177,8 +161,6 @@ }, "MyApiWithAwsIamAuthAndCustomInvokeRoleProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithAwsIamAuthAndCustomInvokeRoleDeployment2a6ecd9264" @@ -191,8 +173,6 @@ }, "MyApiWithAwsIamAuthAndDefaultInvokeRole": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -243,8 +223,6 @@ }, "MyApiWithAwsIamAuthAndCustomInvokeRoleDeployment2a6ecd9264": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithAwsIamAuthAndCustomInvokeRole" @@ -255,8 +233,6 @@ }, "MyApiWithAwsIamAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -307,8 +283,6 @@ }, "MyFunctionWithAwsIamAuthMyApiWithAwsIamAuthAndCustomInvokeRolePermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -330,8 +304,6 @@ }, "MyFunctionWithAwsIamAuthRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-cn/api_with_default_aws_iam_auth_and_no_auth_route.json b/tests/translator/output/aws-cn/api_with_default_aws_iam_auth_and_no_auth_route.json index d15921d08..23ee4b243 100644 --- a/tests/translator/output/aws-cn/api_with_default_aws_iam_auth_and_no_auth_route.json +++ b/tests/translator/output/aws-cn/api_with_default_aws_iam_auth_and_no_auth_route.json @@ -2,8 +2,6 @@ "Resources": { "MyApiWithAwsIamAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithAwsIamAuthDeployment0c9ba99bc2" @@ -16,8 +14,6 @@ }, "MyFunctionWithAwsIamAuth": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -41,8 +37,6 @@ }, "MyFunctionWithAwsIamAuthMyApiWithNoAuthPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -64,8 +58,6 @@ }, "MyFunctionWithAwsIamAuthMyApiWithAwsIamAuthPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -87,8 +79,6 @@ }, "MyApiWithAwsIamAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -154,8 +144,6 @@ }, "MyApiWithAwsIamAuthDeployment0c9ba99bc2": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithAwsIamAuth" @@ -166,8 +154,6 @@ }, "MyFunctionWithAwsIamAuthRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-cn/api_with_gateway_responses.json b/tests/translator/output/aws-cn/api_with_gateway_responses.json index 068865b87..a0eb308b6 100644 --- a/tests/translator/output/aws-cn/api_with_gateway_responses.json +++ b/tests/translator/output/aws-cn/api_with_gateway_responses.json @@ -2,8 +2,6 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "ExplicitApiDeployment9196b651da": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -39,8 +35,6 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -71,8 +65,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -120,8 +112,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment9196b651da" @@ -134,8 +124,6 @@ }, "FunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-cn/api_with_gateway_responses_all.json b/tests/translator/output/aws-cn/api_with_gateway_responses_all.json index 3cbc34659..3605cc0c2 100644 --- a/tests/translator/output/aws-cn/api_with_gateway_responses_all.json +++ b/tests/translator/output/aws-cn/api_with_gateway_responses_all.json @@ -2,8 +2,6 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ExplicitApiDeploymenta27cf1b1d7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -71,8 +65,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -129,8 +121,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymenta27cf1b1d7" @@ -143,8 +133,6 @@ }, "FunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-cn/api_with_gateway_responses_all_openapi_3.json b/tests/translator/output/aws-cn/api_with_gateway_responses_all_openapi_3.json index e3e6abb81..140250a6b 100644 --- a/tests/translator/output/aws-cn/api_with_gateway_responses_all_openapi_3.json +++ b/tests/translator/output/aws-cn/api_with_gateway_responses_all_openapi_3.json @@ -2,8 +2,6 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "ExplicitApiDeploymenta2f31986fe": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -38,8 +34,6 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -70,8 +64,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -128,8 +120,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymenta2f31986fe" @@ -142,8 +132,6 @@ }, "FunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-cn/api_with_gateway_responses_implicit.json b/tests/translator/output/aws-cn/api_with_gateway_responses_implicit.json index 6f9ccf99a..cb116f10e 100644 --- a/tests/translator/output/aws-cn/api_with_gateway_responses_implicit.json +++ b/tests/translator/output/aws-cn/api_with_gateway_responses_implicit.json @@ -2,8 +2,6 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ServerlessRestApiDeployment9196b651da": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -71,8 +65,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment9196b651da" @@ -85,8 +77,6 @@ }, "FunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -108,8 +98,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_gateway_responses_minimal.json b/tests/translator/output/aws-cn/api_with_gateway_responses_minimal.json index ca11e8c89..fdc244668 100644 --- a/tests/translator/output/aws-cn/api_with_gateway_responses_minimal.json +++ b/tests/translator/output/aws-cn/api_with_gateway_responses_minimal.json @@ -2,8 +2,6 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -103,8 +97,6 @@ }, "ExplicitApiDeployment8f2919f3e3": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -115,8 +107,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment8f2919f3e3" @@ -129,8 +119,6 @@ }, "FunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-cn/api_with_gateway_responses_string_status_code.json b/tests/translator/output/aws-cn/api_with_gateway_responses_string_status_code.json index 068865b87..a0eb308b6 100644 --- a/tests/translator/output/aws-cn/api_with_gateway_responses_string_status_code.json +++ b/tests/translator/output/aws-cn/api_with_gateway_responses_string_status_code.json @@ -2,8 +2,6 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "ExplicitApiDeployment9196b651da": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -39,8 +35,6 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -71,8 +65,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -120,8 +112,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment9196b651da" @@ -134,8 +124,6 @@ }, "FunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-cn/api_with_if_conditional_with_resource_policy.json b/tests/translator/output/aws-cn/api_with_if_conditional_with_resource_policy.json index c9e919ab2..a5ab0daf8 100644 --- a/tests/translator/output/aws-cn/api_with_if_conditional_with_resource_policy.json +++ b/tests/translator/output/aws-cn/api_with_if_conditional_with_resource_policy.json @@ -10,8 +10,6 @@ "Resources": { "ExplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -35,8 +33,6 @@ }, "ExplicitApiFunctionPutHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -58,8 +54,6 @@ }, "ExplicitApiDeployment1864127303": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -70,8 +64,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -149,8 +141,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment1864127303" @@ -163,8 +153,6 @@ }, "ExplicitApiFunctionPostHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -186,8 +174,6 @@ }, "ExplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -218,8 +204,6 @@ }, "ExplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-cn/api_with_incompatible_stage_name.json b/tests/translator/output/aws-cn/api_with_incompatible_stage_name.json index fd1c1c849..0cf9ef165 100644 --- a/tests/translator/output/aws-cn/api_with_incompatible_stage_name.json +++ b/tests/translator/output/aws-cn/api_with_incompatible_stage_name.json @@ -2,8 +2,6 @@ "Resources": { "UnderscoreApiStageb34d3ad84e": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "UnderscoreApiDeploymentd4074182ff" @@ -16,8 +14,6 @@ }, "UnderscoreApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -74,8 +70,6 @@ }, "UnderscoreFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -106,8 +100,6 @@ }, "UnderscoreApiDeploymentd4074182ff": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "UnderscoreApi" @@ -118,8 +110,6 @@ }, "HyphenFunctionGetHtmlPermission0c8ecc62cb": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -139,8 +129,6 @@ }, "HyphenApiStage0c8ecc62cb": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "HyphenApiDeployment52a312db45" @@ -153,8 +141,6 @@ }, "UnderscoreFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -178,8 +164,6 @@ }, "UnderscoreFunctionGetHtmlPermissionb34d3ad84e": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -199,8 +183,6 @@ }, "HyphenFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -224,8 +206,6 @@ }, "HyphenApiDeployment52a312db45": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "HyphenApi" @@ -236,8 +216,6 @@ }, "HyphenApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -294,8 +272,6 @@ }, "HyphenFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-cn/api_with_ip_range_blacklist.json b/tests/translator/output/aws-cn/api_with_ip_range_blacklist.json index cf6023d58..f876a1bd8 100644 --- a/tests/translator/output/aws-cn/api_with_ip_range_blacklist.json +++ b/tests/translator/output/aws-cn/api_with_ip_range_blacklist.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -26,8 +24,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment5e467ed97e" @@ -40,8 +36,6 @@ }, "MyFunctionApiPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -63,8 +57,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -95,8 +87,6 @@ }, "ServerlessRestApiDeployment5e467ed97e": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -107,8 +97,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_ip_range_whitelist.json b/tests/translator/output/aws-cn/api_with_ip_range_whitelist.json index 6cc214e08..a9d254e50 100644 --- a/tests/translator/output/aws-cn/api_with_ip_range_whitelist.json +++ b/tests/translator/output/aws-cn/api_with_ip_range_whitelist.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -26,8 +24,6 @@ }, "ServerlessRestApiDeployment4dbd43b8e2": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -38,8 +34,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment4dbd43b8e2" @@ -52,8 +46,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -84,8 +76,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -186,8 +176,6 @@ }, "MyFunctionApiPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-cn/api_with_method_aws_iam_auth.json b/tests/translator/output/aws-cn/api_with_method_aws_iam_auth.json index 58c9ff8a9..cb9023e9e 100644 --- a/tests/translator/output/aws-cn/api_with_method_aws_iam_auth.json +++ b/tests/translator/output/aws-cn/api_with_method_aws_iam_auth.json @@ -2,8 +2,6 @@ "Resources": { "MyFunctionWithAwsIamAuthMyApiWithAwsIamAuthPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -25,8 +23,6 @@ }, "MyApiWithoutAuthDeployment82d56c6578": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithoutAuth" @@ -37,8 +33,6 @@ }, "MyApiWithoutAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -121,8 +115,6 @@ }, "MyFunctionWithAwsIamAuthMyApiWithAwsIamAuthAndDefaultInvokeRolePermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -144,8 +136,6 @@ }, "MyFunctionWithAwsIamAuth": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -169,8 +159,6 @@ }, "MyApiWithoutAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithoutAuthDeployment82d56c6578" @@ -183,8 +171,6 @@ }, "MyFunctionWithAwsIamAuthMyApiWithAwsIamAuthAndCustomInvokeRolePermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -206,8 +192,6 @@ }, "MyFunctionWithAwsIamAuthRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-cn/api_with_method_settings.json b/tests/translator/output/aws-cn/api_with_method_settings.json index d487578ad..5e09017cd 100644 --- a/tests/translator/output/aws-cn/api_with_method_settings.json +++ b/tests/translator/output/aws-cn/api_with_method_settings.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -82,8 +76,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -101,8 +93,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "MethodSettings": [ { @@ -124,8 +114,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "MethodSettings": [ { @@ -147,8 +135,6 @@ }, "ServerlessRestApiDeploymentcb4fb12558": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -159,8 +145,6 @@ }, "ExplicitApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -171,8 +155,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_minimum_compression_size.json b/tests/translator/output/aws-cn/api_with_minimum_compression_size.json index 80b064dfc..ce1ad07b6 100644 --- a/tests/translator/output/aws-cn/api_with_minimum_compression_size.json +++ b/tests/translator/output/aws-cn/api_with_minimum_compression_size.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -82,8 +76,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "MinimumCompressionSize": 256, "EndpointConfiguration": { @@ -102,8 +94,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentf117c932f7" @@ -116,8 +106,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentcb4fb12558" @@ -130,8 +118,6 @@ }, "ServerlessRestApiDeploymentcb4fb12558": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -142,8 +128,6 @@ }, "ExplicitApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -154,8 +138,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_open_api_version.json b/tests/translator/output/aws-cn/api_with_open_api_version.json index 5fbf5383b..5a8bc7db5 100644 --- a/tests/translator/output/aws-cn/api_with_open_api_version.json +++ b/tests/translator/output/aws-cn/api_with_open_api_version.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -82,8 +76,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -107,8 +99,6 @@ }, "ExplicitApiDeploymentd9a0f2ae4f": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -118,8 +108,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment75f93f5c08" @@ -132,8 +120,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentd9a0f2ae4f" @@ -146,8 +132,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -222,8 +206,6 @@ }, "ServerlessRestApiDeployment75f93f5c08": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" diff --git a/tests/translator/output/aws-cn/api_with_open_api_version_2.json b/tests/translator/output/aws-cn/api_with_open_api_version_2.json index cee6fa433..c86109c06 100644 --- a/tests/translator/output/aws-cn/api_with_open_api_version_2.json +++ b/tests/translator/output/aws-cn/api_with_open_api_version_2.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -82,8 +76,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -107,8 +99,6 @@ }, "ServerlessRestApiDeployment3146d7e6fb": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -118,8 +108,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment3146d7e6fb" @@ -132,8 +120,6 @@ }, "ExplicitApiDeployment4154e1c30c": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -143,8 +129,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -221,8 +205,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment4154e1c30c" diff --git a/tests/translator/output/aws-cn/api_with_openapi_definition_body_no_flag.json b/tests/translator/output/aws-cn/api_with_openapi_definition_body_no_flag.json index b870549a8..23804071b 100644 --- a/tests/translator/output/aws-cn/api_with_openapi_definition_body_no_flag.json +++ b/tests/translator/output/aws-cn/api_with_openapi_definition_body_no_flag.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ExplicitApiDeployment9252467a1e": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -71,8 +65,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -136,8 +128,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -155,8 +145,6 @@ }, "ServerlessRestApiDeploymente1212668e0": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -167,8 +155,6 @@ }, "ExplicitApiSomeStageStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -186,8 +172,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -209,8 +193,6 @@ }, "MyUserPool": { "Type": "AWS::Cognito::UserPool", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "UsernameAttributes": [ "email" @@ -232,8 +214,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_path_parameters.json b/tests/translator/output/aws-cn/api_with_path_parameters.json index 1616543c8..89289052b 100644 --- a/tests/translator/output/aws-cn/api_with_path_parameters.json +++ b/tests/translator/output/aws-cn/api_with_path_parameters.json @@ -2,8 +2,6 @@ "Resources": { "HtmlFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -34,8 +32,6 @@ }, "HtmlApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "HtmlApiDeploymentf117c932f7" @@ -48,8 +44,6 @@ }, "HtmlFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -69,8 +63,6 @@ }, "HtmlApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "HtmlApi" @@ -81,8 +73,6 @@ }, "HtmlApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -100,8 +90,6 @@ }, "HtmlFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-cn/api_with_resource_policy.json b/tests/translator/output/aws-cn/api_with_resource_policy.json index 11a3af857..b7299850f 100644 --- a/tests/translator/output/aws-cn/api_with_resource_policy.json +++ b/tests/translator/output/aws-cn/api_with_resource_policy.json @@ -2,8 +2,6 @@ "Resources": { "ExplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "ExplicitApiFunctionPutHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -50,8 +46,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -121,8 +115,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment39d7eca1e3" @@ -135,8 +127,6 @@ }, "ExplicitApiFunctionPostHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -158,8 +148,6 @@ }, "ExplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -190,8 +178,6 @@ }, "ExplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -213,8 +199,6 @@ }, "ExplicitApiDeployment39d7eca1e3": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" diff --git a/tests/translator/output/aws-cn/api_with_resource_policy_global.json b/tests/translator/output/aws-cn/api_with_resource_policy_global.json index 2a6f60c1b..0d7c8c732 100644 --- a/tests/translator/output/aws-cn/api_with_resource_policy_global.json +++ b/tests/translator/output/aws-cn/api_with_resource_policy_global.json @@ -16,8 +16,6 @@ "Resources": { "AnotherApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -61,8 +59,6 @@ }, "ExplicitApiDeploymenta5a5c4e3ff": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -73,8 +69,6 @@ }, "ExplicitApiStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymenta5a5c4e3ff" @@ -89,8 +83,6 @@ }, "ExplicitApiFunctionGetHtmlPermissionStage": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -112,8 +104,6 @@ }, "AnotherApiDeploymentfdf1387e0a": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "AnotherApi" @@ -124,8 +114,6 @@ }, "ExplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -149,8 +137,6 @@ }, "ExplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -181,8 +167,6 @@ }, "AnotherApiStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "AnotherApiDeploymentfdf1387e0a" @@ -197,8 +181,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_resource_policy_global_implicit.json b/tests/translator/output/aws-cn/api_with_resource_policy_global_implicit.json index f50769759..d693a4805 100644 --- a/tests/translator/output/aws-cn/api_with_resource_policy_global_implicit.json +++ b/tests/translator/output/aws-cn/api_with_resource_policy_global_implicit.json @@ -2,8 +2,6 @@ "Resources": { "MinimalFunctionAddItemPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -25,8 +23,6 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -57,8 +53,6 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -82,8 +76,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment0ff9f5a989" @@ -96,8 +88,6 @@ }, "ServerlessRestApiDeployment0ff9f5a989": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -108,8 +98,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_resource_refs.json b/tests/translator/output/aws-cn/api_with_resource_refs.json index 799d54379..78488a30b 100644 --- a/tests/translator/output/aws-cn/api_with_resource_refs.json +++ b/tests/translator/output/aws-cn/api_with_resource_refs.json @@ -24,8 +24,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -49,8 +47,6 @@ }, "MyApiDeployment359f256a3b": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -61,8 +57,6 @@ }, "MyApifooStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment359f256a3b" @@ -75,8 +69,6 @@ }, "ServerlessRestApiDeployment8b5ecabf9b": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -87,8 +79,6 @@ }, "MyFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -110,8 +100,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment8b5ecabf9b" @@ -124,8 +112,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -156,8 +142,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -194,8 +178,6 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "this": "is", diff --git a/tests/translator/output/aws-cn/api_with_source_vpc_blacklist.json b/tests/translator/output/aws-cn/api_with_source_vpc_blacklist.json index 61e8a6bbf..6dfbef3fa 100644 --- a/tests/translator/output/aws-cn/api_with_source_vpc_blacklist.json +++ b/tests/translator/output/aws-cn/api_with_source_vpc_blacklist.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -26,8 +24,6 @@ }, "ServerlessRestApiDeploymentb8219b2586": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -38,8 +34,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentb8219b2586" @@ -52,8 +46,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -84,8 +76,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -164,8 +154,6 @@ }, "MyFunctionApiPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-cn/api_with_source_vpc_whitelist.json b/tests/translator/output/aws-cn/api_with_source_vpc_whitelist.json index 76f5ba883..0d238d2a2 100644 --- a/tests/translator/output/aws-cn/api_with_source_vpc_whitelist.json +++ b/tests/translator/output/aws-cn/api_with_source_vpc_whitelist.json @@ -8,8 +8,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -32,8 +30,6 @@ }, "MyFunctionFetchPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -55,8 +51,6 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment5332c373d4" @@ -69,8 +63,6 @@ }, "ServerlessRestApiDeploymentf39840708b": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -81,8 +73,6 @@ }, "MyApiDeployment5332c373d4": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -93,8 +83,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentf39840708b" @@ -107,8 +95,6 @@ }, "MyFunctionApiPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -130,8 +116,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -162,8 +146,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -293,8 +275,6 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/api_with_stage_tags.json b/tests/translator/output/aws-cn/api_with_stage_tags.json index ad7510546..1e9912886 100644 --- a/tests/translator/output/aws-cn/api_with_stage_tags.json +++ b/tests/translator/output/aws-cn/api_with_stage_tags.json @@ -8,8 +8,6 @@ "Resources": { "MyApiWithStageTagsDeployment5332c373d4": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithStageTags" @@ -20,8 +18,6 @@ }, "MyApiWithStageTags": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -45,8 +41,6 @@ }, "MyApiWithStageTagsProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithStageTagsDeployment5332c373d4" diff --git a/tests/translator/output/aws-cn/api_with_swagger_and_openapi_with_auth.json b/tests/translator/output/aws-cn/api_with_swagger_and_openapi_with_auth.json index eb35d710e..553c9fc90 100644 --- a/tests/translator/output/aws-cn/api_with_swagger_and_openapi_with_auth.json +++ b/tests/translator/output/aws-cn/api_with_swagger_and_openapi_with_auth.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -123,8 +117,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -142,8 +134,6 @@ }, "ServerlessRestApiDeploymente1212668e0": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -154,8 +144,6 @@ }, "ExplicitApiSomeStageStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -173,8 +161,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -196,8 +182,6 @@ }, "MyUserPool": { "Type": "AWS::Cognito::UserPool", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "UsernameAttributes": [ "email" @@ -219,8 +203,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -282,8 +264,6 @@ }, "ExplicitApiDeployment7c4f7dda23": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" diff --git a/tests/translator/output/aws-cn/api_with_usageplans.json b/tests/translator/output/aws-cn/api_with_usageplans.json index 3167b7c45..60dc7b392 100644 --- a/tests/translator/output/aws-cn/api_with_usageplans.json +++ b/tests/translator/output/aws-cn/api_with_usageplans.json @@ -40,8 +40,6 @@ "Resources": { "MyFunctionThreeRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -72,8 +70,6 @@ }, "MyApiOneDeployment7997029260": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiOne" @@ -84,8 +80,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment40b50dc688" @@ -98,8 +92,6 @@ }, "MyApiTwoUsagePlanKey": { "Type": "AWS::ApiGateway::UsagePlanKey", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "KeyType": "API_KEY", "KeyId": { @@ -115,8 +107,6 @@ }, "MyApiThree": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -165,8 +155,6 @@ }, "MyFunctionThreeApiKeyPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -188,8 +176,6 @@ }, "MyFunctionTwo": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -212,8 +198,6 @@ }, "MyFunctionOneApiKeyPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -235,8 +219,6 @@ }, "MyFunctionTwoApiKeyPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -258,8 +240,6 @@ }, "MyFunctionOneRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -290,8 +270,6 @@ }, "MyApiTwo": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -340,8 +318,6 @@ }, "MyFunctionTwoRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -372,8 +348,6 @@ }, "MyFunctionOne": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -396,8 +370,6 @@ }, "ServerlessRestApiDeployment40b50dc688": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -408,8 +380,6 @@ }, "ServerlessUsagePlan": { "Type": "AWS::ApiGateway::UsagePlan", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiStages": [ { @@ -437,8 +407,6 @@ }, "MyApiTwoUsagePlan": { "Type": "AWS::ApiGateway::UsagePlan", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiStages": [ { @@ -478,8 +446,6 @@ }, "MyFunctionTwoImplicitApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -501,8 +467,6 @@ }, "MyApiTwoProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiTwoDeployment03730b64c4" @@ -515,8 +479,6 @@ }, "MyApiOneProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiOneDeployment7997029260" @@ -529,8 +491,6 @@ }, "MyApiTwoDeployment03730b64c4": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiTwo" @@ -541,8 +501,6 @@ }, "MyFunctionThree": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -565,8 +523,6 @@ }, "MyApiThreeProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiThreeDeploymentfa9f73f027" @@ -579,8 +535,6 @@ }, "ServerlessUsagePlanKey": { "Type": "AWS::ApiGateway::UsagePlanKey", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "KeyType": "API_KEY", "KeyId": { @@ -596,8 +550,6 @@ }, "MyApiOne": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -646,8 +598,6 @@ }, "ServerlessApiKey": { "Type": "AWS::ApiGateway::ApiKey", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Enabled": true, "StageKeys": [ @@ -675,8 +625,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -725,8 +673,6 @@ }, "MyApiThreeDeploymentfa9f73f027": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiThree" @@ -737,8 +683,6 @@ }, "MyApiTwoApiKey": { "Type": "AWS::ApiGateway::ApiKey", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Enabled": true, "StageKeys": [ diff --git a/tests/translator/output/aws-cn/api_with_usageplans_intrinsics.json b/tests/translator/output/aws-cn/api_with_usageplans_intrinsics.json index 00459d7a2..c9a6c4230 100644 --- a/tests/translator/output/aws-cn/api_with_usageplans_intrinsics.json +++ b/tests/translator/output/aws-cn/api_with_usageplans_intrinsics.json @@ -30,8 +30,6 @@ "Resources": { "MyApiTwoUsagePlanKey": { "Type": "AWS::ApiGateway::UsagePlanKey", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "KeyType": "API_KEY", "KeyId": { @@ -47,8 +45,6 @@ }, "MyApiOneUsagePlan": { "Type": "AWS::ApiGateway::UsagePlan", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiStages": [ { @@ -68,8 +64,6 @@ }, "MyApiTwoUsagePlan": { "Type": "AWS::ApiGateway::UsagePlan", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiStages": [ { @@ -88,8 +82,6 @@ }, "MyApiTwoDeploymenta997b9e562": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiTwo" @@ -99,8 +91,6 @@ }, "MyApiOneUsagePlanKey": { "Type": "AWS::ApiGateway::UsagePlanKey", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "KeyType": "API_KEY", "KeyId": { @@ -117,8 +107,6 @@ }, "MyApiTwoProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiTwoDeploymenta997b9e562" @@ -131,8 +119,6 @@ }, "MyApiOneProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiOneDeploymentd8cca8c82b" @@ -146,8 +132,6 @@ }, "MyApiOneApiKey": { "Type": "AWS::ApiGateway::ApiKey", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Enabled": true, "StageKeys": [ @@ -168,8 +152,6 @@ }, "MyFunctionTwoRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -200,8 +182,6 @@ }, "MyApiOneDeploymentd8cca8c82b": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiOne" @@ -212,8 +192,6 @@ }, "MyApiTwoApiKey": { "Type": "AWS::ApiGateway::ApiKey", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Enabled": true, "StageKeys": [ @@ -233,8 +211,6 @@ }, "MyFunctionOneApiKeyPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -256,8 +232,6 @@ }, "MyFunctionTwo": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -280,8 +254,6 @@ }, "MyFunctionTwoApiKeyPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -303,8 +275,6 @@ }, "MyFunctionOneRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -335,8 +305,6 @@ }, "MyApiTwo": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -387,8 +355,6 @@ }, "MyApiOne": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -440,8 +406,6 @@ }, "MyFunctionOne": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { diff --git a/tests/translator/output/aws-cn/api_with_xray_tracing.json b/tests/translator/output/aws-cn/api_with_xray_tracing.json index 1fc8c5cf0..34acf4597 100644 --- a/tests/translator/output/aws-cn/api_with_xray_tracing.json +++ b/tests/translator/output/aws-cn/api_with_xray_tracing.json @@ -2,8 +2,6 @@ "Resources": { "HtmlFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -34,8 +32,6 @@ }, "HtmlApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "HtmlApiDeploymentf117c932f7" @@ -49,8 +45,6 @@ }, "HtmlFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -70,8 +64,6 @@ }, "HtmlApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "HtmlApi" @@ -82,8 +74,6 @@ }, "HtmlApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -101,8 +91,6 @@ }, "HtmlFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-cn/application_preparing_state.json b/tests/translator/output/aws-cn/application_preparing_state.json index bfb82c032..92fe7cc8d 100644 --- a/tests/translator/output/aws-cn/application_preparing_state.json +++ b/tests/translator/output/aws-cn/application_preparing_state.json @@ -2,8 +2,6 @@ "Resources": { "PreparingApplication": { "Type": "AWS::CloudFormation::Stack", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "TemplateURL": "https://awsserverlessrepo-changesets-xxx.s3.amazonaws.com/signed-url", "Tags": [ diff --git a/tests/translator/output/aws-cn/application_with_intrinsics.json b/tests/translator/output/aws-cn/application_with_intrinsics.json index 494b74b01..314a99e30 100644 --- a/tests/translator/output/aws-cn/application_with_intrinsics.json +++ b/tests/translator/output/aws-cn/application_with_intrinsics.json @@ -28,8 +28,6 @@ "Resources": { "ApplicationFindInMap": { "Type": "AWS::CloudFormation::Stack", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "NotificationARNs": [ { @@ -55,8 +53,6 @@ }, "ApplicationRefParameter": { "Type": "AWS::CloudFormation::Stack", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "TemplateURL": "https://awsserverlessrepo-changesets-xxx.s3.amazonaws.com/signed-url", "Tags": [ @@ -76,9 +72,7 @@ } }, "Sns": { - "Type": "AWS::SNS::Topic", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::SNS::Topic" } } } diff --git a/tests/translator/output/aws-cn/basic_application.json b/tests/translator/output/aws-cn/basic_application.json index fa4e7d8e4..058e8037e 100644 --- a/tests/translator/output/aws-cn/basic_application.json +++ b/tests/translator/output/aws-cn/basic_application.json @@ -10,8 +10,6 @@ "Resources": { "NormalApplication": { "Type": "AWS::CloudFormation::Stack", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "NotificationARNs": [ "arn:aws:sns:us-east-1:123456789012:sns-arn" @@ -43,8 +41,6 @@ }, "BasicApplication": { "Type": "AWS::CloudFormation::Stack", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "TemplateURL": "https://awsserverlessrepo-changesets-xxx.s3.amazonaws.com/signed-url", "Tags": [ @@ -65,8 +61,6 @@ }, "ApplicationWithLocationUrl": { "Type": "AWS::CloudFormation::Stack", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "TemplateURL": "https://s3-us-east-1.amazonaws.com/demo-bucket/template.yaml", "Tags": [ @@ -83,8 +77,6 @@ }, "ApplicationWithCondition": { "Type": "AWS::CloudFormation::Stack", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "TemplateURL": "https://awsserverlessrepo-changesets-xxx.s3.amazonaws.com/signed-url", "Tags": [ diff --git a/tests/translator/output/aws-cn/basic_function.json b/tests/translator/output/aws-cn/basic_function.json index 2c37233b6..f3d2b1891 100644 --- a/tests/translator/output/aws-cn/basic_function.json +++ b/tests/translator/output/aws-cn/basic_function.json @@ -12,8 +12,6 @@ "Resources": { "FunctionWithInlineCode": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "TracingConfig": { "Mode": "Active" @@ -39,8 +37,6 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -71,8 +67,6 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -96,8 +90,6 @@ }, "FunctionWithPolicyDocument": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -121,8 +113,6 @@ }, "FunctionWithPolicies": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -146,8 +136,6 @@ }, "FunctionWithCodeUriObjectRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -178,8 +166,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Path": "/", "Policies": [ @@ -217,8 +203,6 @@ }, "CompleteFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -261,8 +245,6 @@ }, "FunctionWithCodeUriObject": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -287,8 +269,6 @@ }, "FunctionWithPoliciesRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -320,8 +300,6 @@ }, "FunctionWithInlineCodeRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -353,8 +331,6 @@ }, "FunctionWithTracingRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -386,8 +362,6 @@ }, "FunctionWithRoleRef": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -411,8 +385,6 @@ }, "FunctionWithTracing": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "TracingConfig": { "Mode": "Active" @@ -439,8 +411,6 @@ }, "FunctionWithPolicyDocumentRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-cn/basic_function_with_tags.json b/tests/translator/output/aws-cn/basic_function_with_tags.json index b51f7e069..119f925f3 100644 --- a/tests/translator/output/aws-cn/basic_function_with_tags.json +++ b/tests/translator/output/aws-cn/basic_function_with_tags.json @@ -9,8 +9,6 @@ "Resources": { "AlexaSkillFuncRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -60,8 +58,6 @@ }, "AlexaSkillFuncAlexaSkillEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { @@ -72,8 +68,6 @@ }, "AlexaSkillFunc": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-cn/basic_function_withimageuri.json b/tests/translator/output/aws-cn/basic_function_withimageuri.json index a9b5f1163..894fbb717 100644 --- a/tests/translator/output/aws-cn/basic_function_withimageuri.json +++ b/tests/translator/output/aws-cn/basic_function_withimageuri.json @@ -12,8 +12,6 @@ "Resources": { "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -51,8 +49,6 @@ }, "MinimalImageFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ImageUri": "123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest" @@ -74,8 +70,6 @@ }, "MinimalImageFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -106,8 +100,6 @@ }, "MinimalImageFunctionPackageTypeAndImageConfig": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ImageUri": "123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest" @@ -134,8 +126,6 @@ }, "MinimalImageFunctionPackageTypeAndImageConfigRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -166,8 +156,6 @@ }, "CompleteImageFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ImageUri": "123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest" @@ -213,8 +201,6 @@ }, "FunctionWithPolicies": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ImageUri": "123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest" @@ -236,8 +222,6 @@ }, "FunctionWithPoliciesRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -269,8 +253,6 @@ }, "FunctionWithPolicyDocument": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ImageUri": "123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest" @@ -292,8 +274,6 @@ }, "FunctionWithPolicyDocumentRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -340,8 +320,6 @@ }, "FunctionWithRoleRef": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ImageUri": "123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest" diff --git a/tests/translator/output/aws-cn/basic_layer.json b/tests/translator/output/aws-cn/basic_layer.json index 5421d7ca6..d373bd19c 100644 --- a/tests/translator/output/aws-cn/basic_layer.json +++ b/tests/translator/output/aws-cn/basic_layer.json @@ -9,8 +9,7 @@ }, "Resources": { "LayerWithCondition7c655e10ea": { - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::LayerVersion", "Properties": { "Content": { @@ -22,8 +21,7 @@ "Condition": "TestCondition" }, "MinimalLayer0c7f96cce7": { - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::LayerVersion", "Properties": { "Content": { @@ -34,7 +32,6 @@ } }, "CompleteLayer5d71a60e81": { - "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Retain", "Type": "AWS::Lambda::LayerVersion", "Properties": { @@ -52,7 +49,6 @@ } }, "LayerWithContentUriObjectbdbf1b82ac": { - "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete", "Type": "AWS::Lambda::LayerVersion", "Properties": { diff --git a/tests/translator/output/aws-cn/cloudwatch_logs_with_ref.json b/tests/translator/output/aws-cn/cloudwatch_logs_with_ref.json index f170efee7..029fab42e 100644 --- a/tests/translator/output/aws-cn/cloudwatch_logs_with_ref.json +++ b/tests/translator/output/aws-cn/cloudwatch_logs_with_ref.json @@ -13,8 +13,6 @@ "Resources": { "TriggeredFunctionCWLogEvent": { "Type": "AWS::Logs::SubscriptionFilter", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DestinationArn": { "Fn::GetAtt": [ @@ -35,8 +33,6 @@ }, "TriggeredFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -61,8 +57,6 @@ }, "TriggeredFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -93,8 +87,6 @@ }, "TriggeredFunctionCWLogEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "logs.amazonaws.com", diff --git a/tests/translator/output/aws-cn/cloudwatchevent.json b/tests/translator/output/aws-cn/cloudwatchevent.json index 27b0f00d7..b62317f54 100644 --- a/tests/translator/output/aws-cn/cloudwatchevent.json +++ b/tests/translator/output/aws-cn/cloudwatchevent.json @@ -2,8 +2,6 @@ "Resources": { "ScheduledFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -34,8 +32,6 @@ }, "TriggeredFunctionOnTerminatePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -52,8 +48,6 @@ }, "ScheduledFunctionSchedulePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -70,8 +64,6 @@ }, "ScheduledFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -96,8 +88,6 @@ }, "TriggeredFunctionOnTerminate": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -122,8 +112,6 @@ }, "TriggeredFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -148,8 +136,6 @@ }, "TriggeredFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -180,8 +166,6 @@ }, "ScheduledFunctionSchedule": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ScheduleExpression": "rate(1 minute)", "Targets": [ diff --git a/tests/translator/output/aws-cn/cloudwatchlog.json b/tests/translator/output/aws-cn/cloudwatchlog.json index 83d950b1b..f11344282 100644 --- a/tests/translator/output/aws-cn/cloudwatchlog.json +++ b/tests/translator/output/aws-cn/cloudwatchlog.json @@ -2,8 +2,6 @@ "Resources": { "TriggeredFunctionCWLogEvent": { "Type": "AWS::Logs::SubscriptionFilter", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DestinationArn": { "Fn::GetAtt": [ @@ -20,8 +18,6 @@ }, "TriggeredFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -46,8 +42,6 @@ }, "TriggeredFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -78,8 +72,6 @@ }, "TriggeredFunctionCWLogEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "logs.amazonaws.com", diff --git a/tests/translator/output/aws-cn/cognito_userpool_with_event.json b/tests/translator/output/aws-cn/cognito_userpool_with_event.json index 9d0c71d99..973838a75 100644 --- a/tests/translator/output/aws-cn/cognito_userpool_with_event.json +++ b/tests/translator/output/aws-cn/cognito_userpool_with_event.json @@ -2,8 +2,6 @@ "Resources": { "UserPool": { "Type": "AWS::Cognito::UserPool", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "LambdaConfig": { "PreSignUp": { @@ -29,8 +27,6 @@ }, "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -54,8 +50,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -86,8 +80,6 @@ }, "ImplicitApiFunctionCognitoPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { diff --git a/tests/translator/output/aws-cn/depends_on.json b/tests/translator/output/aws-cn/depends_on.json index d4de265b6..f05114985 100644 --- a/tests/translator/output/aws-cn/depends_on.json +++ b/tests/translator/output/aws-cn/depends_on.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -31,8 +29,6 @@ }, "MyExplicitApiDeployment74b681ce04": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyExplicitApi" @@ -43,8 +39,6 @@ }, "MyExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -63,8 +57,6 @@ }, "MyOtherTable": { "Type": "AWS::DynamoDB::Table", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "KeySchema": [ { @@ -90,8 +82,6 @@ }, "MyExplicitApidevStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyExplicitApiDeployment74b681ce04" @@ -104,8 +94,6 @@ }, "MySamTable": { "Type": "AWS::DynamoDB::Table", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BillingMode": "PAY_PER_REQUEST", "AttributeDefinitions": [ @@ -124,8 +112,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -156,8 +142,6 @@ }, "MyFunctionMyApiPermissiondev": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-cn/eventbridgerule.json b/tests/translator/output/aws-cn/eventbridgerule.json index 67a33837a..91c6a68e8 100644 --- a/tests/translator/output/aws-cn/eventbridgerule.json +++ b/tests/translator/output/aws-cn/eventbridgerule.json @@ -2,8 +2,6 @@ "Resources": { "ScheduledFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -34,8 +32,6 @@ }, "TriggeredFunctionOnTerminatePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -52,8 +48,6 @@ }, "ScheduledFunctionSchedulePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -70,8 +64,6 @@ }, "ScheduledFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -96,8 +88,6 @@ }, "TriggeredFunctionOnTerminate": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -122,8 +112,6 @@ }, "TriggeredFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -148,8 +136,6 @@ }, "TriggeredFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -180,8 +166,6 @@ }, "ScheduledFunctionSchedule": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ScheduleExpression": "rate(1 minute)", "Targets": [ diff --git a/tests/translator/output/aws-cn/eventbridgerule_schedule_properties.json b/tests/translator/output/aws-cn/eventbridgerule_schedule_properties.json index b7e4396a6..4f463b834 100644 --- a/tests/translator/output/aws-cn/eventbridgerule_schedule_properties.json +++ b/tests/translator/output/aws-cn/eventbridgerule_schedule_properties.json @@ -2,8 +2,6 @@ "Resources": { "ScheduledFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -34,8 +32,6 @@ }, "TriggeredFunctionOnTerminatePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -52,8 +48,6 @@ }, "ScheduledFunctionSchedulePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -70,8 +64,6 @@ }, "ScheduledFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -96,8 +88,6 @@ }, "TriggeredFunctionOnTerminate": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -121,8 +111,6 @@ }, "TriggeredFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -147,8 +135,6 @@ }, "TriggeredFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -179,13 +165,11 @@ }, "ScheduledFunctionSchedule": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ScheduleExpression": "rate(1 minute)", - "Name": "test-schedule", - "Description": "Test Schedule", - "State": "ENABLED", + "Name": "test-schedule", + "Description": "Test Schedule", + "State": "ENABLED", "Targets": [ { "Id": "ScheduledFunctionScheduleLambdaTarget", diff --git a/tests/translator/output/aws-cn/eventbridgerule_with_dlq.json b/tests/translator/output/aws-cn/eventbridgerule_with_dlq.json index 11455cf14..6f6fa0460 100644 --- a/tests/translator/output/aws-cn/eventbridgerule_with_dlq.json +++ b/tests/translator/output/aws-cn/eventbridgerule_with_dlq.json @@ -2,8 +2,6 @@ "Resources": { "ScheduledFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -34,8 +32,6 @@ }, "ScheduledFunctionScheduleQueuePolicy": { "Type": "AWS::SQS::QueuePolicy", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Queues": [ { @@ -74,8 +70,6 @@ }, "TriggeredFunctionOnTerminate": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -103,8 +97,6 @@ }, "TriggeredFunctionOnTerminatePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -121,8 +113,6 @@ }, "ScheduledFunctionSchedulePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -139,8 +129,6 @@ }, "ScheduledFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -165,14 +153,10 @@ }, "ScheduledFunctionScheduleQueue": { "Type": "AWS::SQS::Queue", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": {} }, "TriggeredFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -197,8 +181,6 @@ }, "TriggeredFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -229,8 +211,6 @@ }, "ScheduledFunctionSchedule": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ScheduleExpression": "rate(1 minute)", "Targets": [ diff --git a/tests/translator/output/aws-cn/eventbridgerule_with_retry_policy.json b/tests/translator/output/aws-cn/eventbridgerule_with_retry_policy.json index 7e834d5f1..d1ab9d848 100644 --- a/tests/translator/output/aws-cn/eventbridgerule_with_retry_policy.json +++ b/tests/translator/output/aws-cn/eventbridgerule_with_retry_policy.json @@ -2,8 +2,6 @@ "Resources": { "ScheduledFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -34,8 +32,6 @@ }, "TriggeredFunctionOnTerminatePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -52,8 +48,6 @@ }, "ScheduledFunctionSchedulePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -70,8 +64,6 @@ }, "ScheduledFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -96,8 +88,6 @@ }, "TriggeredFunctionOnTerminate": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -126,8 +116,6 @@ }, "TriggeredFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -152,8 +140,6 @@ }, "TriggeredFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -184,8 +170,6 @@ }, "ScheduledFunctionSchedule": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ScheduleExpression": "rate(1 minute)", "Targets": [ diff --git a/tests/translator/output/aws-cn/explicit_api.json b/tests/translator/output/aws-cn/explicit_api.json index db3c14830..81fb57d35 100644 --- a/tests/translator/output/aws-cn/explicit_api.json +++ b/tests/translator/output/aws-cn/explicit_api.json @@ -12,8 +12,6 @@ "Resources": { "GetHtmlFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -37,8 +35,6 @@ }, "ApiWithInlineSwaggerStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ApiWithInlineSwaggerDeployment09cda3d97b" @@ -53,8 +49,6 @@ }, "GetHtmlApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "GetHtmlApi" @@ -65,8 +59,6 @@ }, "GetHtmlFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -99,8 +91,6 @@ }, "ApiWithInlineSwagger": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "this": "is", @@ -118,8 +108,6 @@ }, "GetHtmlFunctionGetHtmlPermissionStage": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -141,8 +129,6 @@ }, "GetHtmlApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -161,8 +147,6 @@ }, "GetHtmlApiStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "GetHtmlApiDeploymentf117c932f7" @@ -183,8 +167,6 @@ }, "ApiWithInlineSwaggerDeployment09cda3d97b": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ApiWithInlineSwagger" diff --git a/tests/translator/output/aws-cn/explicit_api_openapi_3.json b/tests/translator/output/aws-cn/explicit_api_openapi_3.json index 60b14ae84..38e863d3a 100644 --- a/tests/translator/output/aws-cn/explicit_api_openapi_3.json +++ b/tests/translator/output/aws-cn/explicit_api_openapi_3.json @@ -12,8 +12,6 @@ "Resources": { "GetHtmlFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -37,8 +35,6 @@ }, "ApiWithInlineSwaggerStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ApiWithInlineSwaggerDeployment74abcb3a5b" @@ -53,8 +49,6 @@ }, "GetHtmlApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "GetHtmlApi" @@ -65,8 +59,6 @@ }, "ApiWithInlineSwaggerDeployment74abcb3a5b": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ApiWithInlineSwagger" @@ -76,8 +68,6 @@ }, "GetHtmlFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -110,8 +100,6 @@ }, "ApiWithInlineSwagger": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "this": "is", @@ -129,8 +117,6 @@ }, "GetHtmlFunctionGetHtmlPermissionStage": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -152,8 +138,6 @@ }, "GetHtmlApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -172,8 +156,6 @@ }, "GetHtmlApiStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "GetHtmlApiDeploymentf117c932f7" diff --git a/tests/translator/output/aws-cn/explicit_api_with_invalid_events_config.json b/tests/translator/output/aws-cn/explicit_api_with_invalid_events_config.json index 2e8fb3046..c4238ab30 100644 --- a/tests/translator/output/aws-cn/explicit_api_with_invalid_events_config.json +++ b/tests/translator/output/aws-cn/explicit_api_with_invalid_events_config.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -27,8 +25,6 @@ }, "MyFunctionAddApiPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -48,8 +44,6 @@ }, "ApiWithInlineSwaggerProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ApiWithInlineSwaggerDeployment22d399868d" @@ -62,8 +56,6 @@ }, "ApiWithInlineSwagger": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -100,8 +92,6 @@ }, "ApiWithInlineSwaggerDeployment22d399868d": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ApiWithInlineSwagger" @@ -112,8 +102,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-cn/explicit_http_api.json b/tests/translator/output/aws-cn/explicit_http_api.json index 105ded6af..2eebb7bb8 100644 --- a/tests/translator/output/aws-cn/explicit_http_api.json +++ b/tests/translator/output/aws-cn/explicit_http_api.json @@ -2,8 +2,6 @@ "Resources": { "MyApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -17,8 +15,6 @@ }, "MyApi2ApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi2" @@ -32,8 +28,6 @@ }, "HttpApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.restapi", "Code": { @@ -57,8 +51,6 @@ }, "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -80,8 +72,6 @@ }, "MyApi2": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -154,8 +144,6 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -186,8 +174,6 @@ }, "HttpApiFunctionBasePathPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -209,8 +195,6 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FailOnWarnings": true, "Body": { diff --git a/tests/translator/output/aws-cn/explicit_http_api_minimum.json b/tests/translator/output/aws-cn/explicit_http_api_minimum.json index a2e49d1af..09367ab43 100644 --- a/tests/translator/output/aws-cn/explicit_http_api_minimum.json +++ b/tests/translator/output/aws-cn/explicit_http_api_minimum.json @@ -2,8 +2,6 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -27,8 +25,6 @@ }, "FunctionApiPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -50,8 +46,6 @@ }, "Api": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -73,8 +67,6 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -105,8 +97,6 @@ }, "ServerlessHttpApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -143,8 +133,6 @@ }, "ServerlessHttpApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "ServerlessHttpApi" @@ -158,8 +146,6 @@ }, "ApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "Api" diff --git a/tests/translator/output/aws-cn/function_concurrency.json b/tests/translator/output/aws-cn/function_concurrency.json index 462e5c148..c7cdb002b 100644 --- a/tests/translator/output/aws-cn/function_concurrency.json +++ b/tests/translator/output/aws-cn/function_concurrency.json @@ -7,8 +7,6 @@ "Resources": { "ConcurrentFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -38,8 +36,6 @@ }, "ConcurrentFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -62,8 +58,6 @@ }, "AnotherFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -93,8 +87,6 @@ }, "AnotherFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-cn/function_event_conditions.json b/tests/translator/output/aws-cn/function_event_conditions.json index 5524262e6..1e1ee3b38 100644 --- a/tests/translator/output/aws-cn/function_event_conditions.json +++ b/tests/translator/output/aws-cn/function_event_conditions.json @@ -10,8 +10,6 @@ "Resources": { "MyAwesomeFunctionAliasLive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "FunctionVersion": { @@ -28,8 +26,6 @@ }, "MyAwesomeFunctionNotificationTopicPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Action": "lambda:InvokeFunction", @@ -44,8 +40,6 @@ }, "MyAwesomeFunctionCWEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Action": "lambda:InvokeFunction", @@ -63,8 +57,6 @@ }, "MyAwesomeFunctionEBRulePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Action": "lambda:InvokeFunction", @@ -82,8 +74,6 @@ }, "MyAwesomeFunctionDDBStream": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "BatchSize": 200, @@ -96,8 +86,6 @@ }, "MyAwesomeFunctionIoTRule": { "Type": "AWS::IoT::TopicRule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "TopicRulePayload": { @@ -118,8 +106,6 @@ }, "MyAwesomeFunctionKinesisStream": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "BatchSize": 100, @@ -132,8 +118,6 @@ }, "MyAwesomeFunctionIoTRulePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Action": "lambda:InvokeFunction", @@ -158,8 +142,6 @@ }, "MyAwesomeFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Endpoint": { @@ -173,8 +155,6 @@ }, "MyAwesomeFunctionS3TriggerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Action": "lambda:InvokeFunction", @@ -189,8 +169,6 @@ }, "MyAwesomeFunctionCWLogPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Action": "lambda:InvokeFunction", @@ -210,8 +188,6 @@ }, "MyAwesomeFunctionEBSchedule": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "ScheduleExpression": "rate(1 minute)", @@ -227,8 +203,6 @@ }, "MyAwesomeFunctionCWLog": { "Type": "AWS::Logs::SubscriptionFilter", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "DestinationArn": { @@ -243,8 +217,6 @@ }, "MyAwesomeFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "ManagedPolicyArns": [ @@ -279,8 +251,6 @@ }, "MyAwesomeFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Code": { @@ -305,8 +275,6 @@ }, "MyAwesomeFunctionCWEvent": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "EventPattern": { @@ -328,8 +296,6 @@ }, "MyAwesomeFunctionEBRule": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "EventPattern": { @@ -350,8 +316,7 @@ } }, "MyAwesomeFunctionVersion640128d35d": { - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", "Condition": "MyCondition", "Properties": { @@ -362,14 +327,10 @@ }, "Notifications": { "Condition": "MyCondition", - "Type": "AWS::SNS::Topic", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::SNS::Topic" }, "MyAwesomeFunctionEBSchedulePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Action": "lambda:InvokeFunction", @@ -387,8 +348,6 @@ }, "FunctionOneImageBucketPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -402,8 +361,6 @@ }, "FunctionOneRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -434,8 +391,6 @@ }, "FunctionOne": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -459,8 +414,6 @@ }, "Images": { "Type": "AWS::S3::Bucket", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "NotificationConfiguration": { "LambdaConfigurations": [ @@ -510,8 +463,6 @@ }, "MyAwesomeFunctionSNSTopicWithSQSSubscription": { "Type": "AWS::SNS::Subscription", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Endpoint": { "Fn::GetAtt": [ @@ -528,8 +479,6 @@ }, "MyAwesomeFunctionSNSTopicWithSQSSubscriptionQueuePolicy": { "Type": "AWS::SQS::QueuePolicy", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Queues": [ { @@ -564,8 +513,6 @@ }, "MyAwesomeFunctionSNSTopicWithSQSSubscriptionEventSourceMapping": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BatchSize": 10, "Enabled": true, @@ -584,14 +531,10 @@ "MyAwesomeFunctionAnotherSNSWithSQSSubscriptionQueue": { "Condition": "MyCondition", "Type": "AWS::SQS::Queue", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": {} }, "MyAwesomeFunctionAnotherSNSWithSQSSubscriptionEventSourceMapping": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BatchSize": 10, "Enabled": true, @@ -609,8 +552,6 @@ }, "MyAwesomeFunctionAnotherSNSWithSQSSubscription": { "Type": "AWS::SNS::Subscription", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Endpoint": { "Fn::GetAtt": [ @@ -627,8 +568,6 @@ }, "MyAwesomeFunctionAnotherSNSWithSQSSubscriptionQueuePolicy": { "Type": "AWS::SQS::QueuePolicy", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Queues": [ { @@ -663,8 +602,6 @@ }, "Queue": { "Type": "AWS::SQS::Queue", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition" } } diff --git a/tests/translator/output/aws-cn/function_managed_inline_policy.json b/tests/translator/output/aws-cn/function_managed_inline_policy.json index f15380c02..af76c7621 100644 --- a/tests/translator/output/aws-cn/function_managed_inline_policy.json +++ b/tests/translator/output/aws-cn/function_managed_inline_policy.json @@ -8,8 +8,6 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -33,8 +31,6 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", diff --git a/tests/translator/output/aws-cn/function_with_alias.json b/tests/translator/output/aws-cn/function_with_alias.json index 9aea9696f..cf8953e96 100644 --- a/tests/translator/output/aws-cn/function_with_alias.json +++ b/tests/translator/output/aws-cn/function_with_alias.json @@ -1,9 +1,8 @@ { "Resources": { "MinimalFunctionVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Description": "sam-testing", "FunctionName": { @@ -13,8 +12,6 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -30,8 +27,6 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -55,8 +50,6 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-cn/function_with_alias_and_event_sources.json b/tests/translator/output/aws-cn/function_with_alias_and_event_sources.json index cb673315b..e48747d79 100644 --- a/tests/translator/output/aws-cn/function_with_alias_and_event_sources.json +++ b/tests/translator/output/aws-cn/function_with_alias_and_event_sources.json @@ -8,8 +8,6 @@ "Resources": { "MyAwesomeFunctionAliasLive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -25,8 +23,6 @@ }, "MyAwesomeFunctionNotificationTopicPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "sns.amazonaws.com", @@ -40,8 +36,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment042edc7e2e" @@ -54,8 +48,6 @@ }, "GetHtmlApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "GetHtmlApi" @@ -66,8 +58,6 @@ }, "MyAwesomeFunctionCWEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -84,8 +74,6 @@ }, "MyAwesomeFunctionEBRulePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -102,8 +90,6 @@ }, "MyAwesomeFunctionDDBStream": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BatchSize": 200, "EventSourceArn": "arn:aws:dynamodb:us-west-2:012345678901:table/TestTable/stream/2015-05-11T21:21:33.291", @@ -115,8 +101,6 @@ }, "MyAwesomeFunctionIoTRule": { "Type": "AWS::IoT::TopicRule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "TopicRulePayload": { "AwsIotSqlVersion": "beta", @@ -136,8 +120,6 @@ }, "MyAwesomeFunctionKinesisStream": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BatchSize": 100, "EventSourceArn": "arn:aws:kinesis:us-west-2:012345678901:stream/my-stream", @@ -149,8 +131,6 @@ }, "MyAwesomeFunctionImplicitApiPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -172,8 +152,6 @@ }, "MyAwesomeFunctionIoTRulePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -197,8 +175,6 @@ }, "MyAwesomeFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Endpoint": { "Ref": "MyAwesomeFunctionAliasLive" @@ -211,8 +187,6 @@ }, "MyAwesomeFunctionS3TriggerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -226,8 +200,6 @@ }, "GetHtmlApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -246,8 +218,6 @@ }, "MyAwesomeFunctionCWLogPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "logs.amazonaws.com", @@ -266,8 +236,6 @@ }, "MyAwesomeFunctionEBSchedule": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ScheduleExpression": "rate(1 minute)", "Targets": [ @@ -282,8 +250,6 @@ }, "MyAwesomeFunctionCWLog": { "Type": "AWS::Logs::SubscriptionFilter", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DestinationArn": { "Ref": "MyAwesomeFunctionAliasLive" @@ -297,8 +263,6 @@ }, "MyAwesomeFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -331,8 +295,6 @@ }, "MyAwesomeFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -356,8 +318,6 @@ }, "MyAwesomeFunctionCWEvent": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -378,8 +338,6 @@ }, "MyAwesomeFunctionEBRule": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -399,9 +357,8 @@ } }, "MyAwesomeFunctionVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MyAwesomeFunction" @@ -410,8 +367,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -447,14 +402,10 @@ } }, "Notifications": { - "Type": "AWS::SNS::Topic", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::SNS::Topic" }, "MyAwesomeFunctionEBSchedulePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -471,8 +422,6 @@ }, "Images": { "Type": "AWS::S3::Bucket", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "NotificationConfiguration": { "LambdaConfigurations": [ @@ -491,8 +440,6 @@ }, "GetHtmlApiStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "GetHtmlApiDeploymentf117c932f7" @@ -512,8 +459,6 @@ }, "MyAwesomeFunctionExplicitApiPermissionStage": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -535,8 +480,6 @@ }, "ServerlessRestApiDeployment042edc7e2e": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" diff --git a/tests/translator/output/aws-cn/function_with_alias_intrinsics.json b/tests/translator/output/aws-cn/function_with_alias_intrinsics.json index 99d76a600..3fff52854 100644 --- a/tests/translator/output/aws-cn/function_with_alias_intrinsics.json +++ b/tests/translator/output/aws-cn/function_with_alias_intrinsics.json @@ -7,9 +7,8 @@ }, "Resources": { "MinimalFunctionVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -18,8 +17,6 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -35,8 +32,6 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -60,8 +55,6 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-cn/function_with_amq.json b/tests/translator/output/aws-cn/function_with_amq.json index 9ed678fc9..6a34ed771 100644 --- a/tests/translator/output/aws-cn/function_with_amq.json +++ b/tests/translator/output/aws-cn/function_with_amq.json @@ -2,8 +2,6 @@ "Resources": { "MQFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -27,8 +25,6 @@ }, "MQFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -82,8 +78,6 @@ }, "MQFunctionMyMQQueue": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EventSourceArn": "arn:aws:mq:us-east-2:123456789012:broker:MyBroker:b-1234a5b6-78cd-901e-2fgh-3i45j6k178l9", "FunctionName": { diff --git a/tests/translator/output/aws-cn/function_with_amq_kms.json b/tests/translator/output/aws-cn/function_with_amq_kms.json index 2079f1d98..e79122065 100644 --- a/tests/translator/output/aws-cn/function_with_amq_kms.json +++ b/tests/translator/output/aws-cn/function_with_amq_kms.json @@ -2,8 +2,6 @@ "Resources": { "MQFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -27,8 +25,6 @@ }, "MQFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -89,8 +85,6 @@ }, "MQFunctionMyMQQueue": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EventSourceArn": "arn:aws:mq:us-east-2:123456789012:broker:MyBroker:b-1234a5b6-78cd-901e-2fgh-3i45j6k178l9", "FunctionName": { diff --git a/tests/translator/output/aws-cn/function_with_condition.json b/tests/translator/output/aws-cn/function_with_condition.json index 9589faa21..4fbd2abf8 100644 --- a/tests/translator/output/aws-cn/function_with_condition.json +++ b/tests/translator/output/aws-cn/function_with_condition.json @@ -10,8 +10,6 @@ "Resources": { "ConditionFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -36,8 +34,6 @@ }, "ConditionFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-cn/function_with_conditional_managed_policy.json b/tests/translator/output/aws-cn/function_with_conditional_managed_policy.json index 140e67f11..a71779ff9 100644 --- a/tests/translator/output/aws-cn/function_with_conditional_managed_policy.json +++ b/tests/translator/output/aws-cn/function_with_conditional_managed_policy.json @@ -10,8 +10,6 @@ "Resources": { "FunctionWithConditionalPolicy": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -36,8 +34,6 @@ }, "FunctionWithConditionalPolicyRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", diff --git a/tests/translator/output/aws-cn/function_with_conditional_managed_policy_and_ref_no_value.json b/tests/translator/output/aws-cn/function_with_conditional_managed_policy_and_ref_no_value.json index 10de66f45..794ee731d 100644 --- a/tests/translator/output/aws-cn/function_with_conditional_managed_policy_and_ref_no_value.json +++ b/tests/translator/output/aws-cn/function_with_conditional_managed_policy_and_ref_no_value.json @@ -10,8 +10,6 @@ "Resources": { "FunctionWithConditionalPolicy": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -36,8 +34,6 @@ }, "FunctionWithConditionalPolicyRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", diff --git a/tests/translator/output/aws-cn/function_with_conditional_policy_template.json b/tests/translator/output/aws-cn/function_with_conditional_policy_template.json index aab11669f..9dc9f720a 100644 --- a/tests/translator/output/aws-cn/function_with_conditional_policy_template.json +++ b/tests/translator/output/aws-cn/function_with_conditional_policy_template.json @@ -10,8 +10,6 @@ "Resources": { "FunctionWithConditionalPolicy": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -36,8 +34,6 @@ }, "FunctionWithConditionalPolicyRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-cn/function_with_conditional_policy_template_and_ref_no_value.json b/tests/translator/output/aws-cn/function_with_conditional_policy_template_and_ref_no_value.json index f0811e9c5..109cf4819 100644 --- a/tests/translator/output/aws-cn/function_with_conditional_policy_template_and_ref_no_value.json +++ b/tests/translator/output/aws-cn/function_with_conditional_policy_template_and_ref_no_value.json @@ -10,8 +10,6 @@ "Resources": { "FunctionWithConditionalPolicy": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -36,8 +34,6 @@ }, "FunctionWithConditionalPolicyRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-cn/function_with_custom_codedeploy_deployment_preference.json b/tests/translator/output/aws-cn/function_with_custom_codedeploy_deployment_preference.json index 4460aadab..f3d5e0510 100644 --- a/tests/translator/output/aws-cn/function_with_custom_codedeploy_deployment_preference.json +++ b/tests/translator/output/aws-cn/function_with_custom_codedeploy_deployment_preference.json @@ -34,8 +34,6 @@ "Resources": { "NormalWithRefAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -60,9 +58,8 @@ } }, "CustomWithFindInMapVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "CustomWithFindInMap" @@ -111,8 +108,6 @@ }, "CustomWithFindInMapAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -138,8 +133,6 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -163,8 +156,6 @@ }, "CustomWithSubAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -190,8 +181,6 @@ }, "NormalWithSub": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -214,9 +203,8 @@ } }, "CustomWithConditionVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "CustomWithCondition" @@ -252,10 +240,9 @@ } } }, - "CustomWithCondition2Version640128d35d": { + "CustomWithCondition2Version640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "CustomWithCondition2" @@ -264,8 +251,6 @@ }, "CustomWithCondition": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -289,8 +274,6 @@ }, "CustomWithSub": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -319,9 +302,8 @@ } }, "NormalWithRefVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "NormalWithRef" @@ -422,8 +404,6 @@ }, "NormalWithSubAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -448,9 +428,8 @@ } }, "CustomWithSubVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "CustomWithSub" @@ -459,8 +438,6 @@ }, "CustomWithSubRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -491,8 +468,6 @@ }, "CustomWithConditionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -563,8 +538,6 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -595,8 +568,6 @@ }, "CustomWithFindInMap": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -619,9 +590,8 @@ } }, "NormalWithSubVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "NormalWithSub" @@ -630,8 +600,6 @@ }, "CustomWithConditionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -657,8 +625,6 @@ }, "CustomWithFindInMapRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -689,8 +655,6 @@ }, "NormalWithRef": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -714,8 +678,6 @@ }, "CustomWithCondition2": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -766,8 +728,6 @@ }, "NormalWithRefRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -798,8 +758,6 @@ }, "CustomWithCondition2Aliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -825,8 +783,6 @@ }, "NormalWithSubRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -856,9 +812,8 @@ } }, "MinimalFunctionVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -894,8 +849,6 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -921,8 +874,6 @@ }, "CustomWithCondition2Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-cn/function_with_custom_conditional_codedeploy_deployment_preference.json b/tests/translator/output/aws-cn/function_with_custom_conditional_codedeploy_deployment_preference.json index f628da6b8..26c5417e6 100644 --- a/tests/translator/output/aws-cn/function_with_custom_conditional_codedeploy_deployment_preference.json +++ b/tests/translator/output/aws-cn/function_with_custom_conditional_codedeploy_deployment_preference.json @@ -33,8 +33,6 @@ }, "HelloWorldFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -141,9 +139,8 @@ } }, "HelloWorldFunctionVersionfb53d5c2e6": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "HelloWorldFunction" @@ -152,8 +149,6 @@ }, "HelloWorldFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -179,8 +174,6 @@ }, "HelloWorldFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { diff --git a/tests/translator/output/aws-cn/function_with_deployment_and_custom_role.json b/tests/translator/output/aws-cn/function_with_deployment_and_custom_role.json index e09e6d735..03a936a6d 100644 --- a/tests/translator/output/aws-cn/function_with_deployment_and_custom_role.json +++ b/tests/translator/output/aws-cn/function_with_deployment_and_custom_role.json @@ -2,8 +2,6 @@ "Resources": { "FunctionWithRole": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -27,8 +25,6 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -52,8 +48,6 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -84,8 +78,6 @@ }, "DeploymentRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSCodeDeployRole" @@ -108,10 +100,9 @@ } } }, - "FunctionWithRoleVersion640128d35d": { + "FunctionWithRoleVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "FunctionWithRole" @@ -217,9 +208,8 @@ } }, "MinimalFunctionVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -228,8 +218,6 @@ }, "FunctionWithRoleAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -255,8 +243,6 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { diff --git a/tests/translator/output/aws-cn/function_with_deployment_no_service_role.json b/tests/translator/output/aws-cn/function_with_deployment_no_service_role.json index a8e253da2..65d6a4483 100644 --- a/tests/translator/output/aws-cn/function_with_deployment_no_service_role.json +++ b/tests/translator/output/aws-cn/function_with_deployment_no_service_role.json @@ -33,8 +33,6 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -58,8 +56,6 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -89,9 +85,8 @@ } }, "OtherFunctionVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "OtherFunction" @@ -100,8 +95,6 @@ }, "OtherFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -132,8 +125,6 @@ }, "DeploymentRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSCodeDeployRole" @@ -193,10 +184,9 @@ "ComputePlatform": "Lambda" } }, - "MinimalFunctionVersion640128d35d": { + "MinimalFunctionVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -205,8 +195,6 @@ }, "OtherFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -230,8 +218,6 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -257,8 +243,6 @@ }, "OtherFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { diff --git a/tests/translator/output/aws-cn/function_with_deployment_preference.json b/tests/translator/output/aws-cn/function_with_deployment_preference.json index 77307da60..830ecaa18 100644 --- a/tests/translator/output/aws-cn/function_with_deployment_preference.json +++ b/tests/translator/output/aws-cn/function_with_deployment_preference.json @@ -63,8 +63,6 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -95,8 +93,6 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -149,9 +145,8 @@ } }, "MinimalFunctionVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -160,8 +155,6 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { diff --git a/tests/translator/output/aws-cn/function_with_deployment_preference_alarms_intrinsic_if.json b/tests/translator/output/aws-cn/function_with_deployment_preference_alarms_intrinsic_if.json index dca960256..077d23fc8 100644 --- a/tests/translator/output/aws-cn/function_with_deployment_preference_alarms_intrinsic_if.json +++ b/tests/translator/output/aws-cn/function_with_deployment_preference_alarms_intrinsic_if.json @@ -10,8 +10,6 @@ "Resources": { "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -35,8 +33,7 @@ }, "MinimalFunctionVersion640128d35d": { "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", + "DeletionPolicy": "Retain", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -45,8 +42,6 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -72,8 +67,6 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", diff --git a/tests/translator/output/aws-cn/function_with_deployment_preference_all_parameters.json b/tests/translator/output/aws-cn/function_with_deployment_preference_all_parameters.json index bd64d3d6d..739a81811 100644 --- a/tests/translator/output/aws-cn/function_with_deployment_preference_all_parameters.json +++ b/tests/translator/output/aws-cn/function_with_deployment_preference_all_parameters.json @@ -2,8 +2,6 @@ "Resources": { "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -27,8 +25,6 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "MySanityTestFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -91,8 +85,6 @@ }, "MyCloudWatchAlarm": { "Type": "AWS::CloudWatch::Alarm", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EvaluationPeriods": 1, "Namespace": "AWS/EC2", @@ -160,8 +152,6 @@ }, "MySanityTestFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "my-bucket", @@ -214,9 +204,8 @@ } }, "MinimalFunctionVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -225,8 +214,6 @@ }, "MyValidationTestFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "my-bucket", @@ -250,8 +237,6 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -283,8 +268,6 @@ }, "MyValidationTestFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -314,9 +297,7 @@ } }, "MySNSTopic": { - "Type": "AWS::SNS::Topic", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::SNS::Topic" } } } \ No newline at end of file diff --git a/tests/translator/output/aws-cn/function_with_deployment_preference_from_parameters.json b/tests/translator/output/aws-cn/function_with_deployment_preference_from_parameters.json index 6389c3926..0e83fb6c6 100644 --- a/tests/translator/output/aws-cn/function_with_deployment_preference_from_parameters.json +++ b/tests/translator/output/aws-cn/function_with_deployment_preference_from_parameters.json @@ -16,8 +16,6 @@ "Resources": { "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -41,8 +39,6 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -73,8 +69,6 @@ }, "MySanityTestFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -105,8 +99,6 @@ }, "MyCloudWatchAlarm": { "Type": "AWS::CloudWatch::Alarm", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EvaluationPeriods": 1, "Namespace": "AWS/EC2", @@ -174,8 +166,6 @@ }, "MySanityTestFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "my-bucket", @@ -228,9 +218,8 @@ } }, "MinimalFunctionVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -239,8 +228,6 @@ }, "MyValidationTestFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "my-bucket", @@ -264,8 +251,6 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -297,8 +282,6 @@ }, "MyValidationTestFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -328,9 +311,7 @@ } }, "MySNSTopic": { - "Type": "AWS::SNS::Topic", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::SNS::Topic" } } } \ No newline at end of file diff --git a/tests/translator/output/aws-cn/function_with_deployment_preference_multiple_combinations.json b/tests/translator/output/aws-cn/function_with_deployment_preference_multiple_combinations.json index b7846ed5d..7c9543aa5 100644 --- a/tests/translator/output/aws-cn/function_with_deployment_preference_multiple_combinations.json +++ b/tests/translator/output/aws-cn/function_with_deployment_preference_multiple_combinations.json @@ -2,8 +2,6 @@ "Resources": { "MinimalFunctionWithDeploymentPreferenceWithHooksAndAlarms": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -27,8 +25,6 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -84,8 +78,6 @@ }, "MinimalFunctionWithMinimalDeploymentPreferenceRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -116,8 +108,6 @@ }, "MyCloudWatchAlarm": { "Type": "AWS::CloudWatch::Alarm", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EvaluationPeriods": 1, "Namespace": "AWS/EC2", @@ -129,8 +119,6 @@ }, "MinimalFunctionWithMinimalDeploymentPreferenceAliaslivewithdeployment": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -199,9 +187,8 @@ } }, "MinimalFunctionWithMinimalDeploymentPreferenceVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunctionWithMinimalDeploymentPreference" @@ -210,8 +197,6 @@ }, "MinimalFunctionWithDeploymentPreferenceWithHooksAndAlarmsRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -242,8 +227,6 @@ }, "MySanityTestFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -274,8 +257,6 @@ }, "MinimalFunctionWithMinimalDeploymentPreference": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -299,8 +280,6 @@ }, "MySanityTestFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "my-bucket", @@ -323,9 +302,8 @@ } }, "MinimalFunctionWithDeploymentPreferenceWithHooksAndAlarmsVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunctionWithDeploymentPreferenceWithHooksAndAlarms" @@ -397,9 +375,8 @@ } }, "MinimalFunctionVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -408,8 +385,6 @@ }, "MyValidationTestFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -440,8 +415,6 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -457,8 +430,6 @@ }, "MinimalFunctionWithDeploymentPreferenceWithHooksAndAlarmsAliaslivewithdeploymentwithhooksandalarms": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -490,8 +461,6 @@ }, "MyValidationTestFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "my-bucket", diff --git a/tests/translator/output/aws-cn/function_with_disabled_deployment_preference.json b/tests/translator/output/aws-cn/function_with_disabled_deployment_preference.json index 6045e1f2a..80337bcd2 100644 --- a/tests/translator/output/aws-cn/function_with_disabled_deployment_preference.json +++ b/tests/translator/output/aws-cn/function_with_disabled_deployment_preference.json @@ -1,9 +1,8 @@ { "Resources": { - "MinimalFunctionVersion640128d35d": { + "MinimalFunctionVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -12,8 +11,6 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -29,8 +26,6 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -54,8 +49,6 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-cn/function_with_dlq.json b/tests/translator/output/aws-cn/function_with_dlq.json index 61d9c5cc5..3c006a0af 100644 --- a/tests/translator/output/aws-cn/function_with_dlq.json +++ b/tests/translator/output/aws-cn/function_with_dlq.json @@ -2,8 +2,6 @@ "Resources": { "MySnsDlqLambdaFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -49,8 +47,6 @@ }, "MySqsDlqLambdaFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -96,8 +92,6 @@ }, "MySqsDlqLambdaFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -124,8 +118,6 @@ }, "MySnsDlqLambdaFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-cn/function_with_event_dest.json b/tests/translator/output/aws-cn/function_with_event_dest.json index 961ee8ab6..b719a2dc1 100644 --- a/tests/translator/output/aws-cn/function_with_event_dest.json +++ b/tests/translator/output/aws-cn/function_with_event_dest.json @@ -49,8 +49,6 @@ "Resources": { "MyTestFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -126,15 +124,11 @@ }, "MyTestFunctionEventInvokeConfigOnSuccessQueue": { "Type": "AWS::SQS::Queue", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": {}, "Condition": "NOTQueueCreationDisabled2da03e5b6f" }, "SNSSubscription": { "Type": "AWS::SNS::Subscription", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Endpoint": "example@example.com", "Protocol": "email", @@ -146,8 +140,6 @@ }, "MyTestFunctionEventInvokeConfig": { "Type": "AWS::Lambda::EventInvokeConfig", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "MaximumEventAgeInSeconds": 70, "MaximumRetryAttempts": 1, @@ -186,8 +178,6 @@ }, "MyTestFunction2Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -249,8 +239,6 @@ }, "DestinationLambda": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async (event) => {\n const response = {\n statusCode: 200,\n body: JSON.stringify('Hello from Lambda!'),\n };\n return response;\n};\n" @@ -274,8 +262,6 @@ }, "MyTestFunction2EventInvokeConfig": { "Type": "AWS::Lambda::EventInvokeConfig", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "MaximumEventAgeInSeconds": 70, "MaximumRetryAttempts": 1, @@ -300,8 +286,6 @@ }, "DestinationLambdaRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -332,8 +316,6 @@ }, "MyTestFunction2": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = function(event, context, callback) {\n var event_received_at = new Date().toISOString();\n console.log('Event received at: ' + event_received_at);\n console.log('Received event:', JSON.stringify(event, null, 2));\n\n if (event.Success) {\n console.log(\"Success\");\n context.callbackWaitsForEmptyEventLoop = false;\n callback(null);\n } else {\n console.log(\"Failure\");\n context.callbackWaitsForEmptyEventLoop = false;\n callback(new Error(\"Failure from event, Success = false, I am failing!\"), 'Destination Function Error Thrown');\n }\n}; \n" @@ -357,8 +339,6 @@ }, "MyTestFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = function(event, context, callback) {\n var event_received_at = new Date().toISOString();\n console.log('Event received at: ' + event_received_at);\n console.log('Received event:', JSON.stringify(event, null, 2));\n\n if (event.Success) {\n console.log(\"Success\");\n context.callbackWaitsForEmptyEventLoop = false;\n callback(null);\n } else {\n console.log(\"Failure\");\n context.callbackWaitsForEmptyEventLoop = false;\n callback(new Error(\"Failure from event, Success = false, I am failing!\"), 'Destination Function Error Thrown');\n }\n}; \n" @@ -382,8 +362,6 @@ }, "MyTestFunctionEventInvokeConfigOnFailureTopic": { "Type": "AWS::SNS::Topic", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": {}, "Condition": "TopicCreationEnabled" } diff --git a/tests/translator/output/aws-cn/function_with_event_dest_basic.json b/tests/translator/output/aws-cn/function_with_event_dest_basic.json index 0e757eae5..01a3440e1 100644 --- a/tests/translator/output/aws-cn/function_with_event_dest_basic.json +++ b/tests/translator/output/aws-cn/function_with_event_dest_basic.json @@ -8,14 +8,10 @@ "Resources": { "MyTestFunctionEventInvokeConfigOnSuccessQueue": { "Type": "AWS::SQS::Queue", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": {} }, "MyTestFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -77,8 +73,6 @@ }, "MyTestFunctionEventInvokeConfig": { "Type": "AWS::Lambda::EventInvokeConfig", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "MaximumEventAgeInSeconds": 70, "MaximumRetryAttempts": 1, @@ -106,8 +100,6 @@ }, "MyTestFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = function(event, context, callback) {\n var event_received_at = new Date().toISOString();\n console.log('Event received at: ' + event_received_at);\n console.log('Received event:', JSON.stringify(event, null, 2));\n\n if (event.Success) {\n console.log(\"Success\");\n context.callbackWaitsForEmptyEventLoop = false;\n callback(null);\n } else {\n console.log(\"Failure\");\n context.callbackWaitsForEmptyEventLoop = false;\n callback(new Error(\"Failure from event, Success = false, I am failing!\"), 'Destination Function Error Thrown');\n }\n}; \n" @@ -131,8 +123,6 @@ }, "MyTestFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -147,9 +137,8 @@ } }, "MyTestFunctionVersiondaf9da458d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MyTestFunction" diff --git a/tests/translator/output/aws-cn/function_with_event_dest_conditional.json b/tests/translator/output/aws-cn/function_with_event_dest_conditional.json index a30d1ba7b..e90a0e585 100644 --- a/tests/translator/output/aws-cn/function_with_event_dest_conditional.json +++ b/tests/translator/output/aws-cn/function_with_event_dest_conditional.json @@ -59,8 +59,6 @@ "Resources": { "DestinationLambdaRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -92,15 +90,11 @@ }, "MyTestFunctionEventInvokeConfigOnSuccessQueue": { "Type": "AWS::SQS::Queue", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": {}, "Condition": "FunctionConditionANDNOTQueueCreationDisabled2da03e5b6fe547d4e2d6" }, "MyTestFunctionEventInvokeConfig": { "Type": "AWS::Lambda::EventInvokeConfig", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "MaximumEventAgeInSeconds": 70, "MaximumRetryAttempts": 1, @@ -143,8 +137,6 @@ }, "MyTestFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = function(event, context, callback) {\n var event_received_at = new Date().toISOString();\n console.log('Event received at: ' + event_received_at);\n console.log('Received event:', JSON.stringify(event, null, 2));\n\n if (event.Success) {\n console.log(\"Success\");\n context.callbackWaitsForEmptyEventLoop = false;\n callback(null);\n } else {\n console.log(\"Failure\");\n context.callbackWaitsForEmptyEventLoop = false;\n callback(new Error(\"Failure from event, Success = false, I am failing!\"), 'Destination Function Error Thrown');\n }\n}; \n" @@ -169,8 +161,6 @@ }, "DestinationLambda": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async (event) => {\n const response = {\n statusCode: 200,\n body: JSON.stringify('Hello from Lambda!'),\n };\n return response;\n};\n" @@ -195,8 +185,6 @@ }, "MyTestFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", diff --git a/tests/translator/output/aws-cn/function_with_event_source_mapping.json b/tests/translator/output/aws-cn/function_with_event_source_mapping.json index c608349d6..c566b9490 100644 --- a/tests/translator/output/aws-cn/function_with_event_source_mapping.json +++ b/tests/translator/output/aws-cn/function_with_event_source_mapping.json @@ -9,19 +9,13 @@ }, "Resources": { "MySqsQueue": { - "Type": "AWS::SQS::Queue", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::SQS::Queue" }, "MySnsTopic": { - "Type": "AWS::SNS::Topic", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::SNS::Topic" }, "MyFunctionForBatchingExampleStream": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "MaximumBatchingWindowInSeconds": 20, "EventSourceArn": { @@ -38,8 +32,6 @@ }, "DynamoDBTable": { "Type": "AWS::DynamoDB::Table", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "KeySchema": [ { @@ -64,8 +56,6 @@ }, "MyFunctionForBatchingExampleRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -157,16 +147,12 @@ }, "KinesisStream1": { "Type": "AWS::Kinesis::Stream", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ShardCount": 1 } }, "MyFunctionForBatchingExampleDynamoDBStreamEvent": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "MaximumBatchingWindowInSeconds": { "Ref": "MyBatchingWindowParam" @@ -202,8 +188,6 @@ }, "MyFunctionForBatchingExample": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -226,8 +210,6 @@ }, "MyFunctionForBatchingExampleStreamEvent": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "MaximumBatchingWindowInSeconds": { "Ref": "MyBatchingWindowParam" @@ -253,8 +235,6 @@ }, "KinesisStream": { "Type": "AWS::Kinesis::Stream", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ShardCount": 1 } diff --git a/tests/translator/output/aws-cn/function_with_file_system_config.json b/tests/translator/output/aws-cn/function_with_file_system_config.json index 28283ba89..9fc9269eb 100644 --- a/tests/translator/output/aws-cn/function_with_file_system_config.json +++ b/tests/translator/output/aws-cn/function_with_file_system_config.json @@ -1,14 +1,10 @@ { "Resources": { "EfsFileSystem": { - "Type": "AWS::EFS::FileSystem", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::EFS::FileSystem" }, "LambdaFunctionWithEfs": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "const fs = require('fs')\nconst path = require('path')\nconst efsMountPath = '/mnt/efs'\n\nexports.handler = async (event, context, callback) => {\nconst directory = path.join(efsMountPath, event.body)\nconst files = fs.readdirSync(directory)\nreturn files\n}\n" @@ -52,8 +48,6 @@ }, "MountTarget": { "Type": "AWS::EFS::MountTarget", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "SubnetId": "subnet-abc123", "FileSystemId": { @@ -66,8 +60,6 @@ }, "LambdaFunctionWithEfsRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -99,8 +91,6 @@ }, "AccessPoint": { "Type": "AWS::EFS::AccessPoint", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FileSystemId": { "Ref": "EfsFileSystem" diff --git a/tests/translator/output/aws-cn/function_with_global_layers.json b/tests/translator/output/aws-cn/function_with_global_layers.json index 4c6b09896..e0fcdb520 100644 --- a/tests/translator/output/aws-cn/function_with_global_layers.json +++ b/tests/translator/output/aws-cn/function_with_global_layers.json @@ -2,8 +2,6 @@ "Resources": { "ManyLayersFuncRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -34,8 +32,6 @@ }, "ManyLayersFunc": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-cn/function_with_kmskeyarn.json b/tests/translator/output/aws-cn/function_with_kmskeyarn.json index 3a9a54a8d..c26fd2506 100644 --- a/tests/translator/output/aws-cn/function_with_kmskeyarn.json +++ b/tests/translator/output/aws-cn/function_with_kmskeyarn.json @@ -2,8 +2,6 @@ "Resources": { "FunctionWithKeyArnRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -34,8 +32,6 @@ }, "FunctionWithReferenceToKeyArnRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -66,8 +62,6 @@ }, "FunctionWithKeyArn": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -92,8 +86,6 @@ }, "myKey": { "Type": "AWS::KMS::Key", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "KeyPolicy": { "Version": "2012-10-17", @@ -117,8 +109,6 @@ }, "FunctionWithReferenceToKeyArn": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-cn/function_with_layers.json b/tests/translator/output/aws-cn/function_with_layers.json index b0400f815..7c2004acf 100644 --- a/tests/translator/output/aws-cn/function_with_layers.json +++ b/tests/translator/output/aws-cn/function_with_layers.json @@ -2,8 +2,6 @@ "Resources": { "MinimalLayerFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Layers": [ "arn:aws:lambda:us-east-1:123456789101:layer:CorpXLayer:1" @@ -29,9 +27,8 @@ } }, "MyLayera5167acaba": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::LayerVersion", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "sam-demo-bucket", @@ -42,8 +39,6 @@ }, "FunctionReferencesLayer": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Layers": [ { @@ -72,8 +67,6 @@ }, "MinimalLayerFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -104,8 +97,6 @@ }, "FunctionReferencesLayerRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -136,8 +127,6 @@ }, "FunctionLayerWithSubIntrinsic": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Layers": [ { @@ -169,8 +158,6 @@ }, "FunctionNoLayerVersion": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Layers": [ "arn:aws:lambda:us-east-1:123456789101:layer:CorpXLayer:1" @@ -197,8 +184,6 @@ }, "FunctionNoLayerVersionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -229,8 +214,6 @@ }, "FunctionLayerWithSubIntrinsicRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-cn/function_with_many_layers.json b/tests/translator/output/aws-cn/function_with_many_layers.json index ec7de6553..2bff7ff8f 100644 --- a/tests/translator/output/aws-cn/function_with_many_layers.json +++ b/tests/translator/output/aws-cn/function_with_many_layers.json @@ -1,9 +1,8 @@ { "Resources": { "MyLayera5167acaba": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::LayerVersion", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "sam-demo-bucket", @@ -14,8 +13,6 @@ }, "ManyLayersFuncRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -46,8 +43,6 @@ }, "ManyLayersFunc": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Layers": [ "arn:aws:lambda:us-east-1:123456789101:layer:z:1", diff --git a/tests/translator/output/aws-cn/function_with_permissions_boundary.json b/tests/translator/output/aws-cn/function_with_permissions_boundary.json index 637e63f39..b71af4f7b 100644 --- a/tests/translator/output/aws-cn/function_with_permissions_boundary.json +++ b/tests/translator/output/aws-cn/function_with_permissions_boundary.json @@ -2,8 +2,6 @@ "Resources": { "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -35,8 +33,6 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { diff --git a/tests/translator/output/aws-cn/function_with_policy_templates.json b/tests/translator/output/aws-cn/function_with_policy_templates.json index 7c4b53775..d6e45817e 100644 --- a/tests/translator/output/aws-cn/function_with_policy_templates.json +++ b/tests/translator/output/aws-cn/function_with_policy_templates.json @@ -7,8 +7,6 @@ "Resources": { "OnePolicyTemplate": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -32,8 +30,6 @@ }, "MultiplePolicyTemplates": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -57,8 +53,6 @@ }, "OnePolicyTemplateRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -124,8 +118,6 @@ }, "MultiplePolicyTemplatesRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -205,8 +197,6 @@ }, "AllCombinations": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -230,8 +220,6 @@ }, "AllCombinationsRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaRole", diff --git a/tests/translator/output/aws-cn/function_with_request_parameters.json b/tests/translator/output/aws-cn/function_with_request_parameters.json index 9c213975a..d5715a354 100644 --- a/tests/translator/output/aws-cn/function_with_request_parameters.json +++ b/tests/translator/output/aws-cn/function_with_request_parameters.json @@ -2,8 +2,6 @@ "Resources": { "ApiParameterFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "NoApiParameterFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ServerlessRestApiDeployment32042a0513": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -71,8 +65,6 @@ }, "ApiParameterFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -103,8 +95,6 @@ }, "NoApiParameterFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -126,8 +116,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment32042a0513" @@ -140,8 +128,6 @@ }, "ApiDeploymentd779e9df57": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "Api" @@ -152,8 +138,6 @@ }, "Api": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -201,8 +185,6 @@ }, "ApiParameterFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -222,8 +204,6 @@ }, "ApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ApiDeploymentd779e9df57" @@ -236,8 +216,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -294,8 +272,6 @@ }, "NoApiParameterFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { diff --git a/tests/translator/output/aws-cn/function_with_resource_refs.json b/tests/translator/output/aws-cn/function_with_resource_refs.json index ad27e4a38..89ab2a671 100644 --- a/tests/translator/output/aws-cn/function_with_resource_refs.json +++ b/tests/translator/output/aws-cn/function_with_resource_refs.json @@ -53,8 +53,6 @@ "Resources": { "FunctionWithoutAlias": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -78,8 +76,6 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -110,8 +106,6 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -135,8 +129,6 @@ }, "FunctionWithoutAliasRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -166,9 +158,8 @@ } }, "MinimalFunctionVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -177,8 +168,6 @@ }, "MyBucket": { "Type": "AWS::S3::Bucket", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Name": { "Fn::GetAtt": [ @@ -190,8 +179,6 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ diff --git a/tests/translator/output/aws-cn/function_with_signing_profile.json b/tests/translator/output/aws-cn/function_with_signing_profile.json index 2e07d93ee..d25c7e526 100644 --- a/tests/translator/output/aws-cn/function_with_signing_profile.json +++ b/tests/translator/output/aws-cn/function_with_signing_profile.json @@ -2,8 +2,6 @@ "Resources": { "FunctionWithSigningProfile": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -30,8 +28,6 @@ }, "FunctionWithSigningProfileRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -62,8 +58,6 @@ }, "MySignedFunctionCodeSigningConfig": { "Type": "AWS::Lambda::CodeSigningConfig", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "CodeSigningPolicies": { "UntrustedArtifactOnDeployment": "Enforce" @@ -83,8 +77,6 @@ }, "SigningProfile": { "Type": "AWS::Signer::SigningProfile", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "PlatformId": "AWSLambda-SHA384-ECDSA" } diff --git a/tests/translator/output/aws-cn/function_with_sns_event_source_all_parameters.json b/tests/translator/output/aws-cn/function_with_sns_event_source_all_parameters.json index 5b009f9ec..7cf732ff1 100644 --- a/tests/translator/output/aws-cn/function_with_sns_event_source_all_parameters.json +++ b/tests/translator/output/aws-cn/function_with_sns_event_source_all_parameters.json @@ -2,8 +2,6 @@ "Resources": { "MyAwesomeFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FilterPolicy": { "store": [ @@ -41,8 +39,6 @@ }, "MyAwesomeFunctionNotificationTopicPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "sns.amazonaws.com", @@ -54,8 +50,6 @@ }, "MyAwesomeFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -86,8 +80,6 @@ }, "MyAwesomeFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-cn/global_handle_path_level_parameter.json b/tests/translator/output/aws-cn/global_handle_path_level_parameter.json index df03ba605..51b5040b7 100644 --- a/tests/translator/output/aws-cn/global_handle_path_level_parameter.json +++ b/tests/translator/output/aws-cn/global_handle_path_level_parameter.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -131,8 +125,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -150,8 +142,6 @@ }, "ServerlessRestApiDeploymente1212668e0": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -162,8 +152,6 @@ }, "ExplicitApiSomeStageStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -181,8 +169,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -204,8 +190,6 @@ }, "MyUserPool": { "Type": "AWS::Cognito::UserPool", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "UsernameAttributes": [ "email" @@ -227,8 +211,6 @@ }, "ExplicitApiDeployment9a254aa466": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -239,8 +221,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/globals_for_api.json b/tests/translator/output/aws-cn/globals_for_api.json index 3ce20482e..27c4118f0 100644 --- a/tests/translator/output/aws-cn/globals_for_api.json +++ b/tests/translator/output/aws-cn/globals_for_api.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -130,8 +124,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -149,8 +141,6 @@ }, "ExplicitApiSomeStageStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -168,8 +158,6 @@ }, "ServerlessRestApiDeploymentf6c326a165": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -180,8 +168,6 @@ }, "ExplicitApiDeployment43e01e673d": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -192,8 +178,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -215,8 +199,6 @@ }, "MyUserPool": { "Type": "AWS::Cognito::UserPool", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "UsernameAttributes": [ "email" @@ -238,8 +220,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/globals_for_function.json b/tests/translator/output/aws-cn/globals_for_function.json index de6c22ffa..79ecc2ab9 100644 --- a/tests/translator/output/aws-cn/globals_for_function.json +++ b/tests/translator/output/aws-cn/globals_for_function.json @@ -2,8 +2,6 @@ "Resources": { "FunctionWithOverridesRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -45,8 +43,6 @@ }, "FunctionWithOverrides": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Layers": [ { @@ -108,8 +104,6 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -147,8 +141,6 @@ }, "FunctionWithOverridesAliasprod": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -164,8 +156,6 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Layers": [ { @@ -218,8 +208,6 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -234,9 +222,8 @@ } }, "FunctionWithOverridesVersion096ed3b52b": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "FunctionWithOverrides" @@ -244,9 +231,8 @@ } }, "MinimalFunctionVersion0a06fc8fb1": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" diff --git a/tests/translator/output/aws-cn/globals_for_simpletable.json b/tests/translator/output/aws-cn/globals_for_simpletable.json index 990238365..313fd286c 100644 --- a/tests/translator/output/aws-cn/globals_for_simpletable.json +++ b/tests/translator/output/aws-cn/globals_for_simpletable.json @@ -2,8 +2,6 @@ "Resources": { "MinimalTable": { "Type": "AWS::DynamoDB::Table", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BillingMode": "PAY_PER_REQUEST", "SSESpecification": { diff --git a/tests/translator/output/aws-cn/http_api_def_uri.json b/tests/translator/output/aws-cn/http_api_def_uri.json index 3cd0db66d..f285640fc 100644 --- a/tests/translator/output/aws-cn/http_api_def_uri.json +++ b/tests/translator/output/aws-cn/http_api_def_uri.json @@ -2,8 +2,6 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -27,8 +25,6 @@ }, "FunctionApiPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -48,8 +44,6 @@ }, "MyApiStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -72,8 +66,6 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -104,8 +96,6 @@ }, "MyApi2ApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi2" @@ -119,8 +109,6 @@ }, "MyApi2": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BodyS3Location": { "Version": "version", @@ -131,8 +119,6 @@ }, "FunctionApi2Permission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -154,8 +140,6 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BodyS3Location": { "Bucket": "bucket", diff --git a/tests/translator/output/aws-cn/http_api_description.json b/tests/translator/output/aws-cn/http_api_description.json index 8d6d6bc0f..e5b49fcb3 100644 --- a/tests/translator/output/aws-cn/http_api_description.json +++ b/tests/translator/output/aws-cn/http_api_description.json @@ -2,8 +2,6 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -27,8 +25,6 @@ }, "FunctionApiPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -48,8 +44,6 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -80,8 +74,6 @@ }, "HttpApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AutoDeploy": true, "ApiId": { @@ -95,8 +87,6 @@ }, "HttpApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "openapi": "3.0.1", diff --git a/tests/translator/output/aws-cn/http_api_existing_openapi.json b/tests/translator/output/aws-cn/http_api_existing_openapi.json index ddb17d59c..606deddcb 100644 --- a/tests/translator/output/aws-cn/http_api_existing_openapi.json +++ b/tests/translator/output/aws-cn/http_api_existing_openapi.json @@ -8,8 +8,6 @@ "Resources": { "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -31,8 +29,6 @@ }, "MyApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -46,8 +42,6 @@ }, "HttpApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.restapi", "Code": { @@ -71,8 +65,6 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -104,8 +96,6 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/http_api_existing_openapi_conditions.json b/tests/translator/output/aws-cn/http_api_existing_openapi_conditions.json index 115dd2f5e..c674491ca 100644 --- a/tests/translator/output/aws-cn/http_api_existing_openapi_conditions.json +++ b/tests/translator/output/aws-cn/http_api_existing_openapi_conditions.json @@ -10,8 +10,6 @@ "Resources": { "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -34,8 +32,6 @@ }, "MyApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -51,8 +47,6 @@ }, "HttpApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.restapi", "Code": { @@ -77,8 +71,6 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -110,8 +102,6 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/http_api_explicit_stage.json b/tests/translator/output/aws-cn/http_api_explicit_stage.json index 6eeb619b6..eb33d241d 100644 --- a/tests/translator/output/aws-cn/http_api_explicit_stage.json +++ b/tests/translator/output/aws-cn/http_api_explicit_stage.json @@ -12,8 +12,6 @@ "Resources": { "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -35,8 +33,6 @@ }, "HttpApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.restapi", "Code": { @@ -60,8 +56,6 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AutoDeploy": true, "StageVariables": { @@ -90,8 +84,6 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -122,8 +114,6 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FailOnWarnings": true, "Body": { diff --git a/tests/translator/output/aws-cn/http_api_lambda_auth.json b/tests/translator/output/aws-cn/http_api_lambda_auth.json index 9c65d2e04..9f40ee94f 100644 --- a/tests/translator/output/aws-cn/http_api_lambda_auth.json +++ b/tests/translator/output/aws-cn/http_api_lambda_auth.json @@ -2,8 +2,6 @@ "Resources": { "HttpApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -27,8 +25,6 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -59,8 +55,6 @@ }, "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { @@ -82,8 +76,6 @@ }, "MyAuthFn": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "bucket", @@ -107,8 +99,6 @@ }, "MyAuthFnRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -139,8 +129,6 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "openapi": "3.0.1", @@ -250,8 +238,6 @@ }, "MyApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" diff --git a/tests/translator/output/aws-cn/http_api_lambda_auth_full.json b/tests/translator/output/aws-cn/http_api_lambda_auth_full.json index 3d9f44428..7fe416f92 100644 --- a/tests/translator/output/aws-cn/http_api_lambda_auth_full.json +++ b/tests/translator/output/aws-cn/http_api_lambda_auth_full.json @@ -2,8 +2,6 @@ "Resources": { "HttpApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -27,8 +25,6 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -59,8 +55,6 @@ }, "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { @@ -82,8 +76,6 @@ }, "MyAuthFn": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "bucket", @@ -107,8 +99,6 @@ }, "MyAuthFnRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -139,8 +129,6 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "openapi": "3.0.1", @@ -264,8 +252,6 @@ }, "MyApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" diff --git a/tests/translator/output/aws-cn/http_api_with_cors.json b/tests/translator/output/aws-cn/http_api_with_cors.json index 278064a44..ccf90e087 100644 --- a/tests/translator/output/aws-cn/http_api_with_cors.json +++ b/tests/translator/output/aws-cn/http_api_with_cors.json @@ -10,8 +10,6 @@ "Resources": { "MyApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -25,8 +23,6 @@ }, "ServerlessHttpApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "ServerlessHttpApi" @@ -40,8 +36,6 @@ }, "ServerlessHttpApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -98,8 +92,6 @@ }, "HttpApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -122,8 +114,6 @@ }, "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -145,8 +135,6 @@ }, "HttpApiFunctionImplicitApiPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -168,8 +156,6 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -200,8 +186,6 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/implicit_and_explicit_api_with_conditions.json b/tests/translator/output/aws-cn/implicit_and_explicit_api_with_conditions.json index af16d22f2..4ebfafc91 100644 --- a/tests/translator/output/aws-cn/implicit_and_explicit_api_with_conditions.json +++ b/tests/translator/output/aws-cn/implicit_and_explicit_api_with_conditions.json @@ -39,8 +39,6 @@ "Resources": { "explicithello2": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -66,8 +64,6 @@ }, "implicithello2Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -99,8 +95,6 @@ }, "explicithello1": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -126,8 +120,6 @@ }, "ServerlessRestApiDeploymentafcab1755e": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -139,8 +131,6 @@ }, "explicitapiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "explicitapiDeploymentc5102c0776" @@ -153,8 +143,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentafcab1755e" @@ -168,8 +156,6 @@ }, "explicithello2Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -201,8 +187,6 @@ }, "explicithello1ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -225,8 +209,6 @@ }, "implicithello2": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -252,8 +234,6 @@ }, "implicithello1ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -276,8 +256,6 @@ }, "explicitapiDeploymentc5102c0776": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "explicitapi" @@ -288,8 +266,6 @@ }, "implicithello1": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -315,8 +291,6 @@ }, "explicithello2ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -339,8 +313,6 @@ }, "explicitapi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -437,8 +409,6 @@ }, "implicithello2ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -461,8 +431,6 @@ }, "explicithello1Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -494,8 +462,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -593,8 +559,6 @@ }, "implicithello1Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-cn/implicit_api.json b/tests/translator/output/aws-cn/implicit_api.json index 020d3aea6..913146077 100644 --- a/tests/translator/output/aws-cn/implicit_api.json +++ b/tests/translator/output/aws-cn/implicit_api.json @@ -2,8 +2,6 @@ "Resources": { "RestApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -35,8 +33,6 @@ }, "RestApiFunctionAddItemPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -58,8 +54,6 @@ }, "GetHtmlFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -81,8 +75,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentb5184bf2cc" @@ -95,8 +87,6 @@ }, "GetHtmlFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -120,8 +110,6 @@ }, "GetHtmlFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -153,8 +141,6 @@ }, "RestApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -178,8 +164,6 @@ }, "ServerlessRestApiDeploymentb5184bf2cc": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -190,8 +174,6 @@ }, "RestApiFunctionGetListPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -213,8 +195,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -287,8 +267,6 @@ }, "RestApiFunctionCompleteItemPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-cn/implicit_api_with_auth_and_conditions_max.json b/tests/translator/output/aws-cn/implicit_api_with_auth_and_conditions_max.json index ae885116a..c0bad5fb1 100644 --- a/tests/translator/output/aws-cn/implicit_api_with_auth_and_conditions_max.json +++ b/tests/translator/output/aws-cn/implicit_api_with_auth_and_conditions_max.json @@ -81,8 +81,6 @@ "Resources": { "MyFunction4": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -107,8 +105,6 @@ }, "MyFunction6": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -133,8 +129,6 @@ }, "MyFunction2WithCognitoMultipleUserPoolsAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -157,8 +151,6 @@ }, "MyFunction3": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -183,8 +175,6 @@ }, "MyFunction2": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -209,8 +199,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment6b0de9dc9a" @@ -224,8 +212,6 @@ }, "MyFunction5Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -257,8 +243,6 @@ }, "MyFunction2Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -290,8 +274,6 @@ }, "MyFunction4Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -323,8 +305,6 @@ }, "MyFunction5": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -349,8 +329,6 @@ }, "MyFunction6Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -382,8 +360,6 @@ }, "ServerlessRestApiMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -403,8 +379,6 @@ }, "MyFunctionWithNoAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -427,8 +401,6 @@ }, "MyFunction3Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -460,8 +432,6 @@ }, "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -486,8 +456,6 @@ }, "MyFunction4WithLambdaTokenAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -510,8 +478,6 @@ }, "ServerlessRestApiMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -531,8 +497,6 @@ }, "MyFunction5WithLambdaRequestAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -555,8 +519,6 @@ }, "ServerlessRestApiMyLambdaTokenAuthNoneFunctionInvokeRoleAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -576,8 +538,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -609,8 +569,6 @@ }, "ServerlessRestApiDeployment6b0de9dc9a": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -622,8 +580,6 @@ }, "MyFunction3WithLambdaTokenAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -646,8 +602,6 @@ }, "MyFunction6WithDefaultAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -670,8 +624,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/implicit_api_with_many_conditions.json b/tests/translator/output/aws-cn/implicit_api_with_many_conditions.json index ff7c03c08..bfe56a522 100644 --- a/tests/translator/output/aws-cn/implicit_api_with_many_conditions.json +++ b/tests/translator/output/aws-cn/implicit_api_with_many_conditions.json @@ -125,8 +125,6 @@ "Resources": { "helloworld7ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -149,8 +147,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment5d9ff7b9fd" @@ -164,8 +160,6 @@ }, "helloworld1Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -197,8 +191,6 @@ }, "helloworld7": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -224,8 +216,6 @@ }, "helloworld6": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -251,8 +241,6 @@ }, "helloworldRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -284,8 +272,6 @@ }, "helloworld4": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -311,8 +297,6 @@ }, "helloworld3": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -338,8 +322,6 @@ }, "helloworld2": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -365,8 +347,6 @@ }, "helloworld1": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -392,8 +372,6 @@ }, "helloworld9": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -419,8 +397,6 @@ }, "helloApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -443,8 +419,6 @@ }, "helloworld2ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -467,8 +441,6 @@ }, "helloworld3ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -491,8 +463,6 @@ }, "helloworld1ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -515,8 +485,6 @@ }, "helloworld8": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -542,8 +510,6 @@ }, "helloworld6ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -566,8 +532,6 @@ }, "ServerlessRestApiDeployment5d9ff7b9fd": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -579,8 +543,6 @@ }, "helloworld4Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -612,8 +574,6 @@ }, "helloworldApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -636,8 +596,6 @@ }, "helloworld9Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -669,8 +627,6 @@ }, "helloworld5ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -693,8 +649,6 @@ }, "helloworld8ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -717,8 +671,6 @@ }, "helloRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -750,8 +702,6 @@ }, "helloworld8Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -783,8 +733,6 @@ }, "helloworld": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -810,8 +758,6 @@ }, "helloworld5Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -843,8 +789,6 @@ }, "hello": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -870,8 +814,6 @@ }, "helloworld5": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -897,8 +839,6 @@ }, "helloworld9ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -921,8 +861,6 @@ }, "helloworld6Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -954,8 +892,6 @@ }, "helloworld7Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -987,8 +923,6 @@ }, "helloworld2Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -1020,8 +954,6 @@ }, "helloworld3Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -1053,8 +985,6 @@ }, "helloworld4ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -1077,8 +1007,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/implicit_api_with_serverless_rest_api_resource.json b/tests/translator/output/aws-cn/implicit_api_with_serverless_rest_api_resource.json index 169f82af4..8acd95d0f 100644 --- a/tests/translator/output/aws-cn/implicit_api_with_serverless_rest_api_resource.json +++ b/tests/translator/output/aws-cn/implicit_api_with_serverless_rest_api_resource.json @@ -2,8 +2,6 @@ "Resources": { "RestApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -35,8 +33,6 @@ }, "RestApiFunctionAddItemPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -58,8 +54,6 @@ }, "GetHtmlFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -81,8 +75,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentb5184bf2cc" @@ -95,8 +87,6 @@ }, "GetHtmlFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -120,8 +110,6 @@ }, "GetHtmlFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -153,8 +141,6 @@ }, "RestApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -178,8 +164,6 @@ }, "ServerlessRestApiDeploymentb5184bf2cc": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -190,8 +174,6 @@ }, "RestApiFunctionGetListPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -213,8 +195,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -287,8 +267,6 @@ }, "RestApiFunctionCompleteItemPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-cn/implicit_http_api.json b/tests/translator/output/aws-cn/implicit_http_api.json index af582ddb7..c23badb55 100644 --- a/tests/translator/output/aws-cn/implicit_http_api.json +++ b/tests/translator/output/aws-cn/implicit_http_api.json @@ -2,8 +2,6 @@ "Resources": { "ServerlessHttpApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "ServerlessHttpApi" @@ -17,8 +15,6 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -50,8 +46,6 @@ }, "HttpApiFunction2Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -83,8 +77,6 @@ }, "HttpApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.restapi", "Code": { @@ -108,8 +100,6 @@ }, "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -131,8 +121,6 @@ }, "HttpApiFunction2": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.restapi", "Code": { @@ -156,8 +144,6 @@ }, "ServerlessHttpApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -245,8 +231,6 @@ }, "HttpApiFunction2PathParametersPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -268,8 +252,6 @@ }, "HttpApiFunction2Basic2Permission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-cn/implicit_http_api_auth_and_simple_case.json b/tests/translator/output/aws-cn/implicit_http_api_auth_and_simple_case.json index 723132b47..b3e095010 100644 --- a/tests/translator/output/aws-cn/implicit_http_api_auth_and_simple_case.json +++ b/tests/translator/output/aws-cn/implicit_http_api_auth_and_simple_case.json @@ -2,8 +2,6 @@ "Resources": { "ServerlessHttpApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "ServerlessHttpApi" @@ -17,8 +15,6 @@ }, "RestApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -50,8 +46,6 @@ }, "RestApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.restapi", "Code": { @@ -75,8 +69,6 @@ }, "RestApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -98,8 +90,6 @@ }, "ServerlessHttpApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/implicit_http_api_with_many_conditions.json b/tests/translator/output/aws-cn/implicit_http_api_with_many_conditions.json index c91728d59..90f1f1c0f 100644 --- a/tests/translator/output/aws-cn/implicit_http_api_with_many_conditions.json +++ b/tests/translator/output/aws-cn/implicit_http_api_with_many_conditions.json @@ -116,8 +116,6 @@ "Resources": { "helloworld9HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -140,8 +138,6 @@ }, "helloworld9Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -173,8 +169,6 @@ }, "helloworld2HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -197,8 +191,6 @@ }, "ServerlessHttpApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -691,8 +683,6 @@ }, "helloworld6HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -715,8 +705,6 @@ }, "helloworld1Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -748,8 +736,6 @@ }, "helloworld7": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -775,8 +761,6 @@ }, "helloworld6": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -802,8 +786,6 @@ }, "helloworld5": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -829,8 +811,6 @@ }, "helloworld1099Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -862,8 +842,6 @@ }, "helloworld3": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -889,8 +867,6 @@ }, "helloworld2": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -916,8 +892,6 @@ }, "helloworld1": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -943,8 +917,6 @@ }, "helloworld9": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -970,8 +942,6 @@ }, "hello": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -997,8 +967,6 @@ }, "helloRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -1030,8 +998,6 @@ }, "helloworld7HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -1054,8 +1020,6 @@ }, "helloHttpApiEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -1078,8 +1042,6 @@ }, "helloworld1HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -1102,8 +1064,6 @@ }, "helloworld5Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -1135,8 +1095,6 @@ }, "helloworld4Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -1168,8 +1126,6 @@ }, "helloworld1099HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -1192,8 +1148,6 @@ }, "helloworld5HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -1216,8 +1170,6 @@ }, "helloworld7Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -1249,8 +1201,6 @@ }, "helloworld2Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -1282,8 +1232,6 @@ }, "helloworld8Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -1315,8 +1263,6 @@ }, "helloworld4": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -1342,8 +1288,6 @@ }, "helloworld1099": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -1369,8 +1313,6 @@ }, "helloworld8HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -1393,8 +1335,6 @@ }, "ServerlessHttpApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AutoDeploy": true, "ApiId": { @@ -1433,8 +1373,6 @@ }, "helloworld3Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -1466,8 +1404,6 @@ }, "helloworld8": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -1493,8 +1429,6 @@ }, "helloworld4HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -1517,8 +1451,6 @@ }, "helloworld6Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -1550,8 +1482,6 @@ }, "helloworld3HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-cn/inline_precedence.json b/tests/translator/output/aws-cn/inline_precedence.json index c2566a666..5a3b8edd7 100644 --- a/tests/translator/output/aws-cn/inline_precedence.json +++ b/tests/translator/output/aws-cn/inline_precedence.json @@ -2,8 +2,6 @@ "Resources": { "HelloWorldFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -34,8 +32,6 @@ }, "HelloWorldFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.lambda_handler", "Code": { diff --git a/tests/translator/output/aws-cn/intrinsic_functions.json b/tests/translator/output/aws-cn/intrinsic_functions.json index 784a174b5..4c06c2cf8 100644 --- a/tests/translator/output/aws-cn/intrinsic_functions.json +++ b/tests/translator/output/aws-cn/intrinsic_functions.json @@ -32,8 +32,6 @@ "Resources": { "MyExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -54,8 +52,6 @@ }, "MyTable": { "Type": "AWS::DynamoDB::Table", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "KeySchema": [ { @@ -79,14 +75,10 @@ } }, "SnsDlqQueue": { - "Type": "AWS::SNS::Topic", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::SNS::Topic" }, "MySqsDlqLambdaFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -117,14 +109,10 @@ } }, "SqsDlqQueue": { - "Type": "AWS::SQS::Queue", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::SQS::Queue" }, "ApiWithExplicitS3Uri": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -144,8 +132,6 @@ }, "MyExplicitApiDeployment7145dd00ce": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyExplicitApi" @@ -156,8 +142,6 @@ }, "FunctionWithExplicitS3Uri": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "stream.ddb_handler", "Code": { @@ -182,8 +166,6 @@ }, "MySnsDlqLambdaFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -231,8 +213,6 @@ }, "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "TracingConfig": { "Mode": { @@ -292,8 +272,6 @@ }, "FunctionWithExplicitS3UriRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -324,8 +302,6 @@ }, "DynamoDBFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -357,8 +333,6 @@ }, "MySnsDlqLambdaFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -387,8 +361,6 @@ }, "MyNewRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -428,8 +400,6 @@ }, "DynamoDBFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "stream.ddb_handler", "Code": { @@ -453,8 +423,6 @@ }, "ApiWithExplicitS3UridevStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ApiWithExplicitS3UriDeploymenta227798f00" @@ -468,8 +436,6 @@ }, "DynamoDBFunctionMyDDBStream": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BatchSize": 200, "EventSourceArn": { @@ -486,8 +452,6 @@ }, "ApiWithExplicitS3UriDeploymenta227798f00": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ApiWithExplicitS3Uri" @@ -499,8 +463,6 @@ }, "MySqsDlqLambdaFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -551,8 +513,6 @@ }, "MyExplicitApidevStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyExplicitApiDeployment7145dd00ce" @@ -579,8 +539,6 @@ }, "MyFunctionMyApiPermissiondev": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-cn/iot_rule.json b/tests/translator/output/aws-cn/iot_rule.json index 34d3c1db6..c54b46f7f 100644 --- a/tests/translator/output/aws-cn/iot_rule.json +++ b/tests/translator/output/aws-cn/iot_rule.json @@ -4,8 +4,6 @@ "Resources": { "IoTRuleFuncMyIoTRule": { "Type": "AWS::IoT::TopicRule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "TopicRulePayload": { "AwsIotSqlVersion": "beta", @@ -28,8 +26,6 @@ }, "IoTRuleFuncMyOtherIoTRule": { "Type": "AWS::IoT::TopicRule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "TopicRulePayload": { "Actions": [ @@ -51,8 +47,6 @@ }, "IoTRuleFuncMyIoTRulePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -76,8 +70,6 @@ }, "IoTRuleFuncMyOtherIoTRulePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -101,8 +93,6 @@ }, "IoTRuleFunc": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -129,8 +119,6 @@ }, "IoTRuleFuncRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-cn/layers_all_properties.json b/tests/translator/output/aws-cn/layers_all_properties.json index 760494f88..3520acb5b 100644 --- a/tests/translator/output/aws-cn/layers_all_properties.json +++ b/tests/translator/output/aws-cn/layers_all_properties.json @@ -38,8 +38,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Layers": [ { @@ -67,9 +65,8 @@ } }, "MyLayerd04062b365": { + "DeletionPolicy": "Delete", "Type": "AWS::Lambda::LayerVersion", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "bucket", @@ -79,9 +76,8 @@ } }, "MyLayerWithANamefda8c9ec8c": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::LayerVersion", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "bucket", @@ -92,8 +88,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-cn/layers_with_intrinsics.json b/tests/translator/output/aws-cn/layers_with_intrinsics.json index be1d755cf..bc999791a 100644 --- a/tests/translator/output/aws-cn/layers_with_intrinsics.json +++ b/tests/translator/output/aws-cn/layers_with_intrinsics.json @@ -18,9 +18,8 @@ }, "Resources": { "LayerWithNameIntrinsiccf8baed8b9": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::LayerVersion", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "sam-demo-bucket", @@ -30,9 +29,8 @@ } }, "LayerWithRefNameIntrinsicRegion186db7e435": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::LayerVersion", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "sam-demo-bucket", @@ -42,9 +40,8 @@ } }, "LayerWithSubNameIntrinsicRegionfbc3f9f13d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::LayerVersion", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "sam-demo-bucket", @@ -56,9 +53,8 @@ } }, "LayerWithRuntimesIntrinsic1a006faa85": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::LayerVersion", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "sam-demo-bucket", @@ -71,6 +67,7 @@ } }, "LayerWithSingleListRefRuntimesIntrinsic9d7a72f24a": { + "DeletionPolicy": "Retain", "Properties": { "CompatibleRuntimes": [ { @@ -83,11 +80,10 @@ }, "LayerName": "LayerWithSingleListRefRuntimesIntrinsic" }, - "Type": "AWS::Lambda::LayerVersion", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::Lambda::LayerVersion" }, "LayerWithMixedListRefRuntimesIntrinsic71fd80f592": { + "DeletionPolicy": "Retain", "Properties": { "CompatibleRuntimes": [ { @@ -101,14 +97,11 @@ }, "LayerName": "LayerWithMixedListRefRuntimesIntrinsic" }, - "Type": "AWS::Lambda::LayerVersion", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::Lambda::LayerVersion" }, "LayerWithLicenseIntrinsic965c8d0c9b": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::LayerVersion", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "sam-demo-bucket", @@ -120,8 +113,7 @@ }, "LayerWithSubNameIntrinsic6e9b477102": { "Type": "AWS::Lambda::LayerVersion", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", + "DeletionPolicy": "Retain", "Properties": { "Content": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-cn/no_implicit_api_with_serverless_rest_api_resource.json b/tests/translator/output/aws-cn/no_implicit_api_with_serverless_rest_api_resource.json index a82eac5a8..d100ffdc6 100644 --- a/tests/translator/output/aws-cn/no_implicit_api_with_serverless_rest_api_resource.json +++ b/tests/translator/output/aws-cn/no_implicit_api_with_serverless_rest_api_resource.json @@ -2,8 +2,6 @@ "Resources": { "GetHtmlFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -27,8 +25,6 @@ }, "GetHtmlFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ThumbnailFunctionImageBucketPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -74,8 +68,6 @@ }, "RestApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -106,8 +98,6 @@ }, "RestApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -131,8 +121,6 @@ }, "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -163,8 +151,6 @@ }, "Images": { "Type": "AWS::S3::Bucket", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "NotificationConfiguration": { "LambdaConfigurations": [ @@ -186,8 +172,6 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.generate_thumbails", "Code": { @@ -211,8 +195,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/s3.json b/tests/translator/output/aws-cn/s3.json index c8b735232..be472d564 100644 --- a/tests/translator/output/aws-cn/s3.json +++ b/tests/translator/output/aws-cn/s3.json @@ -2,8 +2,6 @@ "Resources": { "Images": { "Type": "AWS::S3::Bucket", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "DependsOn": ["ThumbnailFunctionImageBucketPermission"], "Properties": { "NotificationConfiguration": { @@ -23,8 +21,6 @@ }, "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,8 +51,6 @@ }, "ThumbnailFunctionImageBucketPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -70,8 +64,6 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-cn/s3_create_remove.json b/tests/translator/output/aws-cn/s3_create_remove.json index 45d3a8aaa..0c2833cd4 100644 --- a/tests/translator/output/aws-cn/s3_create_remove.json +++ b/tests/translator/output/aws-cn/s3_create_remove.json @@ -2,8 +2,6 @@ "Resources": { "Images": { "Type": "AWS::S3::Bucket", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "DependsOn": ["ThumbnailFunctionImageBucketPermission"], "Properties": { "NotificationConfiguration": { @@ -40,8 +38,6 @@ }, "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -72,8 +68,6 @@ }, "ThumbnailFunctionImageBucketPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -87,8 +81,6 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-cn/s3_existing_lambda_notification_configuration.json b/tests/translator/output/aws-cn/s3_existing_lambda_notification_configuration.json index c8b735232..be472d564 100644 --- a/tests/translator/output/aws-cn/s3_existing_lambda_notification_configuration.json +++ b/tests/translator/output/aws-cn/s3_existing_lambda_notification_configuration.json @@ -2,8 +2,6 @@ "Resources": { "Images": { "Type": "AWS::S3::Bucket", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "DependsOn": ["ThumbnailFunctionImageBucketPermission"], "Properties": { "NotificationConfiguration": { @@ -23,8 +21,6 @@ }, "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,8 +51,6 @@ }, "ThumbnailFunctionImageBucketPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -70,8 +64,6 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-cn/s3_existing_other_notification_configuration.json b/tests/translator/output/aws-cn/s3_existing_other_notification_configuration.json index 164eb584d..65d2709c8 100644 --- a/tests/translator/output/aws-cn/s3_existing_other_notification_configuration.json +++ b/tests/translator/output/aws-cn/s3_existing_other_notification_configuration.json @@ -2,8 +2,6 @@ "Resources": { "Images": { "Type": "AWS::S3::Bucket", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "NotificationConfiguration": { "LambdaConfigurations": [ @@ -31,8 +29,6 @@ }, "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -63,8 +59,6 @@ }, "ThumbnailFunctionImageBucketPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -78,8 +72,6 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.generate_thumbails", "Code": { diff --git a/tests/translator/output/aws-cn/s3_filter.json b/tests/translator/output/aws-cn/s3_filter.json index 1778ed409..b9c128d6d 100644 --- a/tests/translator/output/aws-cn/s3_filter.json +++ b/tests/translator/output/aws-cn/s3_filter.json @@ -2,8 +2,6 @@ "Resources": { "Images": { "Type": "AWS::S3::Bucket", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "DependsOn": ["ThumbnailFunctionImageBucketPermission"], "Properties": { "NotificationConfiguration": { @@ -33,8 +31,6 @@ }, "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -65,8 +61,6 @@ }, "ThumbnailFunctionImageBucketPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -80,8 +74,6 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-cn/s3_multiple_events_same_bucket.json b/tests/translator/output/aws-cn/s3_multiple_events_same_bucket.json index 52480e838..0c604138e 100644 --- a/tests/translator/output/aws-cn/s3_multiple_events_same_bucket.json +++ b/tests/translator/output/aws-cn/s3_multiple_events_same_bucket.json @@ -2,8 +2,6 @@ "Resources": { "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -34,8 +32,6 @@ }, "ThumbnailFunctionImageBucketCreatesPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -49,8 +45,6 @@ }, "Images": { "Type": "AWS::S3::Bucket", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "DependsOn": ["ThumbnailFunctionImageBucketDeletesPermission", "ThumbnailFunctionImageBucketCreatesPermission"], "Properties": { "NotificationConfiguration": { @@ -89,8 +83,6 @@ }, "ThumbnailFunctionImageBucketDeletesPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -104,8 +96,6 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-cn/s3_multiple_functions.json b/tests/translator/output/aws-cn/s3_multiple_functions.json index f2dd02a2b..e1ba64e22 100644 --- a/tests/translator/output/aws-cn/s3_multiple_functions.json +++ b/tests/translator/output/aws-cn/s3_multiple_functions.json @@ -2,8 +2,6 @@ "Resources": { "FunctionOneRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -34,8 +32,6 @@ }, "FunctionTwoImageBucketPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -49,8 +45,6 @@ }, "Images": { "Type": "AWS::S3::Bucket", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "NotificationConfiguration": { "LambdaConfigurations": [ @@ -88,8 +82,6 @@ }, "FunctionTwoRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -120,8 +112,6 @@ }, "FunctionOneImageBucketPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -135,8 +125,6 @@ }, "FunctionTwo": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -160,8 +148,6 @@ }, "FunctionOne": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-cn/s3_with_condition.json b/tests/translator/output/aws-cn/s3_with_condition.json index aa8ac9f1c..7c90662b9 100644 --- a/tests/translator/output/aws-cn/s3_with_condition.json +++ b/tests/translator/output/aws-cn/s3_with_condition.json @@ -10,8 +10,6 @@ "Resources": { "Images": { "Type": "AWS::S3::Bucket", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "NotificationConfiguration": { "LambdaConfigurations": [ @@ -52,8 +50,6 @@ }, "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -85,8 +81,6 @@ }, "ThumbnailFunctionImageBucketPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -101,8 +95,6 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.generate_thumbails", "Code": { diff --git a/tests/translator/output/aws-cn/s3_with_dependsOn.json b/tests/translator/output/aws-cn/s3_with_dependsOn.json index 4e7dc5fdc..b2d321a04 100644 --- a/tests/translator/output/aws-cn/s3_with_dependsOn.json +++ b/tests/translator/output/aws-cn/s3_with_dependsOn.json @@ -1,14 +1,10 @@ { "Resources": { "Topic": { - "Type": "AWS::SNS::Topic", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::SNS::Topic" }, "Images": { "Type": "AWS::S3::Bucket", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "DependsOn": [ "ThumbnailFunctionImageBucketPermission", "Topic" @@ -31,8 +27,6 @@ }, "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -63,8 +57,6 @@ }, "ThumbnailFunctionImageBucketPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -78,8 +70,6 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-cn/simple_table_ref_parameter_intrinsic.json b/tests/translator/output/aws-cn/simple_table_ref_parameter_intrinsic.json index 6593dd4ac..cd79e4bc1 100644 --- a/tests/translator/output/aws-cn/simple_table_ref_parameter_intrinsic.json +++ b/tests/translator/output/aws-cn/simple_table_ref_parameter_intrinsic.json @@ -16,8 +16,6 @@ "Resources": { "MinimalTableRefParamLongForm": { "Type": "AWS::DynamoDB::Table", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ProvisionedThroughput": { "WriteCapacityUnits": { diff --git a/tests/translator/output/aws-cn/simple_table_with_extra_tags.json b/tests/translator/output/aws-cn/simple_table_with_extra_tags.json index 36e580e2f..a02e088cd 100644 --- a/tests/translator/output/aws-cn/simple_table_with_extra_tags.json +++ b/tests/translator/output/aws-cn/simple_table_with_extra_tags.json @@ -8,8 +8,6 @@ "Resources": { "MinimalTableWithTags": { "Type": "AWS::DynamoDB::Table", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BillingMode": "PAY_PER_REQUEST", "AttributeDefinitions": [ diff --git a/tests/translator/output/aws-cn/simple_table_with_table_name.json b/tests/translator/output/aws-cn/simple_table_with_table_name.json index e42662064..f70cdcc4e 100644 --- a/tests/translator/output/aws-cn/simple_table_with_table_name.json +++ b/tests/translator/output/aws-cn/simple_table_with_table_name.json @@ -8,8 +8,6 @@ "Resources": { "MinimalTableWithTableName": { "Type": "AWS::DynamoDB::Table", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "TableName": "MySimpleTable", "BillingMode": "PAY_PER_REQUEST", @@ -29,8 +27,6 @@ }, "MinimalTableWithRefTableName": { "Type": "AWS::DynamoDB::Table", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "TableName": { "Ref": "MySimpleTableParameter" @@ -52,8 +48,6 @@ }, "MinimalTableWithSubTableName": { "Type": "AWS::DynamoDB::Table", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "TableName": { "Fn::Sub": "${AWS::StackName}MySimpleTable" diff --git a/tests/translator/output/aws-cn/simpletable.json b/tests/translator/output/aws-cn/simpletable.json index f26c9fa8f..c59f7a660 100644 --- a/tests/translator/output/aws-cn/simpletable.json +++ b/tests/translator/output/aws-cn/simpletable.json @@ -2,8 +2,6 @@ "Resources": { "MinimalTable": { "Type": "AWS::DynamoDB::Table", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BillingMode": "PAY_PER_REQUEST", "AttributeDefinitions": [ @@ -22,8 +20,6 @@ }, "CompleteTable": { "Type": "AWS::DynamoDB::Table", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ProvisionedThroughput": { "WriteCapacityUnits": 10, diff --git a/tests/translator/output/aws-cn/simpletable_with_sse.json b/tests/translator/output/aws-cn/simpletable_with_sse.json index e160085a5..ab4c3d3f5 100644 --- a/tests/translator/output/aws-cn/simpletable_with_sse.json +++ b/tests/translator/output/aws-cn/simpletable_with_sse.json @@ -2,8 +2,6 @@ "Resources": { "TableWithSSE": { "Type": "AWS::DynamoDB::Table", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BillingMode": "PAY_PER_REQUEST", "SSESpecification": { diff --git a/tests/translator/output/aws-cn/sns.json b/tests/translator/output/aws-cn/sns.json index 4811a77d9..236d8baef 100644 --- a/tests/translator/output/aws-cn/sns.json +++ b/tests/translator/output/aws-cn/sns.json @@ -1,14 +1,10 @@ { "Resources": { "Notifications": { - "Type": "AWS::SNS::Topic", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::SNS::Topic" }, "SaveNotificationFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -39,8 +35,6 @@ }, "SaveNotificationFunctionNotificationTopicPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "sns.amazonaws.com", @@ -54,8 +48,6 @@ }, "SaveNotificationFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -79,8 +71,6 @@ }, "SaveNotificationFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Endpoint": { "Fn::GetAtt": [ diff --git a/tests/translator/output/aws-cn/sns_existing_other_subscription.json b/tests/translator/output/aws-cn/sns_existing_other_subscription.json index 45ab41bf2..98ad0f9fa 100644 --- a/tests/translator/output/aws-cn/sns_existing_other_subscription.json +++ b/tests/translator/output/aws-cn/sns_existing_other_subscription.json @@ -2,8 +2,6 @@ "Resources": { "Notifications": { "Type": "AWS::SNS::Topic", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Subscription": [ { @@ -15,8 +13,6 @@ }, "SaveNotificationFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -47,8 +43,6 @@ }, "SaveNotificationFunctionNotificationTopicPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "sns.amazonaws.com", @@ -62,8 +56,6 @@ }, "SaveNotificationFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -87,8 +79,6 @@ }, "SaveNotificationFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Endpoint": { "Fn::GetAtt": [ diff --git a/tests/translator/output/aws-cn/sns_existing_sqs.json b/tests/translator/output/aws-cn/sns_existing_sqs.json index 41f680d44..326c6baba 100644 --- a/tests/translator/output/aws-cn/sns_existing_sqs.json +++ b/tests/translator/output/aws-cn/sns_existing_sqs.json @@ -1,19 +1,13 @@ { "Resources": { "Queue": { - "Type": "AWS::SQS::Queue", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::SQS::Queue" }, "Notifications": { - "Type": "AWS::SNS::Topic", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::SNS::Topic" }, "NotificationA": { "Type": "AWS::SQS::QueuePolicy", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Queues": [ { @@ -47,8 +41,6 @@ }, "SaveNotificationFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FilterPolicy": { "price_usd": [ @@ -77,8 +69,6 @@ }, "SaveNotificationFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -110,8 +100,6 @@ }, "SaveNotificationFunctionNotificationTopicEventSourceMapping": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BatchSize": 8, "Enabled": true, @@ -128,8 +116,6 @@ }, "SaveNotificationFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.save_notification", "Code": { diff --git a/tests/translator/output/aws-cn/sns_outside_sqs.json b/tests/translator/output/aws-cn/sns_outside_sqs.json index 14f9e4bf5..624867e0a 100644 --- a/tests/translator/output/aws-cn/sns_outside_sqs.json +++ b/tests/translator/output/aws-cn/sns_outside_sqs.json @@ -2,8 +2,6 @@ "Resources": { "NotificationB": { "Type": "AWS::SQS::QueuePolicy", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Queues": [ "https://sqs.us-east-1.amazonaws.com/123456789012/MyQueue" @@ -29,14 +27,10 @@ } }, "Notifications": { - "Type": "AWS::SNS::Topic", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::SNS::Topic" }, "SaveNotificationFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FilterPolicy": { "price_usd": [ @@ -60,8 +54,6 @@ }, "SaveNotificationFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -93,8 +85,6 @@ }, "SaveNotificationFunctionNotificationTopicEventSourceMapping": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BatchSize": 8, "Enabled": true, @@ -106,8 +96,6 @@ }, "SaveNotificationFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.save_notification", "Code": { diff --git a/tests/translator/output/aws-cn/sns_sqs.json b/tests/translator/output/aws-cn/sns_sqs.json index ab152c1e4..90961ae75 100644 --- a/tests/translator/output/aws-cn/sns_sqs.json +++ b/tests/translator/output/aws-cn/sns_sqs.json @@ -1,20 +1,14 @@ { "Resources": { "Notifications": { - "Type": "AWS::SNS::Topic", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::SNS::Topic" }, "SaveNotificationFunctionNotificationTopicQueue": { "Type": "AWS::SQS::Queue", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": {} }, "SaveNotificationFunctionNotificationTopicQueuePolicy": { "Type": "AWS::SQS::QueuePolicy", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Queues": [ { @@ -48,8 +42,6 @@ }, "SaveNotificationFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FilterPolicy": { "price_usd": [ @@ -78,8 +70,6 @@ }, "SaveNotificationFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -111,8 +101,6 @@ }, "SaveNotificationFunctionNotificationTopicEventSourceMapping": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BatchSize": 10, "Enabled": true, @@ -129,8 +117,6 @@ }, "SaveNotificationFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.save_notification", "Code": { diff --git a/tests/translator/output/aws-cn/sns_topic_outside_template.json b/tests/translator/output/aws-cn/sns_topic_outside_template.json index d99b37b0e..60e185e06 100644 --- a/tests/translator/output/aws-cn/sns_topic_outside_template.json +++ b/tests/translator/output/aws-cn/sns_topic_outside_template.json @@ -7,8 +7,6 @@ "Resources": { "SaveNotificationFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Endpoint": { "Fn::GetAtt": [ @@ -24,8 +22,6 @@ }, "SaveNotificationFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -56,8 +52,6 @@ }, "SaveNotificationFunctionNotificationTopicPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "sns.amazonaws.com", @@ -71,8 +65,6 @@ }, "SaveNotificationFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-cn/sqs.json b/tests/translator/output/aws-cn/sqs.json index 399e78b7a..cad7b2248 100644 --- a/tests/translator/output/aws-cn/sqs.json +++ b/tests/translator/output/aws-cn/sqs.json @@ -2,8 +2,6 @@ "Resources": { "SQSFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -33,8 +31,6 @@ }, "SQSFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -56,8 +52,6 @@ }, "SQSFunctionMySqsQueue": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BatchSize": 10, "Enabled": false, diff --git a/tests/translator/output/aws-cn/state_machine_with_api_auth_default_scopes.json b/tests/translator/output/aws-cn/state_machine_with_api_auth_default_scopes.json index ab72718f4..6a466f04a 100644 --- a/tests/translator/output/aws-cn/state_machine_with_api_auth_default_scopes.json +++ b/tests/translator/output/aws-cn/state_machine_with_api_auth_default_scopes.json @@ -2,8 +2,6 @@ "Resources": { "MyApiWithCognitoAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -369,8 +367,6 @@ }, "MyStateMachineCognitoWithAuthNoneRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -408,8 +404,6 @@ }, "MyStateMachineCognitoDefaultScopesNoneRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -447,8 +441,6 @@ }, "MyStateMachineCognitoDefaultAuthDefaultScopesNoneRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -486,8 +478,6 @@ }, "MyStateMachineCognitoDefaultScopesWithOverwrittenRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -525,8 +515,6 @@ }, "MyApiWithCognitoAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithCognitoAuthDeployment57b57dfc88" @@ -539,8 +527,6 @@ }, "MyApiWithCognitoAuthDeployment57b57dfc88": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithCognitoAuth" @@ -550,8 +536,6 @@ }, "MyStateMachineCognitoDefaultScopesDefaultAuthorizerRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -589,8 +573,6 @@ }, "MyStateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ @@ -632,8 +614,6 @@ }, "MyStateMachineCognitoAuthorizerWithDefaultScopesRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -671,8 +651,6 @@ }, "MyStateMachineCognitoAuthorizerScopesOverwrittenRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -710,8 +688,6 @@ }, "MyStateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", diff --git a/tests/translator/output/aws-cn/state_machine_with_api_authorizer.json b/tests/translator/output/aws-cn/state_machine_with_api_authorizer.json index 3596485e7..859dea489 100644 --- a/tests/translator/output/aws-cn/state_machine_with_api_authorizer.json +++ b/tests/translator/output/aws-cn/state_machine_with_api_authorizer.json @@ -2,8 +2,6 @@ "Resources": { "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ @@ -46,8 +44,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentaaffc688ce" @@ -60,8 +56,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -124,8 +118,6 @@ }, "StateMachineWithLambdaTokenAuthRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -163,8 +155,6 @@ }, "MyApiMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -183,8 +173,6 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -282,8 +270,6 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -327,8 +313,6 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment2d6a709a2a" @@ -341,8 +325,6 @@ }, "ServerlessRestApiDeploymentaaffc688ce": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -353,8 +335,6 @@ }, "StateMachineWithNoAuthorizerRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -392,8 +372,6 @@ }, "MyApiDeployment2d6a709a2a": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" diff --git a/tests/translator/output/aws-cn/state_machine_with_api_authorizer_maximum.json b/tests/translator/output/aws-cn/state_machine_with_api_authorizer_maximum.json index 997556209..4755fb316 100644 --- a/tests/translator/output/aws-cn/state_machine_with_api_authorizer_maximum.json +++ b/tests/translator/output/aws-cn/state_machine_with_api_authorizer_maximum.json @@ -2,8 +2,6 @@ "Resources": { "MyApiMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -22,8 +20,6 @@ }, "StateMachineWithLambdaRequestAuthorizerRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -61,8 +57,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ @@ -105,8 +99,6 @@ }, "StateMachineWithDefaultAuthorizerRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -144,8 +136,6 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -486,8 +476,6 @@ }, "MyApiMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -506,8 +494,6 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -551,8 +537,6 @@ }, "StateMachineWithLambdaTokenAuthorizerRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -590,8 +574,6 @@ }, "MyApiMyLambdaTokenAuthNoneFunctionInvokeRoleAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -610,8 +592,6 @@ }, "MyApiDeployment704a2ea820": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -622,8 +602,6 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment704a2ea820" @@ -636,8 +614,6 @@ }, "StateMachineWithCognitoMultipleUserPoolsAuthorizerRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -675,8 +651,6 @@ }, "StateMachineWithNoAuthorizerRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { diff --git a/tests/translator/output/aws-cn/state_machine_with_api_resource_policy.json b/tests/translator/output/aws-cn/state_machine_with_api_resource_policy.json index 450ad48c1..f9b4100a5 100644 --- a/tests/translator/output/aws-cn/state_machine_with_api_resource_policy.json +++ b/tests/translator/output/aws-cn/state_machine_with_api_resource_policy.json @@ -2,8 +2,6 @@ "Resources": { "MyStateMachineGetHtmlRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -41,8 +39,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -304,8 +300,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment17065a95ba" @@ -318,8 +312,6 @@ }, "MyStateMachinePutHtmlRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -357,8 +349,6 @@ }, "MyStateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ @@ -400,8 +390,6 @@ }, "ExplicitApiDeployment17065a95ba": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -412,8 +400,6 @@ }, "MyStateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -457,8 +443,6 @@ }, "MyStateMachinePostHtmlRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { diff --git a/tests/translator/output/aws-cn/state_machine_with_condition.json b/tests/translator/output/aws-cn/state_machine_with_condition.json index 756e0dd02..7d67abe1a 100644 --- a/tests/translator/output/aws-cn/state_machine_with_condition.json +++ b/tests/translator/output/aws-cn/state_machine_with_condition.json @@ -10,8 +10,6 @@ "Resources": { "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "StateMachineName": "MyStateMachine", diff --git a/tests/translator/output/aws-cn/state_machine_with_condition_and_events.json b/tests/translator/output/aws-cn/state_machine_with_condition_and_events.json index daaa04767..8e0a7a0ab 100644 --- a/tests/translator/output/aws-cn/state_machine_with_condition_and_events.json +++ b/tests/translator/output/aws-cn/state_machine_with_condition_and_events.json @@ -10,8 +10,6 @@ "Resources": { "StateMachineMyApiEventRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -50,8 +48,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "StateMachineName": "MyStateMachine", @@ -71,8 +67,6 @@ }, "StateMachineScheduleEventRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -111,8 +105,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentaeae651245" @@ -126,8 +118,6 @@ }, "StateMachineScheduleEvent": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ScheduleExpression": "rate(1 minute)", "Targets": [ @@ -150,8 +140,6 @@ }, "StateMachineCWEvent": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -179,8 +167,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -268,8 +254,6 @@ }, "ServerlessRestApiDeploymentaeae651245": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -281,8 +265,6 @@ }, "StateMachineCWEventRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { diff --git a/tests/translator/output/aws-cn/state_machine_with_cwe.json b/tests/translator/output/aws-cn/state_machine_with_cwe.json index 177fdfe96..04164e943 100644 --- a/tests/translator/output/aws-cn/state_machine_with_cwe.json +++ b/tests/translator/output/aws-cn/state_machine_with_cwe.json @@ -2,8 +2,6 @@ "Resources": { "StateMachineCWEvent": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -30,8 +28,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "DefinitionS3Location": { @@ -48,8 +44,6 @@ }, "StateMachineCWEventRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { diff --git a/tests/translator/output/aws-cn/state_machine_with_definition_S3_object.json b/tests/translator/output/aws-cn/state_machine_with_definition_S3_object.json index aa9c1bd58..81caf3cfe 100644 --- a/tests/translator/output/aws-cn/state_machine_with_definition_S3_object.json +++ b/tests/translator/output/aws-cn/state_machine_with_definition_S3_object.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -28,8 +26,6 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -78,8 +74,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -110,8 +104,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Tags": [ { diff --git a/tests/translator/output/aws-cn/state_machine_with_definition_S3_string.json b/tests/translator/output/aws-cn/state_machine_with_definition_S3_string.json index 062d5c5e1..97b28ece4 100644 --- a/tests/translator/output/aws-cn/state_machine_with_definition_S3_string.json +++ b/tests/translator/output/aws-cn/state_machine_with_definition_S3_string.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -28,8 +26,6 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -78,8 +74,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -110,8 +104,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Tags": [ { diff --git a/tests/translator/output/aws-cn/state_machine_with_definition_substitutions.json b/tests/translator/output/aws-cn/state_machine_with_definition_substitutions.json index 5787da02a..0b6ac94f6 100644 --- a/tests/translator/output/aws-cn/state_machine_with_definition_substitutions.json +++ b/tests/translator/output/aws-cn/state_machine_with_definition_substitutions.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -27,8 +25,6 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -77,8 +73,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -109,8 +103,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DefinitionSubstitutions": { "definition_substitution_1": { diff --git a/tests/translator/output/aws-cn/state_machine_with_eb_dlq.json b/tests/translator/output/aws-cn/state_machine_with_eb_dlq.json index 47aa3b4f3..e49e64256 100644 --- a/tests/translator/output/aws-cn/state_machine_with_eb_dlq.json +++ b/tests/translator/output/aws-cn/state_machine_with_eb_dlq.json @@ -2,8 +2,6 @@ "Resources": { "StateMachineCWEvent": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -33,8 +31,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "DefinitionS3Location": { @@ -51,8 +47,6 @@ }, "StateMachineCWEventRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { diff --git a/tests/translator/output/aws-cn/state_machine_with_eb_dlq_generated.json b/tests/translator/output/aws-cn/state_machine_with_eb_dlq_generated.json index 213cea8c0..7e57f8926 100644 --- a/tests/translator/output/aws-cn/state_machine_with_eb_dlq_generated.json +++ b/tests/translator/output/aws-cn/state_machine_with_eb_dlq_generated.json @@ -2,14 +2,10 @@ "Resources": { "TestDLQ": { "Type": "AWS::SQS::Queue", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": {} }, "StateMachineCWEvent": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -44,8 +40,6 @@ }, "StateMachineCWEventQueuePolicy": { "Type": "AWS::SQS::QueuePolicy", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Queues": [ { @@ -84,8 +78,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "DefinitionS3Location": { @@ -102,8 +94,6 @@ }, "StateMachineCWEventRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { diff --git a/tests/translator/output/aws-cn/state_machine_with_eb_retry_policy.json b/tests/translator/output/aws-cn/state_machine_with_eb_retry_policy.json index 3d6af1cfa..bff94e177 100644 --- a/tests/translator/output/aws-cn/state_machine_with_eb_retry_policy.json +++ b/tests/translator/output/aws-cn/state_machine_with_eb_retry_policy.json @@ -2,8 +2,6 @@ "Resources": { "StateMachineCWEvent": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -34,8 +32,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "DefinitionS3Location": { @@ -52,8 +48,6 @@ }, "StateMachineCWEventRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { diff --git a/tests/translator/output/aws-cn/state_machine_with_explicit_api.json b/tests/translator/output/aws-cn/state_machine_with_explicit_api.json index 3cad7af0f..70ef4676a 100644 --- a/tests/translator/output/aws-cn/state_machine_with_explicit_api.json +++ b/tests/translator/output/aws-cn/state_machine_with_explicit_api.json @@ -2,8 +2,6 @@ "Resources": { "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -47,8 +45,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ @@ -91,8 +87,6 @@ }, "MyApiDeployment05bc9f394c": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -103,8 +97,6 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment05bc9f394c" @@ -117,8 +109,6 @@ }, "StateMachineMyApiEventRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -156,8 +146,6 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/state_machine_with_express_logging.json b/tests/translator/output/aws-cn/state_machine_with_express_logging.json index eea4adefa..5a5583bf6 100644 --- a/tests/translator/output/aws-cn/state_machine_with_express_logging.json +++ b/tests/translator/output/aws-cn/state_machine_with_express_logging.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -27,8 +25,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -59,8 +55,6 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -132,14 +126,10 @@ } }, "ExpressLogGroup": { - "Type": "AWS::Logs::LogGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::Logs::LogGroup" }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Tags": [ { diff --git a/tests/translator/output/aws-cn/state_machine_with_implicit_api.json b/tests/translator/output/aws-cn/state_machine_with_implicit_api.json index d9f4c7542..ebb4b1c02 100644 --- a/tests/translator/output/aws-cn/state_machine_with_implicit_api.json +++ b/tests/translator/output/aws-cn/state_machine_with_implicit_api.json @@ -2,8 +2,6 @@ "Resources": { "StateMachineMyApiEventRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -41,8 +39,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ @@ -85,8 +81,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment05bc9f394c" @@ -99,8 +93,6 @@ }, "ServerlessRestApiDeployment05bc9f394c": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -111,8 +103,6 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -156,8 +146,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/state_machine_with_implicit_api_globals.json b/tests/translator/output/aws-cn/state_machine_with_implicit_api_globals.json index 0a7dc1ff9..c28b4704f 100644 --- a/tests/translator/output/aws-cn/state_machine_with_implicit_api_globals.json +++ b/tests/translator/output/aws-cn/state_machine_with_implicit_api_globals.json @@ -2,8 +2,6 @@ "Resources": { "StateMachineMyApiEventRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -41,8 +39,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ @@ -85,8 +81,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment1f01b589d4" @@ -99,8 +93,6 @@ }, "ServerlessRestApiDeployment1f01b589d4": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -111,8 +103,6 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -156,8 +146,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-cn/state_machine_with_inline_definition.json b/tests/translator/output/aws-cn/state_machine_with_inline_definition.json index 52817da2b..722bc9ec7 100644 --- a/tests/translator/output/aws-cn/state_machine_with_inline_definition.json +++ b/tests/translator/output/aws-cn/state_machine_with_inline_definition.json @@ -2,8 +2,6 @@ "Resources": { "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -47,8 +45,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ diff --git a/tests/translator/output/aws-cn/state_machine_with_inline_definition_intrinsics.json b/tests/translator/output/aws-cn/state_machine_with_inline_definition_intrinsics.json index 87567cec1..0237cf961 100644 --- a/tests/translator/output/aws-cn/state_machine_with_inline_definition_intrinsics.json +++ b/tests/translator/output/aws-cn/state_machine_with_inline_definition_intrinsics.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -28,8 +26,6 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -78,8 +74,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -110,8 +104,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DefinitionString": { "Fn::Join": [ diff --git a/tests/translator/output/aws-cn/state_machine_with_inline_policies.json b/tests/translator/output/aws-cn/state_machine_with_inline_policies.json index 87567cec1..0237cf961 100644 --- a/tests/translator/output/aws-cn/state_machine_with_inline_policies.json +++ b/tests/translator/output/aws-cn/state_machine_with_inline_policies.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -28,8 +26,6 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -78,8 +74,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -110,8 +104,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DefinitionString": { "Fn::Join": [ diff --git a/tests/translator/output/aws-cn/state_machine_with_managed_policy.json b/tests/translator/output/aws-cn/state_machine_with_managed_policy.json index 59e7c9449..be6090ce9 100644 --- a/tests/translator/output/aws-cn/state_machine_with_managed_policy.json +++ b/tests/translator/output/aws-cn/state_machine_with_managed_policy.json @@ -2,8 +2,6 @@ "Resources": { "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -34,8 +32,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ diff --git a/tests/translator/output/aws-cn/state_machine_with_permissions_boundary.json b/tests/translator/output/aws-cn/state_machine_with_permissions_boundary.json index a8eba5bae..645e7d5a3 100644 --- a/tests/translator/output/aws-cn/state_machine_with_permissions_boundary.json +++ b/tests/translator/output/aws-cn/state_machine_with_permissions_boundary.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -28,8 +26,6 @@ }, "StateMachineMyApiEventRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "PermissionsBoundary": "arn:aws:1234:iam:boundary/CustomerCreatedPermissionsBoundary", "Policies": [ @@ -68,8 +64,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ @@ -93,8 +87,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment05bc9f394c" @@ -107,8 +99,6 @@ }, "ServerlessRestApiDeployment05bc9f394c": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -119,8 +109,6 @@ }, "StateMachineCWEvent": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -147,8 +135,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -179,8 +165,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -243,8 +227,6 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -299,8 +281,6 @@ }, "StateMachineScheduleEventRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "PermissionsBoundary": "arn:aws:1234:iam:boundary/CustomerCreatedPermissionsBoundary", "Policies": [ @@ -339,8 +319,6 @@ }, "StateMachineScheduleEvent": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ScheduleExpression": "rate(1 minute)", "Targets": [ @@ -362,8 +340,6 @@ }, "StateMachineCWEventRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "PermissionsBoundary": "arn:aws:1234:iam:boundary/CustomerCreatedPermissionsBoundary", "Policies": [ diff --git a/tests/translator/output/aws-cn/state_machine_with_role.json b/tests/translator/output/aws-cn/state_machine_with_role.json index e929f3e45..0db8c03ab 100644 --- a/tests/translator/output/aws-cn/state_machine_with_role.json +++ b/tests/translator/output/aws-cn/state_machine_with_role.json @@ -2,8 +2,6 @@ "Resources": { "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "StateMachineName": "MyStateMachineWithRole", diff --git a/tests/translator/output/aws-cn/state_machine_with_sam_policy_templates.json b/tests/translator/output/aws-cn/state_machine_with_sam_policy_templates.json index e9dbaaf07..17fb1640d 100644 --- a/tests/translator/output/aws-cn/state_machine_with_sam_policy_templates.json +++ b/tests/translator/output/aws-cn/state_machine_with_sam_policy_templates.json @@ -2,8 +2,6 @@ "Resources": { "ResolverLambda": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "resolver.handler", "Code": { @@ -27,8 +25,6 @@ }, "NestedWorkflow": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DefinitionSubstitutions": { "definition_substitution_1": { @@ -75,8 +71,6 @@ }, "StarterLambda": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "starter.handler", "Code": { @@ -100,8 +94,6 @@ }, "ProcessingWorkflow": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DefinitionSubstitutions": { "definition_substitution_4": { @@ -250,8 +242,6 @@ }, "StarterLambdaRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -282,8 +272,6 @@ }, "ProcessingWorkflowRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -449,8 +437,6 @@ }, "OutputStore": { "Type": "AWS::DynamoDB::Table", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "KeySchema": [ { @@ -469,14 +455,10 @@ } }, "ProcessingQueue": { - "Type": "AWS::SQS::Queue", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::SQS::Queue" }, "ResolverLambdaRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", diff --git a/tests/translator/output/aws-cn/state_machine_with_schedule.json b/tests/translator/output/aws-cn/state_machine_with_schedule.json index 76099c10b..8730521be 100644 --- a/tests/translator/output/aws-cn/state_machine_with_schedule.json +++ b/tests/translator/output/aws-cn/state_machine_with_schedule.json @@ -2,8 +2,6 @@ "Resources": { "StateMachineScheduleEvent": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "State": "DISABLED", "ScheduleExpression": "rate(1 minute)", @@ -27,8 +25,6 @@ }, "StateMachineScheduleEventRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -66,8 +62,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "DefinitionS3Location": { diff --git a/tests/translator/output/aws-cn/state_machine_with_schedule_dlq_retry_policy.json b/tests/translator/output/aws-cn/state_machine_with_schedule_dlq_retry_policy.json index fa7f67853..5d49175a9 100644 --- a/tests/translator/output/aws-cn/state_machine_with_schedule_dlq_retry_policy.json +++ b/tests/translator/output/aws-cn/state_machine_with_schedule_dlq_retry_policy.json @@ -2,8 +2,6 @@ "Resources": { "StateMachineScheduleEvent": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "State": "DISABLED", "ScheduleExpression": "rate(1 minute)", @@ -34,8 +32,6 @@ }, "StateMachineScheduleEventRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -73,8 +69,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "DefinitionS3Location": { diff --git a/tests/translator/output/aws-cn/state_machine_with_standard_logging.json b/tests/translator/output/aws-cn/state_machine_with_standard_logging.json index 9b142a7bc..315b60c2f 100644 --- a/tests/translator/output/aws-cn/state_machine_with_standard_logging.json +++ b/tests/translator/output/aws-cn/state_machine_with_standard_logging.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -26,14 +24,10 @@ } }, "StandardLogGroup": { - "Type": "AWS::Logs::LogGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::Logs::LogGroup" }, "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -106,8 +100,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -138,8 +130,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Tags": [ { diff --git a/tests/translator/output/aws-cn/state_machine_with_tags.json b/tests/translator/output/aws-cn/state_machine_with_tags.json index ba81b1f62..6016da420 100644 --- a/tests/translator/output/aws-cn/state_machine_with_tags.json +++ b/tests/translator/output/aws-cn/state_machine_with_tags.json @@ -2,8 +2,6 @@ "Resources": { "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -55,8 +53,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ diff --git a/tests/translator/output/aws-cn/state_machine_with_xray_policies.json b/tests/translator/output/aws-cn/state_machine_with_xray_policies.json index 997f543d5..c073afdc6 100644 --- a/tests/translator/output/aws-cn/state_machine_with_xray_policies.json +++ b/tests/translator/output/aws-cn/state_machine_with_xray_policies.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -27,8 +25,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -59,8 +55,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DefinitionS3Location": { "Bucket": "sam-demo-bucket", @@ -87,8 +81,6 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", diff --git a/tests/translator/output/aws-cn/state_machine_with_xray_role.json b/tests/translator/output/aws-cn/state_machine_with_xray_role.json index 0ac655a98..156d59d44 100644 --- a/tests/translator/output/aws-cn/state_machine_with_xray_role.json +++ b/tests/translator/output/aws-cn/state_machine_with_xray_role.json @@ -2,8 +2,6 @@ "Resources": { "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Tags": [ { diff --git a/tests/translator/output/aws-cn/streams.json b/tests/translator/output/aws-cn/streams.json index 8687c9b2e..ce73f1a36 100644 --- a/tests/translator/output/aws-cn/streams.json +++ b/tests/translator/output/aws-cn/streams.json @@ -2,8 +2,6 @@ "Resources": { "DynamoDBFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -25,8 +23,6 @@ }, "KinesisFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -48,8 +44,6 @@ }, "MSKFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -71,8 +65,6 @@ }, "DynamoDBFunctionMyDDBStream": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BatchSize": 200, "EventSourceArn": "arn:aws:dynamodb:us-west-2:012345678901:table/TestTable/stream/2015-05-11T21:21:33.291", @@ -84,8 +76,6 @@ }, "DynamoDBFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -115,8 +105,6 @@ }, "KinesisFunctionMyKinesisStream": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BatchSize": 100, "Enabled": false, @@ -129,8 +117,6 @@ }, "KinesisFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -160,8 +146,6 @@ }, "MSKFunctionMyMSKStream": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EventSourceArn": "arn:aws:kafka:us-west-2:012345678901:cluster/mycluster/6cc0432b-8618-4f44-bccc-e1fbd8fb7c4d-2", "FunctionName": { @@ -173,8 +157,6 @@ }, "MSKFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", diff --git a/tests/translator/output/aws-us-gov/alexa_skill.json b/tests/translator/output/aws-us-gov/alexa_skill.json index 939abffa5..dad934a97 100644 --- a/tests/translator/output/aws-us-gov/alexa_skill.json +++ b/tests/translator/output/aws-us-gov/alexa_skill.json @@ -4,9 +4,6 @@ "Resources": { "AlexaSkillFuncRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -37,9 +34,6 @@ }, "AlexaSkillFuncAlexaSkillEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { @@ -50,9 +44,6 @@ }, "AlexaSkillFunc": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-us-gov/alexa_skill_with_skill_id.json b/tests/translator/output/aws-us-gov/alexa_skill_with_skill_id.json index 735a70659..391e2fa72 100644 --- a/tests/translator/output/aws-us-gov/alexa_skill_with_skill_id.json +++ b/tests/translator/output/aws-us-gov/alexa_skill_with_skill_id.json @@ -4,9 +4,6 @@ "Resources": { "AlexaSkillFuncRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -37,9 +34,6 @@ }, "AlexaSkillFuncAlexaSkillEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { @@ -51,9 +45,6 @@ }, "AlexaSkillFunc": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-us-gov/all_policy_templates.json b/tests/translator/output/aws-us-gov/all_policy_templates.json index 1be9622d2..61d463baf 100644 --- a/tests/translator/output/aws-us-gov/all_policy_templates.json +++ b/tests/translator/output/aws-us-gov/all_policy_templates.json @@ -2,9 +2,6 @@ "Resources": { "KitchenSinkFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "Handler": "hello.handler", "Code": { @@ -28,9 +25,6 @@ }, "KitchenSinkFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", diff --git a/tests/translator/output/aws-us-gov/api_cache.json b/tests/translator/output/aws-us-gov/api_cache.json index 43c885208..35bdeb080 100644 --- a/tests/translator/output/aws-us-gov/api_cache.json +++ b/tests/translator/output/aws-us-gov/api_cache.json @@ -2,9 +2,6 @@ "Resources": { "HtmlFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -35,9 +32,6 @@ }, "HtmlApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "CacheClusterEnabled": true, "DeploymentId": { @@ -52,9 +46,6 @@ }, "HtmlFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -74,9 +65,6 @@ }, "HtmlApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "RestApiId": { "Ref": "HtmlApi" @@ -87,9 +75,6 @@ }, "HtmlApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "EndpointConfiguration": { "Types": [ @@ -107,9 +92,6 @@ }, "HtmlFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-us-gov/api_description.json b/tests/translator/output/aws-us-gov/api_description.json index a03c66d72..aef917ae1 100644 --- a/tests/translator/output/aws-us-gov/api_description.json +++ b/tests/translator/output/aws-us-gov/api_description.json @@ -2,9 +2,6 @@ "Resources": { "FunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -35,9 +32,6 @@ }, "ApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "DeploymentId": { "Ref": "ApiDeploymentf117c932f7" @@ -50,9 +44,6 @@ }, "FunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -72,9 +63,6 @@ }, "ApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "RestApiId": { "Ref": "Api" @@ -85,9 +73,6 @@ }, "Api": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "BodyS3Location": { "Bucket": "sam-demo-bucket", @@ -106,9 +91,6 @@ }, "Function": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", - "Condition": "Condition1", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-us-gov/api_endpoint_configuration.json b/tests/translator/output/aws-us-gov/api_endpoint_configuration.json index 10583c2bb..f2da8187e 100644 --- a/tests/translator/output/aws-us-gov/api_endpoint_configuration.json +++ b/tests/translator/output/aws-us-gov/api_endpoint_configuration.json @@ -7,8 +7,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -32,8 +30,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -64,8 +60,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -87,8 +81,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -106,8 +98,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentf117c932f7" @@ -120,8 +110,6 @@ }, "ServerlessRestApiDeployment5b2cb4ba8f": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -132,8 +120,6 @@ }, "ExplicitApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -144,8 +130,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment5b2cb4ba8f" @@ -158,8 +142,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_endpoint_configuration_with_vpcendpoint.json b/tests/translator/output/aws-us-gov/api_endpoint_configuration_with_vpcendpoint.json index 4a6bacdde..45af2dde5 100644 --- a/tests/translator/output/aws-us-gov/api_endpoint_configuration_with_vpcendpoint.json +++ b/tests/translator/output/aws-us-gov/api_endpoint_configuration_with_vpcendpoint.json @@ -10,8 +10,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -35,8 +33,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -67,8 +63,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -90,8 +84,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -109,8 +101,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentf117c932f7" @@ -123,8 +113,6 @@ }, "ServerlessRestApiDeployment5b2cb4ba8f": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -135,8 +123,6 @@ }, "ExplicitApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -147,8 +133,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment5b2cb4ba8f" @@ -161,8 +145,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_request_model.json b/tests/translator/output/aws-us-gov/api_request_model.json index c50e61fb1..fd5005a28 100644 --- a/tests/translator/output/aws-us-gov/api_request_model.json +++ b/tests/translator/output/aws-us-gov/api_request_model.json @@ -2,8 +2,6 @@ "Resources": { "HtmlFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -34,8 +32,6 @@ }, "HtmlApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "HtmlApiDeployment3744537077" @@ -48,8 +44,6 @@ }, "HtmlFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -69,8 +63,6 @@ }, "HtmlApiDeployment3744537077": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "HtmlApi" @@ -81,8 +73,6 @@ }, "HtmlApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -139,8 +129,6 @@ }, "HtmlFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-us-gov/api_request_model_openapi_3.json b/tests/translator/output/aws-us-gov/api_request_model_openapi_3.json index 9f3abcbea..008a26bc1 100644 --- a/tests/translator/output/aws-us-gov/api_request_model_openapi_3.json +++ b/tests/translator/output/aws-us-gov/api_request_model_openapi_3.json @@ -2,8 +2,6 @@ "Resources": { "HtmlFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -34,8 +32,6 @@ }, "HtmlApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "HtmlApiDeploymenta488cfa4f9" @@ -48,8 +44,6 @@ }, "HtmlFunctionIamPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -71,8 +65,6 @@ }, "HtmlApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -167,8 +159,6 @@ }, "HtmlApiDeploymenta488cfa4f9": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "HtmlApi" @@ -178,8 +168,6 @@ }, "HtmlFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -199,8 +187,6 @@ }, "HtmlFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { diff --git a/tests/translator/output/aws-us-gov/api_with_access_log_setting.json b/tests/translator/output/aws-us-gov/api_with_access_log_setting.json index 5bc849737..0c0a9d676 100644 --- a/tests/translator/output/aws-us-gov/api_with_access_log_setting.json +++ b/tests/translator/output/aws-us-gov/api_with_access_log_setting.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -82,8 +76,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -101,8 +93,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AccessLogSetting": { "DestinationArn": "arn:aws:logs:us-west-2:012345678901/API-Gateway-Execution-Logs_0123456789/prod:log-stream:12345678910", @@ -119,8 +109,6 @@ }, "ServerlessRestApiDeployment5b2cb4ba8f": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -131,8 +119,6 @@ }, "ExplicitApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -143,8 +129,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AccessLogSetting": { "DestinationArn": "arn:aws:logs:us-west-2:012345678901/API-Gateway-Execution-Logs_0123456789/prod:log-stream:12345678910", @@ -161,8 +145,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_with_apikey_default_override.json b/tests/translator/output/aws-us-gov/api_with_apikey_default_override.json index 7d37f5677..cdab211aa 100644 --- a/tests/translator/output/aws-us-gov/api_with_apikey_default_override.json +++ b/tests/translator/output/aws-us-gov/api_with_apikey_default_override.json @@ -2,8 +2,6 @@ "Resources": { "MyApiWithAuthDeployment084855ab6d": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithAuth" @@ -14,8 +12,6 @@ }, "MyFunctionWithApiKeyRequiredTrueMyApiWithApiKeyRequiredTruePermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -37,8 +33,6 @@ }, "MyFunctionWithApiKeyRequiredFalseMyApiWithApiKeyRequiredFalsePermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -60,8 +54,6 @@ }, "MyApiWithAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithAuthDeployment084855ab6d" @@ -74,8 +66,6 @@ }, "MyFunctionWithApiKeyRequiredTrue": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -99,8 +89,6 @@ }, "MyFunctionWithApiKeyRequiredDefault": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -124,8 +112,6 @@ }, "MyFunctionWithApiKeyRequiredDefaultMyApiWithApiKeyRequiredDefaultPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -147,8 +133,6 @@ }, "MyFunctionWithApiKeyRequiredFalse": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -172,8 +156,6 @@ }, "MyFunctionWithApiKeyRequiredFalseRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -204,8 +186,6 @@ }, "MyFunctionWithApiKeyRequiredDefaultRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -236,8 +216,6 @@ }, "MyFunctionWithApiKeyRequiredTrueRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -268,8 +246,6 @@ }, "MyApiWithAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_with_apikey_required.json b/tests/translator/output/aws-us-gov/api_with_apikey_required.json index cd61e002d..b18a21e4a 100644 --- a/tests/translator/output/aws-us-gov/api_with_apikey_required.json +++ b/tests/translator/output/aws-us-gov/api_with_apikey_required.json @@ -2,8 +2,6 @@ "Resources": { "MyFunctionWithApiKeyRequiredRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -34,8 +32,6 @@ }, "MyApiWithoutAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -84,8 +80,6 @@ }, "MyApiWithoutAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithoutAuthDeployment1f6bf4c0d5" @@ -98,8 +92,6 @@ }, "MyFunctionWithApiKeyRequiredMyApiWithApiKeyRequiredPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -121,8 +113,6 @@ }, "MyFunctionWithApiKeyRequired": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -146,8 +136,6 @@ }, "MyApiWithoutAuthDeployment1f6bf4c0d5": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithoutAuth" diff --git a/tests/translator/output/aws-us-gov/api_with_apikey_required_openapi_3.json b/tests/translator/output/aws-us-gov/api_with_apikey_required_openapi_3.json index a9500984f..c6dc6a9ca 100644 --- a/tests/translator/output/aws-us-gov/api_with_apikey_required_openapi_3.json +++ b/tests/translator/output/aws-us-gov/api_with_apikey_required_openapi_3.json @@ -2,8 +2,6 @@ "Resources": { "MyFunctionWithApiKeyRequiredRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -34,8 +32,6 @@ }, "MyApiWithoutAuthDeployment36e0aae784": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithoutAuth" @@ -45,8 +41,6 @@ }, "MyApiWithoutAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -97,8 +91,6 @@ }, "MyApiWithoutAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithoutAuthDeployment36e0aae784" @@ -111,8 +103,6 @@ }, "MyFunctionWithApiKeyRequiredMyApiWithApiKeyRequiredPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -134,8 +124,6 @@ }, "MyFunctionWithApiKeyRequired": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { diff --git a/tests/translator/output/aws-us-gov/api_with_auth_all_maximum.json b/tests/translator/output/aws-us-gov/api_with_auth_all_maximum.json index 2d71c9727..d2731e6dc 100644 --- a/tests/translator/output/aws-us-gov/api_with_auth_all_maximum.json +++ b/tests/translator/output/aws-us-gov/api_with_auth_all_maximum.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -27,8 +25,6 @@ }, "MyFunctionWithLambdaTokenAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -50,8 +46,6 @@ }, "MyApiMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -70,8 +64,6 @@ }, "MyFunctionWithCognitoMultipleUserPoolsAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -93,8 +85,6 @@ }, "MyApiDeployment7939ed72e3": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -105,8 +95,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -137,8 +125,6 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -349,8 +335,6 @@ }, "MyApiMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -369,8 +353,6 @@ }, "MyFunctionWithLambdaRequestAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -392,8 +374,6 @@ }, "MyApiMyLambdaTokenAuthNoneFunctionInvokeRoleAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -412,8 +392,6 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment7939ed72e3" @@ -426,8 +404,6 @@ }, "MyFunctionWithNoAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -449,8 +425,6 @@ }, "MyFunctionWithDefaultAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/api_with_auth_all_maximum_openapi_3.json b/tests/translator/output/aws-us-gov/api_with_auth_all_maximum_openapi_3.json index 927c04166..3195b25b9 100644 --- a/tests/translator/output/aws-us-gov/api_with_auth_all_maximum_openapi_3.json +++ b/tests/translator/output/aws-us-gov/api_with_auth_all_maximum_openapi_3.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -27,8 +25,6 @@ }, "MyFunctionWithLambdaTokenAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -50,8 +46,6 @@ }, "MyApiMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -70,8 +64,6 @@ }, "MyFunctionWithCognitoMultipleUserPoolsAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -93,8 +85,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -125,8 +115,6 @@ }, "MyApiDeployment57e8e73ac5": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -136,8 +124,6 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -350,8 +336,6 @@ }, "MyApiMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -370,8 +354,6 @@ }, "MyFunctionWithLambdaRequestAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -393,8 +375,6 @@ }, "MyApiMyLambdaTokenAuthNoneFunctionInvokeRoleAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -413,8 +393,6 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment57e8e73ac5" @@ -427,8 +405,6 @@ }, "MyFunctionWithNoAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -450,8 +426,6 @@ }, "MyFunctionWithDefaultAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/api_with_auth_all_minimum.json b/tests/translator/output/aws-us-gov/api_with_auth_all_minimum.json index 7ee4c5a12..7ab9dea6e 100644 --- a/tests/translator/output/aws-us-gov/api_with_auth_all_minimum.json +++ b/tests/translator/output/aws-us-gov/api_with_auth_all_minimum.json @@ -2,8 +2,6 @@ "Resources": { "MyApiWithCognitoAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -64,8 +62,6 @@ }, "MyApiWithLambdaRequestAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithLambdaRequestAuthDeploymentca86749bcd" @@ -78,8 +74,6 @@ }, "MyApiWithNotCachedLambdaRequestAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithNotCachedLambdaRequestAuthDeploymentd3b8858811" @@ -92,8 +86,6 @@ }, "MyApiWithLambdaTokenAuthMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -117,8 +109,6 @@ }, "MyAuthFn": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -142,8 +132,6 @@ }, "MyApiWithLambdaTokenAuthDeployment5192789870": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithLambdaTokenAuth" @@ -154,8 +142,6 @@ }, "MyFnRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -186,8 +172,6 @@ }, "MyApiWithCognitoAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithCognitoAuthDeployment9b695a6dd5" @@ -200,8 +184,6 @@ }, "MyFnCognitoPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -223,8 +205,6 @@ }, "MyApiWithLambdaRequestAuthMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -248,8 +228,6 @@ }, "MyApiWithNotCachedLambdaRequestAuthMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -273,8 +251,6 @@ }, "MyFnLambdaTokenPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -296,8 +272,6 @@ }, "MyApiWithNotCachedLambdaRequestAuthDeploymentd3b8858811": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithNotCachedLambdaRequestAuth" @@ -308,8 +282,6 @@ }, "MyFnLambdaRequestPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -331,8 +303,6 @@ }, "MyFnLambdaNotCachedRequestPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -354,8 +324,6 @@ }, "MyApiWithLambdaTokenAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -421,8 +389,6 @@ }, "MyApiWithLambdaRequestAuthDeploymentca86749bcd": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithLambdaRequestAuth" @@ -433,8 +399,6 @@ }, "MyUserPool": { "Type": "AWS::Cognito::UserPool", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "UsernameAttributes": [ "email" @@ -456,8 +420,6 @@ }, "MyFn": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -481,8 +443,6 @@ }, "MyAuthFnRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -513,8 +473,6 @@ }, "MyApiWithLambdaTokenAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithLambdaTokenAuthDeployment5192789870" @@ -527,8 +485,6 @@ }, "MyApiWithCognitoAuthDeployment9b695a6dd5": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithCognitoAuth" @@ -539,8 +495,6 @@ }, "MyApiWithLambdaRequestAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -607,8 +561,6 @@ }, "MyApiWithNotCachedLambdaRequestAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_with_auth_all_minimum_openapi.json b/tests/translator/output/aws-us-gov/api_with_auth_all_minimum_openapi.json index b18c185bb..d64968c4e 100644 --- a/tests/translator/output/aws-us-gov/api_with_auth_all_minimum_openapi.json +++ b/tests/translator/output/aws-us-gov/api_with_auth_all_minimum_openapi.json @@ -2,8 +2,6 @@ "Resources": { "MyApiWithCognitoAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -66,8 +64,6 @@ }, "MyApiWithLambdaRequestAuthDeployment7c3972b020": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithLambdaRequestAuth" @@ -77,8 +73,6 @@ }, "MyApiWithCognitoAuthDeploymente1765ad6c1": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithCognitoAuth" @@ -88,8 +82,6 @@ }, "MyApiWithLambdaRequestAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithLambdaRequestAuthDeployment7c3972b020" @@ -102,8 +94,6 @@ }, "MyApiWithLambdaTokenAuthMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -127,8 +117,6 @@ }, "MyApiWithLambdaTokenAuthDeploymentfc5424e34c": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithLambdaTokenAuth" @@ -138,8 +126,6 @@ }, "MyAuthFn": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -163,8 +149,6 @@ }, "MyFnRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -195,8 +179,6 @@ }, "MyApiWithCognitoAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithCognitoAuthDeploymente1765ad6c1" @@ -209,8 +191,6 @@ }, "MyFnCognitoPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -232,8 +212,6 @@ }, "MyApiWithLambdaRequestAuthMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -257,8 +235,6 @@ }, "MyFnLambdaTokenPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -280,8 +256,6 @@ }, "MyFnLambdaRequestPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -303,8 +277,6 @@ }, "MyApiWithLambdaTokenAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -372,8 +344,6 @@ }, "MyUserPool": { "Type": "AWS::Cognito::UserPool", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "UsernameAttributes": [ "email" @@ -395,8 +365,6 @@ }, "MyFn": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -420,8 +388,6 @@ }, "MyAuthFnRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -452,8 +418,6 @@ }, "MyApiWithLambdaTokenAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithLambdaTokenAuthDeploymentfc5424e34c" @@ -466,8 +430,6 @@ }, "MyApiWithLambdaRequestAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_with_auth_and_conditions_all_max.json b/tests/translator/output/aws-us-gov/api_with_auth_and_conditions_all_max.json index 788a76db4..75a72a5d6 100644 --- a/tests/translator/output/aws-us-gov/api_with_auth_and_conditions_all_max.json +++ b/tests/translator/output/aws-us-gov/api_with_auth_and_conditions_all_max.json @@ -10,8 +10,6 @@ "Resources": { "MyFunctionWithLambdaTokenAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -33,8 +31,6 @@ }, "MyApiMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -53,8 +49,6 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment5d64bc1235" @@ -67,8 +61,6 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -322,8 +314,6 @@ }, "MyApiMyLambdaTokenAuthNoneFunctionInvokeRoleAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -342,8 +332,6 @@ }, "MyFunctionWithNoAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -365,8 +353,6 @@ }, "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -390,8 +376,6 @@ }, "MyFunctionWithCognitoMultipleUserPoolsAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -413,8 +397,6 @@ }, "MyApiDeployment5d64bc1235": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -425,8 +407,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -457,8 +437,6 @@ }, "MyFunctionWithConditionalWithLambdaTokenAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -481,8 +459,6 @@ }, "MyFunctionWithConditionalWithLambdaRequestAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -505,8 +481,6 @@ }, "MyApiMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -525,8 +499,6 @@ }, "MyFunctionWithConditionalWithDefaultAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -549,8 +521,6 @@ }, "MyFunctionWithConditionalRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -582,8 +552,6 @@ }, "MyFunctionWithConditional": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { diff --git a/tests/translator/output/aws-us-gov/api_with_auth_no_default.json b/tests/translator/output/aws-us-gov/api_with_auth_no_default.json index 730bc6147..06783f5d9 100644 --- a/tests/translator/output/aws-us-gov/api_with_auth_no_default.json +++ b/tests/translator/output/aws-us-gov/api_with_auth_no_default.json @@ -2,8 +2,6 @@ "Resources": { "MyApiWithCognitoAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -59,8 +57,6 @@ }, "MyApiWithLambdaRequestAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithLambdaRequestAuthDeployment9a21d88fe2" @@ -73,8 +69,6 @@ }, "MyApiWithLambdaTokenAuthMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -98,8 +92,6 @@ }, "MyAuthFn": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -123,8 +115,6 @@ }, "MyFnRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -155,8 +145,6 @@ }, "MyApiWithCognitoAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithCognitoAuthDeployment2da3114321" @@ -169,8 +157,6 @@ }, "MyFnCognitoPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -192,8 +178,6 @@ }, "MyApiWithCognitoAuthDeployment2da3114321": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithCognitoAuth" @@ -204,8 +188,6 @@ }, "MyApiWithLambdaRequestAuthMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -229,8 +211,6 @@ }, "MyApiWithLambdaTokenAuthDeployment613e605d96": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithLambdaTokenAuth" @@ -241,8 +221,6 @@ }, "MyFnLambdaTokenPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -264,8 +242,6 @@ }, "MyFnLambdaRequestPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -287,8 +263,6 @@ }, "MyApiWithLambdaTokenAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -349,8 +323,6 @@ }, "MyUserPool": { "Type": "AWS::Cognito::UserPool", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "UsernameAttributes": [ "email" @@ -372,8 +344,6 @@ }, "MyFn": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -397,8 +367,6 @@ }, "MyAuthFnRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -429,8 +397,6 @@ }, "MyApiWithLambdaRequestAuthDeployment9a21d88fe2": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithLambdaRequestAuth" @@ -441,8 +407,6 @@ }, "MyApiWithLambdaTokenAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithLambdaTokenAuthDeployment613e605d96" @@ -455,8 +419,6 @@ }, "MyApiWithLambdaRequestAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_with_auth_with_default_scopes.json b/tests/translator/output/aws-us-gov/api_with_auth_with_default_scopes.json index bdda69853..1e0140f17 100644 --- a/tests/translator/output/aws-us-gov/api_with_auth_with_default_scopes.json +++ b/tests/translator/output/aws-us-gov/api_with_auth_with_default_scopes.json @@ -2,8 +2,6 @@ "Resources": { "MyApiWithCognitoAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -185,8 +183,6 @@ }, "MyFnCognitoDefaultScopesNonePermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -208,8 +204,6 @@ }, "MyFnCognitoDefaultAuthDefaultScopesNonePermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -231,8 +225,6 @@ }, "MyFnCognitoAuthorizerWithDefaultScopesPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -254,8 +246,6 @@ }, "MyFnCognitoDefaultScopesDefaultAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -277,8 +267,6 @@ }, "MyFnCognitoAuthorizerScopesOverwrittenPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -300,8 +288,6 @@ }, "MyApiWithCognitoAuthDeploymentba9bfa6490": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithCognitoAuth" @@ -312,8 +298,6 @@ }, "MyFnRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -344,8 +328,6 @@ }, "MyFnCognitoWithAuthNonePermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -367,8 +349,6 @@ }, "MyApiWithCognitoAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithCognitoAuthDeploymentba9bfa6490" @@ -381,8 +361,6 @@ }, "MyFn": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -406,8 +384,6 @@ }, "MyFnCognitoDefaultScopesWithOverwrittenPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/api_with_auth_with_default_scopes_openapi.json b/tests/translator/output/aws-us-gov/api_with_auth_with_default_scopes_openapi.json index 738c877ad..f1ed483fa 100644 --- a/tests/translator/output/aws-us-gov/api_with_auth_with_default_scopes_openapi.json +++ b/tests/translator/output/aws-us-gov/api_with_auth_with_default_scopes_openapi.json @@ -2,8 +2,6 @@ "Resources": { "MyApiWithCognitoAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -187,8 +185,6 @@ }, "MyFnCognitoDefaultScopesNonePermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -210,8 +206,6 @@ }, "MyFnCognitoDefaultAuthDefaultScopesNonePermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -233,8 +227,6 @@ }, "MyFnCognitoAuthorizerWithDefaultScopesPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -256,8 +248,6 @@ }, "MyApiWithCognitoAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithCognitoAuthDeploymentddb4f4405b" @@ -270,8 +260,6 @@ }, "MyFnCognitoDefaultScopesDefaultAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -293,8 +281,6 @@ }, "MyFnCognitoAuthorizerScopesOverwrittenPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -316,8 +302,6 @@ }, "MyFnRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -348,8 +332,6 @@ }, "MyFnCognitoWithAuthNonePermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -371,8 +353,6 @@ }, "MyApiWithCognitoAuthDeploymentddb4f4405b": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithCognitoAuth" @@ -382,8 +362,6 @@ }, "MyFn": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -407,8 +385,6 @@ }, "MyFnCognitoDefaultScopesWithOverwrittenPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/api_with_aws_account_blacklist.json b/tests/translator/output/aws-us-gov/api_with_aws_account_blacklist.json index 7d43d68d6..317b6255e 100644 --- a/tests/translator/output/aws-us-gov/api_with_aws_account_blacklist.json +++ b/tests/translator/output/aws-us-gov/api_with_aws_account_blacklist.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -26,8 +24,6 @@ }, "ServerlessRestApiDeployment589bc02957": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -38,8 +34,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment589bc02957" @@ -52,8 +46,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -84,8 +76,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -144,8 +134,6 @@ }, "MyFunctionApiPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/api_with_aws_account_whitelist.json b/tests/translator/output/aws-us-gov/api_with_aws_account_whitelist.json index 813c98fa2..2b0dfff75 100644 --- a/tests/translator/output/aws-us-gov/api_with_aws_account_whitelist.json +++ b/tests/translator/output/aws-us-gov/api_with_aws_account_whitelist.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -26,8 +24,6 @@ }, "ServerlessRestApiDeployment1455f86734": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -38,8 +34,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment1455f86734" @@ -52,8 +46,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -84,8 +76,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -165,8 +155,6 @@ }, "MyFunctionApiPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/api_with_aws_iam_auth_overrides.json b/tests/translator/output/aws-us-gov/api_with_aws_iam_auth_overrides.json index 3d3524455..9ff1fa9ee 100644 --- a/tests/translator/output/aws-us-gov/api_with_aws_iam_auth_overrides.json +++ b/tests/translator/output/aws-us-gov/api_with_aws_iam_auth_overrides.json @@ -2,8 +2,6 @@ "Resources": { "MyFunctionCustomInvokeRole": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -27,8 +25,6 @@ }, "MyFunctionNoneAuth": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -52,8 +48,6 @@ }, "MyFunctionNullInvokeRole": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -77,8 +71,6 @@ }, "MyApiWithAwsIamAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithAwsIamAuthDeploymentc7d4214444" @@ -91,8 +83,6 @@ }, "MyFunctionWithoutAuthRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -123,8 +113,6 @@ }, "MyFunctionCustomInvokeRoleAPI3PermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -146,8 +134,6 @@ }, "MyFunctionMyCognitoAuthAPI1PermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -169,8 +155,6 @@ }, "MyApiWithAwsIamAuthDeploymentc7d4214444": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithAwsIamAuth" @@ -181,8 +165,6 @@ }, "MyApiWithAwsIamAuthNoCallerCredentials": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -248,8 +230,6 @@ }, "MyFunctionWithoutAuthAPI2PermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -271,8 +251,6 @@ }, "MyFunctionDefaultInvokeRoleAPI3PermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -294,8 +272,6 @@ }, "MyFunctionMyCognitoAuth": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -319,8 +295,6 @@ }, "MyFunctionNullInvokeRoleRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -351,8 +325,6 @@ }, "MyFunctionNONEInvokeRole": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -376,8 +348,6 @@ }, "MyFunctionNoCallerCredentialsAPI3PermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -399,8 +369,6 @@ }, "MyFunctionNoneAuthRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -431,8 +399,6 @@ }, "MyFunctionCustomInvokeRoleRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -463,8 +429,6 @@ }, "MyFunctionCallerCredentialsOverrideAPI3PermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -486,8 +450,6 @@ }, "MyFunctionCallerCredentialsOverride": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -511,8 +473,6 @@ }, "MyFunctionWithoutAuth": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -536,8 +496,6 @@ }, "MyFunctionNullInvokeRoleAPI3PermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -559,8 +517,6 @@ }, "MyFunctionNONEInvokeRoleAPI3PermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -582,8 +538,6 @@ }, "MyFunctionNoCallerCredentialsRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -614,8 +568,6 @@ }, "MyFunctionDefaultInvokeRoleRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -646,8 +598,6 @@ }, "MyFunctionCallerCredentialsOverrideRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -678,8 +628,6 @@ }, "MyFunctionMyCognitoAuthRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -710,8 +658,6 @@ }, "MyApiWithAwsIamAuthNoCallerCredentialsProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithAwsIamAuthNoCallerCredentialsDeployment673da6c5e9" @@ -724,8 +670,6 @@ }, "MyFunctionDefaultInvokeRole": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -749,8 +693,6 @@ }, "MyFunctionNoCallerCredentials": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -774,8 +716,6 @@ }, "MyApiWithAwsIamAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -942,8 +882,6 @@ }, "MyFunctionNoneAuthAPI3PermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -965,8 +903,6 @@ }, "MyApiWithAwsIamAuthNoCallerCredentialsDeployment673da6c5e9": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithAwsIamAuthNoCallerCredentials" @@ -977,8 +913,6 @@ }, "MyFunctionNONEInvokeRoleRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-us-gov/api_with_basic_custom_domain.json b/tests/translator/output/aws-us-gov/api_with_basic_custom_domain.json index 8b056dcf4..8d04935fe 100644 --- a/tests/translator/output/aws-us-gov/api_with_basic_custom_domain.json +++ b/tests/translator/output/aws-us-gov/api_with_basic_custom_domain.json @@ -12,8 +12,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -36,8 +34,6 @@ }, "MyFunctionAnotherGetPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -59,8 +55,6 @@ }, "ApiGatewayDomainName23cdccdf9c": { "Type": "AWS::ApiGateway::DomainName", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "CertificateArn": "my-api-cert-arn", "EndpointConfiguration": { @@ -78,8 +72,6 @@ }, "MyFunctionImplicitGetPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -101,8 +93,6 @@ }, "MyAnotherApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyAnotherApiDeploymenteb8302ec1b" @@ -115,8 +105,6 @@ }, "ServerlessRestApiDeployment790a4e6aa6": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -127,8 +115,6 @@ }, "MyFunctionFetchPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -150,8 +136,6 @@ }, "MyAnotherApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -188,8 +172,6 @@ }, "MyApigetBasePathMapping": { "Type": "AWS::ApiGateway::BasePathMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BasePath": "get", "DomainName": { @@ -205,8 +187,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -237,8 +217,6 @@ }, "MyApiDeploymentb34773e43a": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -248,8 +226,6 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -298,8 +274,6 @@ }, "MyAnotherApiBasePathMapping": { "Type": "AWS::ApiGateway::BasePathMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DomainName": { "Ref": "ApiGatewayDomainNameeab65c1531" @@ -314,8 +288,6 @@ }, "ApiGatewayDomainNameeab65c1531": { "Type": "AWS::ApiGateway::DomainName", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -328,8 +300,6 @@ }, "MyApifetchBasePathMapping": { "Type": "AWS::ApiGateway::BasePathMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BasePath": "fetch", "DomainName": { @@ -345,8 +315,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment790a4e6aa6" @@ -359,8 +327,6 @@ }, "MyAnotherApiDeploymenteb8302ec1b": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyAnotherApi" @@ -370,8 +336,6 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeploymentb34773e43a" @@ -384,8 +348,6 @@ }, "ServerlessRestApiBasePathMapping": { "Type": "AWS::ApiGateway::BasePathMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DomainName": { "Ref": "ApiGatewayDomainNameeab65c1531" @@ -400,8 +362,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -438,8 +398,6 @@ }, "MyFunctionApiPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/api_with_basic_custom_domain_http.json b/tests/translator/output/aws-us-gov/api_with_basic_custom_domain_http.json index 482f92789..dff06df86 100644 --- a/tests/translator/output/aws-us-gov/api_with_basic_custom_domain_http.json +++ b/tests/translator/output/aws-us-gov/api_with_basic_custom_domain_http.json @@ -12,8 +12,6 @@ "Resources": { "MyApibasicApiMapping": { "Type": "AWS::ApiGatewayV2::ApiMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -29,8 +27,6 @@ }, "ApiGatewayDomainNameV22dbf35af54": { "Type": "AWS::ApiGatewayV2::DomainName", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DomainName": "sam-example.com", "DomainNameConfigurations": [ @@ -51,8 +47,6 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -66,8 +60,6 @@ }, "HttpApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -90,8 +82,6 @@ }, "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -113,8 +103,6 @@ }, "MyApibeginhereApiMapping": { "Type": "AWS::ApiGatewayV2::ApiMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -130,8 +118,6 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -162,8 +148,6 @@ }, "RecordSetGroup1f4f569a7e": { "Type": "AWS::Route53::RecordSetGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "HostedZoneName": "sam-example.com.", "RecordSets": [ @@ -190,8 +174,6 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_with_basic_custom_domain_intrinsics.json b/tests/translator/output/aws-us-gov/api_with_basic_custom_domain_intrinsics.json index f6b86bf2d..8d1fbf5bb 100644 --- a/tests/translator/output/aws-us-gov/api_with_basic_custom_domain_intrinsics.json +++ b/tests/translator/output/aws-us-gov/api_with_basic_custom_domain_intrinsics.json @@ -28,8 +28,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -53,8 +51,6 @@ }, "MyFunctionImplicitGetPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -77,8 +73,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment0294e6b48a" @@ -92,8 +86,6 @@ }, "MyApifetchBasePathMapping": { "Type": "AWS::ApiGateway::BasePathMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BasePath": "fetch", "DomainName": { @@ -110,8 +102,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -143,8 +133,6 @@ }, "MyApigetBasePathMapping": { "Type": "AWS::ApiGateway::BasePathMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BasePath": "get", "DomainName": { @@ -161,8 +149,6 @@ }, "ServerlessRestApiDeployment0294e6b48a": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -174,8 +160,6 @@ }, "MyApiDeployment32e59613e2": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -186,8 +170,6 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -249,8 +231,6 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment32e59613e2" @@ -264,8 +244,6 @@ }, "ApiGatewayDomainName9c93aac102": { "Type": "AWS::ApiGateway::DomainName", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -286,8 +264,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -349,8 +325,6 @@ }, "MyFunctionApiPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/api_with_basic_custom_domain_intrinsics_http.json b/tests/translator/output/aws-us-gov/api_with_basic_custom_domain_intrinsics_http.json index 89b3c2171..a54589ced 100644 --- a/tests/translator/output/aws-us-gov/api_with_basic_custom_domain_intrinsics_http.json +++ b/tests/translator/output/aws-us-gov/api_with_basic_custom_domain_intrinsics_http.json @@ -28,8 +28,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -53,8 +51,6 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -69,8 +65,6 @@ }, "ServerlessHttpApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -131,8 +125,6 @@ }, "MyFunctionImplicitGetPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -155,8 +147,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -188,8 +178,6 @@ }, "ApiGatewayDomainNameV29c93aac102": { "Type": "AWS::ApiGatewayV2::DomainName", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DomainName": { "Fn::Sub": "example-us-gov-west-1.com" @@ -213,8 +201,6 @@ }, "MyFunctionApiPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -237,8 +223,6 @@ }, "MyApigetApiMapping": { "Type": "AWS::ApiGatewayV2::ApiMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -255,8 +239,6 @@ }, "ServerlessHttpApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "ServerlessHttpApi" @@ -271,8 +253,6 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -340,8 +320,6 @@ }, "MyApifetchApiMapping": { "Type": "AWS::ApiGatewayV2::ApiMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" diff --git a/tests/translator/output/aws-us-gov/api_with_binary_media_types.json b/tests/translator/output/aws-us-gov/api_with_binary_media_types.json index b5d89c272..3e2dc7c19 100644 --- a/tests/translator/output/aws-us-gov/api_with_binary_media_types.json +++ b/tests/translator/output/aws-us-gov/api_with_binary_media_types.json @@ -8,8 +8,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -33,8 +31,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -65,8 +61,6 @@ }, "ExplicitApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -77,8 +71,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -100,8 +92,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BinaryMediaTypes": [ "image~1gif", @@ -133,8 +123,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentf117c932f7" @@ -147,8 +135,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment9746c8328e" @@ -161,8 +147,6 @@ }, "ServerlessRestApiDeployment9746c8328e": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -173,8 +157,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_with_binary_media_types_definition_body.json b/tests/translator/output/aws-us-gov/api_with_binary_media_types_definition_body.json index 1b308c002..75b031c54 100644 --- a/tests/translator/output/aws-us-gov/api_with_binary_media_types_definition_body.json +++ b/tests/translator/output/aws-us-gov/api_with_binary_media_types_definition_body.json @@ -8,8 +8,6 @@ "Resources": { "ExplicitApiManagedSwaggerProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiManagedSwaggerDeploymentfe9c2c09a2" @@ -22,8 +20,6 @@ }, "ExplicitApiManagedSwaggerDeploymentfe9c2c09a2": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApiManagedSwagger" @@ -34,8 +30,6 @@ }, "ExplicitApiDefinitionBody": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "paths": {}, @@ -81,8 +75,6 @@ }, "ExplicitApiDefinitionBodyDeployment1f26996adb": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApiDefinitionBody" @@ -93,8 +85,6 @@ }, "ExplicitApiDefinitionBodyProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDefinitionBodyDeployment1f26996adb" @@ -107,8 +97,6 @@ }, "ExplicitApiManagedSwagger": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_with_canary_setting.json b/tests/translator/output/aws-us-gov/api_with_canary_setting.json index 208d558b6..d33fda88e 100644 --- a/tests/translator/output/aws-us-gov/api_with_canary_setting.json +++ b/tests/translator/output/aws-us-gov/api_with_canary_setting.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -82,8 +76,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -101,8 +93,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "CanarySetting": { "PercentTraffic": 100, @@ -123,8 +113,6 @@ }, "ServerlessRestApiDeployment5b2cb4ba8f": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -135,8 +123,6 @@ }, "ExplicitApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -147,8 +133,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "CanarySetting": { "PercentTraffic": 100, @@ -169,8 +153,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_with_cors.json b/tests/translator/output/aws-us-gov/api_with_cors.json index 04e531295..369d19951 100644 --- a/tests/translator/output/aws-us-gov/api_with_cors.json +++ b/tests/translator/output/aws-us-gov/api_with_cors.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ImplicitApiFunctionAnyApiPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -82,8 +76,6 @@ }, "ServerlessRestApiDeployment1754a26207": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -94,8 +86,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -240,8 +230,6 @@ }, "GetHtmlFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -272,8 +260,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment1754a26207" @@ -286,8 +272,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment3a5a78688c" @@ -300,8 +284,6 @@ }, "RestApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -332,8 +314,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -355,8 +335,6 @@ }, "ExplicitApiDeployment3a5a78688c": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -367,8 +345,6 @@ }, "RestApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -392,8 +368,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -538,8 +512,6 @@ }, "GetHtmlFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { diff --git a/tests/translator/output/aws-us-gov/api_with_cors_and_auth_no_preflight_auth.json b/tests/translator/output/aws-us-gov/api_with_cors_and_auth_no_preflight_auth.json index bd5d23304..9492ea146 100644 --- a/tests/translator/output/aws-us-gov/api_with_cors_and_auth_no_preflight_auth.json +++ b/tests/translator/output/aws-us-gov/api_with_cors_and_auth_no_preflight_auth.json @@ -2,8 +2,6 @@ "Resources": { "ServerlessApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -125,8 +123,6 @@ }, "ApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -157,8 +153,6 @@ }, "ServerlessApiDeployment0aae939ae6": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessApi" @@ -169,8 +163,6 @@ }, "ServerlessApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessApiDeployment0aae939ae6" @@ -183,8 +175,6 @@ }, "ApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -206,8 +196,6 @@ }, "ApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -231,8 +219,6 @@ }, "MyAuthFn": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -256,8 +242,6 @@ }, "ApiFunctionPostHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -279,8 +263,6 @@ }, "MyAuthFnRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -311,8 +293,6 @@ }, "ServerlessApiMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/api_with_cors_and_auth_preflight_auth.json b/tests/translator/output/aws-us-gov/api_with_cors_and_auth_preflight_auth.json index ead4ea685..8130f7908 100644 --- a/tests/translator/output/aws-us-gov/api_with_cors_and_auth_preflight_auth.json +++ b/tests/translator/output/aws-us-gov/api_with_cors_and_auth_preflight_auth.json @@ -2,8 +2,6 @@ "Resources": { "ServerlessApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -130,8 +128,6 @@ }, "ApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -162,8 +158,6 @@ }, "ServerlessApiDeployment1aab931299": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessApi" @@ -174,8 +168,6 @@ }, "ApiFunctionPostHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -197,8 +189,6 @@ }, "ApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -220,8 +210,6 @@ }, "ApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -245,8 +233,6 @@ }, "MyAuthFn": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -270,8 +256,6 @@ }, "MyAuthFnRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -302,8 +286,6 @@ }, "ServerlessApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessApiDeployment1aab931299" @@ -316,8 +298,6 @@ }, "ServerlessApiMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/api_with_cors_and_conditions_no_definitionbody.json b/tests/translator/output/aws-us-gov/api_with_cors_and_conditions_no_definitionbody.json index fde7ba7b5..035b35918 100644 --- a/tests/translator/output/aws-us-gov/api_with_cors_and_conditions_no_definitionbody.json +++ b/tests/translator/output/aws-us-gov/api_with_cors_and_conditions_no_definitionbody.json @@ -11,8 +11,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -37,8 +35,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -70,8 +66,6 @@ }, "ImplicitApiFunctionPostHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -94,8 +88,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentc140480269" @@ -108,8 +100,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -238,8 +228,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -262,8 +250,6 @@ }, "ExplicitApiDeploymentc140480269": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -274,8 +260,6 @@ }, "ImplicitApiFunction2Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -306,8 +290,6 @@ }, "ImplicitApiFunction2DeleteHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -329,8 +311,6 @@ }, "ImplicitApiFunction2": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { diff --git a/tests/translator/output/aws-us-gov/api_with_cors_and_only_credentials_false.json b/tests/translator/output/aws-us-gov/api_with_cors_and_only_credentials_false.json index 0453c8073..13650f845 100644 --- a/tests/translator/output/aws-us-gov/api_with_cors_and_only_credentials_false.json +++ b/tests/translator/output/aws-us-gov/api_with_cors_and_only_credentials_false.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment398246867a" @@ -73,8 +67,6 @@ }, "ExplicitApiDeployment398246867a": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -85,8 +77,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_with_cors_and_only_headers.json b/tests/translator/output/aws-us-gov/api_with_cors_and_only_headers.json index 6201d9d4d..cbdf27d25 100644 --- a/tests/translator/output/aws-us-gov/api_with_cors_and_only_headers.json +++ b/tests/translator/output/aws-us-gov/api_with_cors_and_only_headers.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ServerlessRestApiDeployment8e16bddf6b": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -71,8 +65,6 @@ }, "ImplicitApiFunctionPostHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -94,8 +86,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment03e65d7ea2" @@ -108,8 +98,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment8e16bddf6b" @@ -122,8 +110,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -260,8 +246,6 @@ }, "ExplicitApiDeployment03e65d7ea2": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -272,8 +256,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -295,8 +277,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_with_cors_and_only_maxage.json b/tests/translator/output/aws-us-gov/api_with_cors_and_only_maxage.json index 9dfe45d26..bd02c3bea 100644 --- a/tests/translator/output/aws-us-gov/api_with_cors_and_only_maxage.json +++ b/tests/translator/output/aws-us-gov/api_with_cors_and_only_maxage.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ExplicitApiDeploymentb61cfb7d60": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -71,8 +65,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentb61cfb7d60" @@ -85,8 +77,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_with_cors_and_only_methods.json b/tests/translator/output/aws-us-gov/api_with_cors_and_only_methods.json index 6eb351bf1..1955ea1fe 100644 --- a/tests/translator/output/aws-us-gov/api_with_cors_and_only_methods.json +++ b/tests/translator/output/aws-us-gov/api_with_cors_and_only_methods.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -82,8 +76,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment50aa0cc33c" @@ -96,8 +88,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -174,8 +164,6 @@ }, "ServerlessRestApiDeployment50aa0cc33c": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" diff --git a/tests/translator/output/aws-us-gov/api_with_cors_and_only_origins.json b/tests/translator/output/aws-us-gov/api_with_cors_and_only_origins.json index 61351a75d..8ab271326 100644 --- a/tests/translator/output/aws-us-gov/api_with_cors_and_only_origins.json +++ b/tests/translator/output/aws-us-gov/api_with_cors_and_only_origins.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ExplicitApiDeploymenta7a992bbb6": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -71,8 +65,6 @@ }, "ImplicitApiFunctionPostHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -94,8 +86,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymenta7a992bbb6" @@ -108,8 +98,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentc934a493f3" @@ -122,8 +110,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -252,8 +238,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -275,8 +259,6 @@ }, "ServerlessRestApiDeploymentc934a493f3": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -287,8 +269,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_with_cors_no_definitionbody.json b/tests/translator/output/aws-us-gov/api_with_cors_no_definitionbody.json index 29a23cac9..e384a6395 100644 --- a/tests/translator/output/aws-us-gov/api_with_cors_no_definitionbody.json +++ b/tests/translator/output/aws-us-gov/api_with_cors_no_definitionbody.json @@ -3,8 +3,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -26,8 +24,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -56,8 +52,6 @@ }, "ImplicitApiFunctionPostHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -79,8 +73,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -102,8 +94,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -190,8 +180,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentc934a493f3" @@ -204,8 +192,6 @@ }, "ExplicitApiDeploymentc934a493f3": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" diff --git a/tests/translator/output/aws-us-gov/api_with_cors_openapi_3.json b/tests/translator/output/aws-us-gov/api_with_cors_openapi_3.json index ba8c6ed60..a4451857f 100644 --- a/tests/translator/output/aws-us-gov/api_with_cors_openapi_3.json +++ b/tests/translator/output/aws-us-gov/api_with_cors_openapi_3.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ImplicitApiFunctionAnyApiPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -82,8 +76,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -228,8 +220,6 @@ }, "GetHtmlFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -260,8 +250,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment8493e7adfe" @@ -274,8 +262,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment8cc53ffaa5" @@ -288,8 +274,6 @@ }, "RestApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -320,8 +304,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -343,8 +325,6 @@ }, "ExplicitApiDeployment8cc53ffaa5": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -354,8 +334,6 @@ }, "RestApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -379,8 +357,6 @@ }, "ServerlessRestApiDeployment8493e7adfe": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -390,8 +366,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -532,8 +506,6 @@ }, "GetHtmlFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { diff --git a/tests/translator/output/aws-us-gov/api_with_custom_domain_route53.json b/tests/translator/output/aws-us-gov/api_with_custom_domain_route53.json index aebd2aafd..362045c0b 100644 --- a/tests/translator/output/aws-us-gov/api_with_custom_domain_route53.json +++ b/tests/translator/output/aws-us-gov/api_with_custom_domain_route53.json @@ -12,8 +12,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -36,8 +34,6 @@ }, "MyFunctionFetchPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -59,8 +55,6 @@ }, "MyApiDeployment1deeaff693": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -70,8 +64,6 @@ }, "RecordSetGroupbd00d962a4": { "Type": "AWS::Route53::RecordSetGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "HostedZoneId": "ZQ1UAL4EFZVME", "RecordSets": [ @@ -106,8 +98,6 @@ }, "MyApioneBasePathMapping": { "Type": "AWS::ApiGateway::BasePathMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BasePath": "one", "DomainName": { @@ -123,8 +113,6 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment1deeaff693" @@ -137,8 +125,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -169,8 +155,6 @@ }, "ApiGatewayDomainName0caaf24ab1": { "Type": "AWS::ApiGateway::DomainName", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "CertificateArn": "cert-arn-in-us-east-1", "EndpointConfiguration": { @@ -183,8 +167,6 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_with_custom_domain_route53_hosted_zone_name.json b/tests/translator/output/aws-us-gov/api_with_custom_domain_route53_hosted_zone_name.json index 906499d04..5445e4f69 100644 --- a/tests/translator/output/aws-us-gov/api_with_custom_domain_route53_hosted_zone_name.json +++ b/tests/translator/output/aws-us-gov/api_with_custom_domain_route53_hosted_zone_name.json @@ -12,8 +12,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -36,8 +34,6 @@ }, "MyFunctionFetchPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -59,8 +55,6 @@ }, "MyApiDeployment501f2306c4": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -70,8 +64,6 @@ }, "MyApioneBasePathMapping": { "Type": "AWS::ApiGateway::BasePathMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BasePath": "one", "DomainName": { @@ -87,8 +79,6 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment501f2306c4" @@ -101,8 +91,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -133,8 +121,6 @@ }, "ApiGatewayDomainName0caaf24ab1": { "Type": "AWS::ApiGateway::DomainName", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "CertificateArn": "cert-arn-in-us-east-1", "EndpointConfiguration": { @@ -147,8 +133,6 @@ }, "RecordSetGroup456ebaf280": { "Type": "AWS::Route53::RecordSetGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "HostedZoneName": "www.my-domain.com.", "RecordSets": [ @@ -183,8 +167,6 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_with_custom_domain_route53_hosted_zone_name_http.json b/tests/translator/output/aws-us-gov/api_with_custom_domain_route53_hosted_zone_name_http.json index 0c052cd00..f952f03ad 100644 --- a/tests/translator/output/aws-us-gov/api_with_custom_domain_route53_hosted_zone_name_http.json +++ b/tests/translator/output/aws-us-gov/api_with_custom_domain_route53_hosted_zone_name_http.json @@ -12,8 +12,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -36,8 +34,6 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -51,8 +47,6 @@ }, "MyApioneApiMapping": { "Type": "AWS::ApiGatewayV2::ApiMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -68,8 +62,6 @@ }, "ApiGatewayDomainNameV20caaf24ab1": { "Type": "AWS::ApiGatewayV2::DomainName", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DomainName": "example.com", "DomainNameConfigurations": [ @@ -85,8 +77,6 @@ }, "RecordSetGroup456ebaf280": { "Type": "AWS::Route53::RecordSetGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "HostedZoneName": "www.my-domain.com.", "RecordSets": [ @@ -113,8 +103,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -145,8 +133,6 @@ }, "MyFunctionFetchPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -168,8 +154,6 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_with_custom_domain_route53_http.json b/tests/translator/output/aws-us-gov/api_with_custom_domain_route53_http.json index 0fb60f59e..c92bc2242 100644 --- a/tests/translator/output/aws-us-gov/api_with_custom_domain_route53_http.json +++ b/tests/translator/output/aws-us-gov/api_with_custom_domain_route53_http.json @@ -12,8 +12,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -36,8 +34,6 @@ }, "MyApioneApiMapping": { "Type": "AWS::ApiGatewayV2::ApiMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -53,8 +49,6 @@ }, "RecordSetGroupbd00d962a4": { "Type": "AWS::Route53::RecordSetGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "HostedZoneId": "ZQ1UAL4EFZVME", "RecordSets": [ @@ -99,8 +93,6 @@ }, "ApiGatewayDomainNameV20caaf24ab1": { "Type": "AWS::ApiGatewayV2::DomainName", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DomainName": "example.com", "DomainNameConfigurations": [ @@ -116,8 +108,6 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -131,8 +121,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -163,8 +151,6 @@ }, "MyFunctionFetchPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -186,8 +172,6 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_with_default_aws_iam_auth.json b/tests/translator/output/aws-us-gov/api_with_default_aws_iam_auth.json index 4a84bfebc..9d43ce2ae 100644 --- a/tests/translator/output/aws-us-gov/api_with_default_aws_iam_auth.json +++ b/tests/translator/output/aws-us-gov/api_with_default_aws_iam_auth.json @@ -2,8 +2,6 @@ "Resources": { "MyFunctionWithAwsIamAuth": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -27,8 +25,6 @@ }, "MyApiWithAwsIamAuthDeploymentf9a4964a7d": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithAwsIamAuth" @@ -39,8 +35,6 @@ }, "MyFunctionWithAwsIamAuthMyApiWithAwsIamAuthPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -62,8 +56,6 @@ }, "MyApiWithAwsIamAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithAwsIamAuthDeploymentf9a4964a7d" @@ -76,8 +68,6 @@ }, "MyApiWithAwsIamAuthAndDefaultInvokeRoleProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithAwsIamAuthAndDefaultInvokeRoleDeploymentce2dead7de" @@ -90,8 +80,6 @@ }, "MyFunctionWithAwsIamAuthMyApiWithAwsIamAuthAndDefaultInvokeRolePermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -113,8 +101,6 @@ }, "MyApiWithAwsIamAuthAndDefaultInvokeRoleDeploymentce2dead7de": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithAwsIamAuthAndDefaultInvokeRole" @@ -125,8 +111,6 @@ }, "MyApiWithAwsIamAuthAndCustomInvokeRoleDeploymentb31aa75bb2": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithAwsIamAuthAndCustomInvokeRole" @@ -137,8 +121,6 @@ }, "MyApiWithAwsIamAuthAndCustomInvokeRole": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -189,8 +171,6 @@ }, "MyApiWithAwsIamAuthAndCustomInvokeRoleProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithAwsIamAuthAndCustomInvokeRoleDeploymentb31aa75bb2" @@ -203,8 +183,6 @@ }, "MyApiWithAwsIamAuthAndDefaultInvokeRole": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -255,8 +233,6 @@ }, "MyApiWithAwsIamAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -307,8 +283,6 @@ }, "MyFunctionWithAwsIamAuthMyApiWithAwsIamAuthAndCustomInvokeRolePermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -330,8 +304,6 @@ }, "MyFunctionWithAwsIamAuthRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-us-gov/api_with_default_aws_iam_auth_and_no_auth_route.json b/tests/translator/output/aws-us-gov/api_with_default_aws_iam_auth_and_no_auth_route.json index b03b3b2cc..0b0daf61f 100644 --- a/tests/translator/output/aws-us-gov/api_with_default_aws_iam_auth_and_no_auth_route.json +++ b/tests/translator/output/aws-us-gov/api_with_default_aws_iam_auth_and_no_auth_route.json @@ -2,8 +2,6 @@ "Resources": { "MyFunctionWithAwsIamAuth": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -27,8 +25,6 @@ }, "MyFunctionWithAwsIamAuthMyApiWithNoAuthPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -50,8 +46,6 @@ }, "MyFunctionWithAwsIamAuthMyApiWithAwsIamAuthPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -73,8 +67,6 @@ }, "MyApiWithAwsIamAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -140,8 +132,6 @@ }, "MyApiWithAwsIamAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithAwsIamAuthDeploymentce96ce9f89" @@ -154,8 +144,6 @@ }, "MyApiWithAwsIamAuthDeploymentce96ce9f89": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithAwsIamAuth" @@ -166,8 +154,6 @@ }, "MyFunctionWithAwsIamAuthRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-us-gov/api_with_gateway_responses.json b/tests/translator/output/aws-us-gov/api_with_gateway_responses.json index 9df713cd8..936b9c68c 100644 --- a/tests/translator/output/aws-us-gov/api_with_gateway_responses.json +++ b/tests/translator/output/aws-us-gov/api_with_gateway_responses.json @@ -2,8 +2,6 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "ExplicitApiDeployment929d2126a7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -39,8 +35,6 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -71,8 +65,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -120,8 +112,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment929d2126a7" @@ -134,8 +124,6 @@ }, "FunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/api_with_gateway_responses_all.json b/tests/translator/output/aws-us-gov/api_with_gateway_responses_all.json index e5f0ea5e6..599af342c 100644 --- a/tests/translator/output/aws-us-gov/api_with_gateway_responses_all.json +++ b/tests/translator/output/aws-us-gov/api_with_gateway_responses_all.json @@ -2,8 +2,6 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "ExplicitApiDeployment42329c77b0": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -39,8 +35,6 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -71,8 +65,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -129,8 +121,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment42329c77b0" @@ -143,8 +133,6 @@ }, "FunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/api_with_gateway_responses_all_openapi_3.json b/tests/translator/output/aws-us-gov/api_with_gateway_responses_all_openapi_3.json index e587bf33d..67623b474 100644 --- a/tests/translator/output/aws-us-gov/api_with_gateway_responses_all_openapi_3.json +++ b/tests/translator/output/aws-us-gov/api_with_gateway_responses_all_openapi_3.json @@ -2,8 +2,6 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -117,8 +111,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment0f8408588e" @@ -131,8 +123,6 @@ }, "FunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -154,8 +144,6 @@ }, "ExplicitApiDeployment0f8408588e": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" diff --git a/tests/translator/output/aws-us-gov/api_with_gateway_responses_implicit.json b/tests/translator/output/aws-us-gov/api_with_gateway_responses_implicit.json index c3743dba2..8ba952ee4 100644 --- a/tests/translator/output/aws-us-gov/api_with_gateway_responses_implicit.json +++ b/tests/translator/output/aws-us-gov/api_with_gateway_responses_implicit.json @@ -2,8 +2,6 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment929d2126a7" @@ -73,8 +67,6 @@ }, "ServerlessRestApiDeployment929d2126a7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -85,8 +77,6 @@ }, "FunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -108,8 +98,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_with_gateway_responses_minimal.json b/tests/translator/output/aws-us-gov/api_with_gateway_responses_minimal.json index 4d610155f..ea9059e27 100644 --- a/tests/translator/output/aws-us-gov/api_with_gateway_responses_minimal.json +++ b/tests/translator/output/aws-us-gov/api_with_gateway_responses_minimal.json @@ -2,8 +2,6 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -103,8 +97,6 @@ }, "ExplicitApiDeployment40cf320ad7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -115,8 +107,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment40cf320ad7" @@ -129,8 +119,6 @@ }, "FunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/api_with_gateway_responses_string_status_code.json b/tests/translator/output/aws-us-gov/api_with_gateway_responses_string_status_code.json index 9df713cd8..936b9c68c 100644 --- a/tests/translator/output/aws-us-gov/api_with_gateway_responses_string_status_code.json +++ b/tests/translator/output/aws-us-gov/api_with_gateway_responses_string_status_code.json @@ -2,8 +2,6 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "ExplicitApiDeployment929d2126a7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -39,8 +35,6 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -71,8 +65,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -120,8 +112,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment929d2126a7" @@ -134,8 +124,6 @@ }, "FunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/api_with_if_conditional_with_resource_policy.json b/tests/translator/output/aws-us-gov/api_with_if_conditional_with_resource_policy.json index c2fda349f..b0bd1013b 100644 --- a/tests/translator/output/aws-us-gov/api_with_if_conditional_with_resource_policy.json +++ b/tests/translator/output/aws-us-gov/api_with_if_conditional_with_resource_policy.json @@ -10,8 +10,6 @@ "Resources": { "ExplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -35,8 +33,6 @@ }, "ExplicitApiFunctionPutHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -58,8 +54,6 @@ }, "ExplicitApiDeploymente252ad8b51": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -70,8 +64,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -149,8 +141,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymente252ad8b51" @@ -163,8 +153,6 @@ }, "ExplicitApiFunctionPostHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -186,8 +174,6 @@ }, "ExplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -218,8 +204,6 @@ }, "ExplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/api_with_incompatible_stage_name.json b/tests/translator/output/aws-us-gov/api_with_incompatible_stage_name.json index e78c45228..4f1c1e6b3 100644 --- a/tests/translator/output/aws-us-gov/api_with_incompatible_stage_name.json +++ b/tests/translator/output/aws-us-gov/api_with_incompatible_stage_name.json @@ -2,8 +2,6 @@ "Resources": { "UnderscoreApiStageb34d3ad84e": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "UnderscoreApiDeployment94459366c6" @@ -16,8 +14,6 @@ }, "UnderscoreApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -74,8 +70,6 @@ }, "UnderscoreFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -106,8 +100,6 @@ }, "HyphenFunctionGetHtmlPermission0c8ecc62cb": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -127,8 +119,6 @@ }, "HyphenApiStage0c8ecc62cb": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "HyphenApiDeploymente60ebb9f56" @@ -141,8 +131,6 @@ }, "UnderscoreFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -166,8 +154,6 @@ }, "UnderscoreFunctionGetHtmlPermissionb34d3ad84e": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -187,8 +173,6 @@ }, "HyphenFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -212,8 +196,6 @@ }, "HyphenApiDeploymente60ebb9f56": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "HyphenApi" @@ -224,8 +206,6 @@ }, "UnderscoreApiDeployment94459366c6": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "UnderscoreApi" @@ -236,8 +216,6 @@ }, "HyphenApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -294,8 +272,6 @@ }, "HyphenFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-us-gov/api_with_ip_range_blacklist.json b/tests/translator/output/aws-us-gov/api_with_ip_range_blacklist.json index 095a84f0c..d89da5b7f 100644 --- a/tests/translator/output/aws-us-gov/api_with_ip_range_blacklist.json +++ b/tests/translator/output/aws-us-gov/api_with_ip_range_blacklist.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -26,8 +24,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment7a90608509" @@ -40,8 +36,6 @@ }, "ServerlessRestApiDeployment7a90608509": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -52,8 +46,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -84,8 +76,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -183,8 +173,6 @@ }, "MyFunctionApiPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/api_with_ip_range_whitelist.json b/tests/translator/output/aws-us-gov/api_with_ip_range_whitelist.json index 9c4d1f10c..5750d7cf7 100644 --- a/tests/translator/output/aws-us-gov/api_with_ip_range_whitelist.json +++ b/tests/translator/output/aws-us-gov/api_with_ip_range_whitelist.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -26,8 +24,6 @@ }, "ServerlessRestApiDeployment05e180d91b": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -38,8 +34,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment05e180d91b" @@ -52,8 +46,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -84,8 +76,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -186,8 +176,6 @@ }, "MyFunctionApiPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/api_with_method_aws_iam_auth.json b/tests/translator/output/aws-us-gov/api_with_method_aws_iam_auth.json index 2fe14ee94..730d83d09 100644 --- a/tests/translator/output/aws-us-gov/api_with_method_aws_iam_auth.json +++ b/tests/translator/output/aws-us-gov/api_with_method_aws_iam_auth.json @@ -2,8 +2,6 @@ "Resources": { "MyFunctionWithAwsIamAuthMyApiWithAwsIamAuthPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -25,8 +23,6 @@ }, "MyApiWithoutAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -109,8 +105,6 @@ }, "MyFunctionWithAwsIamAuthMyApiWithAwsIamAuthAndDefaultInvokeRolePermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -132,8 +126,6 @@ }, "MyFunctionWithAwsIamAuth": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -157,8 +149,6 @@ }, "MyApiWithoutAuthDeploymentd7b0de15e2": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithoutAuth" @@ -169,8 +159,6 @@ }, "MyApiWithoutAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithoutAuthDeploymentd7b0de15e2" @@ -183,8 +171,6 @@ }, "MyFunctionWithAwsIamAuthMyApiWithAwsIamAuthAndCustomInvokeRolePermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -206,8 +192,6 @@ }, "MyFunctionWithAwsIamAuthRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-us-gov/api_with_method_settings.json b/tests/translator/output/aws-us-gov/api_with_method_settings.json index f288864e9..58f29e309 100644 --- a/tests/translator/output/aws-us-gov/api_with_method_settings.json +++ b/tests/translator/output/aws-us-gov/api_with_method_settings.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -82,8 +76,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -101,8 +93,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "MethodSettings": [ { @@ -124,8 +114,6 @@ }, "ServerlessRestApiDeployment5b2cb4ba8f": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -136,8 +124,6 @@ }, "ExplicitApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -148,8 +134,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "MethodSettings": [ { @@ -171,8 +155,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_with_minimum_compression_size.json b/tests/translator/output/aws-us-gov/api_with_minimum_compression_size.json index cffb43bcc..5dc49fdfe 100644 --- a/tests/translator/output/aws-us-gov/api_with_minimum_compression_size.json +++ b/tests/translator/output/aws-us-gov/api_with_minimum_compression_size.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -82,8 +76,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "MinimumCompressionSize": 256, "EndpointConfiguration": { @@ -102,8 +94,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentf117c932f7" @@ -116,8 +106,6 @@ }, "ServerlessRestApiDeployment5b2cb4ba8f": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -128,8 +116,6 @@ }, "ExplicitApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -140,8 +126,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment5b2cb4ba8f" @@ -154,8 +138,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_with_open_api_version.json b/tests/translator/output/aws-us-gov/api_with_open_api_version.json index 23ebe2f86..1ddc31fc3 100644 --- a/tests/translator/output/aws-us-gov/api_with_open_api_version.json +++ b/tests/translator/output/aws-us-gov/api_with_open_api_version.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -82,8 +76,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -107,8 +99,6 @@ }, "ExplicitApiDeploymentd9a0f2ae4f": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -118,8 +108,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymenta4ffcdf019" @@ -132,8 +120,6 @@ }, "ServerlessRestApiDeploymenta4ffcdf019": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -143,8 +129,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -219,8 +203,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentd9a0f2ae4f" diff --git a/tests/translator/output/aws-us-gov/api_with_open_api_version_2.json b/tests/translator/output/aws-us-gov/api_with_open_api_version_2.json index ce4b2d798..49655c0d2 100644 --- a/tests/translator/output/aws-us-gov/api_with_open_api_version_2.json +++ b/tests/translator/output/aws-us-gov/api_with_open_api_version_2.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -82,8 +76,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -107,8 +99,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment4154e1c30c" @@ -121,8 +111,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment2ce765616b" @@ -135,8 +123,6 @@ }, "ExplicitApiDeployment4154e1c30c": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -146,8 +132,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -224,8 +208,6 @@ }, "ServerlessRestApiDeployment2ce765616b": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" diff --git a/tests/translator/output/aws-us-gov/api_with_openapi_definition_body_no_flag.json b/tests/translator/output/aws-us-gov/api_with_openapi_definition_body_no_flag.json index 2c8b50f08..ac3cc1ea5 100644 --- a/tests/translator/output/aws-us-gov/api_with_openapi_definition_body_no_flag.json +++ b/tests/translator/output/aws-us-gov/api_with_openapi_definition_body_no_flag.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ExplicitApiDeployment9252467a1e": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -71,8 +65,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -136,8 +128,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -155,8 +145,6 @@ }, "ExplicitApiSomeStageStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -174,8 +162,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -197,8 +183,6 @@ }, "ServerlessRestApiDeploymentc969c99f9d": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -209,8 +193,6 @@ }, "MyUserPool": { "Type": "AWS::Cognito::UserPool", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "UsernameAttributes": [ "email" @@ -232,8 +214,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_with_path_parameters.json b/tests/translator/output/aws-us-gov/api_with_path_parameters.json index b89ecce01..da74d7fc9 100644 --- a/tests/translator/output/aws-us-gov/api_with_path_parameters.json +++ b/tests/translator/output/aws-us-gov/api_with_path_parameters.json @@ -2,8 +2,6 @@ "Resources": { "HtmlFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -34,8 +32,6 @@ }, "HtmlApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "HtmlApiDeploymentf117c932f7" @@ -48,8 +44,6 @@ }, "HtmlFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -69,8 +63,6 @@ }, "HtmlApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "HtmlApi" @@ -81,8 +73,6 @@ }, "HtmlApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -100,8 +90,6 @@ }, "HtmlFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-us-gov/api_with_resource_policy.json b/tests/translator/output/aws-us-gov/api_with_resource_policy.json index fd3c9425d..086f0655d 100644 --- a/tests/translator/output/aws-us-gov/api_with_resource_policy.json +++ b/tests/translator/output/aws-us-gov/api_with_resource_policy.json @@ -2,8 +2,6 @@ "Resources": { "ExplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "ExplicitApiFunctionPutHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -50,8 +46,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -121,8 +115,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymentb5a112ecdf" @@ -135,8 +127,6 @@ }, "ExplicitApiFunctionPostHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -158,8 +148,6 @@ }, "ExplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -190,8 +178,6 @@ }, "ExplicitApiDeploymentb5a112ecdf": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -202,8 +188,6 @@ }, "ExplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/api_with_resource_policy_global.json b/tests/translator/output/aws-us-gov/api_with_resource_policy_global.json index 2ecfb4342..b690b0271 100644 --- a/tests/translator/output/aws-us-gov/api_with_resource_policy_global.json +++ b/tests/translator/output/aws-us-gov/api_with_resource_policy_global.json @@ -16,8 +16,6 @@ "Resources": { "AnotherApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -61,8 +59,6 @@ }, "ExplicitApiDeploymenta5a5c4e3ff": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -73,8 +69,6 @@ }, "ExplicitApiStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeploymenta5a5c4e3ff" @@ -89,8 +83,6 @@ }, "ExplicitApiFunctionGetHtmlPermissionStage": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -112,8 +104,6 @@ }, "AnotherApiDeploymentfdf1387e0a": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "AnotherApi" @@ -124,8 +114,6 @@ }, "ExplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -149,8 +137,6 @@ }, "ExplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -181,8 +167,6 @@ }, "AnotherApiStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "AnotherApiDeploymentfdf1387e0a" @@ -197,8 +181,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_with_resource_policy_global_implicit.json b/tests/translator/output/aws-us-gov/api_with_resource_policy_global_implicit.json index 46c1cda89..fcfb7e108 100644 --- a/tests/translator/output/aws-us-gov/api_with_resource_policy_global_implicit.json +++ b/tests/translator/output/aws-us-gov/api_with_resource_policy_global_implicit.json @@ -2,8 +2,6 @@ "Resources": { "MinimalFunctionAddItemPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -25,8 +23,6 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -57,8 +53,6 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -82,8 +76,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment9558094c1e" @@ -96,8 +88,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -151,8 +141,6 @@ }, "ServerlessRestApiDeployment9558094c1e": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" diff --git a/tests/translator/output/aws-us-gov/api_with_resource_refs.json b/tests/translator/output/aws-us-gov/api_with_resource_refs.json index efc84bc20..f54274e54 100644 --- a/tests/translator/output/aws-us-gov/api_with_resource_refs.json +++ b/tests/translator/output/aws-us-gov/api_with_resource_refs.json @@ -24,8 +24,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -49,8 +47,6 @@ }, "MyApiDeployment359f256a3b": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -61,8 +57,6 @@ }, "MyApifooStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment359f256a3b" @@ -75,8 +69,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment2657ea030d" @@ -89,8 +81,6 @@ }, "MyFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -112,8 +102,6 @@ }, "ServerlessRestApiDeployment2657ea030d": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -124,8 +112,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -156,8 +142,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -194,8 +178,6 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "this": "is", diff --git a/tests/translator/output/aws-us-gov/api_with_source_vpc_blacklist.json b/tests/translator/output/aws-us-gov/api_with_source_vpc_blacklist.json index d6091c730..349d33670 100644 --- a/tests/translator/output/aws-us-gov/api_with_source_vpc_blacklist.json +++ b/tests/translator/output/aws-us-gov/api_with_source_vpc_blacklist.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -26,8 +24,6 @@ }, "ServerlessRestApiDeployment8123e1b4d0": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -38,8 +34,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment8123e1b4d0" @@ -52,8 +46,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -84,8 +76,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -164,8 +154,6 @@ }, "MyFunctionApiPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/api_with_source_vpc_whitelist.json b/tests/translator/output/aws-us-gov/api_with_source_vpc_whitelist.json index 7b2502476..f6b28aa07 100644 --- a/tests/translator/output/aws-us-gov/api_with_source_vpc_whitelist.json +++ b/tests/translator/output/aws-us-gov/api_with_source_vpc_whitelist.json @@ -8,8 +8,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -32,8 +30,6 @@ }, "MyFunctionFetchPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -55,8 +51,6 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment5332c373d4" @@ -69,8 +63,6 @@ }, "MyApiDeployment5332c373d4": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -81,8 +73,6 @@ }, "ServerlessRestApiDeploymente6268e43cf": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -93,8 +83,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymente6268e43cf" @@ -107,8 +95,6 @@ }, "MyFunctionApiPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -130,8 +116,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -162,8 +146,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -293,8 +275,6 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/api_with_stage_tags.json b/tests/translator/output/aws-us-gov/api_with_stage_tags.json index ad7510546..1e9912886 100644 --- a/tests/translator/output/aws-us-gov/api_with_stage_tags.json +++ b/tests/translator/output/aws-us-gov/api_with_stage_tags.json @@ -8,8 +8,6 @@ "Resources": { "MyApiWithStageTagsDeployment5332c373d4": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithStageTags" @@ -20,8 +18,6 @@ }, "MyApiWithStageTags": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -45,8 +41,6 @@ }, "MyApiWithStageTagsProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithStageTagsDeployment5332c373d4" diff --git a/tests/translator/output/aws-us-gov/api_with_swagger_and_openapi_with_auth.json b/tests/translator/output/aws-us-gov/api_with_swagger_and_openapi_with_auth.json index ae736058d..898e3ae3b 100644 --- a/tests/translator/output/aws-us-gov/api_with_swagger_and_openapi_with_auth.json +++ b/tests/translator/output/aws-us-gov/api_with_swagger_and_openapi_with_auth.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -123,8 +117,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -142,8 +134,6 @@ }, "ExplicitApiSomeStageStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -161,8 +151,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -184,8 +172,6 @@ }, "ServerlessRestApiDeploymentc969c99f9d": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -196,8 +182,6 @@ }, "MyUserPool": { "Type": "AWS::Cognito::UserPool", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "UsernameAttributes": [ "email" @@ -219,8 +203,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -282,8 +264,6 @@ }, "ExplicitApiDeployment7c4f7dda23": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" diff --git a/tests/translator/output/aws-us-gov/api_with_usageplans.json b/tests/translator/output/aws-us-gov/api_with_usageplans.json index eefe8c4c0..bda4c204a 100644 --- a/tests/translator/output/aws-us-gov/api_with_usageplans.json +++ b/tests/translator/output/aws-us-gov/api_with_usageplans.json @@ -40,8 +40,6 @@ "Resources": { "MyFunctionThreeRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -72,8 +70,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentd197b03bdf" @@ -86,8 +82,6 @@ }, "MyApiTwoUsagePlanKey": { "Type": "AWS::ApiGateway::UsagePlanKey", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "KeyType": "API_KEY", "KeyId": { @@ -103,8 +97,6 @@ }, "MyApiThree": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -153,8 +145,6 @@ }, "MyFunctionThreeApiKeyPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -176,8 +166,6 @@ }, "MyApiTwoApiKey": { "Type": "AWS::ApiGateway::ApiKey", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Enabled": true, "StageKeys": [ @@ -197,8 +185,6 @@ }, "MyFunctionTwo": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -221,8 +207,6 @@ }, "MyFunctionOneApiKeyPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -244,8 +228,6 @@ }, "MyFunctionTwoApiKeyPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -267,8 +249,6 @@ }, "MyFunctionOneRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -299,8 +279,6 @@ }, "MyApiTwo": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -349,8 +327,6 @@ }, "MyFunctionTwoRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -381,8 +357,6 @@ }, "MyFunctionOne": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -405,8 +379,6 @@ }, "ServerlessUsagePlan": { "Type": "AWS::ApiGateway::UsagePlan", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiStages": [ { @@ -434,8 +406,6 @@ }, "ServerlessApiKey": { "Type": "AWS::ApiGateway::ApiKey", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Enabled": true, "StageKeys": [ @@ -463,8 +433,6 @@ }, "MyApiTwoUsagePlan": { "Type": "AWS::ApiGateway::UsagePlan", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiStages": [ { @@ -504,8 +472,6 @@ }, "ServerlessRestApiDeploymentd197b03bdf": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -516,8 +482,6 @@ }, "MyApiTwoDeployment0e45b81469": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiTwo" @@ -528,8 +492,6 @@ }, "MyFunctionTwoImplicitApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -551,8 +513,6 @@ }, "MyApiTwoProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiTwoDeployment0e45b81469" @@ -565,8 +525,6 @@ }, "MyApiOneProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiOneDeploymentdccbc5fda1" @@ -579,8 +537,6 @@ }, "MyApiThreeDeployment5206882d23": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiThree" @@ -591,8 +547,6 @@ }, "MyApiThreeProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiThreeDeployment5206882d23" @@ -605,8 +559,6 @@ }, "ServerlessUsagePlanKey": { "Type": "AWS::ApiGateway::UsagePlanKey", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "KeyType": "API_KEY", "KeyId": { @@ -622,8 +574,6 @@ }, "MyApiOne": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -672,8 +622,6 @@ }, "MyApiOneDeploymentdccbc5fda1": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiOne" @@ -684,8 +632,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -734,8 +680,6 @@ }, "MyFunctionThree": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { diff --git a/tests/translator/output/aws-us-gov/api_with_usageplans_intrinsics.json b/tests/translator/output/aws-us-gov/api_with_usageplans_intrinsics.json index 10825d205..0a9355d91 100644 --- a/tests/translator/output/aws-us-gov/api_with_usageplans_intrinsics.json +++ b/tests/translator/output/aws-us-gov/api_with_usageplans_intrinsics.json @@ -30,8 +30,6 @@ "Resources": { "MyApiTwoUsagePlanKey": { "Type": "AWS::ApiGateway::UsagePlanKey", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "KeyType": "API_KEY", "KeyId": { @@ -47,8 +45,6 @@ }, "MyApiTwoDeployment802c3b471d": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiTwo" @@ -58,8 +54,6 @@ }, "MyApiOneUsagePlan": { "Type": "AWS::ApiGateway::UsagePlan", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiStages": [ { @@ -79,8 +73,6 @@ }, "MyApiOneDeployment8b73115419": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiOne" @@ -91,8 +83,6 @@ }, "MyApiTwoUsagePlan": { "Type": "AWS::ApiGateway::UsagePlan", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiStages": [ { @@ -111,8 +101,6 @@ }, "MyApiTwoProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiTwoDeployment802c3b471d" @@ -125,8 +113,6 @@ }, "MyApiOneProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiOneDeployment8b73115419" @@ -140,8 +126,6 @@ }, "MyApiOneApiKey": { "Type": "AWS::ApiGateway::ApiKey", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Enabled": true, "StageKeys": [ @@ -162,8 +146,6 @@ }, "MyFunctionTwoRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -194,8 +176,6 @@ }, "MyApiOneUsagePlanKey": { "Type": "AWS::ApiGateway::UsagePlanKey", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "KeyType": "API_KEY", "KeyId": { @@ -212,8 +192,6 @@ }, "MyApiTwoApiKey": { "Type": "AWS::ApiGateway::ApiKey", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Enabled": true, "StageKeys": [ @@ -233,8 +211,6 @@ }, "MyFunctionOneApiKeyPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -256,8 +232,6 @@ }, "MyFunctionTwo": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -280,8 +254,6 @@ }, "MyFunctionTwoApiKeyPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -303,8 +275,6 @@ }, "MyFunctionOneRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -335,8 +305,6 @@ }, "MyApiTwo": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -387,8 +355,6 @@ }, "MyApiOne": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -440,8 +406,6 @@ }, "MyFunctionOne": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { diff --git a/tests/translator/output/aws-us-gov/api_with_xray_tracing.json b/tests/translator/output/aws-us-gov/api_with_xray_tracing.json index c86685387..f8b546a91 100644 --- a/tests/translator/output/aws-us-gov/api_with_xray_tracing.json +++ b/tests/translator/output/aws-us-gov/api_with_xray_tracing.json @@ -2,8 +2,6 @@ "Resources": { "HtmlFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -34,8 +32,6 @@ }, "HtmlApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "HtmlApiDeploymentf117c932f7" @@ -49,8 +45,6 @@ }, "HtmlFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -70,8 +64,6 @@ }, "HtmlApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "HtmlApi" @@ -82,8 +74,6 @@ }, "HtmlApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -101,8 +91,6 @@ }, "HtmlFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-us-gov/application_preparing_state.json b/tests/translator/output/aws-us-gov/application_preparing_state.json index bfb82c032..92fe7cc8d 100644 --- a/tests/translator/output/aws-us-gov/application_preparing_state.json +++ b/tests/translator/output/aws-us-gov/application_preparing_state.json @@ -2,8 +2,6 @@ "Resources": { "PreparingApplication": { "Type": "AWS::CloudFormation::Stack", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "TemplateURL": "https://awsserverlessrepo-changesets-xxx.s3.amazonaws.com/signed-url", "Tags": [ diff --git a/tests/translator/output/aws-us-gov/application_with_intrinsics.json b/tests/translator/output/aws-us-gov/application_with_intrinsics.json index cbed10f0f..b21b0c3ea 100644 --- a/tests/translator/output/aws-us-gov/application_with_intrinsics.json +++ b/tests/translator/output/aws-us-gov/application_with_intrinsics.json @@ -28,8 +28,6 @@ "Resources": { "ApplicationFindInMap": { "Type": "AWS::CloudFormation::Stack", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "NotificationARNs": [ { @@ -55,8 +53,6 @@ }, "ApplicationRefParameter": { "Type": "AWS::CloudFormation::Stack", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "TemplateURL": "https://awsserverlessrepo-changesets-xxx.s3.amazonaws.com/signed-url", "Tags": [ @@ -76,9 +72,7 @@ } }, "Sns": { - "Type": "AWS::SNS::Topic", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::SNS::Topic" } } } diff --git a/tests/translator/output/aws-us-gov/basic_application.json b/tests/translator/output/aws-us-gov/basic_application.json index fa4e7d8e4..058e8037e 100644 --- a/tests/translator/output/aws-us-gov/basic_application.json +++ b/tests/translator/output/aws-us-gov/basic_application.json @@ -10,8 +10,6 @@ "Resources": { "NormalApplication": { "Type": "AWS::CloudFormation::Stack", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "NotificationARNs": [ "arn:aws:sns:us-east-1:123456789012:sns-arn" @@ -43,8 +41,6 @@ }, "BasicApplication": { "Type": "AWS::CloudFormation::Stack", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "TemplateURL": "https://awsserverlessrepo-changesets-xxx.s3.amazonaws.com/signed-url", "Tags": [ @@ -65,8 +61,6 @@ }, "ApplicationWithLocationUrl": { "Type": "AWS::CloudFormation::Stack", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "TemplateURL": "https://s3-us-east-1.amazonaws.com/demo-bucket/template.yaml", "Tags": [ @@ -83,8 +77,6 @@ }, "ApplicationWithCondition": { "Type": "AWS::CloudFormation::Stack", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "TemplateURL": "https://awsserverlessrepo-changesets-xxx.s3.amazonaws.com/signed-url", "Tags": [ diff --git a/tests/translator/output/aws-us-gov/basic_function.json b/tests/translator/output/aws-us-gov/basic_function.json index d33d120e5..ad22b6c2b 100644 --- a/tests/translator/output/aws-us-gov/basic_function.json +++ b/tests/translator/output/aws-us-gov/basic_function.json @@ -12,8 +12,6 @@ "Resources": { "FunctionWithInlineCode": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "TracingConfig": { "Mode": "Active" @@ -39,8 +37,6 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -71,8 +67,6 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -96,8 +90,6 @@ }, "FunctionWithPolicyDocument": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -121,8 +113,6 @@ }, "FunctionWithPolicies": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -146,8 +136,6 @@ }, "FunctionWithCodeUriObjectRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -178,8 +166,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Path": "/", "Policies": [ @@ -217,8 +203,6 @@ }, "CompleteFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -261,8 +245,6 @@ }, "FunctionWithCodeUriObject": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -287,8 +269,6 @@ }, "FunctionWithPoliciesRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -320,8 +300,6 @@ }, "FunctionWithInlineCodeRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -353,8 +331,6 @@ }, "FunctionWithTracingRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -386,8 +362,6 @@ }, "FunctionWithRoleRef": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -411,8 +385,6 @@ }, "FunctionWithTracing": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "TracingConfig": { "Mode": "Active" @@ -439,8 +411,6 @@ }, "FunctionWithPolicyDocumentRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-us-gov/basic_function_with_tags.json b/tests/translator/output/aws-us-gov/basic_function_with_tags.json index ce97e4c4d..2e9855ec6 100644 --- a/tests/translator/output/aws-us-gov/basic_function_with_tags.json +++ b/tests/translator/output/aws-us-gov/basic_function_with_tags.json @@ -9,8 +9,6 @@ "Resources": { "AlexaSkillFuncRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +57,6 @@ }, "AlexaSkillFuncAlexaSkillEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { @@ -71,8 +67,6 @@ }, "AlexaSkillFunc": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-us-gov/basic_function_withimageuri.json b/tests/translator/output/aws-us-gov/basic_function_withimageuri.json index 9e8c9dbbe..bb91395e6 100644 --- a/tests/translator/output/aws-us-gov/basic_function_withimageuri.json +++ b/tests/translator/output/aws-us-gov/basic_function_withimageuri.json @@ -12,8 +12,6 @@ "Resources": { "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -51,8 +49,6 @@ }, "MinimalImageFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ImageUri": "123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest" @@ -74,8 +70,6 @@ }, "MinimalImageFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -106,8 +100,6 @@ }, "MinimalImageFunctionPackageTypeAndImageConfig": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ImageUri": "123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest" @@ -134,8 +126,6 @@ }, "MinimalImageFunctionPackageTypeAndImageConfigRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -166,8 +156,6 @@ }, "CompleteImageFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ImageUri": "123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest" @@ -213,8 +201,6 @@ }, "FunctionWithPolicies": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ImageUri": "123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest" @@ -236,8 +222,6 @@ }, "FunctionWithPoliciesRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -269,8 +253,6 @@ }, "FunctionWithPolicyDocument": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ImageUri": "123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest" @@ -292,8 +274,6 @@ }, "FunctionWithPolicyDocumentRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -340,8 +320,6 @@ }, "FunctionWithRoleRef": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ImageUri": "123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest" diff --git a/tests/translator/output/aws-us-gov/basic_layer.json b/tests/translator/output/aws-us-gov/basic_layer.json index 5421d7ca6..d373bd19c 100644 --- a/tests/translator/output/aws-us-gov/basic_layer.json +++ b/tests/translator/output/aws-us-gov/basic_layer.json @@ -9,8 +9,7 @@ }, "Resources": { "LayerWithCondition7c655e10ea": { - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::LayerVersion", "Properties": { "Content": { @@ -22,8 +21,7 @@ "Condition": "TestCondition" }, "MinimalLayer0c7f96cce7": { - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::LayerVersion", "Properties": { "Content": { @@ -34,7 +32,6 @@ } }, "CompleteLayer5d71a60e81": { - "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Retain", "Type": "AWS::Lambda::LayerVersion", "Properties": { @@ -52,7 +49,6 @@ } }, "LayerWithContentUriObjectbdbf1b82ac": { - "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete", "Type": "AWS::Lambda::LayerVersion", "Properties": { diff --git a/tests/translator/output/aws-us-gov/cloudwatch_logs_with_ref.json b/tests/translator/output/aws-us-gov/cloudwatch_logs_with_ref.json index 4b995bace..f61871da5 100644 --- a/tests/translator/output/aws-us-gov/cloudwatch_logs_with_ref.json +++ b/tests/translator/output/aws-us-gov/cloudwatch_logs_with_ref.json @@ -13,8 +13,6 @@ "Resources": { "TriggeredFunctionCWLogEvent": { "Type": "AWS::Logs::SubscriptionFilter", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DestinationArn": { "Fn::GetAtt": [ @@ -35,8 +33,6 @@ }, "TriggeredFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -61,8 +57,6 @@ }, "TriggeredFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -93,8 +87,6 @@ }, "TriggeredFunctionCWLogEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "logs.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/cloudwatchevent.json b/tests/translator/output/aws-us-gov/cloudwatchevent.json index 4f4f9afd5..3d8914b21 100644 --- a/tests/translator/output/aws-us-gov/cloudwatchevent.json +++ b/tests/translator/output/aws-us-gov/cloudwatchevent.json @@ -2,8 +2,6 @@ "Resources": { "ScheduledFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -34,8 +32,6 @@ }, "TriggeredFunctionOnTerminatePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -52,8 +48,6 @@ }, "ScheduledFunctionSchedulePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -70,8 +64,6 @@ }, "ScheduledFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -96,8 +88,6 @@ }, "TriggeredFunctionOnTerminate": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -122,8 +112,6 @@ }, "TriggeredFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -148,8 +136,6 @@ }, "TriggeredFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -180,8 +166,6 @@ }, "ScheduledFunctionSchedule": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ScheduleExpression": "rate(1 minute)", "Targets": [ diff --git a/tests/translator/output/aws-us-gov/cloudwatchlog.json b/tests/translator/output/aws-us-gov/cloudwatchlog.json index c58faaa8c..74d47771d 100644 --- a/tests/translator/output/aws-us-gov/cloudwatchlog.json +++ b/tests/translator/output/aws-us-gov/cloudwatchlog.json @@ -2,8 +2,6 @@ "Resources": { "TriggeredFunctionCWLogEvent": { "Type": "AWS::Logs::SubscriptionFilter", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DestinationArn": { "Fn::GetAtt": [ @@ -20,8 +18,6 @@ }, "TriggeredFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -46,8 +42,6 @@ }, "TriggeredFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -78,8 +72,6 @@ }, "TriggeredFunctionCWLogEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "logs.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/cognito_userpool_with_event.json b/tests/translator/output/aws-us-gov/cognito_userpool_with_event.json index 5b6e03db5..82a183830 100644 --- a/tests/translator/output/aws-us-gov/cognito_userpool_with_event.json +++ b/tests/translator/output/aws-us-gov/cognito_userpool_with_event.json @@ -2,8 +2,6 @@ "Resources": { "UserPool": { "Type": "AWS::Cognito::UserPool", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "LambdaConfig": { "PreSignUp": { @@ -29,8 +27,6 @@ }, "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -54,8 +50,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -86,8 +80,6 @@ }, "ImplicitApiFunctionCognitoPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { diff --git a/tests/translator/output/aws-us-gov/depends_on.json b/tests/translator/output/aws-us-gov/depends_on.json index 1e21ec236..6e1282963 100644 --- a/tests/translator/output/aws-us-gov/depends_on.json +++ b/tests/translator/output/aws-us-gov/depends_on.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -31,8 +29,6 @@ }, "MyExplicitApiDeployment74b681ce04": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyExplicitApi" @@ -43,8 +39,6 @@ }, "MyExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -63,8 +57,6 @@ }, "MyOtherTable": { "Type": "AWS::DynamoDB::Table", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "KeySchema": [ { @@ -90,8 +82,6 @@ }, "MyExplicitApidevStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyExplicitApiDeployment74b681ce04" @@ -104,8 +94,6 @@ }, "MySamTable": { "Type": "AWS::DynamoDB::Table", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BillingMode": "PAY_PER_REQUEST", "AttributeDefinitions": [ @@ -124,8 +112,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -156,8 +142,6 @@ }, "MyFunctionMyApiPermissiondev": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/eventbridgerule.json b/tests/translator/output/aws-us-gov/eventbridgerule.json index b349a0712..799d38946 100644 --- a/tests/translator/output/aws-us-gov/eventbridgerule.json +++ b/tests/translator/output/aws-us-gov/eventbridgerule.json @@ -2,8 +2,6 @@ "Resources": { "ScheduledFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -34,8 +32,6 @@ }, "TriggeredFunctionOnTerminatePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -52,8 +48,6 @@ }, "ScheduledFunctionSchedulePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -70,8 +64,6 @@ }, "ScheduledFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -96,8 +88,6 @@ }, "TriggeredFunctionOnTerminate": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -122,8 +112,6 @@ }, "TriggeredFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -148,8 +136,6 @@ }, "TriggeredFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -180,8 +166,6 @@ }, "ScheduledFunctionSchedule": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ScheduleExpression": "rate(1 minute)", "Targets": [ diff --git a/tests/translator/output/aws-us-gov/eventbridgerule_schedule_properties.json b/tests/translator/output/aws-us-gov/eventbridgerule_schedule_properties.json index b1f54a6b2..6a6eef9ce 100644 --- a/tests/translator/output/aws-us-gov/eventbridgerule_schedule_properties.json +++ b/tests/translator/output/aws-us-gov/eventbridgerule_schedule_properties.json @@ -2,8 +2,6 @@ "Resources": { "ScheduledFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -34,8 +32,6 @@ }, "TriggeredFunctionOnTerminatePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -52,8 +48,6 @@ }, "ScheduledFunctionSchedulePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -70,8 +64,6 @@ }, "ScheduledFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -96,8 +88,6 @@ }, "TriggeredFunctionOnTerminate": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -121,8 +111,6 @@ }, "TriggeredFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -147,8 +135,6 @@ }, "TriggeredFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -179,8 +165,6 @@ }, "ScheduledFunctionSchedule": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ScheduleExpression": "rate(1 minute)", "Name": "test-schedule", diff --git a/tests/translator/output/aws-us-gov/eventbridgerule_with_dlq.json b/tests/translator/output/aws-us-gov/eventbridgerule_with_dlq.json index eac210019..b5dd4901b 100644 --- a/tests/translator/output/aws-us-gov/eventbridgerule_with_dlq.json +++ b/tests/translator/output/aws-us-gov/eventbridgerule_with_dlq.json @@ -2,8 +2,6 @@ "Resources": { "ScheduledFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -34,8 +32,6 @@ }, "ScheduledFunctionScheduleQueuePolicy": { "Type": "AWS::SQS::QueuePolicy", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Queues": [ { @@ -74,8 +70,6 @@ }, "TriggeredFunctionOnTerminate": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -103,8 +97,6 @@ }, "TriggeredFunctionOnTerminatePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -121,8 +113,6 @@ }, "ScheduledFunctionSchedulePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -139,8 +129,6 @@ }, "ScheduledFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -165,14 +153,10 @@ }, "ScheduledFunctionScheduleQueue": { "Type": "AWS::SQS::Queue", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": {} }, "TriggeredFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -197,8 +181,6 @@ }, "TriggeredFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -229,8 +211,6 @@ }, "ScheduledFunctionSchedule": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ScheduleExpression": "rate(1 minute)", "Targets": [ diff --git a/tests/translator/output/aws-us-gov/eventbridgerule_with_retry_policy.json b/tests/translator/output/aws-us-gov/eventbridgerule_with_retry_policy.json index f19fc2022..d904833c3 100644 --- a/tests/translator/output/aws-us-gov/eventbridgerule_with_retry_policy.json +++ b/tests/translator/output/aws-us-gov/eventbridgerule_with_retry_policy.json @@ -2,8 +2,6 @@ "Resources": { "ScheduledFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -34,8 +32,6 @@ }, "TriggeredFunctionOnTerminatePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -52,8 +48,6 @@ }, "ScheduledFunctionSchedulePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -70,8 +64,6 @@ }, "ScheduledFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -96,8 +88,6 @@ }, "TriggeredFunctionOnTerminate": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -126,8 +116,6 @@ }, "TriggeredFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -152,8 +140,6 @@ }, "TriggeredFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -184,8 +170,6 @@ }, "ScheduledFunctionSchedule": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ScheduleExpression": "rate(1 minute)", "Targets": [ diff --git a/tests/translator/output/aws-us-gov/explicit_api.json b/tests/translator/output/aws-us-gov/explicit_api.json index 047ca2fa1..5c2d3ec05 100644 --- a/tests/translator/output/aws-us-gov/explicit_api.json +++ b/tests/translator/output/aws-us-gov/explicit_api.json @@ -12,8 +12,6 @@ "Resources": { "GetHtmlFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -37,8 +35,6 @@ }, "ApiWithInlineSwaggerStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ApiWithInlineSwaggerDeployment09cda3d97b" @@ -53,8 +49,6 @@ }, "GetHtmlApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "GetHtmlApi" @@ -65,8 +59,6 @@ }, "GetHtmlFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -99,8 +91,6 @@ }, "ApiWithInlineSwagger": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "this": "is", @@ -118,8 +108,6 @@ }, "GetHtmlFunctionGetHtmlPermissionStage": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -141,8 +129,6 @@ }, "GetHtmlApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -161,8 +147,6 @@ }, "GetHtmlApiStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "GetHtmlApiDeploymentf117c932f7" @@ -183,8 +167,6 @@ }, "ApiWithInlineSwaggerDeployment09cda3d97b": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ApiWithInlineSwagger" diff --git a/tests/translator/output/aws-us-gov/explicit_api_openapi_3.json b/tests/translator/output/aws-us-gov/explicit_api_openapi_3.json index 7b41a6094..49592d0b2 100644 --- a/tests/translator/output/aws-us-gov/explicit_api_openapi_3.json +++ b/tests/translator/output/aws-us-gov/explicit_api_openapi_3.json @@ -12,8 +12,6 @@ "Resources": { "GetHtmlFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -37,8 +35,6 @@ }, "ApiWithInlineSwaggerStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ApiWithInlineSwaggerDeployment74abcb3a5b" @@ -53,8 +49,6 @@ }, "GetHtmlApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "GetHtmlApi" @@ -65,8 +59,6 @@ }, "ApiWithInlineSwaggerDeployment74abcb3a5b": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ApiWithInlineSwagger" @@ -76,8 +68,6 @@ }, "GetHtmlFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -110,8 +100,6 @@ }, "ApiWithInlineSwagger": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "this": "is", @@ -129,8 +117,6 @@ }, "GetHtmlFunctionGetHtmlPermissionStage": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -152,8 +138,6 @@ }, "GetHtmlApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -172,8 +156,6 @@ }, "GetHtmlApiStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "GetHtmlApiDeploymentf117c932f7" diff --git a/tests/translator/output/aws-us-gov/explicit_api_with_invalid_events_config.json b/tests/translator/output/aws-us-gov/explicit_api_with_invalid_events_config.json index 2010798ec..be3dbcbf9 100644 --- a/tests/translator/output/aws-us-gov/explicit_api_with_invalid_events_config.json +++ b/tests/translator/output/aws-us-gov/explicit_api_with_invalid_events_config.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -27,8 +25,6 @@ }, "MyFunctionAddApiPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -48,8 +44,6 @@ }, "ApiWithInlineSwaggerProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ApiWithInlineSwaggerDeployment22d399868d" @@ -62,8 +56,6 @@ }, "ApiWithInlineSwagger": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -100,8 +92,6 @@ }, "ApiWithInlineSwaggerDeployment22d399868d": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ApiWithInlineSwagger" @@ -112,8 +102,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-us-gov/explicit_http_api.json b/tests/translator/output/aws-us-gov/explicit_http_api.json index eee7b8f00..e3ff6cce6 100644 --- a/tests/translator/output/aws-us-gov/explicit_http_api.json +++ b/tests/translator/output/aws-us-gov/explicit_http_api.json @@ -2,8 +2,6 @@ "Resources": { "MyApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -17,8 +15,6 @@ }, "MyApi2ApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi2" @@ -32,8 +28,6 @@ }, "HttpApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.restapi", "Code": { @@ -57,8 +51,6 @@ }, "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -80,8 +72,6 @@ }, "MyApi2": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -154,8 +144,6 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -186,8 +174,6 @@ }, "HttpApiFunctionBasePathPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -209,8 +195,6 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FailOnWarnings": true, "Body": { diff --git a/tests/translator/output/aws-us-gov/explicit_http_api_minimum.json b/tests/translator/output/aws-us-gov/explicit_http_api_minimum.json index 8b1c84fa2..df8e5fcfb 100644 --- a/tests/translator/output/aws-us-gov/explicit_http_api_minimum.json +++ b/tests/translator/output/aws-us-gov/explicit_http_api_minimum.json @@ -2,8 +2,6 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -27,8 +25,6 @@ }, "FunctionApiPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -50,8 +46,6 @@ }, "Api": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -73,8 +67,6 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -105,8 +97,6 @@ }, "ServerlessHttpApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -143,8 +133,6 @@ }, "ServerlessHttpApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "ServerlessHttpApi" @@ -158,8 +146,6 @@ }, "ApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "Api" diff --git a/tests/translator/output/aws-us-gov/function_concurrency.json b/tests/translator/output/aws-us-gov/function_concurrency.json index 84ce4e5ab..9eb5d9f57 100644 --- a/tests/translator/output/aws-us-gov/function_concurrency.json +++ b/tests/translator/output/aws-us-gov/function_concurrency.json @@ -7,8 +7,6 @@ "Resources": { "ConcurrentFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -38,8 +36,6 @@ }, "ConcurrentFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -62,8 +58,6 @@ }, "AnotherFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -93,8 +87,6 @@ }, "AnotherFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-us-gov/function_event_conditions.json b/tests/translator/output/aws-us-gov/function_event_conditions.json index 33d8a5139..d35bfe484 100644 --- a/tests/translator/output/aws-us-gov/function_event_conditions.json +++ b/tests/translator/output/aws-us-gov/function_event_conditions.json @@ -10,8 +10,6 @@ "Resources": { "MyAwesomeFunctionAliasLive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "FunctionVersion": { @@ -28,8 +26,6 @@ }, "MyAwesomeFunctionNotificationTopicPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Action": "lambda:InvokeFunction", @@ -44,8 +40,6 @@ }, "MyAwesomeFunctionCWEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Action": "lambda:InvokeFunction", @@ -63,8 +57,6 @@ }, "MyAwesomeFunctionEBRulePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Action": "lambda:InvokeFunction", @@ -82,8 +74,6 @@ }, "MyAwesomeFunctionDDBStream": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "BatchSize": 200, @@ -96,8 +86,6 @@ }, "MyAwesomeFunctionIoTRule": { "Type": "AWS::IoT::TopicRule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "TopicRulePayload": { @@ -118,8 +106,6 @@ }, "MyAwesomeFunctionKinesisStream": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "BatchSize": 100, @@ -132,8 +118,6 @@ }, "MyAwesomeFunctionIoTRulePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Action": "lambda:InvokeFunction", @@ -158,8 +142,6 @@ }, "MyAwesomeFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Endpoint": { @@ -173,8 +155,6 @@ }, "MyAwesomeFunctionS3TriggerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Action": "lambda:InvokeFunction", @@ -189,8 +169,6 @@ }, "MyAwesomeFunctionCWLogPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Action": "lambda:InvokeFunction", @@ -210,8 +188,6 @@ }, "MyAwesomeFunctionEBSchedule": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "ScheduleExpression": "rate(1 minute)", @@ -227,8 +203,6 @@ }, "MyAwesomeFunctionCWLog": { "Type": "AWS::Logs::SubscriptionFilter", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "DestinationArn": { @@ -243,8 +217,6 @@ }, "MyAwesomeFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "ManagedPolicyArns": [ @@ -279,8 +251,6 @@ }, "MyAwesomeFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Code": { @@ -305,8 +275,6 @@ }, "MyAwesomeFunctionCWEvent": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "EventPattern": { @@ -328,8 +296,6 @@ }, "MyAwesomeFunctionEBRule": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "EventPattern": { @@ -350,8 +316,7 @@ } }, "MyAwesomeFunctionVersion640128d35d": { - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", "Condition": "MyCondition", "Properties": { @@ -362,14 +327,10 @@ }, "Notifications": { "Condition": "MyCondition", - "Type": "AWS::SNS::Topic", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::SNS::Topic" }, "MyAwesomeFunctionEBSchedulePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Action": "lambda:InvokeFunction", @@ -387,8 +348,6 @@ }, "FunctionOneImageBucketPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -402,8 +361,6 @@ }, "FunctionOneRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -434,8 +391,6 @@ }, "FunctionOne": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -459,8 +414,6 @@ }, "Images": { "Type": "AWS::S3::Bucket", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "NotificationConfiguration": { "LambdaConfigurations": [ @@ -510,8 +463,6 @@ }, "MyAwesomeFunctionSNSTopicWithSQSSubscription": { "Type": "AWS::SNS::Subscription", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Endpoint": { "Fn::GetAtt": [ @@ -528,8 +479,6 @@ }, "MyAwesomeFunctionSNSTopicWithSQSSubscriptionQueuePolicy": { "Type": "AWS::SQS::QueuePolicy", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Queues": [ { @@ -564,8 +513,6 @@ }, "MyAwesomeFunctionSNSTopicWithSQSSubscriptionEventSourceMapping": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BatchSize": 10, "Enabled": true, @@ -584,14 +531,10 @@ "MyAwesomeFunctionAnotherSNSWithSQSSubscriptionQueue": { "Condition": "MyCondition", "Type": "AWS::SQS::Queue", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": {} }, "MyAwesomeFunctionAnotherSNSWithSQSSubscriptionEventSourceMapping": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BatchSize": 10, "Enabled": true, @@ -609,8 +552,6 @@ }, "MyAwesomeFunctionAnotherSNSWithSQSSubscription": { "Type": "AWS::SNS::Subscription", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Endpoint": { "Fn::GetAtt": [ @@ -627,8 +568,6 @@ }, "MyAwesomeFunctionAnotherSNSWithSQSSubscriptionQueuePolicy": { "Type": "AWS::SQS::QueuePolicy", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Queues": [ { @@ -663,8 +602,6 @@ }, "Queue": { "Type": "AWS::SQS::Queue", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition" } } diff --git a/tests/translator/output/aws-us-gov/function_managed_inline_policy.json b/tests/translator/output/aws-us-gov/function_managed_inline_policy.json index ab924b11c..ffbf7809d 100644 --- a/tests/translator/output/aws-us-gov/function_managed_inline_policy.json +++ b/tests/translator/output/aws-us-gov/function_managed_inline_policy.json @@ -8,8 +8,6 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -33,8 +31,6 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", diff --git a/tests/translator/output/aws-us-gov/function_with_alias.json b/tests/translator/output/aws-us-gov/function_with_alias.json index 8bfaf9a44..aae104be5 100644 --- a/tests/translator/output/aws-us-gov/function_with_alias.json +++ b/tests/translator/output/aws-us-gov/function_with_alias.json @@ -1,9 +1,8 @@ { "Resources": { "MinimalFunctionVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Description": "sam-testing", "FunctionName": { @@ -13,8 +12,6 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -30,8 +27,6 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -55,8 +50,6 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-us-gov/function_with_alias_and_event_sources.json b/tests/translator/output/aws-us-gov/function_with_alias_and_event_sources.json index eb3280591..99ccfc0b3 100644 --- a/tests/translator/output/aws-us-gov/function_with_alias_and_event_sources.json +++ b/tests/translator/output/aws-us-gov/function_with_alias_and_event_sources.json @@ -8,8 +8,6 @@ "Resources": { "MyAwesomeFunctionAliasLive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -25,8 +23,6 @@ }, "MyAwesomeFunctionNotificationTopicPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "sns.amazonaws.com", @@ -40,8 +36,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentd696835fbb" @@ -54,8 +48,6 @@ }, "GetHtmlApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "GetHtmlApi" @@ -66,8 +58,6 @@ }, "MyAwesomeFunctionCWEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -84,8 +74,6 @@ }, "MyAwesomeFunctionEBRulePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -102,8 +90,6 @@ }, "MyAwesomeFunctionDDBStream": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BatchSize": 200, "EventSourceArn": "arn:aws:dynamodb:us-west-2:012345678901:table/TestTable/stream/2015-05-11T21:21:33.291", @@ -115,8 +101,6 @@ }, "MyAwesomeFunctionIoTRule": { "Type": "AWS::IoT::TopicRule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "TopicRulePayload": { "AwsIotSqlVersion": "beta", @@ -136,8 +120,6 @@ }, "MyAwesomeFunctionKinesisStream": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BatchSize": 100, "EventSourceArn": "arn:aws:kinesis:us-west-2:012345678901:stream/my-stream", @@ -149,8 +131,6 @@ }, "MyAwesomeFunctionImplicitApiPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -172,8 +152,6 @@ }, "ServerlessRestApiDeploymentd696835fbb": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -184,8 +162,6 @@ }, "MyAwesomeFunctionIoTRulePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -209,8 +185,6 @@ }, "MyAwesomeFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Endpoint": { "Ref": "MyAwesomeFunctionAliasLive" @@ -223,8 +197,6 @@ }, "MyAwesomeFunctionS3TriggerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -238,8 +210,6 @@ }, "GetHtmlApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -258,8 +228,6 @@ }, "MyAwesomeFunctionCWLogPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "logs.amazonaws.com", @@ -278,8 +246,6 @@ }, "MyAwesomeFunctionEBSchedule": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ScheduleExpression": "rate(1 minute)", "Targets": [ @@ -294,8 +260,6 @@ }, "MyAwesomeFunctionCWLog": { "Type": "AWS::Logs::SubscriptionFilter", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DestinationArn": { "Ref": "MyAwesomeFunctionAliasLive" @@ -309,8 +273,6 @@ }, "MyAwesomeFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -343,8 +305,6 @@ }, "MyAwesomeFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -368,8 +328,6 @@ }, "MyAwesomeFunctionCWEvent": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -390,8 +348,6 @@ }, "MyAwesomeFunctionEBRule": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -411,9 +367,8 @@ } }, "MyAwesomeFunctionVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MyAwesomeFunction" @@ -422,8 +377,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -459,14 +412,10 @@ } }, "Notifications": { - "Type": "AWS::SNS::Topic", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::SNS::Topic" }, "MyAwesomeFunctionEBSchedulePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -483,8 +432,6 @@ }, "Images": { "Type": "AWS::S3::Bucket", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "NotificationConfiguration": { "LambdaConfigurations": [ @@ -503,8 +450,6 @@ }, "GetHtmlApiStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "GetHtmlApiDeploymentf117c932f7" @@ -524,8 +469,6 @@ }, "MyAwesomeFunctionExplicitApiPermissionStage": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/function_with_alias_intrinsics.json b/tests/translator/output/aws-us-gov/function_with_alias_intrinsics.json index bfa03df54..6844f0abb 100644 --- a/tests/translator/output/aws-us-gov/function_with_alias_intrinsics.json +++ b/tests/translator/output/aws-us-gov/function_with_alias_intrinsics.json @@ -7,9 +7,8 @@ }, "Resources": { "MinimalFunctionVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -18,8 +17,6 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -35,8 +32,6 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -60,8 +55,6 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-us-gov/function_with_amq.json b/tests/translator/output/aws-us-gov/function_with_amq.json index ac045fcd3..a8a471c86 100644 --- a/tests/translator/output/aws-us-gov/function_with_amq.json +++ b/tests/translator/output/aws-us-gov/function_with_amq.json @@ -2,8 +2,6 @@ "Resources": { "MQFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -27,8 +25,6 @@ }, "MQFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -82,8 +78,6 @@ }, "MQFunctionMyMQQueue": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EventSourceArn": "arn:aws:mq:us-east-2:123456789012:broker:MyBroker:b-1234a5b6-78cd-901e-2fgh-3i45j6k178l9", "FunctionName": { diff --git a/tests/translator/output/aws-us-gov/function_with_amq_kms.json b/tests/translator/output/aws-us-gov/function_with_amq_kms.json index b8e23fbd2..37b991a49 100644 --- a/tests/translator/output/aws-us-gov/function_with_amq_kms.json +++ b/tests/translator/output/aws-us-gov/function_with_amq_kms.json @@ -2,8 +2,6 @@ "Resources": { "MQFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -27,8 +25,6 @@ }, "MQFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -89,8 +85,6 @@ }, "MQFunctionMyMQQueue": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EventSourceArn": "arn:aws:mq:us-east-2:123456789012:broker:MyBroker:b-1234a5b6-78cd-901e-2fgh-3i45j6k178l9", "FunctionName": { diff --git a/tests/translator/output/aws-us-gov/function_with_condition.json b/tests/translator/output/aws-us-gov/function_with_condition.json index b1ac81010..55fc68469 100644 --- a/tests/translator/output/aws-us-gov/function_with_condition.json +++ b/tests/translator/output/aws-us-gov/function_with_condition.json @@ -10,8 +10,6 @@ "Resources": { "ConditionFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -36,8 +34,6 @@ }, "ConditionFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-us-gov/function_with_conditional_managed_policy.json b/tests/translator/output/aws-us-gov/function_with_conditional_managed_policy.json index 58b8a4972..e2a0e8c5f 100644 --- a/tests/translator/output/aws-us-gov/function_with_conditional_managed_policy.json +++ b/tests/translator/output/aws-us-gov/function_with_conditional_managed_policy.json @@ -10,8 +10,6 @@ "Resources": { "FunctionWithConditionalPolicy": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -36,8 +34,6 @@ }, "FunctionWithConditionalPolicyRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", diff --git a/tests/translator/output/aws-us-gov/function_with_conditional_managed_policy_and_ref_no_value.json b/tests/translator/output/aws-us-gov/function_with_conditional_managed_policy_and_ref_no_value.json index d49a6e003..da893a16c 100644 --- a/tests/translator/output/aws-us-gov/function_with_conditional_managed_policy_and_ref_no_value.json +++ b/tests/translator/output/aws-us-gov/function_with_conditional_managed_policy_and_ref_no_value.json @@ -10,8 +10,6 @@ "Resources": { "FunctionWithConditionalPolicy": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -36,8 +34,6 @@ }, "FunctionWithConditionalPolicyRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", diff --git a/tests/translator/output/aws-us-gov/function_with_conditional_policy_template.json b/tests/translator/output/aws-us-gov/function_with_conditional_policy_template.json index 7dcc8a85d..18e2f7216 100644 --- a/tests/translator/output/aws-us-gov/function_with_conditional_policy_template.json +++ b/tests/translator/output/aws-us-gov/function_with_conditional_policy_template.json @@ -10,8 +10,6 @@ "Resources": { "FunctionWithConditionalPolicy": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -36,8 +34,6 @@ }, "FunctionWithConditionalPolicyRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-us-gov/function_with_conditional_policy_template_and_ref_no_value.json b/tests/translator/output/aws-us-gov/function_with_conditional_policy_template_and_ref_no_value.json index c09b9713d..08c9629f1 100644 --- a/tests/translator/output/aws-us-gov/function_with_conditional_policy_template_and_ref_no_value.json +++ b/tests/translator/output/aws-us-gov/function_with_conditional_policy_template_and_ref_no_value.json @@ -10,8 +10,6 @@ "Resources": { "FunctionWithConditionalPolicy": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -36,8 +34,6 @@ }, "FunctionWithConditionalPolicyRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-us-gov/function_with_custom_codedeploy_deployment_preference.json b/tests/translator/output/aws-us-gov/function_with_custom_codedeploy_deployment_preference.json index 5fa549bea..f601b9622 100644 --- a/tests/translator/output/aws-us-gov/function_with_custom_codedeploy_deployment_preference.json +++ b/tests/translator/output/aws-us-gov/function_with_custom_codedeploy_deployment_preference.json @@ -34,8 +34,6 @@ "Resources": { "NormalWithRefAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -60,9 +58,8 @@ } }, "CustomWithFindInMapVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "CustomWithFindInMap" @@ -111,8 +108,6 @@ }, "CustomWithFindInMapAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -138,8 +133,6 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -163,8 +156,6 @@ }, "CustomWithSubAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -190,8 +181,6 @@ }, "NormalWithSub": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -213,10 +202,9 @@ ] } }, - "CustomWithConditionVersion640128d35d": { + "CustomWithConditionVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "CustomWithCondition" @@ -252,10 +240,9 @@ } } }, - "CustomWithCondition2Version640128d35d": { + "CustomWithCondition2Version640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "CustomWithCondition2" @@ -264,8 +251,6 @@ }, "CustomWithCondition": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -289,8 +274,6 @@ }, "CustomWithSub": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -318,10 +301,9 @@ "ComputePlatform": "Lambda" } }, - "NormalWithRefVersion640128d35d": { + "NormalWithRefVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "NormalWithRef" @@ -422,8 +404,6 @@ }, "NormalWithSubAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -448,9 +428,8 @@ } }, "CustomWithSubVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "CustomWithSub" @@ -459,8 +438,6 @@ }, "CustomWithSubRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -491,8 +468,6 @@ }, "CustomWithConditionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -563,8 +538,6 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -595,8 +568,6 @@ }, "CustomWithFindInMap": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -619,9 +590,8 @@ } }, "NormalWithSubVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "NormalWithSub" @@ -630,8 +600,6 @@ }, "CustomWithConditionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -657,8 +625,6 @@ }, "CustomWithFindInMapRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -689,8 +655,6 @@ }, "NormalWithRef": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -714,8 +678,6 @@ }, "CustomWithCondition2": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -766,8 +728,6 @@ }, "NormalWithRefRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -798,8 +758,6 @@ }, "CustomWithCondition2Aliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -825,8 +783,6 @@ }, "NormalWithSubRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -856,9 +812,8 @@ } }, "MinimalFunctionVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -894,8 +849,6 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -921,8 +874,6 @@ }, "CustomWithCondition2Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-us-gov/function_with_custom_conditional_codedeploy_deployment_preference.json b/tests/translator/output/aws-us-gov/function_with_custom_conditional_codedeploy_deployment_preference.json index 9d724199a..b91a7f0ff 100644 --- a/tests/translator/output/aws-us-gov/function_with_custom_conditional_codedeploy_deployment_preference.json +++ b/tests/translator/output/aws-us-gov/function_with_custom_conditional_codedeploy_deployment_preference.json @@ -33,8 +33,6 @@ }, "HelloWorldFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -141,9 +139,8 @@ } }, "HelloWorldFunctionVersionfb53d5c2e6": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "HelloWorldFunction" @@ -152,8 +149,6 @@ }, "HelloWorldFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -179,8 +174,6 @@ }, "HelloWorldFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { diff --git a/tests/translator/output/aws-us-gov/function_with_deployment_and_custom_role.json b/tests/translator/output/aws-us-gov/function_with_deployment_and_custom_role.json index f6eb96d35..68a538606 100644 --- a/tests/translator/output/aws-us-gov/function_with_deployment_and_custom_role.json +++ b/tests/translator/output/aws-us-gov/function_with_deployment_and_custom_role.json @@ -2,8 +2,6 @@ "Resources": { "FunctionWithRole": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -27,8 +25,6 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -52,8 +48,6 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -84,8 +78,6 @@ }, "DeploymentRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSCodeDeployRole" @@ -109,9 +101,8 @@ } }, "FunctionWithRoleVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "FunctionWithRole" @@ -217,9 +208,8 @@ } }, "MinimalFunctionVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -228,8 +218,6 @@ }, "FunctionWithRoleAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -255,8 +243,6 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { diff --git a/tests/translator/output/aws-us-gov/function_with_deployment_no_service_role.json b/tests/translator/output/aws-us-gov/function_with_deployment_no_service_role.json index aac9cc42f..ca6cf4a1e 100644 --- a/tests/translator/output/aws-us-gov/function_with_deployment_no_service_role.json +++ b/tests/translator/output/aws-us-gov/function_with_deployment_no_service_role.json @@ -33,8 +33,6 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -58,8 +56,6 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -89,9 +85,8 @@ } }, "OtherFunctionVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "OtherFunction" @@ -100,8 +95,6 @@ }, "OtherFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -132,8 +125,6 @@ }, "DeploymentRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSCodeDeployRole" @@ -193,10 +184,9 @@ "ComputePlatform": "Lambda" } }, - "MinimalFunctionVersion640128d35d": { + "MinimalFunctionVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -205,8 +195,6 @@ }, "OtherFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -230,8 +218,6 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -257,8 +243,6 @@ }, "OtherFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { diff --git a/tests/translator/output/aws-us-gov/function_with_deployment_preference.json b/tests/translator/output/aws-us-gov/function_with_deployment_preference.json index 3e56a7b75..3b6868a1e 100644 --- a/tests/translator/output/aws-us-gov/function_with_deployment_preference.json +++ b/tests/translator/output/aws-us-gov/function_with_deployment_preference.json @@ -63,8 +63,6 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -95,8 +93,6 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -149,9 +145,8 @@ } }, "MinimalFunctionVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -160,8 +155,6 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { diff --git a/tests/translator/output/aws-us-gov/function_with_deployment_preference_alarms_intrinsic_if.json b/tests/translator/output/aws-us-gov/function_with_deployment_preference_alarms_intrinsic_if.json index 904156314..b156bf318 100644 --- a/tests/translator/output/aws-us-gov/function_with_deployment_preference_alarms_intrinsic_if.json +++ b/tests/translator/output/aws-us-gov/function_with_deployment_preference_alarms_intrinsic_if.json @@ -10,8 +10,6 @@ "Resources": { "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -35,8 +33,7 @@ }, "MinimalFunctionVersion640128d35d": { "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", + "DeletionPolicy": "Retain", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -45,8 +42,6 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -72,8 +67,6 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", diff --git a/tests/translator/output/aws-us-gov/function_with_deployment_preference_all_parameters.json b/tests/translator/output/aws-us-gov/function_with_deployment_preference_all_parameters.json index 9ee044a97..2eb18aee3 100644 --- a/tests/translator/output/aws-us-gov/function_with_deployment_preference_all_parameters.json +++ b/tests/translator/output/aws-us-gov/function_with_deployment_preference_all_parameters.json @@ -2,8 +2,6 @@ "Resources": { "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -27,8 +25,6 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "MySanityTestFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -91,8 +85,6 @@ }, "MyCloudWatchAlarm": { "Type": "AWS::CloudWatch::Alarm", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EvaluationPeriods": 1, "Namespace": "AWS/EC2", @@ -160,8 +152,6 @@ }, "MySanityTestFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "my-bucket", @@ -214,9 +204,8 @@ } }, "MinimalFunctionVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -225,8 +214,6 @@ }, "MyValidationTestFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "my-bucket", @@ -250,8 +237,6 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -283,8 +268,6 @@ }, "MyValidationTestFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -314,9 +297,7 @@ } }, "MySNSTopic": { - "Type": "AWS::SNS::Topic", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::SNS::Topic" } } } \ No newline at end of file diff --git a/tests/translator/output/aws-us-gov/function_with_deployment_preference_from_parameters.json b/tests/translator/output/aws-us-gov/function_with_deployment_preference_from_parameters.json index b638e0243..960cf3d85 100644 --- a/tests/translator/output/aws-us-gov/function_with_deployment_preference_from_parameters.json +++ b/tests/translator/output/aws-us-gov/function_with_deployment_preference_from_parameters.json @@ -16,8 +16,6 @@ "Resources": { "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -41,8 +39,6 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -73,8 +69,6 @@ }, "MySanityTestFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -105,8 +99,6 @@ }, "MyCloudWatchAlarm": { "Type": "AWS::CloudWatch::Alarm", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EvaluationPeriods": 1, "Namespace": "AWS/EC2", @@ -174,8 +166,6 @@ }, "MySanityTestFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "my-bucket", @@ -228,9 +218,8 @@ } }, "MinimalFunctionVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -239,8 +228,6 @@ }, "MyValidationTestFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "my-bucket", @@ -264,8 +251,6 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -297,8 +282,6 @@ }, "MyValidationTestFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -328,9 +311,7 @@ } }, "MySNSTopic": { - "Type": "AWS::SNS::Topic", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::SNS::Topic" } } } \ No newline at end of file diff --git a/tests/translator/output/aws-us-gov/function_with_deployment_preference_multiple_combinations.json b/tests/translator/output/aws-us-gov/function_with_deployment_preference_multiple_combinations.json index 4daea5dea..2ad3524ec 100644 --- a/tests/translator/output/aws-us-gov/function_with_deployment_preference_multiple_combinations.json +++ b/tests/translator/output/aws-us-gov/function_with_deployment_preference_multiple_combinations.json @@ -2,8 +2,6 @@ "Resources": { "MinimalFunctionWithDeploymentPreferenceWithHooksAndAlarms": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -27,8 +25,6 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -84,8 +78,6 @@ }, "MinimalFunctionWithMinimalDeploymentPreferenceRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -116,8 +108,6 @@ }, "MyCloudWatchAlarm": { "Type": "AWS::CloudWatch::Alarm", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EvaluationPeriods": 1, "Namespace": "AWS/EC2", @@ -129,8 +119,6 @@ }, "MinimalFunctionWithMinimalDeploymentPreferenceAliaslivewithdeployment": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -199,9 +187,8 @@ } }, "MinimalFunctionWithMinimalDeploymentPreferenceVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunctionWithMinimalDeploymentPreference" @@ -210,8 +197,6 @@ }, "MinimalFunctionWithDeploymentPreferenceWithHooksAndAlarmsRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -242,8 +227,6 @@ }, "MySanityTestFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -274,8 +257,6 @@ }, "MinimalFunctionWithMinimalDeploymentPreference": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -299,8 +280,6 @@ }, "MySanityTestFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "my-bucket", @@ -323,9 +302,8 @@ } }, "MinimalFunctionWithDeploymentPreferenceWithHooksAndAlarmsVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunctionWithDeploymentPreferenceWithHooksAndAlarms" @@ -397,9 +375,8 @@ } }, "MinimalFunctionVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -408,8 +385,6 @@ }, "MyValidationTestFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -440,8 +415,6 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -457,8 +430,6 @@ }, "MinimalFunctionWithDeploymentPreferenceWithHooksAndAlarmsAliaslivewithdeploymentwithhooksandalarms": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -490,8 +461,6 @@ }, "MyValidationTestFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "my-bucket", diff --git a/tests/translator/output/aws-us-gov/function_with_disabled_deployment_preference.json b/tests/translator/output/aws-us-gov/function_with_disabled_deployment_preference.json index f3d303dd6..6057dd5f9 100644 --- a/tests/translator/output/aws-us-gov/function_with_disabled_deployment_preference.json +++ b/tests/translator/output/aws-us-gov/function_with_disabled_deployment_preference.json @@ -1,9 +1,8 @@ { "Resources": { "MinimalFunctionVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -12,8 +11,6 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -29,8 +26,6 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -54,8 +49,6 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-us-gov/function_with_dlq.json b/tests/translator/output/aws-us-gov/function_with_dlq.json index ad0a39128..d72373ef2 100644 --- a/tests/translator/output/aws-us-gov/function_with_dlq.json +++ b/tests/translator/output/aws-us-gov/function_with_dlq.json @@ -2,8 +2,6 @@ "Resources": { "MySnsDlqLambdaFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -49,8 +47,6 @@ }, "MySqsDlqLambdaFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -96,8 +92,6 @@ }, "MySqsDlqLambdaFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -124,8 +118,6 @@ }, "MySnsDlqLambdaFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-us-gov/function_with_event_dest.json b/tests/translator/output/aws-us-gov/function_with_event_dest.json index f15d20f30..629685776 100644 --- a/tests/translator/output/aws-us-gov/function_with_event_dest.json +++ b/tests/translator/output/aws-us-gov/function_with_event_dest.json @@ -49,8 +49,6 @@ "Resources": { "MyTestFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -126,15 +124,11 @@ }, "MyTestFunctionEventInvokeConfigOnSuccessQueue": { "Type": "AWS::SQS::Queue", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": {}, "Condition": "NOTQueueCreationDisabled2da03e5b6f" }, "SNSSubscription": { "Type": "AWS::SNS::Subscription", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Endpoint": "example@example.com", "Protocol": "email", @@ -146,8 +140,6 @@ }, "MyTestFunctionEventInvokeConfig": { "Type": "AWS::Lambda::EventInvokeConfig", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "MaximumEventAgeInSeconds": 70, "MaximumRetryAttempts": 1, @@ -186,8 +178,6 @@ }, "MyTestFunction2Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -249,8 +239,6 @@ }, "DestinationLambda": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async (event) => {\n const response = {\n statusCode: 200,\n body: JSON.stringify('Hello from Lambda!'),\n };\n return response;\n};\n" @@ -274,8 +262,6 @@ }, "MyTestFunction2EventInvokeConfig": { "Type": "AWS::Lambda::EventInvokeConfig", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "MaximumEventAgeInSeconds": 70, "MaximumRetryAttempts": 1, @@ -300,8 +286,6 @@ }, "DestinationLambdaRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -332,8 +316,6 @@ }, "MyTestFunction2": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = function(event, context, callback) {\n var event_received_at = new Date().toISOString();\n console.log('Event received at: ' + event_received_at);\n console.log('Received event:', JSON.stringify(event, null, 2));\n\n if (event.Success) {\n console.log(\"Success\");\n context.callbackWaitsForEmptyEventLoop = false;\n callback(null);\n } else {\n console.log(\"Failure\");\n context.callbackWaitsForEmptyEventLoop = false;\n callback(new Error(\"Failure from event, Success = false, I am failing!\"), 'Destination Function Error Thrown');\n }\n}; \n" @@ -357,8 +339,6 @@ }, "MyTestFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = function(event, context, callback) {\n var event_received_at = new Date().toISOString();\n console.log('Event received at: ' + event_received_at);\n console.log('Received event:', JSON.stringify(event, null, 2));\n\n if (event.Success) {\n console.log(\"Success\");\n context.callbackWaitsForEmptyEventLoop = false;\n callback(null);\n } else {\n console.log(\"Failure\");\n context.callbackWaitsForEmptyEventLoop = false;\n callback(new Error(\"Failure from event, Success = false, I am failing!\"), 'Destination Function Error Thrown');\n }\n}; \n" @@ -382,8 +362,6 @@ }, "MyTestFunctionEventInvokeConfigOnFailureTopic": { "Type": "AWS::SNS::Topic", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": {}, "Condition": "TopicCreationEnabled" } diff --git a/tests/translator/output/aws-us-gov/function_with_event_dest_basic.json b/tests/translator/output/aws-us-gov/function_with_event_dest_basic.json index e86c1cc23..2849abc9a 100644 --- a/tests/translator/output/aws-us-gov/function_with_event_dest_basic.json +++ b/tests/translator/output/aws-us-gov/function_with_event_dest_basic.json @@ -8,14 +8,10 @@ "Resources": { "MyTestFunctionEventInvokeConfigOnSuccessQueue": { "Type": "AWS::SQS::Queue", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": {} }, "MyTestFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -77,8 +73,6 @@ }, "MyTestFunctionEventInvokeConfig": { "Type": "AWS::Lambda::EventInvokeConfig", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "MaximumEventAgeInSeconds": 70, "MaximumRetryAttempts": 1, @@ -106,8 +100,6 @@ }, "MyTestFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = function(event, context, callback) {\n var event_received_at = new Date().toISOString();\n console.log('Event received at: ' + event_received_at);\n console.log('Received event:', JSON.stringify(event, null, 2));\n\n if (event.Success) {\n console.log(\"Success\");\n context.callbackWaitsForEmptyEventLoop = false;\n callback(null);\n } else {\n console.log(\"Failure\");\n context.callbackWaitsForEmptyEventLoop = false;\n callback(new Error(\"Failure from event, Success = false, I am failing!\"), 'Destination Function Error Thrown');\n }\n}; \n" @@ -131,8 +123,6 @@ }, "MyTestFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -147,9 +137,8 @@ } }, "MyTestFunctionVersiondaf9da458d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MyTestFunction" diff --git a/tests/translator/output/aws-us-gov/function_with_event_dest_conditional.json b/tests/translator/output/aws-us-gov/function_with_event_dest_conditional.json index f3b767344..32175aa06 100644 --- a/tests/translator/output/aws-us-gov/function_with_event_dest_conditional.json +++ b/tests/translator/output/aws-us-gov/function_with_event_dest_conditional.json @@ -59,8 +59,6 @@ "Resources": { "DestinationLambdaRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -92,15 +90,11 @@ }, "MyTestFunctionEventInvokeConfigOnSuccessQueue": { "Type": "AWS::SQS::Queue", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": {}, "Condition": "FunctionConditionANDNOTQueueCreationDisabled2da03e5b6fe547d4e2d6" }, "MyTestFunctionEventInvokeConfig": { "Type": "AWS::Lambda::EventInvokeConfig", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "MaximumEventAgeInSeconds": 70, "MaximumRetryAttempts": 1, @@ -143,8 +137,6 @@ }, "MyTestFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = function(event, context, callback) {\n var event_received_at = new Date().toISOString();\n console.log('Event received at: ' + event_received_at);\n console.log('Received event:', JSON.stringify(event, null, 2));\n\n if (event.Success) {\n console.log(\"Success\");\n context.callbackWaitsForEmptyEventLoop = false;\n callback(null);\n } else {\n console.log(\"Failure\");\n context.callbackWaitsForEmptyEventLoop = false;\n callback(new Error(\"Failure from event, Success = false, I am failing!\"), 'Destination Function Error Thrown');\n }\n}; \n" @@ -169,8 +161,6 @@ }, "DestinationLambda": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async (event) => {\n const response = {\n statusCode: 200,\n body: JSON.stringify('Hello from Lambda!'),\n };\n return response;\n};\n" @@ -195,8 +185,6 @@ }, "MyTestFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", diff --git a/tests/translator/output/aws-us-gov/function_with_event_source_mapping.json b/tests/translator/output/aws-us-gov/function_with_event_source_mapping.json index 6e902a548..a910aefed 100644 --- a/tests/translator/output/aws-us-gov/function_with_event_source_mapping.json +++ b/tests/translator/output/aws-us-gov/function_with_event_source_mapping.json @@ -9,19 +9,13 @@ }, "Resources": { "MySqsQueue": { - "Type": "AWS::SQS::Queue", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::SQS::Queue" }, "MySnsTopic": { - "Type": "AWS::SNS::Topic", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::SNS::Topic" }, "MyFunctionForBatchingExampleStream": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "MaximumBatchingWindowInSeconds": 20, "EventSourceArn": { @@ -38,8 +32,6 @@ }, "DynamoDBTable": { "Type": "AWS::DynamoDB::Table", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "KeySchema": [ { @@ -64,8 +56,6 @@ }, "MyFunctionForBatchingExampleRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -157,16 +147,12 @@ }, "KinesisStream1": { "Type": "AWS::Kinesis::Stream", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ShardCount": 1 } }, "MyFunctionForBatchingExampleDynamoDBStreamEvent": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "MaximumBatchingWindowInSeconds": { "Ref": "MyBatchingWindowParam" @@ -202,8 +188,6 @@ }, "MyFunctionForBatchingExample": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -226,8 +210,6 @@ }, "MyFunctionForBatchingExampleStreamEvent": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "MaximumBatchingWindowInSeconds": { "Ref": "MyBatchingWindowParam" @@ -253,8 +235,6 @@ }, "KinesisStream": { "Type": "AWS::Kinesis::Stream", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ShardCount": 1 } diff --git a/tests/translator/output/aws-us-gov/function_with_file_system_config.json b/tests/translator/output/aws-us-gov/function_with_file_system_config.json index f7a9e27bf..132a7e909 100644 --- a/tests/translator/output/aws-us-gov/function_with_file_system_config.json +++ b/tests/translator/output/aws-us-gov/function_with_file_system_config.json @@ -1,14 +1,10 @@ { "Resources": { "EfsFileSystem": { - "Type": "AWS::EFS::FileSystem", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::EFS::FileSystem" }, "LambdaFunctionWithEfs": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "const fs = require('fs')\nconst path = require('path')\nconst efsMountPath = '/mnt/efs'\n\nexports.handler = async (event, context, callback) => {\nconst directory = path.join(efsMountPath, event.body)\nconst files = fs.readdirSync(directory)\nreturn files\n}\n" @@ -52,8 +48,6 @@ }, "MountTarget": { "Type": "AWS::EFS::MountTarget", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "SubnetId": "subnet-abc123", "FileSystemId": { @@ -66,8 +60,6 @@ }, "LambdaFunctionWithEfsRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -99,8 +91,6 @@ }, "AccessPoint": { "Type": "AWS::EFS::AccessPoint", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FileSystemId": { "Ref": "EfsFileSystem" diff --git a/tests/translator/output/aws-us-gov/function_with_global_layers.json b/tests/translator/output/aws-us-gov/function_with_global_layers.json index 324ef40d4..58bd6af51 100644 --- a/tests/translator/output/aws-us-gov/function_with_global_layers.json +++ b/tests/translator/output/aws-us-gov/function_with_global_layers.json @@ -2,8 +2,6 @@ "Resources": { "ManyLayersFuncRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -34,8 +32,6 @@ }, "ManyLayersFunc": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-us-gov/function_with_kmskeyarn.json b/tests/translator/output/aws-us-gov/function_with_kmskeyarn.json index fbd8f9454..7ff51981f 100644 --- a/tests/translator/output/aws-us-gov/function_with_kmskeyarn.json +++ b/tests/translator/output/aws-us-gov/function_with_kmskeyarn.json @@ -2,8 +2,6 @@ "Resources": { "FunctionWithKeyArnRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -34,8 +32,6 @@ }, "FunctionWithReferenceToKeyArnRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -66,8 +62,6 @@ }, "FunctionWithKeyArn": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -92,8 +86,6 @@ }, "myKey": { "Type": "AWS::KMS::Key", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "KeyPolicy": { "Version": "2012-10-17", @@ -117,8 +109,6 @@ }, "FunctionWithReferenceToKeyArn": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-us-gov/function_with_layers.json b/tests/translator/output/aws-us-gov/function_with_layers.json index bc7e0dbd0..9197f869c 100644 --- a/tests/translator/output/aws-us-gov/function_with_layers.json +++ b/tests/translator/output/aws-us-gov/function_with_layers.json @@ -2,8 +2,6 @@ "Resources": { "MinimalLayerFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Layers": [ "arn:aws:lambda:us-east-1:123456789101:layer:CorpXLayer:1" @@ -29,9 +27,8 @@ } }, "MyLayera5167acaba": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::LayerVersion", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "sam-demo-bucket", @@ -42,8 +39,6 @@ }, "FunctionReferencesLayer": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Layers": [ { @@ -72,8 +67,6 @@ }, "MinimalLayerFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -104,8 +97,6 @@ }, "FunctionReferencesLayerRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -136,8 +127,6 @@ }, "FunctionLayerWithSubIntrinsic": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Layers": [ { @@ -169,8 +158,6 @@ }, "FunctionNoLayerVersion": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Layers": [ "arn:aws:lambda:us-east-1:123456789101:layer:CorpXLayer:1" @@ -197,8 +184,6 @@ }, "FunctionNoLayerVersionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -229,8 +214,6 @@ }, "FunctionLayerWithSubIntrinsicRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-us-gov/function_with_many_layers.json b/tests/translator/output/aws-us-gov/function_with_many_layers.json index 259a57785..15389c0a6 100644 --- a/tests/translator/output/aws-us-gov/function_with_many_layers.json +++ b/tests/translator/output/aws-us-gov/function_with_many_layers.json @@ -1,9 +1,8 @@ { "Resources": { "MyLayera5167acaba": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::LayerVersion", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "sam-demo-bucket", @@ -14,8 +13,6 @@ }, "ManyLayersFuncRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -46,8 +43,6 @@ }, "ManyLayersFunc": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Layers": [ "arn:aws:lambda:us-east-1:123456789101:layer:z:1", diff --git a/tests/translator/output/aws-us-gov/function_with_permissions_boundary.json b/tests/translator/output/aws-us-gov/function_with_permissions_boundary.json index dee6d61e1..f4914ac7c 100644 --- a/tests/translator/output/aws-us-gov/function_with_permissions_boundary.json +++ b/tests/translator/output/aws-us-gov/function_with_permissions_boundary.json @@ -2,8 +2,6 @@ "Resources": { "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -35,8 +33,6 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { diff --git a/tests/translator/output/aws-us-gov/function_with_policy_templates.json b/tests/translator/output/aws-us-gov/function_with_policy_templates.json index f2a292100..4ae24a6d4 100644 --- a/tests/translator/output/aws-us-gov/function_with_policy_templates.json +++ b/tests/translator/output/aws-us-gov/function_with_policy_templates.json @@ -7,8 +7,6 @@ "Resources": { "OnePolicyTemplate": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -32,8 +30,6 @@ }, "MultiplePolicyTemplates": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -57,8 +53,6 @@ }, "OnePolicyTemplateRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -124,8 +118,6 @@ }, "MultiplePolicyTemplatesRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -205,8 +197,6 @@ }, "AllCombinations": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -230,8 +220,6 @@ }, "AllCombinationsRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaRole", diff --git a/tests/translator/output/aws-us-gov/function_with_request_parameters.json b/tests/translator/output/aws-us-gov/function_with_request_parameters.json index fbd4cc870..67345e559 100644 --- a/tests/translator/output/aws-us-gov/function_with_request_parameters.json +++ b/tests/translator/output/aws-us-gov/function_with_request_parameters.json @@ -2,8 +2,6 @@ "Resources": { "ApiParameterFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "NoApiParameterFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ServerlessRestApiDeploymentbe3a929cf9": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -71,8 +65,6 @@ }, "ApiDeployment5e67eb8be3": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "Api" @@ -83,8 +75,6 @@ }, "ApiParameterFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -115,8 +105,6 @@ }, "NoApiParameterFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -138,8 +126,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentbe3a929cf9" @@ -152,8 +138,6 @@ }, "Api": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -201,8 +185,6 @@ }, "ApiParameterFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -222,8 +204,6 @@ }, "ApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ApiDeployment5e67eb8be3" @@ -236,8 +216,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -294,8 +272,6 @@ }, "NoApiParameterFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { diff --git a/tests/translator/output/aws-us-gov/function_with_resource_refs.json b/tests/translator/output/aws-us-gov/function_with_resource_refs.json index 51744a1f6..b54893054 100644 --- a/tests/translator/output/aws-us-gov/function_with_resource_refs.json +++ b/tests/translator/output/aws-us-gov/function_with_resource_refs.json @@ -53,8 +53,6 @@ "Resources": { "FunctionWithoutAlias": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -78,8 +76,6 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -110,8 +106,6 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -135,8 +129,6 @@ }, "FunctionWithoutAliasRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -166,9 +158,8 @@ } }, "MinimalFunctionVersion640128d35d": { - "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", + "DeletionPolicy": "Retain", + "Type": "AWS::Lambda::Version", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -177,8 +168,6 @@ }, "MyBucket": { "Type": "AWS::S3::Bucket", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Name": { "Fn::GetAtt": [ @@ -190,8 +179,6 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ diff --git a/tests/translator/output/aws-us-gov/function_with_signing_profile.json b/tests/translator/output/aws-us-gov/function_with_signing_profile.json index 2f91d0041..fb4065fa5 100644 --- a/tests/translator/output/aws-us-gov/function_with_signing_profile.json +++ b/tests/translator/output/aws-us-gov/function_with_signing_profile.json @@ -2,8 +2,6 @@ "Resources": { "FunctionWithSigningProfile": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -30,8 +28,6 @@ }, "FunctionWithSigningProfileRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -62,8 +58,6 @@ }, "MySignedFunctionCodeSigningConfig": { "Type": "AWS::Lambda::CodeSigningConfig", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "CodeSigningPolicies": { "UntrustedArtifactOnDeployment": "Enforce" @@ -83,8 +77,6 @@ }, "SigningProfile": { "Type": "AWS::Signer::SigningProfile", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "PlatformId": "AWSLambda-SHA384-ECDSA" } diff --git a/tests/translator/output/aws-us-gov/function_with_sns_event_source_all_parameters.json b/tests/translator/output/aws-us-gov/function_with_sns_event_source_all_parameters.json index 57761ef10..87237d78b 100644 --- a/tests/translator/output/aws-us-gov/function_with_sns_event_source_all_parameters.json +++ b/tests/translator/output/aws-us-gov/function_with_sns_event_source_all_parameters.json @@ -2,8 +2,6 @@ "Resources": { "MyAwesomeFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FilterPolicy": { "store": [ @@ -41,8 +39,6 @@ }, "MyAwesomeFunctionNotificationTopicPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "sns.amazonaws.com", @@ -54,8 +50,6 @@ }, "MyAwesomeFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -86,8 +80,6 @@ }, "MyAwesomeFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-us-gov/global_handle_path_level_parameter.json b/tests/translator/output/aws-us-gov/global_handle_path_level_parameter.json index d2bfdbbf6..cdcf96bc2 100644 --- a/tests/translator/output/aws-us-gov/global_handle_path_level_parameter.json +++ b/tests/translator/output/aws-us-gov/global_handle_path_level_parameter.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -131,8 +125,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -150,8 +142,6 @@ }, "ExplicitApiSomeStageStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -169,8 +159,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -192,8 +180,6 @@ }, "ServerlessRestApiDeploymentc969c99f9d": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -204,8 +190,6 @@ }, "MyUserPool": { "Type": "AWS::Cognito::UserPool", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "UsernameAttributes": [ "email" @@ -227,8 +211,6 @@ }, "ExplicitApiDeployment9a254aa466": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -239,8 +221,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/globals_for_api.json b/tests/translator/output/aws-us-gov/globals_for_api.json index 3ce9eccd3..feedaa823 100644 --- a/tests/translator/output/aws-us-gov/globals_for_api.json +++ b/tests/translator/output/aws-us-gov/globals_for_api.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -130,8 +124,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -149,8 +141,6 @@ }, "ExplicitApiSomeStageStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -168,8 +158,6 @@ }, "ExplicitApiDeployment43e01e673d": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -180,8 +168,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -203,8 +189,6 @@ }, "ServerlessRestApiDeployment6fd1928d9b": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -215,8 +199,6 @@ }, "MyUserPool": { "Type": "AWS::Cognito::UserPool", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "UsernameAttributes": [ "email" @@ -238,8 +220,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/globals_for_function.json b/tests/translator/output/aws-us-gov/globals_for_function.json index 5ff295071..6a7fbfe70 100644 --- a/tests/translator/output/aws-us-gov/globals_for_function.json +++ b/tests/translator/output/aws-us-gov/globals_for_function.json @@ -2,8 +2,6 @@ "Resources": { "FunctionWithOverridesRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -45,8 +43,6 @@ }, "FunctionWithOverrides": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Layers": [ { @@ -108,8 +104,6 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -147,8 +141,6 @@ }, "FunctionWithOverridesAliasprod": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -164,8 +156,6 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Layers": [ { @@ -218,8 +208,6 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -234,9 +222,8 @@ } }, "FunctionWithOverridesVersion096ed3b52b": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "FunctionWithOverrides" @@ -244,9 +231,8 @@ } }, "MinimalFunctionVersion0a06fc8fb1": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" diff --git a/tests/translator/output/aws-us-gov/globals_for_simpletable.json b/tests/translator/output/aws-us-gov/globals_for_simpletable.json index 990238365..313fd286c 100644 --- a/tests/translator/output/aws-us-gov/globals_for_simpletable.json +++ b/tests/translator/output/aws-us-gov/globals_for_simpletable.json @@ -2,8 +2,6 @@ "Resources": { "MinimalTable": { "Type": "AWS::DynamoDB::Table", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BillingMode": "PAY_PER_REQUEST", "SSESpecification": { diff --git a/tests/translator/output/aws-us-gov/http_api_def_uri.json b/tests/translator/output/aws-us-gov/http_api_def_uri.json index c4db6212c..519068750 100644 --- a/tests/translator/output/aws-us-gov/http_api_def_uri.json +++ b/tests/translator/output/aws-us-gov/http_api_def_uri.json @@ -2,8 +2,6 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -27,8 +25,6 @@ }, "FunctionApiPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -48,8 +44,6 @@ }, "MyApiStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -72,8 +66,6 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -104,8 +96,6 @@ }, "MyApi2ApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi2" @@ -119,8 +109,6 @@ }, "MyApi2": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BodyS3Location": { "Version": "version", @@ -131,8 +119,6 @@ }, "FunctionApi2Permission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -154,8 +140,6 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BodyS3Location": { "Bucket": "bucket", diff --git a/tests/translator/output/aws-us-gov/http_api_description.json b/tests/translator/output/aws-us-gov/http_api_description.json index fb8af0044..dd4a7f36c 100644 --- a/tests/translator/output/aws-us-gov/http_api_description.json +++ b/tests/translator/output/aws-us-gov/http_api_description.json @@ -2,8 +2,6 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -27,8 +25,6 @@ }, "FunctionApiPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -48,8 +44,6 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -80,8 +74,6 @@ }, "HttpApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AutoDeploy": true, "ApiId": { @@ -95,8 +87,6 @@ }, "HttpApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "openapi": "3.0.1", diff --git a/tests/translator/output/aws-us-gov/http_api_existing_openapi.json b/tests/translator/output/aws-us-gov/http_api_existing_openapi.json index 9b927dc45..5efdccc32 100644 --- a/tests/translator/output/aws-us-gov/http_api_existing_openapi.json +++ b/tests/translator/output/aws-us-gov/http_api_existing_openapi.json @@ -8,8 +8,6 @@ "Resources": { "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -31,8 +29,6 @@ }, "MyApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -46,8 +42,6 @@ }, "HttpApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.restapi", "Code": { @@ -71,8 +65,6 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -104,8 +96,6 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/http_api_existing_openapi_conditions.json b/tests/translator/output/aws-us-gov/http_api_existing_openapi_conditions.json index 5a3ff261f..22e36ce32 100644 --- a/tests/translator/output/aws-us-gov/http_api_existing_openapi_conditions.json +++ b/tests/translator/output/aws-us-gov/http_api_existing_openapi_conditions.json @@ -10,8 +10,6 @@ "Resources": { "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -34,8 +32,6 @@ }, "MyApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -51,8 +47,6 @@ }, "HttpApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.restapi", "Code": { @@ -77,8 +71,6 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -110,8 +102,6 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/http_api_explicit_stage.json b/tests/translator/output/aws-us-gov/http_api_explicit_stage.json index 35c6de61f..6fbeb6689 100644 --- a/tests/translator/output/aws-us-gov/http_api_explicit_stage.json +++ b/tests/translator/output/aws-us-gov/http_api_explicit_stage.json @@ -12,8 +12,6 @@ "Resources": { "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -35,8 +33,6 @@ }, "HttpApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.restapi", "Code": { @@ -60,8 +56,6 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "StageVariables": { "VarName": "VarValue" @@ -90,8 +84,6 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -122,8 +114,6 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FailOnWarnings": true, "Body": { diff --git a/tests/translator/output/aws-us-gov/http_api_lambda_auth.json b/tests/translator/output/aws-us-gov/http_api_lambda_auth.json index 84715546f..bf4184c64 100644 --- a/tests/translator/output/aws-us-gov/http_api_lambda_auth.json +++ b/tests/translator/output/aws-us-gov/http_api_lambda_auth.json @@ -2,8 +2,6 @@ "Resources": { "HttpApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -27,8 +25,6 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -59,8 +55,6 @@ }, "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { @@ -82,8 +76,6 @@ }, "MyAuthFn": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "bucket", @@ -107,8 +99,6 @@ }, "MyAuthFnRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -139,8 +129,6 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "openapi": "3.0.1", @@ -250,8 +238,6 @@ }, "MyApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" diff --git a/tests/translator/output/aws-us-gov/http_api_lambda_auth_full.json b/tests/translator/output/aws-us-gov/http_api_lambda_auth_full.json index 34b0c46f5..3fe74a218 100644 --- a/tests/translator/output/aws-us-gov/http_api_lambda_auth_full.json +++ b/tests/translator/output/aws-us-gov/http_api_lambda_auth_full.json @@ -2,8 +2,6 @@ "Resources": { "HttpApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -27,8 +25,6 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -59,8 +55,6 @@ }, "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { @@ -82,8 +76,6 @@ }, "MyAuthFn": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "bucket", @@ -107,8 +99,6 @@ }, "MyAuthFnRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -139,8 +129,6 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "openapi": "3.0.1", @@ -264,8 +252,6 @@ }, "MyApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" diff --git a/tests/translator/output/aws-us-gov/http_api_with_cors.json b/tests/translator/output/aws-us-gov/http_api_with_cors.json index e50105b87..7b9ed1d10 100644 --- a/tests/translator/output/aws-us-gov/http_api_with_cors.json +++ b/tests/translator/output/aws-us-gov/http_api_with_cors.json @@ -10,8 +10,6 @@ "Resources": { "MyApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -25,8 +23,6 @@ }, "ServerlessHttpApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "ServerlessHttpApi" @@ -40,8 +36,6 @@ }, "ServerlessHttpApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -98,8 +92,6 @@ }, "HttpApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -122,8 +114,6 @@ }, "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -145,8 +135,6 @@ }, "HttpApiFunctionImplicitApiPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -168,8 +156,6 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -200,8 +186,6 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/implicit_and_explicit_api_with_conditions.json b/tests/translator/output/aws-us-gov/implicit_and_explicit_api_with_conditions.json index a69b7ad2a..2c5bb7890 100644 --- a/tests/translator/output/aws-us-gov/implicit_and_explicit_api_with_conditions.json +++ b/tests/translator/output/aws-us-gov/implicit_and_explicit_api_with_conditions.json @@ -39,8 +39,6 @@ "Resources": { "explicithello2": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -66,8 +64,6 @@ }, "implicithello2Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -99,8 +95,6 @@ }, "explicithello1": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -126,8 +120,6 @@ }, "explicitapiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "explicitapiDeploymentc8f1a3b6da" @@ -140,8 +132,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment0270cbc16b" @@ -155,8 +145,6 @@ }, "explicithello2Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -188,8 +176,6 @@ }, "explicithello1ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -212,8 +198,6 @@ }, "implicithello2": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -239,8 +223,6 @@ }, "implicithello1ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -263,8 +245,6 @@ }, "ServerlessRestApiDeployment0270cbc16b": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -276,8 +256,6 @@ }, "implicithello1": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -303,8 +281,6 @@ }, "explicithello2ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -327,8 +303,6 @@ }, "explicitapiDeploymentc8f1a3b6da": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "explicitapi" @@ -339,8 +313,6 @@ }, "explicitapi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -437,8 +409,6 @@ }, "implicithello2ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -461,8 +431,6 @@ }, "explicithello1Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -494,8 +462,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -593,8 +559,6 @@ }, "implicithello1Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-us-gov/implicit_api.json b/tests/translator/output/aws-us-gov/implicit_api.json index 681affb13..db1922ff5 100644 --- a/tests/translator/output/aws-us-gov/implicit_api.json +++ b/tests/translator/output/aws-us-gov/implicit_api.json @@ -2,8 +2,6 @@ "Resources": { "RestApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -36,8 +34,6 @@ }, "RestApiFunctionAddItemPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -59,8 +55,6 @@ }, "GetHtmlFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -82,8 +76,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentaaf8bd4588" @@ -96,8 +88,6 @@ }, "ServerlessRestApiDeploymentaaf8bd4588": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -108,8 +98,6 @@ }, "GetHtmlFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -133,8 +121,6 @@ }, "GetHtmlFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -167,8 +153,6 @@ }, "RestApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -192,8 +176,6 @@ }, "RestApiFunctionGetListPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -215,8 +197,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -289,8 +269,6 @@ }, "RestApiFunctionCompleteItemPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/implicit_api_with_auth_and_conditions_max.json b/tests/translator/output/aws-us-gov/implicit_api_with_auth_and_conditions_max.json index 232648757..55919ab21 100644 --- a/tests/translator/output/aws-us-gov/implicit_api_with_auth_and_conditions_max.json +++ b/tests/translator/output/aws-us-gov/implicit_api_with_auth_and_conditions_max.json @@ -81,8 +81,6 @@ "Resources": { "MyFunction4": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -107,8 +105,6 @@ }, "MyFunction6": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -133,8 +129,6 @@ }, "MyFunction2WithCognitoMultipleUserPoolsAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -157,8 +151,6 @@ }, "MyFunction3": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -183,8 +175,6 @@ }, "MyFunction2": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -209,8 +199,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment91a6380656" @@ -224,8 +212,6 @@ }, "MyFunction5Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -257,8 +243,6 @@ }, "MyFunction2Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -290,8 +274,6 @@ }, "MyFunction4Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -323,8 +305,6 @@ }, "MyFunction5": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -349,8 +329,6 @@ }, "MyFunction6Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -382,8 +360,6 @@ }, "ServerlessRestApiMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -403,8 +379,6 @@ }, "MyFunctionWithNoAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -427,8 +401,6 @@ }, "MyFunction3Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -460,8 +432,6 @@ }, "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -486,8 +456,6 @@ }, "MyFunction4WithLambdaTokenAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -510,8 +478,6 @@ }, "ServerlessRestApiMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -531,8 +497,6 @@ }, "MyFunction5WithLambdaRequestAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -555,8 +519,6 @@ }, "ServerlessRestApiMyLambdaTokenAuthNoneFunctionInvokeRoleAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -576,8 +538,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -609,8 +569,6 @@ }, "ServerlessRestApiDeployment91a6380656": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -622,8 +580,6 @@ }, "MyFunction3WithLambdaTokenAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -646,8 +602,6 @@ }, "MyFunction6WithDefaultAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -670,8 +624,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/implicit_api_with_many_conditions.json b/tests/translator/output/aws-us-gov/implicit_api_with_many_conditions.json index 260503992..7a9883371 100644 --- a/tests/translator/output/aws-us-gov/implicit_api_with_many_conditions.json +++ b/tests/translator/output/aws-us-gov/implicit_api_with_many_conditions.json @@ -125,8 +125,6 @@ "Resources": { "helloworld7ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -149,8 +147,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment8fffc54734" @@ -164,8 +160,6 @@ }, "helloworld1Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -197,8 +191,6 @@ }, "helloworld7": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -224,8 +216,6 @@ }, "helloworld6": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -251,8 +241,6 @@ }, "helloworldRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -284,8 +272,6 @@ }, "helloworld4": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -311,8 +297,6 @@ }, "helloworld3": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -338,8 +322,6 @@ }, "helloworld2": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -365,8 +347,6 @@ }, "helloworld1": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -392,8 +372,6 @@ }, "helloworld9": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -419,8 +397,6 @@ }, "helloApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -443,8 +419,6 @@ }, "helloworld2ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -467,8 +441,6 @@ }, "helloworld3ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -491,8 +463,6 @@ }, "helloworld1ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -515,8 +485,6 @@ }, "helloworld8": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -542,8 +510,6 @@ }, "helloworld6ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -566,8 +532,6 @@ }, "helloworld4Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -599,8 +563,6 @@ }, "helloworldApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -623,8 +585,6 @@ }, "helloworld9Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -656,8 +616,6 @@ }, "helloworld5ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -680,8 +638,6 @@ }, "helloworld8ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -704,8 +660,6 @@ }, "helloRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -737,8 +691,6 @@ }, "helloworld8Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -770,8 +722,6 @@ }, "helloworld": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -797,8 +747,6 @@ }, "helloworld5Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -830,8 +778,6 @@ }, "hello": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -857,8 +803,6 @@ }, "ServerlessRestApiDeployment8fffc54734": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -870,8 +814,6 @@ }, "helloworld5": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -897,8 +839,6 @@ }, "helloworld9ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -921,8 +861,6 @@ }, "helloworld6Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -954,8 +892,6 @@ }, "helloworld7Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -987,8 +923,6 @@ }, "helloworld2Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -1020,8 +954,6 @@ }, "helloworld3Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -1053,8 +985,6 @@ }, "helloworld4ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -1077,8 +1007,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/implicit_api_with_serverless_rest_api_resource.json b/tests/translator/output/aws-us-gov/implicit_api_with_serverless_rest_api_resource.json index 72d1c052d..fa2d5021d 100644 --- a/tests/translator/output/aws-us-gov/implicit_api_with_serverless_rest_api_resource.json +++ b/tests/translator/output/aws-us-gov/implicit_api_with_serverless_rest_api_resource.json @@ -2,8 +2,6 @@ "Resources": { "RestApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -35,8 +33,6 @@ }, "RestApiFunctionAddItemPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -58,8 +54,6 @@ }, "GetHtmlFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -81,8 +75,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentaaf8bd4588" @@ -95,8 +87,6 @@ }, "ServerlessRestApiDeploymentaaf8bd4588": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -107,8 +97,6 @@ }, "GetHtmlFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -132,8 +120,6 @@ }, "GetHtmlFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -165,8 +151,6 @@ }, "RestApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.restapi", "Code": { @@ -190,8 +174,6 @@ }, "RestApiFunctionGetListPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -213,8 +195,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -287,8 +267,6 @@ }, "RestApiFunctionCompleteItemPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/implicit_http_api.json b/tests/translator/output/aws-us-gov/implicit_http_api.json index 2d6a47aee..713e890c6 100644 --- a/tests/translator/output/aws-us-gov/implicit_http_api.json +++ b/tests/translator/output/aws-us-gov/implicit_http_api.json @@ -2,8 +2,6 @@ "Resources": { "ServerlessHttpApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "ServerlessHttpApi" @@ -17,8 +15,6 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -50,8 +46,6 @@ }, "HttpApiFunction2Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -83,8 +77,6 @@ }, "HttpApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.restapi", "Code": { @@ -108,8 +100,6 @@ }, "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -131,8 +121,6 @@ }, "HttpApiFunction2": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.restapi", "Code": { @@ -156,8 +144,6 @@ }, "ServerlessHttpApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -245,8 +231,6 @@ }, "HttpApiFunction2PathParametersPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -268,8 +252,6 @@ }, "HttpApiFunction2Basic2Permission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/implicit_http_api_auth_and_simple_case.json b/tests/translator/output/aws-us-gov/implicit_http_api_auth_and_simple_case.json index 170b974b4..7ace3a522 100644 --- a/tests/translator/output/aws-us-gov/implicit_http_api_auth_and_simple_case.json +++ b/tests/translator/output/aws-us-gov/implicit_http_api_auth_and_simple_case.json @@ -2,8 +2,6 @@ "Resources": { "ServerlessHttpApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "ServerlessHttpApi" @@ -17,8 +15,6 @@ }, "RestApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -50,8 +46,6 @@ }, "RestApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.restapi", "Code": { @@ -75,8 +69,6 @@ }, "RestApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -98,8 +90,6 @@ }, "ServerlessHttpApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/implicit_http_api_with_many_conditions.json b/tests/translator/output/aws-us-gov/implicit_http_api_with_many_conditions.json index bc7031a58..9f1185595 100644 --- a/tests/translator/output/aws-us-gov/implicit_http_api_with_many_conditions.json +++ b/tests/translator/output/aws-us-gov/implicit_http_api_with_many_conditions.json @@ -116,8 +116,6 @@ "Resources": { "helloworld9HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -140,8 +138,6 @@ }, "helloworld9Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -173,8 +169,6 @@ }, "helloworld2HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -197,8 +191,6 @@ }, "ServerlessHttpApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -691,8 +683,6 @@ }, "helloworld6HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -715,8 +705,6 @@ }, "helloworld1Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -748,8 +736,6 @@ }, "helloworld7": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -775,8 +761,6 @@ }, "helloworld6": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -802,8 +786,6 @@ }, "helloworld5": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -829,8 +811,6 @@ }, "helloworld1099Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -862,8 +842,6 @@ }, "helloworld3": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -889,8 +867,6 @@ }, "helloworld2": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -916,8 +892,6 @@ }, "helloworld1": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -943,8 +917,6 @@ }, "helloworld9": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -970,8 +942,6 @@ }, "hello": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -997,8 +967,6 @@ }, "helloRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -1030,8 +998,6 @@ }, "helloworld7HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -1054,8 +1020,6 @@ }, "helloHttpApiEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -1078,8 +1042,6 @@ }, "helloworld1HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -1102,8 +1064,6 @@ }, "helloworld5Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -1135,8 +1095,6 @@ }, "helloworld4Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -1168,8 +1126,6 @@ }, "helloworld1099HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -1192,8 +1148,6 @@ }, "helloworld5HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -1216,8 +1170,6 @@ }, "helloworld7Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -1249,8 +1201,6 @@ }, "helloworld2Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -1282,8 +1232,6 @@ }, "helloworld8Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -1315,8 +1263,6 @@ }, "helloworld4": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -1342,8 +1288,6 @@ }, "helloworld1099": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -1369,8 +1313,6 @@ }, "helloworld8HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -1393,8 +1335,6 @@ }, "ServerlessHttpApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AutoDeploy": true, "ApiId": { @@ -1433,8 +1373,6 @@ }, "helloworld3Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -1466,8 +1404,6 @@ }, "helloworld8": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -1493,8 +1429,6 @@ }, "helloworld4HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -1517,8 +1451,6 @@ }, "helloworld6Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -1550,8 +1482,6 @@ }, "helloworld3HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/inline_precedence.json b/tests/translator/output/aws-us-gov/inline_precedence.json index 4552bce56..7d650c33a 100644 --- a/tests/translator/output/aws-us-gov/inline_precedence.json +++ b/tests/translator/output/aws-us-gov/inline_precedence.json @@ -2,8 +2,6 @@ "Resources": { "HelloWorldFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -34,8 +32,6 @@ }, "HelloWorldFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.lambda_handler", "Code": { diff --git a/tests/translator/output/aws-us-gov/intrinsic_functions.json b/tests/translator/output/aws-us-gov/intrinsic_functions.json index 5e0b42fcd..fb8bdbe7a 100644 --- a/tests/translator/output/aws-us-gov/intrinsic_functions.json +++ b/tests/translator/output/aws-us-gov/intrinsic_functions.json @@ -32,8 +32,6 @@ "Resources": { "MyExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -54,8 +52,6 @@ }, "MyTable": { "Type": "AWS::DynamoDB::Table", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "KeySchema": [ { @@ -79,14 +75,10 @@ } }, "SnsDlqQueue": { - "Type": "AWS::SNS::Topic", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::SNS::Topic" }, "MySqsDlqLambdaFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -117,14 +109,10 @@ } }, "SqsDlqQueue": { - "Type": "AWS::SQS::Queue", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::SQS::Queue" }, "ApiWithExplicitS3Uri": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EndpointConfiguration": { "Types": [ @@ -144,8 +132,6 @@ }, "MyExplicitApiDeployment7145dd00ce": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyExplicitApi" @@ -156,8 +142,6 @@ }, "FunctionWithExplicitS3Uri": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "stream.ddb_handler", "Code": { @@ -182,8 +166,6 @@ }, "MySnsDlqLambdaFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -231,8 +213,6 @@ }, "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "TracingConfig": { "Mode": { @@ -292,8 +272,6 @@ }, "FunctionWithExplicitS3UriRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -324,8 +302,6 @@ }, "DynamoDBFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -357,8 +333,6 @@ }, "MySnsDlqLambdaFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -387,8 +361,6 @@ }, "MyNewRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -428,8 +400,6 @@ }, "DynamoDBFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "stream.ddb_handler", "Code": { @@ -453,8 +423,6 @@ }, "ApiWithExplicitS3UridevStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ApiWithExplicitS3UriDeploymenta227798f00" @@ -468,8 +436,6 @@ }, "DynamoDBFunctionMyDDBStream": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BatchSize": 200, "EventSourceArn": { @@ -486,8 +452,6 @@ }, "ApiWithExplicitS3UriDeploymenta227798f00": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ApiWithExplicitS3Uri" @@ -499,8 +463,6 @@ }, "MySqsDlqLambdaFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -551,8 +513,6 @@ }, "MyExplicitApidevStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyExplicitApiDeployment7145dd00ce" @@ -579,8 +539,6 @@ }, "MyFunctionMyApiPermissiondev": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/aws-us-gov/iot_rule.json b/tests/translator/output/aws-us-gov/iot_rule.json index 3d5cd592e..e648ef60d 100644 --- a/tests/translator/output/aws-us-gov/iot_rule.json +++ b/tests/translator/output/aws-us-gov/iot_rule.json @@ -4,8 +4,6 @@ "Resources": { "IoTRuleFuncMyIoTRule": { "Type": "AWS::IoT::TopicRule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "TopicRulePayload": { "AwsIotSqlVersion": "beta", @@ -28,8 +26,6 @@ }, "IoTRuleFuncMyOtherIoTRule": { "Type": "AWS::IoT::TopicRule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "TopicRulePayload": { "Actions": [ @@ -51,8 +47,6 @@ }, "IoTRuleFuncMyIoTRulePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -76,8 +70,6 @@ }, "IoTRuleFuncMyOtherIoTRulePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -101,8 +93,6 @@ }, "IoTRuleFunc": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -129,8 +119,6 @@ }, "IoTRuleFuncRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-us-gov/layers_all_properties.json b/tests/translator/output/aws-us-gov/layers_all_properties.json index 621d4f156..066c5eaab 100644 --- a/tests/translator/output/aws-us-gov/layers_all_properties.json +++ b/tests/translator/output/aws-us-gov/layers_all_properties.json @@ -38,8 +38,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Layers": [ { @@ -67,9 +65,8 @@ } }, "MyLayerd04062b365": { + "DeletionPolicy": "Delete", "Type": "AWS::Lambda::LayerVersion", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "bucket", @@ -79,9 +76,8 @@ } }, "MyLayerWithANamefda8c9ec8c": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::LayerVersion", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "bucket", @@ -92,8 +88,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/aws-us-gov/layers_with_intrinsics.json b/tests/translator/output/aws-us-gov/layers_with_intrinsics.json index 89546b674..e7898aa83 100644 --- a/tests/translator/output/aws-us-gov/layers_with_intrinsics.json +++ b/tests/translator/output/aws-us-gov/layers_with_intrinsics.json @@ -18,9 +18,8 @@ }, "Resources": { "LayerWithNameIntrinsiccf8baed8b9": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::LayerVersion", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "sam-demo-bucket", @@ -30,9 +29,8 @@ } }, "LayerWithRefNameIntrinsicRegionad31c93c8b": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::LayerVersion", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "sam-demo-bucket", @@ -42,9 +40,8 @@ } }, "LayerWithSubNameIntrinsicRegion5b2c74d55e": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::LayerVersion", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "sam-demo-bucket", @@ -56,9 +53,8 @@ } }, "LayerWithRuntimesIntrinsic1a006faa85": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::LayerVersion", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "sam-demo-bucket", @@ -71,6 +67,7 @@ } }, "LayerWithSingleListRefRuntimesIntrinsic9d7a72f24a": { + "DeletionPolicy": "Retain", "Properties": { "CompatibleRuntimes": [ { @@ -83,11 +80,10 @@ }, "LayerName": "LayerWithSingleListRefRuntimesIntrinsic" }, - "Type": "AWS::Lambda::LayerVersion", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::Lambda::LayerVersion" }, "LayerWithMixedListRefRuntimesIntrinsic71fd80f592": { + "DeletionPolicy": "Retain", "Properties": { "CompatibleRuntimes": [ { @@ -101,14 +97,11 @@ }, "LayerName": "LayerWithMixedListRefRuntimesIntrinsic" }, - "Type": "AWS::Lambda::LayerVersion", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::Lambda::LayerVersion" }, "LayerWithLicenseIntrinsic965c8d0c9b": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::LayerVersion", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "sam-demo-bucket", @@ -120,8 +113,7 @@ }, "LayerWithSubNameIntrinsic6e9b477102": { "Type": "AWS::Lambda::LayerVersion", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", + "DeletionPolicy": "Retain", "Properties": { "Content": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-us-gov/no_implicit_api_with_serverless_rest_api_resource.json b/tests/translator/output/aws-us-gov/no_implicit_api_with_serverless_rest_api_resource.json index c0b7b6649..07945dfb6 100644 --- a/tests/translator/output/aws-us-gov/no_implicit_api_with_serverless_rest_api_resource.json +++ b/tests/translator/output/aws-us-gov/no_implicit_api_with_serverless_rest_api_resource.json @@ -2,8 +2,6 @@ "Resources": { "GetHtmlFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -27,8 +25,6 @@ }, "GetHtmlFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ThumbnailFunctionImageBucketPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -74,8 +68,6 @@ }, "RestApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -106,8 +98,6 @@ }, "RestApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -131,8 +121,6 @@ }, "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -163,8 +151,6 @@ }, "Images": { "Type": "AWS::S3::Bucket", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "NotificationConfiguration": { "LambdaConfigurations": [ @@ -186,8 +172,6 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.generate_thumbails", "Code": { @@ -211,8 +195,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/s3.json b/tests/translator/output/aws-us-gov/s3.json index 4373cbd28..31a839213 100644 --- a/tests/translator/output/aws-us-gov/s3.json +++ b/tests/translator/output/aws-us-gov/s3.json @@ -2,8 +2,6 @@ "Resources": { "Images": { "Type": "AWS::S3::Bucket", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "DependsOn": ["ThumbnailFunctionImageBucketPermission"], "Properties": { "NotificationConfiguration": { @@ -23,8 +21,6 @@ }, "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,8 +51,6 @@ }, "ThumbnailFunctionImageBucketPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -70,8 +64,6 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-us-gov/s3_create_remove.json b/tests/translator/output/aws-us-gov/s3_create_remove.json index cbbaa47db..ad5819408 100644 --- a/tests/translator/output/aws-us-gov/s3_create_remove.json +++ b/tests/translator/output/aws-us-gov/s3_create_remove.json @@ -2,8 +2,6 @@ "Resources": { "Images": { "Type": "AWS::S3::Bucket", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "DependsOn": ["ThumbnailFunctionImageBucketPermission"], "Properties": { "NotificationConfiguration": { @@ -40,8 +38,6 @@ }, "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -72,8 +68,6 @@ }, "ThumbnailFunctionImageBucketPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -87,8 +81,6 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-us-gov/s3_existing_lambda_notification_configuration.json b/tests/translator/output/aws-us-gov/s3_existing_lambda_notification_configuration.json index 4373cbd28..31a839213 100644 --- a/tests/translator/output/aws-us-gov/s3_existing_lambda_notification_configuration.json +++ b/tests/translator/output/aws-us-gov/s3_existing_lambda_notification_configuration.json @@ -2,8 +2,6 @@ "Resources": { "Images": { "Type": "AWS::S3::Bucket", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "DependsOn": ["ThumbnailFunctionImageBucketPermission"], "Properties": { "NotificationConfiguration": { @@ -23,8 +21,6 @@ }, "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,8 +51,6 @@ }, "ThumbnailFunctionImageBucketPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -70,8 +64,6 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-us-gov/s3_existing_other_notification_configuration.json b/tests/translator/output/aws-us-gov/s3_existing_other_notification_configuration.json index 9f46c809a..341682e52 100644 --- a/tests/translator/output/aws-us-gov/s3_existing_other_notification_configuration.json +++ b/tests/translator/output/aws-us-gov/s3_existing_other_notification_configuration.json @@ -2,8 +2,6 @@ "Resources": { "Images": { "Type": "AWS::S3::Bucket", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "NotificationConfiguration": { "LambdaConfigurations": [ @@ -31,8 +29,6 @@ }, "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -63,8 +59,6 @@ }, "ThumbnailFunctionImageBucketPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -78,8 +72,6 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.generate_thumbails", "Code": { diff --git a/tests/translator/output/aws-us-gov/s3_filter.json b/tests/translator/output/aws-us-gov/s3_filter.json index e41fa17a9..a90f71b88 100644 --- a/tests/translator/output/aws-us-gov/s3_filter.json +++ b/tests/translator/output/aws-us-gov/s3_filter.json @@ -2,8 +2,6 @@ "Resources": { "Images": { "Type": "AWS::S3::Bucket", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "DependsOn": ["ThumbnailFunctionImageBucketPermission"], "Properties": { "NotificationConfiguration": { @@ -33,8 +31,6 @@ }, "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -65,8 +61,6 @@ }, "ThumbnailFunctionImageBucketPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -80,8 +74,6 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-us-gov/s3_multiple_events_same_bucket.json b/tests/translator/output/aws-us-gov/s3_multiple_events_same_bucket.json index 51a099ccc..d947979a1 100644 --- a/tests/translator/output/aws-us-gov/s3_multiple_events_same_bucket.json +++ b/tests/translator/output/aws-us-gov/s3_multiple_events_same_bucket.json @@ -2,8 +2,6 @@ "Resources": { "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -34,8 +32,6 @@ }, "ThumbnailFunctionImageBucketCreatesPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -49,8 +45,6 @@ }, "Images": { "Type": "AWS::S3::Bucket", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "DependsOn": ["ThumbnailFunctionImageBucketDeletesPermission", "ThumbnailFunctionImageBucketCreatesPermission"], "Properties": { "NotificationConfiguration": { @@ -89,8 +83,6 @@ }, "ThumbnailFunctionImageBucketDeletesPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -104,8 +96,6 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-us-gov/s3_multiple_functions.json b/tests/translator/output/aws-us-gov/s3_multiple_functions.json index 978bd17e9..fd4591fe1 100644 --- a/tests/translator/output/aws-us-gov/s3_multiple_functions.json +++ b/tests/translator/output/aws-us-gov/s3_multiple_functions.json @@ -2,8 +2,6 @@ "Resources": { "FunctionOneRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -34,8 +32,6 @@ }, "FunctionTwoImageBucketPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -49,8 +45,6 @@ }, "Images": { "Type": "AWS::S3::Bucket", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "NotificationConfiguration": { "LambdaConfigurations": [ @@ -88,8 +82,6 @@ }, "FunctionTwoRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -120,8 +112,6 @@ }, "FunctionOneImageBucketPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -135,8 +125,6 @@ }, "FunctionTwo": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -160,8 +148,6 @@ }, "FunctionOne": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-us-gov/s3_with_condition.json b/tests/translator/output/aws-us-gov/s3_with_condition.json index bcb2b61c3..7ec67a04b 100644 --- a/tests/translator/output/aws-us-gov/s3_with_condition.json +++ b/tests/translator/output/aws-us-gov/s3_with_condition.json @@ -10,8 +10,6 @@ "Resources": { "Images": { "Type": "AWS::S3::Bucket", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "NotificationConfiguration": { "LambdaConfigurations": [ @@ -52,8 +50,6 @@ }, "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -85,8 +81,6 @@ }, "ThumbnailFunctionImageBucketPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -101,8 +95,6 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.generate_thumbails", "Code": { diff --git a/tests/translator/output/aws-us-gov/s3_with_dependsOn.json b/tests/translator/output/aws-us-gov/s3_with_dependsOn.json index 9896fe0a1..5a5b0412b 100644 --- a/tests/translator/output/aws-us-gov/s3_with_dependsOn.json +++ b/tests/translator/output/aws-us-gov/s3_with_dependsOn.json @@ -1,14 +1,10 @@ { "Resources": { "Topic": { - "Type": "AWS::SNS::Topic", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::SNS::Topic" }, "Images": { "Type": "AWS::S3::Bucket", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "DependsOn": [ "ThumbnailFunctionImageBucketPermission", "Topic" @@ -31,8 +27,6 @@ }, "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -63,8 +57,6 @@ }, "ThumbnailFunctionImageBucketPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -78,8 +70,6 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-us-gov/simple_table_ref_parameter_intrinsic.json b/tests/translator/output/aws-us-gov/simple_table_ref_parameter_intrinsic.json index a2d13d330..e9a652d3b 100644 --- a/tests/translator/output/aws-us-gov/simple_table_ref_parameter_intrinsic.json +++ b/tests/translator/output/aws-us-gov/simple_table_ref_parameter_intrinsic.json @@ -16,8 +16,6 @@ "Resources": { "MinimalTableRefParamLongForm": { "Type": "AWS::DynamoDB::Table", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ProvisionedThroughput": { "WriteCapacityUnits": { diff --git a/tests/translator/output/aws-us-gov/simple_table_with_extra_tags.json b/tests/translator/output/aws-us-gov/simple_table_with_extra_tags.json index 36e580e2f..a02e088cd 100644 --- a/tests/translator/output/aws-us-gov/simple_table_with_extra_tags.json +++ b/tests/translator/output/aws-us-gov/simple_table_with_extra_tags.json @@ -8,8 +8,6 @@ "Resources": { "MinimalTableWithTags": { "Type": "AWS::DynamoDB::Table", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BillingMode": "PAY_PER_REQUEST", "AttributeDefinitions": [ diff --git a/tests/translator/output/aws-us-gov/simple_table_with_table_name.json b/tests/translator/output/aws-us-gov/simple_table_with_table_name.json index d560f80d8..57b9ef7a8 100644 --- a/tests/translator/output/aws-us-gov/simple_table_with_table_name.json +++ b/tests/translator/output/aws-us-gov/simple_table_with_table_name.json @@ -8,8 +8,6 @@ "Resources": { "MinimalTableWithTableName": { "Type": "AWS::DynamoDB::Table", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "TableName": "MySimpleTable", "BillingMode": "PAY_PER_REQUEST", @@ -29,8 +27,6 @@ }, "MinimalTableWithRefTableName": { "Type": "AWS::DynamoDB::Table", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "TableName": { "Ref": "MySimpleTableParameter" @@ -52,8 +48,6 @@ }, "MinimalTableWithSubTableName": { "Type": "AWS::DynamoDB::Table", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "TableName": { "Fn::Sub": "${AWS::StackName}MySimpleTable" diff --git a/tests/translator/output/aws-us-gov/simpletable.json b/tests/translator/output/aws-us-gov/simpletable.json index f26c9fa8f..c59f7a660 100644 --- a/tests/translator/output/aws-us-gov/simpletable.json +++ b/tests/translator/output/aws-us-gov/simpletable.json @@ -2,8 +2,6 @@ "Resources": { "MinimalTable": { "Type": "AWS::DynamoDB::Table", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BillingMode": "PAY_PER_REQUEST", "AttributeDefinitions": [ @@ -22,8 +20,6 @@ }, "CompleteTable": { "Type": "AWS::DynamoDB::Table", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ProvisionedThroughput": { "WriteCapacityUnits": 10, diff --git a/tests/translator/output/aws-us-gov/simpletable_with_sse.json b/tests/translator/output/aws-us-gov/simpletable_with_sse.json index e160085a5..ab4c3d3f5 100644 --- a/tests/translator/output/aws-us-gov/simpletable_with_sse.json +++ b/tests/translator/output/aws-us-gov/simpletable_with_sse.json @@ -2,8 +2,6 @@ "Resources": { "TableWithSSE": { "Type": "AWS::DynamoDB::Table", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BillingMode": "PAY_PER_REQUEST", "SSESpecification": { diff --git a/tests/translator/output/aws-us-gov/sns.json b/tests/translator/output/aws-us-gov/sns.json index aa8dde0e3..84508ffef 100644 --- a/tests/translator/output/aws-us-gov/sns.json +++ b/tests/translator/output/aws-us-gov/sns.json @@ -1,14 +1,10 @@ { "Resources": { "Notifications": { - "Type": "AWS::SNS::Topic", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::SNS::Topic" }, "SaveNotificationFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -39,8 +35,6 @@ }, "SaveNotificationFunctionNotificationTopicPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "sns.amazonaws.com", @@ -54,8 +48,6 @@ }, "SaveNotificationFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -79,8 +71,6 @@ }, "SaveNotificationFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Endpoint": { "Fn::GetAtt": [ diff --git a/tests/translator/output/aws-us-gov/sns_existing_other_subscription.json b/tests/translator/output/aws-us-gov/sns_existing_other_subscription.json index fa638cdcd..8eef98beb 100644 --- a/tests/translator/output/aws-us-gov/sns_existing_other_subscription.json +++ b/tests/translator/output/aws-us-gov/sns_existing_other_subscription.json @@ -2,8 +2,6 @@ "Resources": { "Notifications": { "Type": "AWS::SNS::Topic", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Subscription": [ { @@ -15,8 +13,6 @@ }, "SaveNotificationFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -47,8 +43,6 @@ }, "SaveNotificationFunctionNotificationTopicPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "sns.amazonaws.com", @@ -62,8 +56,6 @@ }, "SaveNotificationFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -87,8 +79,6 @@ }, "SaveNotificationFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Endpoint": { "Fn::GetAtt": [ diff --git a/tests/translator/output/aws-us-gov/sns_existing_sqs.json b/tests/translator/output/aws-us-gov/sns_existing_sqs.json index 127afd45e..94a123576 100644 --- a/tests/translator/output/aws-us-gov/sns_existing_sqs.json +++ b/tests/translator/output/aws-us-gov/sns_existing_sqs.json @@ -1,19 +1,13 @@ { "Resources": { "Queue": { - "Type": "AWS::SQS::Queue", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::SQS::Queue" }, "Notifications": { - "Type": "AWS::SNS::Topic", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::SNS::Topic" }, "NotificationA": { "Type": "AWS::SQS::QueuePolicy", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Queues": [ { @@ -47,8 +41,6 @@ }, "SaveNotificationFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FilterPolicy": { "price_usd": [ @@ -77,8 +69,6 @@ }, "SaveNotificationFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -110,8 +100,6 @@ }, "SaveNotificationFunctionNotificationTopicEventSourceMapping": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BatchSize": 8, "Enabled": true, @@ -128,8 +116,6 @@ }, "SaveNotificationFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.save_notification", "Code": { diff --git a/tests/translator/output/aws-us-gov/sns_outside_sqs.json b/tests/translator/output/aws-us-gov/sns_outside_sqs.json index cc3f70f47..79c5ff389 100644 --- a/tests/translator/output/aws-us-gov/sns_outside_sqs.json +++ b/tests/translator/output/aws-us-gov/sns_outside_sqs.json @@ -2,8 +2,6 @@ "Resources": { "NotificationB": { "Type": "AWS::SQS::QueuePolicy", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Queues": [ "https://sqs.us-east-1.amazonaws.com/123456789012/MyQueue" @@ -29,14 +27,10 @@ } }, "Notifications": { - "Type": "AWS::SNS::Topic", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::SNS::Topic" }, "SaveNotificationFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FilterPolicy": { "price_usd": [ @@ -60,8 +54,6 @@ }, "SaveNotificationFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -93,8 +85,6 @@ }, "SaveNotificationFunctionNotificationTopicEventSourceMapping": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BatchSize": 8, "Enabled": true, @@ -106,8 +96,6 @@ }, "SaveNotificationFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.save_notification", "Code": { diff --git a/tests/translator/output/aws-us-gov/sns_sqs.json b/tests/translator/output/aws-us-gov/sns_sqs.json index c98729205..d81d36c86 100644 --- a/tests/translator/output/aws-us-gov/sns_sqs.json +++ b/tests/translator/output/aws-us-gov/sns_sqs.json @@ -1,20 +1,14 @@ { "Resources": { "Notifications": { - "Type": "AWS::SNS::Topic", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::SNS::Topic" }, "SaveNotificationFunctionNotificationTopicQueue": { "Type": "AWS::SQS::Queue", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": {} }, "SaveNotificationFunctionNotificationTopicQueuePolicy": { "Type": "AWS::SQS::QueuePolicy", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Queues": [ { @@ -48,8 +42,6 @@ }, "SaveNotificationFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FilterPolicy": { "price_usd": [ @@ -78,8 +70,6 @@ }, "SaveNotificationFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -111,8 +101,6 @@ }, "SaveNotificationFunctionNotificationTopicEventSourceMapping": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BatchSize": 10, "Enabled": true, @@ -129,8 +117,6 @@ }, "SaveNotificationFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.save_notification", "Code": { diff --git a/tests/translator/output/aws-us-gov/sns_topic_outside_template.json b/tests/translator/output/aws-us-gov/sns_topic_outside_template.json index aebe525ba..e91b956cf 100644 --- a/tests/translator/output/aws-us-gov/sns_topic_outside_template.json +++ b/tests/translator/output/aws-us-gov/sns_topic_outside_template.json @@ -7,8 +7,6 @@ "Resources": { "SaveNotificationFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Endpoint": { "Fn::GetAtt": [ @@ -24,8 +22,6 @@ }, "SaveNotificationFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -56,8 +52,6 @@ }, "SaveNotificationFunctionNotificationTopicPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "sns.amazonaws.com", @@ -71,8 +65,6 @@ }, "SaveNotificationFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/aws-us-gov/sqs.json b/tests/translator/output/aws-us-gov/sqs.json index bf0e33edd..0d80717ab 100644 --- a/tests/translator/output/aws-us-gov/sqs.json +++ b/tests/translator/output/aws-us-gov/sqs.json @@ -2,8 +2,6 @@ "Resources": { "SQSFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -33,8 +31,6 @@ }, "SQSFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -56,8 +52,6 @@ }, "SQSFunctionMySqsQueue": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BatchSize": 10, "Enabled": false, diff --git a/tests/translator/output/aws-us-gov/state_machine_with_api_auth_default_scopes.json b/tests/translator/output/aws-us-gov/state_machine_with_api_auth_default_scopes.json index ab72718f4..6a466f04a 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_api_auth_default_scopes.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_api_auth_default_scopes.json @@ -2,8 +2,6 @@ "Resources": { "MyApiWithCognitoAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -369,8 +367,6 @@ }, "MyStateMachineCognitoWithAuthNoneRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -408,8 +404,6 @@ }, "MyStateMachineCognitoDefaultScopesNoneRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -447,8 +441,6 @@ }, "MyStateMachineCognitoDefaultAuthDefaultScopesNoneRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -486,8 +478,6 @@ }, "MyStateMachineCognitoDefaultScopesWithOverwrittenRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -525,8 +515,6 @@ }, "MyApiWithCognitoAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithCognitoAuthDeployment57b57dfc88" @@ -539,8 +527,6 @@ }, "MyApiWithCognitoAuthDeployment57b57dfc88": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithCognitoAuth" @@ -550,8 +536,6 @@ }, "MyStateMachineCognitoDefaultScopesDefaultAuthorizerRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -589,8 +573,6 @@ }, "MyStateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ @@ -632,8 +614,6 @@ }, "MyStateMachineCognitoAuthorizerWithDefaultScopesRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -671,8 +651,6 @@ }, "MyStateMachineCognitoAuthorizerScopesOverwrittenRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -710,8 +688,6 @@ }, "MyStateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", diff --git a/tests/translator/output/aws-us-gov/state_machine_with_api_authorizer.json b/tests/translator/output/aws-us-gov/state_machine_with_api_authorizer.json index b6af29036..c7a7a8711 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_api_authorizer.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_api_authorizer.json @@ -2,8 +2,6 @@ "Resources": { "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ @@ -46,8 +44,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentaaffc688ce" @@ -60,8 +56,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -124,8 +118,6 @@ }, "StateMachineWithLambdaTokenAuthRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -163,8 +155,6 @@ }, "MyApiMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -183,8 +173,6 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -228,8 +216,6 @@ }, "MyApiDeployment3c26186470": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -240,8 +226,6 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment3c26186470" @@ -254,8 +238,6 @@ }, "ServerlessRestApiDeploymentaaffc688ce": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -266,8 +248,6 @@ }, "StateMachineWithNoAuthorizerRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -305,8 +285,6 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/state_machine_with_api_authorizer_maximum.json b/tests/translator/output/aws-us-gov/state_machine_with_api_authorizer_maximum.json index 119be2f8c..42ad354b4 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_api_authorizer_maximum.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_api_authorizer_maximum.json @@ -2,8 +2,6 @@ "Resources": { "MyApiMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -22,8 +20,6 @@ }, "StateMachineWithLambdaRequestAuthorizerRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -61,8 +57,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ @@ -105,8 +99,6 @@ }, "MyApiDeployment2120b73f3e": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -117,8 +109,6 @@ }, "StateMachineWithDefaultAuthorizerRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -156,8 +146,6 @@ }, "MyApiMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -176,8 +164,6 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -221,8 +207,6 @@ }, "StateMachineWithLambdaTokenAuthorizerRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -260,8 +244,6 @@ }, "MyApiMyLambdaTokenAuthNoneFunctionInvokeRoleAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -280,8 +262,6 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment2120b73f3e" @@ -294,8 +274,6 @@ }, "StateMachineWithCognitoMultipleUserPoolsAuthorizerRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -333,8 +311,6 @@ }, "StateMachineWithNoAuthorizerRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -372,8 +348,6 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/state_machine_with_api_resource_policy.json b/tests/translator/output/aws-us-gov/state_machine_with_api_resource_policy.json index 450ad48c1..f9b4100a5 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_api_resource_policy.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_api_resource_policy.json @@ -2,8 +2,6 @@ "Resources": { "MyStateMachineGetHtmlRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -41,8 +39,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -304,8 +300,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment17065a95ba" @@ -318,8 +312,6 @@ }, "MyStateMachinePutHtmlRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -357,8 +349,6 @@ }, "MyStateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ @@ -400,8 +390,6 @@ }, "ExplicitApiDeployment17065a95ba": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -412,8 +400,6 @@ }, "MyStateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -457,8 +443,6 @@ }, "MyStateMachinePostHtmlRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { diff --git a/tests/translator/output/aws-us-gov/state_machine_with_condition.json b/tests/translator/output/aws-us-gov/state_machine_with_condition.json index 756e0dd02..7d67abe1a 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_condition.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_condition.json @@ -10,8 +10,6 @@ "Resources": { "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "StateMachineName": "MyStateMachine", diff --git a/tests/translator/output/aws-us-gov/state_machine_with_condition_and_events.json b/tests/translator/output/aws-us-gov/state_machine_with_condition_and_events.json index daaa04767..8e0a7a0ab 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_condition_and_events.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_condition_and_events.json @@ -10,8 +10,6 @@ "Resources": { "StateMachineMyApiEventRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -50,8 +48,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "StateMachineName": "MyStateMachine", @@ -71,8 +67,6 @@ }, "StateMachineScheduleEventRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -111,8 +105,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentaeae651245" @@ -126,8 +118,6 @@ }, "StateMachineScheduleEvent": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ScheduleExpression": "rate(1 minute)", "Targets": [ @@ -150,8 +140,6 @@ }, "StateMachineCWEvent": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -179,8 +167,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -268,8 +254,6 @@ }, "ServerlessRestApiDeploymentaeae651245": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -281,8 +265,6 @@ }, "StateMachineCWEventRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { diff --git a/tests/translator/output/aws-us-gov/state_machine_with_cwe.json b/tests/translator/output/aws-us-gov/state_machine_with_cwe.json index 177fdfe96..04164e943 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_cwe.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_cwe.json @@ -2,8 +2,6 @@ "Resources": { "StateMachineCWEvent": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -30,8 +28,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "DefinitionS3Location": { @@ -48,8 +44,6 @@ }, "StateMachineCWEventRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { diff --git a/tests/translator/output/aws-us-gov/state_machine_with_definition_S3_object.json b/tests/translator/output/aws-us-gov/state_machine_with_definition_S3_object.json index 2679a95c0..d324146d6 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_definition_S3_object.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_definition_S3_object.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -28,8 +26,6 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -78,8 +74,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -110,8 +104,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Tags": [ { diff --git a/tests/translator/output/aws-us-gov/state_machine_with_definition_S3_string.json b/tests/translator/output/aws-us-gov/state_machine_with_definition_S3_string.json index 5f6a4faba..4caed8074 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_definition_S3_string.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_definition_S3_string.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -28,8 +26,6 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -78,8 +74,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -110,8 +104,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Tags": [ { diff --git a/tests/translator/output/aws-us-gov/state_machine_with_definition_substitutions.json b/tests/translator/output/aws-us-gov/state_machine_with_definition_substitutions.json index 93680ef48..3695a061e 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_definition_substitutions.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_definition_substitutions.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -27,8 +25,6 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -77,8 +73,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -109,8 +103,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DefinitionSubstitutions": { "definition_substitution_1": { diff --git a/tests/translator/output/aws-us-gov/state_machine_with_eb_dlq.json b/tests/translator/output/aws-us-gov/state_machine_with_eb_dlq.json index 47aa3b4f3..e49e64256 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_eb_dlq.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_eb_dlq.json @@ -2,8 +2,6 @@ "Resources": { "StateMachineCWEvent": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -33,8 +31,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "DefinitionS3Location": { @@ -51,8 +47,6 @@ }, "StateMachineCWEventRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { diff --git a/tests/translator/output/aws-us-gov/state_machine_with_eb_dlq_generated.json b/tests/translator/output/aws-us-gov/state_machine_with_eb_dlq_generated.json index 213cea8c0..7e57f8926 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_eb_dlq_generated.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_eb_dlq_generated.json @@ -2,14 +2,10 @@ "Resources": { "TestDLQ": { "Type": "AWS::SQS::Queue", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": {} }, "StateMachineCWEvent": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -44,8 +40,6 @@ }, "StateMachineCWEventQueuePolicy": { "Type": "AWS::SQS::QueuePolicy", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Queues": [ { @@ -84,8 +78,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "DefinitionS3Location": { @@ -102,8 +94,6 @@ }, "StateMachineCWEventRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { diff --git a/tests/translator/output/aws-us-gov/state_machine_with_eb_retry_policy.json b/tests/translator/output/aws-us-gov/state_machine_with_eb_retry_policy.json index 3d6af1cfa..bff94e177 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_eb_retry_policy.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_eb_retry_policy.json @@ -2,8 +2,6 @@ "Resources": { "StateMachineCWEvent": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -34,8 +32,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "DefinitionS3Location": { @@ -52,8 +48,6 @@ }, "StateMachineCWEventRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { diff --git a/tests/translator/output/aws-us-gov/state_machine_with_explicit_api.json b/tests/translator/output/aws-us-gov/state_machine_with_explicit_api.json index 3cad7af0f..70ef4676a 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_explicit_api.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_explicit_api.json @@ -2,8 +2,6 @@ "Resources": { "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -47,8 +45,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ @@ -91,8 +87,6 @@ }, "MyApiDeployment05bc9f394c": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -103,8 +97,6 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment05bc9f394c" @@ -117,8 +109,6 @@ }, "StateMachineMyApiEventRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -156,8 +146,6 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/state_machine_with_express_logging.json b/tests/translator/output/aws-us-gov/state_machine_with_express_logging.json index 7024fdb2e..338d3a0e7 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_express_logging.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_express_logging.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -27,8 +25,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -59,8 +55,6 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -132,14 +126,10 @@ } }, "ExpressLogGroup": { - "Type": "AWS::Logs::LogGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::Logs::LogGroup" }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Tags": [ { diff --git a/tests/translator/output/aws-us-gov/state_machine_with_implicit_api.json b/tests/translator/output/aws-us-gov/state_machine_with_implicit_api.json index d9f4c7542..ebb4b1c02 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_implicit_api.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_implicit_api.json @@ -2,8 +2,6 @@ "Resources": { "StateMachineMyApiEventRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -41,8 +39,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ @@ -85,8 +81,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment05bc9f394c" @@ -99,8 +93,6 @@ }, "ServerlessRestApiDeployment05bc9f394c": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -111,8 +103,6 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -156,8 +146,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/state_machine_with_implicit_api_globals.json b/tests/translator/output/aws-us-gov/state_machine_with_implicit_api_globals.json index 0a7dc1ff9..c28b4704f 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_implicit_api_globals.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_implicit_api_globals.json @@ -2,8 +2,6 @@ "Resources": { "StateMachineMyApiEventRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -41,8 +39,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ @@ -85,8 +81,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment1f01b589d4" @@ -99,8 +93,6 @@ }, "ServerlessRestApiDeployment1f01b589d4": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -111,8 +103,6 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -156,8 +146,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/aws-us-gov/state_machine_with_inline_definition.json b/tests/translator/output/aws-us-gov/state_machine_with_inline_definition.json index 52817da2b..722bc9ec7 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_inline_definition.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_inline_definition.json @@ -2,8 +2,6 @@ "Resources": { "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -47,8 +45,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ diff --git a/tests/translator/output/aws-us-gov/state_machine_with_inline_definition_intrinsics.json b/tests/translator/output/aws-us-gov/state_machine_with_inline_definition_intrinsics.json index 94d09751e..b3d2b2154 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_inline_definition_intrinsics.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_inline_definition_intrinsics.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -28,8 +26,6 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -78,8 +74,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -110,8 +104,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DefinitionString": { "Fn::Join": [ diff --git a/tests/translator/output/aws-us-gov/state_machine_with_inline_policies.json b/tests/translator/output/aws-us-gov/state_machine_with_inline_policies.json index 94d09751e..b3d2b2154 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_inline_policies.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_inline_policies.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -28,8 +26,6 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -78,8 +74,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -110,8 +104,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DefinitionString": { "Fn::Join": [ diff --git a/tests/translator/output/aws-us-gov/state_machine_with_managed_policy.json b/tests/translator/output/aws-us-gov/state_machine_with_managed_policy.json index 66e47b50e..496ec9f64 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_managed_policy.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_managed_policy.json @@ -2,8 +2,6 @@ "Resources": { "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -34,8 +32,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ diff --git a/tests/translator/output/aws-us-gov/state_machine_with_permissions_boundary.json b/tests/translator/output/aws-us-gov/state_machine_with_permissions_boundary.json index 0f30ad7ac..550c0ae53 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_permissions_boundary.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_permissions_boundary.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -28,8 +26,6 @@ }, "StateMachineMyApiEventRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "PermissionsBoundary": "arn:aws:1234:iam:boundary/CustomerCreatedPermissionsBoundary", "Policies": [ @@ -68,8 +64,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ @@ -93,8 +87,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment05bc9f394c" @@ -107,8 +99,6 @@ }, "ServerlessRestApiDeployment05bc9f394c": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -119,8 +109,6 @@ }, "StateMachineCWEvent": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -147,8 +135,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -179,8 +165,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -243,8 +227,6 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -299,8 +281,6 @@ }, "StateMachineScheduleEventRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "PermissionsBoundary": "arn:aws:1234:iam:boundary/CustomerCreatedPermissionsBoundary", "Policies": [ @@ -339,8 +319,6 @@ }, "StateMachineScheduleEvent": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ScheduleExpression": "rate(1 minute)", "Targets": [ @@ -362,8 +340,6 @@ }, "StateMachineCWEventRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "PermissionsBoundary": "arn:aws:1234:iam:boundary/CustomerCreatedPermissionsBoundary", "Policies": [ diff --git a/tests/translator/output/aws-us-gov/state_machine_with_role.json b/tests/translator/output/aws-us-gov/state_machine_with_role.json index e929f3e45..0db8c03ab 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_role.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_role.json @@ -2,8 +2,6 @@ "Resources": { "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "StateMachineName": "MyStateMachineWithRole", diff --git a/tests/translator/output/aws-us-gov/state_machine_with_sam_policy_templates.json b/tests/translator/output/aws-us-gov/state_machine_with_sam_policy_templates.json index c9ad03bda..cc8fd1b19 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_sam_policy_templates.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_sam_policy_templates.json @@ -2,8 +2,6 @@ "Resources": { "ResolverLambda": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "resolver.handler", "Code": { @@ -27,8 +25,6 @@ }, "NestedWorkflow": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DefinitionSubstitutions": { "definition_substitution_1": { @@ -75,8 +71,6 @@ }, "StarterLambda": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "starter.handler", "Code": { @@ -100,8 +94,6 @@ }, "ProcessingWorkflow": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DefinitionSubstitutions": { "definition_substitution_4": { @@ -250,8 +242,6 @@ }, "StarterLambdaRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -282,8 +272,6 @@ }, "ProcessingWorkflowRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -449,8 +437,6 @@ }, "OutputStore": { "Type": "AWS::DynamoDB::Table", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "KeySchema": [ { @@ -469,14 +455,10 @@ } }, "ProcessingQueue": { - "Type": "AWS::SQS::Queue", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::SQS::Queue" }, "ResolverLambdaRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", diff --git a/tests/translator/output/aws-us-gov/state_machine_with_schedule.json b/tests/translator/output/aws-us-gov/state_machine_with_schedule.json index 76099c10b..8730521be 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_schedule.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_schedule.json @@ -2,8 +2,6 @@ "Resources": { "StateMachineScheduleEvent": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "State": "DISABLED", "ScheduleExpression": "rate(1 minute)", @@ -27,8 +25,6 @@ }, "StateMachineScheduleEventRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -66,8 +62,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "DefinitionS3Location": { diff --git a/tests/translator/output/aws-us-gov/state_machine_with_schedule_dlq_retry_policy.json b/tests/translator/output/aws-us-gov/state_machine_with_schedule_dlq_retry_policy.json index fa7f67853..5d49175a9 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_schedule_dlq_retry_policy.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_schedule_dlq_retry_policy.json @@ -2,8 +2,6 @@ "Resources": { "StateMachineScheduleEvent": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "State": "DISABLED", "ScheduleExpression": "rate(1 minute)", @@ -34,8 +32,6 @@ }, "StateMachineScheduleEventRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -73,8 +69,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "DefinitionS3Location": { diff --git a/tests/translator/output/aws-us-gov/state_machine_with_standard_logging.json b/tests/translator/output/aws-us-gov/state_machine_with_standard_logging.json index 2cc7aa6e7..f351648c4 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_standard_logging.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_standard_logging.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -26,14 +24,10 @@ } }, "StandardLogGroup": { - "Type": "AWS::Logs::LogGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::Logs::LogGroup" }, "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -106,8 +100,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -138,8 +130,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Tags": [ { diff --git a/tests/translator/output/aws-us-gov/state_machine_with_tags.json b/tests/translator/output/aws-us-gov/state_machine_with_tags.json index ba81b1f62..6016da420 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_tags.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_tags.json @@ -2,8 +2,6 @@ "Resources": { "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -55,8 +53,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ diff --git a/tests/translator/output/aws-us-gov/state_machine_with_xray_policies.json b/tests/translator/output/aws-us-gov/state_machine_with_xray_policies.json index 2dcf0c99c..287d1b626 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_xray_policies.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_xray_policies.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -27,8 +25,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -59,8 +55,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DefinitionS3Location": { "Bucket": "sam-demo-bucket", @@ -87,8 +81,6 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", diff --git a/tests/translator/output/aws-us-gov/state_machine_with_xray_role.json b/tests/translator/output/aws-us-gov/state_machine_with_xray_role.json index 0ac655a98..156d59d44 100644 --- a/tests/translator/output/aws-us-gov/state_machine_with_xray_role.json +++ b/tests/translator/output/aws-us-gov/state_machine_with_xray_role.json @@ -2,8 +2,6 @@ "Resources": { "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Tags": [ { diff --git a/tests/translator/output/aws-us-gov/streams.json b/tests/translator/output/aws-us-gov/streams.json index 9446bff0b..b87115674 100644 --- a/tests/translator/output/aws-us-gov/streams.json +++ b/tests/translator/output/aws-us-gov/streams.json @@ -2,8 +2,6 @@ "Resources": { "DynamoDBFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -25,8 +23,6 @@ }, "KinesisFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -48,8 +44,6 @@ }, "MSKFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -71,8 +65,6 @@ }, "DynamoDBFunctionMyDDBStream": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BatchSize": 200, "EventSourceArn": "arn:aws:dynamodb:us-west-2:012345678901:table/TestTable/stream/2015-05-11T21:21:33.291", @@ -84,8 +76,6 @@ }, "DynamoDBFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -115,8 +105,6 @@ }, "KinesisFunctionMyKinesisStream": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BatchSize": 100, "Enabled": false, @@ -129,8 +117,6 @@ }, "KinesisFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -160,8 +146,6 @@ }, "MSKFunctionMyMSKStream": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EventSourceArn": "arn:aws:kafka:us-west-2:012345678901:cluster/mycluster/6cc0432b-8618-4f44-bccc-e1fbd8fb7c4d-2", "FunctionName": { @@ -173,8 +157,6 @@ }, "MSKFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", diff --git a/tests/translator/output/basic_application.json b/tests/translator/output/basic_application.json index fa4e7d8e4..058e8037e 100644 --- a/tests/translator/output/basic_application.json +++ b/tests/translator/output/basic_application.json @@ -10,8 +10,6 @@ "Resources": { "NormalApplication": { "Type": "AWS::CloudFormation::Stack", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "NotificationARNs": [ "arn:aws:sns:us-east-1:123456789012:sns-arn" @@ -43,8 +41,6 @@ }, "BasicApplication": { "Type": "AWS::CloudFormation::Stack", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "TemplateURL": "https://awsserverlessrepo-changesets-xxx.s3.amazonaws.com/signed-url", "Tags": [ @@ -65,8 +61,6 @@ }, "ApplicationWithLocationUrl": { "Type": "AWS::CloudFormation::Stack", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "TemplateURL": "https://s3-us-east-1.amazonaws.com/demo-bucket/template.yaml", "Tags": [ @@ -83,8 +77,6 @@ }, "ApplicationWithCondition": { "Type": "AWS::CloudFormation::Stack", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "TemplateURL": "https://awsserverlessrepo-changesets-xxx.s3.amazonaws.com/signed-url", "Tags": [ diff --git a/tests/translator/output/basic_function.json b/tests/translator/output/basic_function.json index da0b27964..8b1e210f4 100644 --- a/tests/translator/output/basic_function.json +++ b/tests/translator/output/basic_function.json @@ -12,8 +12,6 @@ "Resources": { "FunctionWithInlineCode": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "TracingConfig": { "Mode": "Active" @@ -39,8 +37,6 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -71,8 +67,6 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -96,8 +90,6 @@ }, "FunctionWithPolicyDocument": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -121,8 +113,6 @@ }, "FunctionWithPolicies": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -146,8 +136,6 @@ }, "FunctionWithCodeUriObjectRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -178,8 +166,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Path": "/", "Policies": [ @@ -217,8 +203,6 @@ }, "CompleteFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -261,8 +245,6 @@ }, "FunctionWithCodeUriObject": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -287,8 +269,6 @@ }, "FunctionWithPoliciesRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -320,8 +300,6 @@ }, "FunctionWithInlineCodeRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -353,8 +331,6 @@ }, "FunctionWithTracingRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -386,8 +362,6 @@ }, "FunctionWithRoleRef": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -411,8 +385,6 @@ }, "FunctionWithTracing": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "TracingConfig": { "Mode": "Active" @@ -439,8 +411,6 @@ }, "FunctionWithPolicyDocumentRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/basic_function_with_tags.json b/tests/translator/output/basic_function_with_tags.json index da5bd5395..1a23e3ae3 100644 --- a/tests/translator/output/basic_function_with_tags.json +++ b/tests/translator/output/basic_function_with_tags.json @@ -9,8 +9,6 @@ "Resources": { "AlexaSkillFuncRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +57,6 @@ }, "AlexaSkillFuncAlexaSkillEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { @@ -71,8 +67,6 @@ }, "AlexaSkillFunc": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/basic_function_withimageuri.json b/tests/translator/output/basic_function_withimageuri.json index f97f4493b..2dfe45898 100644 --- a/tests/translator/output/basic_function_withimageuri.json +++ b/tests/translator/output/basic_function_withimageuri.json @@ -12,8 +12,6 @@ "Resources": { "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -51,8 +49,6 @@ }, "MinimalImageFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ImageUri": "123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest" @@ -74,8 +70,6 @@ }, "MinimalImageFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -106,8 +100,6 @@ }, "MinimalImageFunctionPackageTypeAndImageConfig": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ImageUri": "123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest" @@ -134,8 +126,6 @@ }, "MinimalImageFunctionPackageTypeAndImageConfigRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -166,8 +156,6 @@ }, "CompleteImageFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ImageUri": "123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest" @@ -213,8 +201,6 @@ }, "FunctionWithPolicies": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ImageUri": "123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest" @@ -236,8 +222,6 @@ }, "FunctionWithPoliciesRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -269,8 +253,6 @@ }, "FunctionWithPolicyDocument": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ImageUri": "123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest" @@ -292,8 +274,6 @@ }, "FunctionWithPolicyDocumentRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -340,8 +320,6 @@ }, "FunctionWithRoleRef": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ImageUri": "123456789.dkr.ecr.region.amazonaws.suffix/myimage:latest" diff --git a/tests/translator/output/basic_layer.json b/tests/translator/output/basic_layer.json index 5421d7ca6..d373bd19c 100644 --- a/tests/translator/output/basic_layer.json +++ b/tests/translator/output/basic_layer.json @@ -9,8 +9,7 @@ }, "Resources": { "LayerWithCondition7c655e10ea": { - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::LayerVersion", "Properties": { "Content": { @@ -22,8 +21,7 @@ "Condition": "TestCondition" }, "MinimalLayer0c7f96cce7": { - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::LayerVersion", "Properties": { "Content": { @@ -34,7 +32,6 @@ } }, "CompleteLayer5d71a60e81": { - "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Retain", "Type": "AWS::Lambda::LayerVersion", "Properties": { @@ -52,7 +49,6 @@ } }, "LayerWithContentUriObjectbdbf1b82ac": { - "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Delete", "Type": "AWS::Lambda::LayerVersion", "Properties": { diff --git a/tests/translator/output/cloudwatch_logs_with_ref.json b/tests/translator/output/cloudwatch_logs_with_ref.json index 9b077b4e4..9c0faab67 100644 --- a/tests/translator/output/cloudwatch_logs_with_ref.json +++ b/tests/translator/output/cloudwatch_logs_with_ref.json @@ -13,8 +13,6 @@ "Resources": { "TriggeredFunctionCWLogEvent": { "Type": "AWS::Logs::SubscriptionFilter", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DestinationArn": { "Fn::GetAtt": [ @@ -35,8 +33,6 @@ }, "TriggeredFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -61,8 +57,6 @@ }, "TriggeredFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -93,8 +87,6 @@ }, "TriggeredFunctionCWLogEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "logs.amazonaws.com", diff --git a/tests/translator/output/cloudwatchevent.json b/tests/translator/output/cloudwatchevent.json index d37d69bcd..8d7f5d0d4 100644 --- a/tests/translator/output/cloudwatchevent.json +++ b/tests/translator/output/cloudwatchevent.json @@ -2,8 +2,6 @@ "Resources": { "ScheduledFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -34,8 +32,6 @@ }, "TriggeredFunctionOnTerminatePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -52,8 +48,6 @@ }, "ScheduledFunctionSchedulePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -70,8 +64,6 @@ }, "ScheduledFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -96,8 +88,6 @@ }, "TriggeredFunctionOnTerminate": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -122,8 +112,6 @@ }, "TriggeredFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -148,8 +136,6 @@ }, "TriggeredFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -180,8 +166,6 @@ }, "ScheduledFunctionSchedule": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ScheduleExpression": "rate(1 minute)", "Targets": [ diff --git a/tests/translator/output/cloudwatchlog.json b/tests/translator/output/cloudwatchlog.json index 144dbd9e3..52af6f596 100644 --- a/tests/translator/output/cloudwatchlog.json +++ b/tests/translator/output/cloudwatchlog.json @@ -2,8 +2,6 @@ "Resources": { "TriggeredFunctionCWLogEvent": { "Type": "AWS::Logs::SubscriptionFilter", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DestinationArn": { "Fn::GetAtt": [ @@ -20,8 +18,6 @@ }, "TriggeredFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -46,8 +42,6 @@ }, "TriggeredFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -78,8 +72,6 @@ }, "TriggeredFunctionCWLogEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "logs.amazonaws.com", diff --git a/tests/translator/output/cognito_userpool_with_event.json b/tests/translator/output/cognito_userpool_with_event.json index 2f1777b26..277f38c37 100644 --- a/tests/translator/output/cognito_userpool_with_event.json +++ b/tests/translator/output/cognito_userpool_with_event.json @@ -2,8 +2,6 @@ "Resources": { "UserPool": { "Type": "AWS::Cognito::UserPool", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "LambdaConfig": { "PreSignUp": { @@ -29,8 +27,6 @@ }, "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -54,8 +50,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -86,8 +80,6 @@ }, "ImplicitApiFunctionCognitoPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { diff --git a/tests/translator/output/depends_on.json b/tests/translator/output/depends_on.json index e001e1b57..c21c75273 100644 --- a/tests/translator/output/depends_on.json +++ b/tests/translator/output/depends_on.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -31,8 +29,6 @@ }, "MyExplicitApiDeployment74b681ce04": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyExplicitApi" @@ -43,8 +39,6 @@ }, "MyExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BodyS3Location": { "Bucket": "sam-translator-tests-dont-delete", @@ -55,8 +49,6 @@ }, "MyOtherTable": { "Type": "AWS::DynamoDB::Table", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "KeySchema": [ { @@ -82,8 +74,6 @@ }, "MyExplicitApidevStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyExplicitApiDeployment74b681ce04" @@ -96,8 +86,6 @@ }, "MySamTable": { "Type": "AWS::DynamoDB::Table", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BillingMode": "PAY_PER_REQUEST", "AttributeDefinitions": [ @@ -116,8 +104,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -148,8 +134,6 @@ }, "MyFunctionMyApiPermissiondev": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/eventbridgerule.json b/tests/translator/output/eventbridgerule.json index e1700840b..0ea8edf56 100644 --- a/tests/translator/output/eventbridgerule.json +++ b/tests/translator/output/eventbridgerule.json @@ -2,8 +2,6 @@ "Resources": { "ScheduledFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -34,8 +32,6 @@ }, "TriggeredFunctionOnTerminatePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -52,8 +48,6 @@ }, "ScheduledFunctionSchedulePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -70,8 +64,6 @@ }, "ScheduledFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -96,8 +88,6 @@ }, "TriggeredFunctionOnTerminate": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -122,8 +112,6 @@ }, "TriggeredFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -148,8 +136,6 @@ }, "TriggeredFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -180,8 +166,6 @@ }, "ScheduledFunctionSchedule": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ScheduleExpression": "rate(1 minute)", "Targets": [ diff --git a/tests/translator/output/eventbridgerule_schedule_properties.json b/tests/translator/output/eventbridgerule_schedule_properties.json index 36bf00145..2ea3bd9c1 100644 --- a/tests/translator/output/eventbridgerule_schedule_properties.json +++ b/tests/translator/output/eventbridgerule_schedule_properties.json @@ -2,8 +2,6 @@ "Resources": { "ScheduledFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -34,8 +32,6 @@ }, "TriggeredFunctionOnTerminatePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -52,8 +48,6 @@ }, "ScheduledFunctionSchedulePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -70,8 +64,6 @@ }, "ScheduledFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -96,8 +88,6 @@ }, "TriggeredFunctionOnTerminate": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -121,8 +111,6 @@ }, "TriggeredFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -147,8 +135,6 @@ }, "TriggeredFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -179,8 +165,6 @@ }, "ScheduledFunctionSchedule": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ScheduleExpression": "rate(1 minute)", "Name": "test-schedule", diff --git a/tests/translator/output/eventbridgerule_with_dlq.json b/tests/translator/output/eventbridgerule_with_dlq.json index 6334d73a2..2d5c96a91 100644 --- a/tests/translator/output/eventbridgerule_with_dlq.json +++ b/tests/translator/output/eventbridgerule_with_dlq.json @@ -2,8 +2,6 @@ "Resources": { "ScheduledFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -34,8 +32,6 @@ }, "ScheduledFunctionScheduleQueuePolicy": { "Type": "AWS::SQS::QueuePolicy", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Queues": [ { @@ -74,8 +70,6 @@ }, "TriggeredFunctionOnTerminate": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -103,8 +97,6 @@ }, "TriggeredFunctionOnTerminatePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -121,8 +113,6 @@ }, "ScheduledFunctionSchedulePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -139,8 +129,6 @@ }, "ScheduledFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -165,14 +153,10 @@ }, "ScheduledFunctionScheduleQueue": { "Type": "AWS::SQS::Queue", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": {} }, "TriggeredFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -197,8 +181,6 @@ }, "TriggeredFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -229,8 +211,6 @@ }, "ScheduledFunctionSchedule": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ScheduleExpression": "rate(1 minute)", "Targets": [ diff --git a/tests/translator/output/eventbridgerule_with_retry_policy.json b/tests/translator/output/eventbridgerule_with_retry_policy.json index 5b290bb9f..2cc7e5d9c 100644 --- a/tests/translator/output/eventbridgerule_with_retry_policy.json +++ b/tests/translator/output/eventbridgerule_with_retry_policy.json @@ -2,8 +2,6 @@ "Resources": { "ScheduledFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -34,8 +32,6 @@ }, "TriggeredFunctionOnTerminatePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -52,8 +48,6 @@ }, "ScheduledFunctionSchedulePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -70,8 +64,6 @@ }, "ScheduledFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -96,8 +88,6 @@ }, "TriggeredFunctionOnTerminate": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -126,8 +116,6 @@ }, "TriggeredFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -152,8 +140,6 @@ }, "TriggeredFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -184,8 +170,6 @@ }, "ScheduledFunctionSchedule": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ScheduleExpression": "rate(1 minute)", "Targets": [ diff --git a/tests/translator/output/explicit_api.json b/tests/translator/output/explicit_api.json index 6c29c587b..cfc5f2e0f 100644 --- a/tests/translator/output/explicit_api.json +++ b/tests/translator/output/explicit_api.json @@ -12,8 +12,6 @@ "Resources": { "GetHtmlFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -37,8 +35,6 @@ }, "ApiWithInlineSwaggerStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ApiWithInlineSwaggerDeployment09cda3d97b" @@ -53,8 +49,6 @@ }, "GetHtmlApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "GetHtmlApi" @@ -65,8 +59,6 @@ }, "GetHtmlFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -99,8 +91,6 @@ }, "ApiWithInlineSwagger": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "this": "is", @@ -110,8 +100,6 @@ }, "GetHtmlFunctionGetHtmlPermissionStage": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -133,8 +121,6 @@ }, "GetHtmlApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BodyS3Location": { "Bucket": "sam-demo-bucket", @@ -145,8 +131,6 @@ }, "GetHtmlApiStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "GetHtmlApiDeploymentf117c932f7" @@ -167,8 +151,6 @@ }, "ApiWithInlineSwaggerDeployment09cda3d97b": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ApiWithInlineSwagger" diff --git a/tests/translator/output/explicit_api_openapi_3.json b/tests/translator/output/explicit_api_openapi_3.json index 72dd5d724..4397a036c 100644 --- a/tests/translator/output/explicit_api_openapi_3.json +++ b/tests/translator/output/explicit_api_openapi_3.json @@ -12,8 +12,6 @@ "Resources": { "GetHtmlFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -37,8 +35,6 @@ }, "ApiWithInlineSwaggerStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ApiWithInlineSwaggerDeployment74abcb3a5b" @@ -53,8 +49,6 @@ }, "GetHtmlApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "GetHtmlApi" @@ -65,8 +59,6 @@ }, "ApiWithInlineSwaggerDeployment74abcb3a5b": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ApiWithInlineSwagger" @@ -76,8 +68,6 @@ }, "GetHtmlFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -110,8 +100,6 @@ }, "ApiWithInlineSwagger": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "this": "is", @@ -121,8 +109,6 @@ }, "GetHtmlFunctionGetHtmlPermissionStage": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -144,8 +130,6 @@ }, "GetHtmlApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BodyS3Location": { "Bucket": "sam-demo-bucket", @@ -156,8 +140,6 @@ }, "GetHtmlApiStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "GetHtmlApiDeploymentf117c932f7" diff --git a/tests/translator/output/explicit_api_with_invalid_events_config.json b/tests/translator/output/explicit_api_with_invalid_events_config.json index 1d85eebaa..854035d36 100644 --- a/tests/translator/output/explicit_api_with_invalid_events_config.json +++ b/tests/translator/output/explicit_api_with_invalid_events_config.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -27,8 +25,6 @@ }, "MyFunctionAddApiPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -48,8 +44,6 @@ }, "ApiWithInlineSwaggerProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ApiWithInlineSwaggerDeployment22d399868d" @@ -62,8 +56,6 @@ }, "ApiWithInlineSwagger": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -92,8 +84,6 @@ }, "ApiWithInlineSwaggerDeployment22d399868d": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ApiWithInlineSwagger" @@ -104,8 +94,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/explicit_http_api.json b/tests/translator/output/explicit_http_api.json index 3865fa984..8a8a6dab6 100644 --- a/tests/translator/output/explicit_http_api.json +++ b/tests/translator/output/explicit_http_api.json @@ -2,8 +2,6 @@ "Resources": { "MyApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -17,8 +15,6 @@ }, "MyApi2ApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi2" @@ -32,8 +28,6 @@ }, "HttpApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.restapi", "Code": { @@ -57,8 +51,6 @@ }, "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -80,8 +72,6 @@ }, "MyApi2": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -154,8 +144,6 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -186,8 +174,6 @@ }, "HttpApiFunctionBasePathPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -209,8 +195,6 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FailOnWarnings": true, "Body": { diff --git a/tests/translator/output/explicit_http_api_minimum.json b/tests/translator/output/explicit_http_api_minimum.json index 5aec9af7c..37be2617d 100644 --- a/tests/translator/output/explicit_http_api_minimum.json +++ b/tests/translator/output/explicit_http_api_minimum.json @@ -2,8 +2,6 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -27,8 +25,6 @@ }, "FunctionApiPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -50,8 +46,6 @@ }, "Api": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -73,8 +67,6 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -105,8 +97,6 @@ }, "ServerlessHttpApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -143,8 +133,6 @@ }, "ServerlessHttpApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "ServerlessHttpApi" @@ -158,8 +146,6 @@ }, "ApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "Api" diff --git a/tests/translator/output/function_concurrency.json b/tests/translator/output/function_concurrency.json index c92ed166c..afd5f36c7 100644 --- a/tests/translator/output/function_concurrency.json +++ b/tests/translator/output/function_concurrency.json @@ -7,8 +7,6 @@ "Resources": { "ConcurrentFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -38,8 +36,6 @@ }, "ConcurrentFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -62,8 +58,6 @@ }, "AnotherFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -93,8 +87,6 @@ }, "AnotherFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/function_event_conditions.json b/tests/translator/output/function_event_conditions.json index 915148277..4926995a9 100644 --- a/tests/translator/output/function_event_conditions.json +++ b/tests/translator/output/function_event_conditions.json @@ -10,8 +10,6 @@ "Resources": { "MyAwesomeFunctionAliasLive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "FunctionVersion": { @@ -28,8 +26,6 @@ }, "MyAwesomeFunctionNotificationTopicPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Action": "lambda:InvokeFunction", @@ -44,8 +40,6 @@ }, "MyAwesomeFunctionCWEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Action": "lambda:InvokeFunction", @@ -63,8 +57,6 @@ }, "MyAwesomeFunctionEBRulePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Action": "lambda:InvokeFunction", @@ -82,8 +74,6 @@ }, "MyAwesomeFunctionDDBStream": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "BatchSize": 200, @@ -96,8 +86,6 @@ }, "MyAwesomeFunctionIoTRule": { "Type": "AWS::IoT::TopicRule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "TopicRulePayload": { @@ -118,8 +106,6 @@ }, "MyAwesomeFunctionKinesisStream": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "BatchSize": 100, @@ -132,8 +118,6 @@ }, "MyAwesomeFunctionIoTRulePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Action": "lambda:InvokeFunction", @@ -158,8 +142,6 @@ }, "MyAwesomeFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Endpoint": { @@ -173,8 +155,6 @@ }, "MyAwesomeFunctionS3TriggerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Action": "lambda:InvokeFunction", @@ -189,8 +169,6 @@ }, "MyAwesomeFunctionCWLogPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Action": "lambda:InvokeFunction", @@ -210,8 +188,6 @@ }, "MyAwesomeFunctionEBSchedule": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "ScheduleExpression": "rate(1 minute)", @@ -227,8 +203,6 @@ }, "MyAwesomeFunctionCWLog": { "Type": "AWS::Logs::SubscriptionFilter", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "DestinationArn": { @@ -243,8 +217,6 @@ }, "MyAwesomeFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "ManagedPolicyArns": [ @@ -279,8 +251,6 @@ }, "MyAwesomeFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Code": { @@ -305,8 +275,6 @@ }, "MyAwesomeFunctionCWEvent": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "EventPattern": { @@ -328,8 +296,6 @@ }, "MyAwesomeFunctionEBRule": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "EventPattern": { @@ -350,8 +316,7 @@ } }, "MyAwesomeFunctionVersion640128d35d": { - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", "Condition": "MyCondition", "Properties": { @@ -362,14 +327,10 @@ }, "Notifications": { "Condition": "MyCondition", - "Type": "AWS::SNS::Topic", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::SNS::Topic" }, "MyAwesomeFunctionEBSchedulePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition", "Properties": { "Action": "lambda:InvokeFunction", @@ -387,8 +348,6 @@ }, "FunctionOneImageBucketPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -402,8 +361,6 @@ }, "FunctionOneRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -434,8 +391,6 @@ }, "FunctionOne": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -459,8 +414,6 @@ }, "Images": { "Type": "AWS::S3::Bucket", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "NotificationConfiguration": { "LambdaConfigurations": [ @@ -510,8 +463,6 @@ }, "MyAwesomeFunctionSNSTopicWithSQSSubscription": { "Type": "AWS::SNS::Subscription", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Endpoint": { "Fn::GetAtt": [ @@ -528,8 +479,6 @@ }, "MyAwesomeFunctionSNSTopicWithSQSSubscriptionQueuePolicy": { "Type": "AWS::SQS::QueuePolicy", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Queues": [ { @@ -564,8 +513,6 @@ }, "MyAwesomeFunctionSNSTopicWithSQSSubscriptionEventSourceMapping": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BatchSize": 10, "Enabled": true, @@ -584,14 +531,10 @@ "MyAwesomeFunctionAnotherSNSWithSQSSubscriptionQueue": { "Condition": "MyCondition", "Type": "AWS::SQS::Queue", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": {} }, "MyAwesomeFunctionAnotherSNSWithSQSSubscriptionEventSourceMapping": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BatchSize": 10, "Enabled": true, @@ -609,8 +552,6 @@ }, "MyAwesomeFunctionAnotherSNSWithSQSSubscription": { "Type": "AWS::SNS::Subscription", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Endpoint": { "Fn::GetAtt": [ @@ -627,8 +568,6 @@ }, "MyAwesomeFunctionAnotherSNSWithSQSSubscriptionQueuePolicy": { "Type": "AWS::SQS::QueuePolicy", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Queues": [ { @@ -663,8 +602,6 @@ }, "Queue": { "Type": "AWS::SQS::Queue", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Condition": "MyCondition" } } diff --git a/tests/translator/output/function_managed_inline_policy.json b/tests/translator/output/function_managed_inline_policy.json index 7e4ef246e..a05542ae8 100644 --- a/tests/translator/output/function_managed_inline_policy.json +++ b/tests/translator/output/function_managed_inline_policy.json @@ -8,8 +8,6 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -33,8 +31,6 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", diff --git a/tests/translator/output/function_with_alias.json b/tests/translator/output/function_with_alias.json index 141140198..306c5b387 100644 --- a/tests/translator/output/function_with_alias.json +++ b/tests/translator/output/function_with_alias.json @@ -1,9 +1,8 @@ { "Resources": { "MinimalFunctionVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Description": "sam-testing", "FunctionName": { @@ -13,8 +12,6 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -30,8 +27,6 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -55,8 +50,6 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/function_with_alias_and_code_sha256.json b/tests/translator/output/function_with_alias_and_code_sha256.json index fbf71280a..5f89a1632 100644 --- a/tests/translator/output/function_with_alias_and_code_sha256.json +++ b/tests/translator/output/function_with_alias_and_code_sha256.json @@ -1,9 +1,8 @@ { "Resources": { - "MinimalFunctionVersion6b86b273ff": { + "MinimalFunctionVersion6b86b273ff": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Description": "sam-testing", "FunctionName": { @@ -13,8 +12,6 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -30,8 +27,6 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -55,8 +50,6 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/function_with_alias_and_event_sources.json b/tests/translator/output/function_with_alias_and_event_sources.json index 05500909f..eb62f8fae 100644 --- a/tests/translator/output/function_with_alias_and_event_sources.json +++ b/tests/translator/output/function_with_alias_and_event_sources.json @@ -8,8 +8,6 @@ "Resources": { "MyAwesomeFunctionAliasLive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -25,8 +23,6 @@ }, "MyAwesomeFunctionNotificationTopicPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "sns.amazonaws.com", @@ -40,8 +36,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment79e6116109" @@ -54,8 +48,6 @@ }, "GetHtmlApiDeploymentf117c932f7": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "GetHtmlApi" @@ -66,8 +58,6 @@ }, "MyAwesomeFunctionCWEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -84,8 +74,6 @@ }, "MyAwesomeFunctionEBRulePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -102,8 +90,6 @@ }, "MyAwesomeFunctionDDBStream": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BatchSize": 200, "EventSourceArn": "arn:aws:dynamodb:us-west-2:012345678901:table/TestTable/stream/2015-05-11T21:21:33.291", @@ -115,8 +101,6 @@ }, "MyAwesomeFunctionIoTRule": { "Type": "AWS::IoT::TopicRule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "TopicRulePayload": { "AwsIotSqlVersion": "beta", @@ -136,8 +120,6 @@ }, "MyAwesomeFunctionKinesisStream": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BatchSize": 100, "EventSourceArn": "arn:aws:kinesis:us-west-2:012345678901:stream/my-stream", @@ -149,8 +131,6 @@ }, "MyAwesomeFunctionImplicitApiPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -172,8 +152,6 @@ }, "MyAwesomeFunctionIoTRulePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -197,8 +175,6 @@ }, "MyAwesomeFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Endpoint": { "Ref": "MyAwesomeFunctionAliasLive" @@ -211,8 +187,6 @@ }, "MyAwesomeFunctionS3TriggerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -226,8 +200,6 @@ }, "GetHtmlApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BodyS3Location": { "Bucket": "sam-demo-bucket", @@ -238,8 +210,6 @@ }, "ServerlessRestApiDeployment79e6116109": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -250,8 +220,6 @@ }, "MyAwesomeFunctionCWLogPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "logs.amazonaws.com", @@ -270,8 +238,6 @@ }, "MyAwesomeFunctionEBSchedule": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ScheduleExpression": "rate(1 minute)", "Targets": [ @@ -286,8 +252,6 @@ }, "MyAwesomeFunctionCWLog": { "Type": "AWS::Logs::SubscriptionFilter", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DestinationArn": { "Ref": "MyAwesomeFunctionAliasLive" @@ -301,8 +265,6 @@ }, "MyAwesomeFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -335,8 +297,6 @@ }, "MyAwesomeFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -360,8 +320,6 @@ }, "MyAwesomeFunctionCWEvent": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -382,8 +340,6 @@ }, "MyAwesomeFunctionEBRule": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -403,9 +359,8 @@ } }, "MyAwesomeFunctionVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MyAwesomeFunction" @@ -414,8 +369,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -443,14 +396,10 @@ } }, "Notifications": { - "Type": "AWS::SNS::Topic", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::SNS::Topic" }, "MyAwesomeFunctionEBSchedulePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "events.amazonaws.com", @@ -467,8 +416,6 @@ }, "Images": { "Type": "AWS::S3::Bucket", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "NotificationConfiguration": { "LambdaConfigurations": [ @@ -487,8 +434,6 @@ }, "GetHtmlApiStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "GetHtmlApiDeploymentf117c932f7" @@ -508,8 +453,6 @@ }, "MyAwesomeFunctionExplicitApiPermissionStage": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/function_with_alias_intrinsics.json b/tests/translator/output/function_with_alias_intrinsics.json index c4510023c..507f8af00 100644 --- a/tests/translator/output/function_with_alias_intrinsics.json +++ b/tests/translator/output/function_with_alias_intrinsics.json @@ -7,9 +7,8 @@ }, "Resources": { "MinimalFunctionVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -18,8 +17,6 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -35,8 +32,6 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -60,8 +55,6 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/function_with_amq.json b/tests/translator/output/function_with_amq.json index a6b0483e2..0d35f71c2 100644 --- a/tests/translator/output/function_with_amq.json +++ b/tests/translator/output/function_with_amq.json @@ -2,8 +2,6 @@ "Resources": { "MQFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -27,8 +25,6 @@ }, "MQFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -82,8 +78,6 @@ }, "MQFunctionMyMQQueue": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EventSourceArn": "arn:aws:mq:us-east-2:123456789012:broker:MyBroker:b-1234a5b6-78cd-901e-2fgh-3i45j6k178l9", "FunctionName": { diff --git a/tests/translator/output/function_with_amq_kms.json b/tests/translator/output/function_with_amq_kms.json index 249da646a..94ae8666a 100644 --- a/tests/translator/output/function_with_amq_kms.json +++ b/tests/translator/output/function_with_amq_kms.json @@ -2,8 +2,6 @@ "Resources": { "MQFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -27,8 +25,6 @@ }, "MQFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -89,8 +85,6 @@ }, "MQFunctionMyMQQueue": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EventSourceArn": "arn:aws:mq:us-east-2:123456789012:broker:MyBroker:b-1234a5b6-78cd-901e-2fgh-3i45j6k178l9", "FunctionName": { diff --git a/tests/translator/output/function_with_condition.json b/tests/translator/output/function_with_condition.json index e45c0b63d..25e902d7b 100644 --- a/tests/translator/output/function_with_condition.json +++ b/tests/translator/output/function_with_condition.json @@ -10,8 +10,6 @@ "Resources": { "ConditionFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -36,8 +34,6 @@ }, "ConditionFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/function_with_conditional_managed_policy.json b/tests/translator/output/function_with_conditional_managed_policy.json index 363ba4065..db41f277c 100644 --- a/tests/translator/output/function_with_conditional_managed_policy.json +++ b/tests/translator/output/function_with_conditional_managed_policy.json @@ -10,8 +10,6 @@ "Resources": { "FunctionWithConditionalPolicy": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -36,8 +34,6 @@ }, "FunctionWithConditionalPolicyRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", diff --git a/tests/translator/output/function_with_conditional_managed_policy_and_ref_no_value.json b/tests/translator/output/function_with_conditional_managed_policy_and_ref_no_value.json index 7eab40e6d..2d64091de 100644 --- a/tests/translator/output/function_with_conditional_managed_policy_and_ref_no_value.json +++ b/tests/translator/output/function_with_conditional_managed_policy_and_ref_no_value.json @@ -10,8 +10,6 @@ "Resources": { "FunctionWithConditionalPolicy": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -36,8 +34,6 @@ }, "FunctionWithConditionalPolicyRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", diff --git a/tests/translator/output/function_with_conditional_policy_template.json b/tests/translator/output/function_with_conditional_policy_template.json index 0fd638d27..9bcd6123e 100644 --- a/tests/translator/output/function_with_conditional_policy_template.json +++ b/tests/translator/output/function_with_conditional_policy_template.json @@ -10,8 +10,6 @@ "Resources": { "FunctionWithConditionalPolicy": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -36,8 +34,6 @@ }, "FunctionWithConditionalPolicyRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/function_with_conditional_policy_template_and_ref_no_value.json b/tests/translator/output/function_with_conditional_policy_template_and_ref_no_value.json index 2269fa60c..40262859a 100644 --- a/tests/translator/output/function_with_conditional_policy_template_and_ref_no_value.json +++ b/tests/translator/output/function_with_conditional_policy_template_and_ref_no_value.json @@ -10,8 +10,6 @@ "Resources": { "FunctionWithConditionalPolicy": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -36,8 +34,6 @@ }, "FunctionWithConditionalPolicyRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/function_with_custom_codedeploy_deployment_preference.json b/tests/translator/output/function_with_custom_codedeploy_deployment_preference.json index d16d6de97..7f9d9822d 100644 --- a/tests/translator/output/function_with_custom_codedeploy_deployment_preference.json +++ b/tests/translator/output/function_with_custom_codedeploy_deployment_preference.json @@ -34,8 +34,6 @@ "Resources": { "NormalWithRefAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -60,9 +58,8 @@ } }, "CustomWithFindInMapVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "CustomWithFindInMap" @@ -111,8 +108,6 @@ }, "CustomWithFindInMapAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -138,8 +133,6 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -163,8 +156,6 @@ }, "CustomWithSubAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -190,8 +181,6 @@ }, "NormalWithSub": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -214,9 +203,8 @@ } }, "CustomWithConditionVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "CustomWithCondition" @@ -253,9 +241,8 @@ } }, "CustomWithCondition2Version640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "CustomWithCondition2" @@ -264,8 +251,6 @@ }, "CustomWithCondition": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -289,8 +274,6 @@ }, "CustomWithSub": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -319,9 +302,8 @@ } }, "NormalWithRefVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "NormalWithRef" @@ -422,8 +404,6 @@ }, "NormalWithSubAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -448,9 +428,8 @@ } }, "CustomWithSubVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "CustomWithSub" @@ -459,8 +438,6 @@ }, "CustomWithSubRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -491,8 +468,6 @@ }, "CustomWithConditionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -563,8 +538,6 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -595,8 +568,6 @@ }, "CustomWithFindInMap": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -619,9 +590,8 @@ } }, "NormalWithSubVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "NormalWithSub" @@ -630,8 +600,6 @@ }, "CustomWithConditionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -657,8 +625,6 @@ }, "CustomWithFindInMapRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -689,8 +655,6 @@ }, "NormalWithRef": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -714,8 +678,6 @@ }, "CustomWithCondition2": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -766,8 +728,6 @@ }, "NormalWithRefRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -798,8 +758,6 @@ }, "CustomWithCondition2Aliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -825,8 +783,6 @@ }, "NormalWithSubRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -856,9 +812,8 @@ } }, "MinimalFunctionVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -894,8 +849,6 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -921,8 +874,6 @@ }, "CustomWithCondition2Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/function_with_custom_conditional_codedeploy_deployment_preference.json b/tests/translator/output/function_with_custom_conditional_codedeploy_deployment_preference.json index 235df1598..26a20afde 100644 --- a/tests/translator/output/function_with_custom_conditional_codedeploy_deployment_preference.json +++ b/tests/translator/output/function_with_custom_conditional_codedeploy_deployment_preference.json @@ -33,8 +33,6 @@ }, "HelloWorldFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -141,9 +139,8 @@ } }, "HelloWorldFunctionVersionfb53d5c2e6": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "HelloWorldFunction" @@ -152,8 +149,6 @@ }, "HelloWorldFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -179,8 +174,6 @@ }, "HelloWorldFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { diff --git a/tests/translator/output/function_with_deployment_and_custom_role.json b/tests/translator/output/function_with_deployment_and_custom_role.json index c73dae738..8ec847d9d 100644 --- a/tests/translator/output/function_with_deployment_and_custom_role.json +++ b/tests/translator/output/function_with_deployment_and_custom_role.json @@ -2,8 +2,6 @@ "Resources": { "FunctionWithRole": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -27,8 +25,6 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -52,8 +48,6 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -84,8 +78,6 @@ }, "DeploymentRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSCodeDeployRole" @@ -109,9 +101,8 @@ } }, "FunctionWithRoleVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "FunctionWithRole" @@ -217,9 +208,8 @@ } }, "MinimalFunctionVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -228,8 +218,6 @@ }, "FunctionWithRoleAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -255,8 +243,6 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { diff --git a/tests/translator/output/function_with_deployment_no_service_role.json b/tests/translator/output/function_with_deployment_no_service_role.json index ef4d06a29..ef9ed4aa6 100644 --- a/tests/translator/output/function_with_deployment_no_service_role.json +++ b/tests/translator/output/function_with_deployment_no_service_role.json @@ -33,8 +33,6 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -58,8 +56,6 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -89,9 +85,8 @@ } }, "OtherFunctionVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "OtherFunction" @@ -100,8 +95,6 @@ }, "OtherFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -132,8 +125,6 @@ }, "DeploymentRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSCodeDeployRole" @@ -194,9 +185,8 @@ } }, "MinimalFunctionVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -205,8 +195,6 @@ }, "OtherFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -230,8 +218,6 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -257,8 +243,6 @@ }, "OtherFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { diff --git a/tests/translator/output/function_with_deployment_preference.json b/tests/translator/output/function_with_deployment_preference.json index 37301ac75..e428000af 100644 --- a/tests/translator/output/function_with_deployment_preference.json +++ b/tests/translator/output/function_with_deployment_preference.json @@ -63,8 +63,6 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -95,8 +93,6 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -149,9 +145,8 @@ } }, "MinimalFunctionVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -160,8 +155,6 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { diff --git a/tests/translator/output/function_with_deployment_preference_alarms_intrinsic_if.json b/tests/translator/output/function_with_deployment_preference_alarms_intrinsic_if.json index 4d89d7a17..72643d9ca 100644 --- a/tests/translator/output/function_with_deployment_preference_alarms_intrinsic_if.json +++ b/tests/translator/output/function_with_deployment_preference_alarms_intrinsic_if.json @@ -10,8 +10,6 @@ "Resources": { "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -35,8 +33,7 @@ }, "MinimalFunctionVersion640128d35d": { "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", + "DeletionPolicy": "Retain", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -45,8 +42,6 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -72,8 +67,6 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", diff --git a/tests/translator/output/function_with_deployment_preference_all_parameters.json b/tests/translator/output/function_with_deployment_preference_all_parameters.json index 23c025e87..aff72299c 100644 --- a/tests/translator/output/function_with_deployment_preference_all_parameters.json +++ b/tests/translator/output/function_with_deployment_preference_all_parameters.json @@ -2,8 +2,6 @@ "Resources": { "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -27,8 +25,6 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "MySanityTestFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -91,8 +85,6 @@ }, "MyCloudWatchAlarm": { "Type": "AWS::CloudWatch::Alarm", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EvaluationPeriods": 1, "Namespace": "AWS/EC2", @@ -160,8 +152,6 @@ }, "MySanityTestFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "my-bucket", @@ -214,9 +204,8 @@ } }, "MinimalFunctionVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -225,8 +214,6 @@ }, "MyValidationTestFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "my-bucket", @@ -250,8 +237,6 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -283,8 +268,6 @@ }, "MyValidationTestFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -314,9 +297,7 @@ } }, "MySNSTopic": { - "Type": "AWS::SNS::Topic", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::SNS::Topic" } } } \ No newline at end of file diff --git a/tests/translator/output/function_with_deployment_preference_from_parameters.json b/tests/translator/output/function_with_deployment_preference_from_parameters.json index 011506b06..bba04a56a 100644 --- a/tests/translator/output/function_with_deployment_preference_from_parameters.json +++ b/tests/translator/output/function_with_deployment_preference_from_parameters.json @@ -16,8 +16,6 @@ "Resources": { "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -41,8 +39,6 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -73,8 +69,6 @@ }, "MySanityTestFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -105,8 +99,6 @@ }, "MyCloudWatchAlarm": { "Type": "AWS::CloudWatch::Alarm", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EvaluationPeriods": 1, "Namespace": "AWS/EC2", @@ -174,8 +166,6 @@ }, "MySanityTestFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "my-bucket", @@ -228,9 +218,8 @@ } }, "MinimalFunctionVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -239,8 +228,6 @@ }, "MyValidationTestFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "my-bucket", @@ -264,8 +251,6 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -297,8 +282,6 @@ }, "MyValidationTestFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -328,9 +311,7 @@ } }, "MySNSTopic": { - "Type": "AWS::SNS::Topic", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::SNS::Topic" } } } \ No newline at end of file diff --git a/tests/translator/output/function_with_deployment_preference_multiple_combinations.json b/tests/translator/output/function_with_deployment_preference_multiple_combinations.json index 9d651086b..2ac095373 100644 --- a/tests/translator/output/function_with_deployment_preference_multiple_combinations.json +++ b/tests/translator/output/function_with_deployment_preference_multiple_combinations.json @@ -2,8 +2,6 @@ "Resources": { "MinimalFunctionWithDeploymentPreferenceWithHooksAndAlarms": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -27,8 +25,6 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -84,8 +78,6 @@ }, "MinimalFunctionWithMinimalDeploymentPreferenceRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -116,8 +108,6 @@ }, "MyCloudWatchAlarm": { "Type": "AWS::CloudWatch::Alarm", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EvaluationPeriods": 1, "Namespace": "AWS/EC2", @@ -129,8 +119,6 @@ }, "MinimalFunctionWithMinimalDeploymentPreferenceAliaslivewithdeployment": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -199,9 +187,8 @@ } }, "MinimalFunctionWithMinimalDeploymentPreferenceVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunctionWithMinimalDeploymentPreference" @@ -210,8 +197,6 @@ }, "MinimalFunctionWithDeploymentPreferenceWithHooksAndAlarmsRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -242,8 +227,6 @@ }, "MySanityTestFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -274,8 +257,6 @@ }, "MinimalFunctionWithMinimalDeploymentPreference": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -299,8 +280,6 @@ }, "MySanityTestFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "my-bucket", @@ -323,9 +302,8 @@ } }, "MinimalFunctionWithDeploymentPreferenceWithHooksAndAlarmsVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunctionWithDeploymentPreferenceWithHooksAndAlarms" @@ -397,9 +375,8 @@ } }, "MinimalFunctionVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -408,8 +385,6 @@ }, "MyValidationTestFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -440,8 +415,6 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -457,8 +430,6 @@ }, "MinimalFunctionWithDeploymentPreferenceWithHooksAndAlarmsAliaslivewithdeploymentwithhooksandalarms": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "UpdatePolicy": { "CodeDeployLambdaAliasUpdate": { "ApplicationName": { @@ -490,8 +461,6 @@ }, "MyValidationTestFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "my-bucket", diff --git a/tests/translator/output/function_with_disabled_deployment_preference.json b/tests/translator/output/function_with_disabled_deployment_preference.json index f44ad3652..47834b6e8 100644 --- a/tests/translator/output/function_with_disabled_deployment_preference.json +++ b/tests/translator/output/function_with_disabled_deployment_preference.json @@ -1,9 +1,8 @@ { "Resources": { "MinimalFunctionVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -12,8 +11,6 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -29,8 +26,6 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -54,8 +49,6 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/function_with_dlq.json b/tests/translator/output/function_with_dlq.json index 233830d44..599656cd9 100644 --- a/tests/translator/output/function_with_dlq.json +++ b/tests/translator/output/function_with_dlq.json @@ -2,8 +2,6 @@ "Resources": { "MySnsDlqLambdaFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -49,8 +47,6 @@ }, "MySqsDlqLambdaFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -96,8 +92,6 @@ }, "MySqsDlqLambdaFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -124,8 +118,6 @@ }, "MySnsDlqLambdaFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/function_with_event_dest.json b/tests/translator/output/function_with_event_dest.json index cc1fb8ec9..f75a3bfa3 100644 --- a/tests/translator/output/function_with_event_dest.json +++ b/tests/translator/output/function_with_event_dest.json @@ -49,8 +49,6 @@ "Resources": { "MyTestFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -126,15 +124,11 @@ }, "MyTestFunctionEventInvokeConfigOnSuccessQueue": { "Type": "AWS::SQS::Queue", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": {}, "Condition": "NOTQueueCreationDisabled2da03e5b6f" }, "SNSSubscription": { "Type": "AWS::SNS::Subscription", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Endpoint": "example@example.com", "Protocol": "email", @@ -146,8 +140,6 @@ }, "MyTestFunctionEventInvokeConfig": { "Type": "AWS::Lambda::EventInvokeConfig", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "MaximumEventAgeInSeconds": 70, "MaximumRetryAttempts": 1, @@ -186,8 +178,6 @@ }, "MyTestFunction2Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -249,8 +239,6 @@ }, "DestinationLambda": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async (event) => {\n const response = {\n statusCode: 200,\n body: JSON.stringify('Hello from Lambda!'),\n };\n return response;\n};\n" @@ -274,8 +262,6 @@ }, "MyTestFunction2EventInvokeConfig": { "Type": "AWS::Lambda::EventInvokeConfig", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "MaximumEventAgeInSeconds": 70, "MaximumRetryAttempts": 1, @@ -300,8 +286,6 @@ }, "DestinationLambdaRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -332,8 +316,6 @@ }, "MyTestFunction2": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = function(event, context, callback) {\n var event_received_at = new Date().toISOString();\n console.log('Event received at: ' + event_received_at);\n console.log('Received event:', JSON.stringify(event, null, 2));\n\n if (event.Success) {\n console.log(\"Success\");\n context.callbackWaitsForEmptyEventLoop = false;\n callback(null);\n } else {\n console.log(\"Failure\");\n context.callbackWaitsForEmptyEventLoop = false;\n callback(new Error(\"Failure from event, Success = false, I am failing!\"), 'Destination Function Error Thrown');\n }\n}; \n" @@ -357,8 +339,6 @@ }, "MyTestFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = function(event, context, callback) {\n var event_received_at = new Date().toISOString();\n console.log('Event received at: ' + event_received_at);\n console.log('Received event:', JSON.stringify(event, null, 2));\n\n if (event.Success) {\n console.log(\"Success\");\n context.callbackWaitsForEmptyEventLoop = false;\n callback(null);\n } else {\n console.log(\"Failure\");\n context.callbackWaitsForEmptyEventLoop = false;\n callback(new Error(\"Failure from event, Success = false, I am failing!\"), 'Destination Function Error Thrown');\n }\n}; \n" @@ -382,8 +362,6 @@ }, "MyTestFunctionEventInvokeConfigOnFailureTopic": { "Type": "AWS::SNS::Topic", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": {}, "Condition": "TopicCreationEnabled" } diff --git a/tests/translator/output/function_with_event_dest_basic.json b/tests/translator/output/function_with_event_dest_basic.json index 881e7e457..e845f151f 100644 --- a/tests/translator/output/function_with_event_dest_basic.json +++ b/tests/translator/output/function_with_event_dest_basic.json @@ -8,14 +8,10 @@ "Resources": { "MyTestFunctionEventInvokeConfigOnSuccessQueue": { "Type": "AWS::SQS::Queue", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": {} }, "MyTestFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -77,8 +73,6 @@ }, "MyTestFunctionEventInvokeConfig": { "Type": "AWS::Lambda::EventInvokeConfig", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "MaximumEventAgeInSeconds": 70, "MaximumRetryAttempts": 1, @@ -106,8 +100,6 @@ }, "MyTestFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = function(event, context, callback) {\n var event_received_at = new Date().toISOString();\n console.log('Event received at: ' + event_received_at);\n console.log('Received event:', JSON.stringify(event, null, 2));\n\n if (event.Success) {\n console.log(\"Success\");\n context.callbackWaitsForEmptyEventLoop = false;\n callback(null);\n } else {\n console.log(\"Failure\");\n context.callbackWaitsForEmptyEventLoop = false;\n callback(new Error(\"Failure from event, Success = false, I am failing!\"), 'Destination Function Error Thrown');\n }\n}; \n" @@ -131,8 +123,6 @@ }, "MyTestFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -147,9 +137,8 @@ } }, "MyTestFunctionVersiondaf9da458d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MyTestFunction" diff --git a/tests/translator/output/function_with_event_dest_conditional.json b/tests/translator/output/function_with_event_dest_conditional.json index b778deb18..8706ccf9f 100644 --- a/tests/translator/output/function_with_event_dest_conditional.json +++ b/tests/translator/output/function_with_event_dest_conditional.json @@ -59,8 +59,6 @@ "Resources": { "DestinationLambdaRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -92,15 +90,11 @@ }, "MyTestFunctionEventInvokeConfigOnSuccessQueue": { "Type": "AWS::SQS::Queue", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": {}, "Condition": "FunctionConditionANDNOTQueueCreationDisabled2da03e5b6fe547d4e2d6" }, "MyTestFunctionEventInvokeConfig": { "Type": "AWS::Lambda::EventInvokeConfig", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "MaximumEventAgeInSeconds": 70, "MaximumRetryAttempts": 1, @@ -143,8 +137,6 @@ }, "MyTestFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = function(event, context, callback) {\n var event_received_at = new Date().toISOString();\n console.log('Event received at: ' + event_received_at);\n console.log('Received event:', JSON.stringify(event, null, 2));\n\n if (event.Success) {\n console.log(\"Success\");\n context.callbackWaitsForEmptyEventLoop = false;\n callback(null);\n } else {\n console.log(\"Failure\");\n context.callbackWaitsForEmptyEventLoop = false;\n callback(new Error(\"Failure from event, Success = false, I am failing!\"), 'Destination Function Error Thrown');\n }\n}; \n" @@ -169,8 +161,6 @@ }, "DestinationLambda": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async (event) => {\n const response = {\n statusCode: 200,\n body: JSON.stringify('Hello from Lambda!'),\n };\n return response;\n};\n" @@ -195,8 +185,6 @@ }, "MyTestFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", diff --git a/tests/translator/output/function_with_event_source_mapping.json b/tests/translator/output/function_with_event_source_mapping.json index 3888a5f28..2a2f668ef 100644 --- a/tests/translator/output/function_with_event_source_mapping.json +++ b/tests/translator/output/function_with_event_source_mapping.json @@ -9,19 +9,13 @@ }, "Resources": { "MySqsQueue": { - "Type": "AWS::SQS::Queue", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::SQS::Queue" }, "MySnsTopic": { - "Type": "AWS::SNS::Topic", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::SNS::Topic" }, "MyFunctionForBatchingExampleStream": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "MaximumBatchingWindowInSeconds": 20, "EventSourceArn": { @@ -38,8 +32,6 @@ }, "DynamoDBTable": { "Type": "AWS::DynamoDB::Table", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "KeySchema": [ { @@ -64,8 +56,6 @@ }, "MyFunctionForBatchingExampleRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -157,16 +147,12 @@ }, "KinesisStream1": { "Type": "AWS::Kinesis::Stream", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ShardCount": 1 } }, "MyFunctionForBatchingExampleDynamoDBStreamEvent": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "MaximumBatchingWindowInSeconds": { "Ref": "MyBatchingWindowParam" @@ -202,8 +188,6 @@ }, "MyFunctionForBatchingExample": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -226,8 +210,6 @@ }, "MyFunctionForBatchingExampleStreamEvent": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "MaximumBatchingWindowInSeconds": { "Ref": "MyBatchingWindowParam" @@ -253,8 +235,6 @@ }, "KinesisStream": { "Type": "AWS::Kinesis::Stream", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ShardCount": 1 } diff --git a/tests/translator/output/function_with_file_system_config.json b/tests/translator/output/function_with_file_system_config.json index bc614a6bd..b9bbcccdc 100644 --- a/tests/translator/output/function_with_file_system_config.json +++ b/tests/translator/output/function_with_file_system_config.json @@ -1,14 +1,10 @@ { "Resources": { "EfsFileSystem": { - "Type": "AWS::EFS::FileSystem", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::EFS::FileSystem" }, "LambdaFunctionWithEfs": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "const fs = require('fs')\nconst path = require('path')\nconst efsMountPath = '/mnt/efs'\n\nexports.handler = async (event, context, callback) => {\nconst directory = path.join(efsMountPath, event.body)\nconst files = fs.readdirSync(directory)\nreturn files\n}\n" @@ -52,8 +48,6 @@ }, "MountTarget": { "Type": "AWS::EFS::MountTarget", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "SubnetId": "subnet-abc123", "FileSystemId": { @@ -66,8 +60,6 @@ }, "LambdaFunctionWithEfsRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -99,8 +91,6 @@ }, "AccessPoint": { "Type": "AWS::EFS::AccessPoint", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FileSystemId": { "Ref": "EfsFileSystem" diff --git a/tests/translator/output/function_with_global_layers.json b/tests/translator/output/function_with_global_layers.json index e7cd04986..b40dcd644 100644 --- a/tests/translator/output/function_with_global_layers.json +++ b/tests/translator/output/function_with_global_layers.json @@ -2,8 +2,6 @@ "Resources": { "ManyLayersFuncRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -34,8 +32,6 @@ }, "ManyLayersFunc": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/function_with_kmskeyarn.json b/tests/translator/output/function_with_kmskeyarn.json index 6fafaf5ed..ef7a69f6c 100644 --- a/tests/translator/output/function_with_kmskeyarn.json +++ b/tests/translator/output/function_with_kmskeyarn.json @@ -2,8 +2,6 @@ "Resources": { "FunctionWithKeyArnRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -34,8 +32,6 @@ }, "FunctionWithReferenceToKeyArnRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -66,8 +62,6 @@ }, "FunctionWithKeyArn": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -92,8 +86,6 @@ }, "myKey": { "Type": "AWS::KMS::Key", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "KeyPolicy": { "Version": "2012-10-17", @@ -117,8 +109,6 @@ }, "FunctionWithReferenceToKeyArn": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/function_with_layers.json b/tests/translator/output/function_with_layers.json index d21b63450..9d660ef49 100644 --- a/tests/translator/output/function_with_layers.json +++ b/tests/translator/output/function_with_layers.json @@ -2,8 +2,6 @@ "Resources": { "MinimalLayerFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Layers": [ "arn:aws:lambda:us-east-1:123456789101:layer:CorpXLayer:1" @@ -29,9 +27,8 @@ } }, "MyLayera5167acaba": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::LayerVersion", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "sam-demo-bucket", @@ -42,8 +39,6 @@ }, "FunctionReferencesLayer": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Layers": [ { @@ -72,8 +67,6 @@ }, "MinimalLayerFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -104,8 +97,6 @@ }, "FunctionReferencesLayerRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -136,8 +127,6 @@ }, "FunctionLayerWithSubIntrinsic": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Layers": [ { @@ -169,8 +158,6 @@ }, "FunctionNoLayerVersion": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Layers": [ "arn:aws:lambda:us-east-1:123456789101:layer:CorpXLayer:1" @@ -197,8 +184,6 @@ }, "FunctionNoLayerVersionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -229,8 +214,6 @@ }, "FunctionLayerWithSubIntrinsicRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/function_with_many_layers.json b/tests/translator/output/function_with_many_layers.json index ab498dc5f..96e64d886 100644 --- a/tests/translator/output/function_with_many_layers.json +++ b/tests/translator/output/function_with_many_layers.json @@ -1,9 +1,8 @@ { "Resources": { "MyLayera5167acaba": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::LayerVersion", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "sam-demo-bucket", @@ -14,8 +13,6 @@ }, "ManyLayersFuncRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -46,8 +43,6 @@ }, "ManyLayersFunc": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Layers": [ "arn:aws:lambda:us-east-1:123456789101:layer:z:1", diff --git a/tests/translator/output/function_with_permissions_boundary.json b/tests/translator/output/function_with_permissions_boundary.json index 26e07ca22..9e77b8781 100644 --- a/tests/translator/output/function_with_permissions_boundary.json +++ b/tests/translator/output/function_with_permissions_boundary.json @@ -2,8 +2,6 @@ "Resources": { "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -35,8 +33,6 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { diff --git a/tests/translator/output/function_with_policy_templates.json b/tests/translator/output/function_with_policy_templates.json index 4344de856..05c9057cb 100644 --- a/tests/translator/output/function_with_policy_templates.json +++ b/tests/translator/output/function_with_policy_templates.json @@ -7,8 +7,6 @@ "Resources": { "OnePolicyTemplate": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -32,8 +30,6 @@ }, "MultiplePolicyTemplates": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -57,8 +53,6 @@ }, "OnePolicyTemplateRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -124,8 +118,6 @@ }, "MultiplePolicyTemplatesRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -205,8 +197,6 @@ }, "AllCombinations": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -230,8 +220,6 @@ }, "AllCombinationsRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaRole", diff --git a/tests/translator/output/function_with_request_parameters.json b/tests/translator/output/function_with_request_parameters.json index 35a38f2e5..940a79710 100644 --- a/tests/translator/output/function_with_request_parameters.json +++ b/tests/translator/output/function_with_request_parameters.json @@ -2,8 +2,6 @@ "Resources": { "ApiParameterFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "NoApiParameterFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ServerlessRestApiDeployment104b236830": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -71,8 +65,6 @@ }, "ApiParameterFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -103,8 +95,6 @@ }, "NoApiParameterFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -126,8 +116,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment104b236830" @@ -140,8 +128,6 @@ }, "Api": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -181,8 +167,6 @@ }, "ApiParameterFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -202,8 +186,6 @@ }, "ApiDeploymentb45131471b": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "Api" @@ -214,8 +196,6 @@ }, "ApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ApiDeploymentb45131471b" @@ -228,8 +208,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -278,8 +256,6 @@ }, "NoApiParameterFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { diff --git a/tests/translator/output/function_with_resource_refs.json b/tests/translator/output/function_with_resource_refs.json index 23091b0de..d331af50a 100644 --- a/tests/translator/output/function_with_resource_refs.json +++ b/tests/translator/output/function_with_resource_refs.json @@ -53,8 +53,6 @@ "Resources": { "FunctionWithoutAlias": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -78,8 +76,6 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -110,8 +106,6 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -135,8 +129,6 @@ }, "FunctionWithoutAliasRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -166,9 +158,8 @@ } }, "MinimalFunctionVersion640128d35d": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" @@ -177,8 +168,6 @@ }, "MyBucket": { "Type": "AWS::S3::Bucket", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Name": { "Fn::GetAtt": [ @@ -190,8 +179,6 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ diff --git a/tests/translator/output/function_with_signing_profile.json b/tests/translator/output/function_with_signing_profile.json index 8e933689e..1b878970d 100644 --- a/tests/translator/output/function_with_signing_profile.json +++ b/tests/translator/output/function_with_signing_profile.json @@ -2,8 +2,6 @@ "Resources": { "FunctionWithSigningProfile": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -30,8 +28,6 @@ }, "FunctionWithSigningProfileRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -62,8 +58,6 @@ }, "MySignedFunctionCodeSigningConfig": { "Type": "AWS::Lambda::CodeSigningConfig", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "CodeSigningPolicies": { "UntrustedArtifactOnDeployment": "Enforce" @@ -83,8 +77,6 @@ }, "SigningProfile": { "Type": "AWS::Signer::SigningProfile", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "PlatformId": "AWSLambda-SHA384-ECDSA" } diff --git a/tests/translator/output/function_with_sns_event_source_all_parameters.json b/tests/translator/output/function_with_sns_event_source_all_parameters.json index 30ff3d554..e999e3eb8 100644 --- a/tests/translator/output/function_with_sns_event_source_all_parameters.json +++ b/tests/translator/output/function_with_sns_event_source_all_parameters.json @@ -2,8 +2,6 @@ "Resources": { "MyAwesomeFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FilterPolicy": { "store": [ @@ -41,8 +39,6 @@ }, "MyAwesomeFunctionNotificationTopicPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "sns.amazonaws.com", @@ -54,8 +50,6 @@ }, "MyAwesomeFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -86,8 +80,6 @@ }, "MyAwesomeFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/global_handle_path_level_parameter.json b/tests/translator/output/global_handle_path_level_parameter.json index ca499417a..64abf7bd2 100644 --- a/tests/translator/output/global_handle_path_level_parameter.json +++ b/tests/translator/output/global_handle_path_level_parameter.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -123,8 +117,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -142,8 +134,6 @@ }, "ServerlessRestApiDeploymentdb4b9da82a": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -154,8 +144,6 @@ }, "ExplicitApiSomeStageStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -173,8 +161,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -196,8 +182,6 @@ }, "MyUserPool": { "Type": "AWS::Cognito::UserPool", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "UsernameAttributes": [ "email" @@ -219,8 +203,6 @@ }, "ExplicitApiDeployment9a254aa466": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -231,8 +213,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/globals_for_api.json b/tests/translator/output/globals_for_api.json index 99aaeb1de..6cb00f73f 100644 --- a/tests/translator/output/globals_for_api.json +++ b/tests/translator/output/globals_for_api.json @@ -2,8 +2,6 @@ "Resources": { "ImplicitApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.gethtml", "Code": { @@ -27,8 +25,6 @@ }, "ImplicitApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ServerlessRestApiDeploymentaa32438b68": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -71,8 +65,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -134,8 +126,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -153,8 +143,6 @@ }, "ExplicitApiSomeStageStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -172,8 +160,6 @@ }, "ExplicitApiDeployment43e01e673d": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -184,8 +170,6 @@ }, "ImplicitApiFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -207,8 +191,6 @@ }, "MyUserPool": { "Type": "AWS::Cognito::UserPool", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "UsernameAttributes": [ "email" @@ -230,8 +212,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/globals_for_function.json b/tests/translator/output/globals_for_function.json index e21ebedb9..6174a06d0 100644 --- a/tests/translator/output/globals_for_function.json +++ b/tests/translator/output/globals_for_function.json @@ -2,8 +2,6 @@ "Resources": { "FunctionWithOverridesRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -45,8 +43,6 @@ }, "FunctionWithOverrides": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Layers": [ { @@ -108,8 +104,6 @@ }, "MinimalFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -147,8 +141,6 @@ }, "FunctionWithOverridesAliasprod": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -164,8 +156,6 @@ }, "MinimalFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Layers": [ { @@ -218,8 +208,6 @@ }, "MinimalFunctionAliaslive": { "Type": "AWS::Lambda::Alias", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionVersion": { "Fn::GetAtt": [ @@ -234,9 +222,8 @@ } }, "FunctionWithOverridesVersion096ed3b52b": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "FunctionWithOverrides" @@ -244,9 +231,8 @@ } }, "MinimalFunctionVersion0a06fc8fb1": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::Version", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FunctionName": { "Ref": "MinimalFunction" diff --git a/tests/translator/output/globals_for_simpletable.json b/tests/translator/output/globals_for_simpletable.json index 841d324a4..313fd286c 100644 --- a/tests/translator/output/globals_for_simpletable.json +++ b/tests/translator/output/globals_for_simpletable.json @@ -2,8 +2,6 @@ "Resources": { "MinimalTable": { "Type": "AWS::DynamoDB::Table", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BillingMode": "PAY_PER_REQUEST", "SSESpecification": { diff --git a/tests/translator/output/http_api_def_uri.json b/tests/translator/output/http_api_def_uri.json index 84b1639f3..fd5dedd14 100644 --- a/tests/translator/output/http_api_def_uri.json +++ b/tests/translator/output/http_api_def_uri.json @@ -2,8 +2,6 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -27,8 +25,6 @@ }, "FunctionApiPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -48,8 +44,6 @@ }, "MyApiStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AutoDeploy": true, "ApiId": { @@ -72,8 +66,6 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -104,8 +96,6 @@ }, "MyApi2ApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AutoDeploy": true, "ApiId": { @@ -119,8 +109,6 @@ }, "MyApi2": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BodyS3Location": { "Version": "version", @@ -131,8 +119,6 @@ }, "FunctionApi2Permission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -154,8 +140,6 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BodyS3Location": { "Bucket": "bucket", diff --git a/tests/translator/output/http_api_description.json b/tests/translator/output/http_api_description.json index 700b9d871..fed22b685 100644 --- a/tests/translator/output/http_api_description.json +++ b/tests/translator/output/http_api_description.json @@ -2,8 +2,6 @@ "Resources": { "Function": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -27,8 +25,6 @@ }, "FunctionApiPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -48,8 +44,6 @@ }, "FunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -80,8 +74,6 @@ }, "HttpApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AutoDeploy": true, "ApiId": { @@ -95,8 +87,6 @@ }, "HttpApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "openapi": "3.0.1", diff --git a/tests/translator/output/http_api_existing_openapi.json b/tests/translator/output/http_api_existing_openapi.json index 1e872d43f..ea696cf89 100644 --- a/tests/translator/output/http_api_existing_openapi.json +++ b/tests/translator/output/http_api_existing_openapi.json @@ -8,8 +8,6 @@ "Resources": { "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -31,8 +29,6 @@ }, "MyApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -46,8 +42,6 @@ }, "HttpApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.restapi", "Code": { @@ -71,8 +65,6 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -104,8 +96,6 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/http_api_existing_openapi_conditions.json b/tests/translator/output/http_api_existing_openapi_conditions.json index 1fd8e0300..f1a6d177d 100644 --- a/tests/translator/output/http_api_existing_openapi_conditions.json +++ b/tests/translator/output/http_api_existing_openapi_conditions.json @@ -10,8 +10,6 @@ "Resources": { "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -34,8 +32,6 @@ }, "MyApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -51,8 +47,6 @@ }, "HttpApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.restapi", "Code": { @@ -77,8 +71,6 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -110,8 +102,6 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/http_api_explicit_stage.json b/tests/translator/output/http_api_explicit_stage.json index 1cf23fd55..6f827ff3a 100644 --- a/tests/translator/output/http_api_explicit_stage.json +++ b/tests/translator/output/http_api_explicit_stage.json @@ -12,8 +12,6 @@ "Resources": { "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -35,8 +33,6 @@ }, "HttpApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.restapi", "Code": { @@ -60,8 +56,6 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AutoDeploy": true, "StageVariables": { @@ -90,8 +84,6 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -122,8 +114,6 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FailOnWarnings": true, "Body": { diff --git a/tests/translator/output/http_api_lambda_auth.json b/tests/translator/output/http_api_lambda_auth.json index 6e75b5187..ac6d3b4fb 100644 --- a/tests/translator/output/http_api_lambda_auth.json +++ b/tests/translator/output/http_api_lambda_auth.json @@ -2,8 +2,6 @@ "Resources": { "HttpApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -27,8 +25,6 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -59,8 +55,6 @@ }, "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { @@ -82,8 +76,6 @@ }, "MyAuthFn": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "bucket", @@ -107,8 +99,6 @@ }, "MyAuthFnRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -139,8 +129,6 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "openapi": "3.0.1", @@ -250,8 +238,6 @@ }, "MyApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" diff --git a/tests/translator/output/http_api_lambda_auth_full.json b/tests/translator/output/http_api_lambda_auth_full.json index cbd1fcf6b..20b14e636 100644 --- a/tests/translator/output/http_api_lambda_auth_full.json +++ b/tests/translator/output/http_api_lambda_auth_full.json @@ -2,8 +2,6 @@ "Resources": { "HttpApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -27,8 +25,6 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -59,8 +55,6 @@ }, "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { @@ -82,8 +76,6 @@ }, "MyAuthFn": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "bucket", @@ -107,8 +99,6 @@ }, "MyAuthFnRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -139,8 +129,6 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "openapi": "3.0.1", @@ -264,8 +252,6 @@ }, "MyApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" diff --git a/tests/translator/output/http_api_with_cors.json b/tests/translator/output/http_api_with_cors.json index ec7fafd33..a24a91009 100644 --- a/tests/translator/output/http_api_with_cors.json +++ b/tests/translator/output/http_api_with_cors.json @@ -10,8 +10,6 @@ "Resources": { "MyApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "MyApi" @@ -25,8 +23,6 @@ }, "ServerlessHttpApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "ServerlessHttpApi" @@ -40,8 +36,6 @@ }, "ServerlessHttpApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -98,8 +92,6 @@ }, "HttpApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -122,8 +114,6 @@ }, "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -145,8 +135,6 @@ }, "HttpApiFunctionImplicitApiPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -168,8 +156,6 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -200,8 +186,6 @@ }, "MyApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/implicit_and_explicit_api_with_conditions.json b/tests/translator/output/implicit_and_explicit_api_with_conditions.json index 3d079f50e..cc3e91e86 100644 --- a/tests/translator/output/implicit_and_explicit_api_with_conditions.json +++ b/tests/translator/output/implicit_and_explicit_api_with_conditions.json @@ -39,8 +39,6 @@ "Resources": { "explicithello2": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -66,8 +64,6 @@ }, "implicithello2Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -99,8 +95,6 @@ }, "explicithello1": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -126,8 +120,6 @@ }, "explicitapiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "explicitapiDeployment9fcb053eda" @@ -140,8 +132,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentfa2ce19a90" @@ -155,8 +145,6 @@ }, "explicithello1ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -179,8 +167,6 @@ }, "implicithello2": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -206,8 +192,6 @@ }, "implicithello1ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -230,8 +214,6 @@ }, "explicithello2Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -263,8 +245,6 @@ }, "implicithello1": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -290,8 +270,6 @@ }, "explicithello2ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -314,8 +292,6 @@ }, "ServerlessRestApiDeploymentfa2ce19a90": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -327,8 +303,6 @@ }, "explicitapi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -417,8 +391,6 @@ }, "implicithello2ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -441,8 +413,6 @@ }, "explicithello1Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -474,8 +444,6 @@ }, "explicitapiDeployment9fcb053eda": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "explicitapi" @@ -486,8 +454,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -577,8 +543,6 @@ }, "implicithello1Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/implicit_api.json b/tests/translator/output/implicit_api.json index b950333ec..6eb61200b 100644 --- a/tests/translator/output/implicit_api.json +++ b/tests/translator/output/implicit_api.json @@ -2,8 +2,6 @@ "Resources": { "RestApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -36,8 +34,6 @@ }, "RestApiFunctionAddItemPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -59,8 +55,6 @@ }, "GetHtmlFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -82,8 +76,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment127e3fb911" @@ -96,8 +88,6 @@ }, "GetHtmlFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -121,8 +111,6 @@ }, "GetHtmlFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -155,8 +143,6 @@ }, "RestApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -180,8 +166,6 @@ }, "ServerlessRestApiDeployment127e3fb911": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -192,8 +176,6 @@ }, "RestApiFunctionGetListPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -215,8 +197,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -281,8 +261,6 @@ }, "RestApiFunctionCompleteItemPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/implicit_api_with_auth_and_conditions_max.json b/tests/translator/output/implicit_api_with_auth_and_conditions_max.json index 7ba5ebe9d..d83d1eb90 100644 --- a/tests/translator/output/implicit_api_with_auth_and_conditions_max.json +++ b/tests/translator/output/implicit_api_with_auth_and_conditions_max.json @@ -81,8 +81,6 @@ "Resources": { "MyFunction4": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -107,8 +105,6 @@ }, "MyFunction6": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -133,8 +129,6 @@ }, "MyFunction2WithCognitoMultipleUserPoolsAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -157,8 +151,6 @@ }, "MyFunction3": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -183,8 +175,6 @@ }, "MyFunction2": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -209,8 +199,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentcbc79073ff" @@ -224,8 +212,6 @@ }, "MyFunction5Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -257,8 +243,6 @@ }, "MyFunction2Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -290,8 +274,6 @@ }, "ServerlessRestApiDeploymentcbc79073ff": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -303,8 +285,6 @@ }, "MyFunction4Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -336,8 +316,6 @@ }, "MyFunction5": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -362,8 +340,6 @@ }, "MyFunction6Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -395,8 +371,6 @@ }, "ServerlessRestApiMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -416,8 +390,6 @@ }, "MyFunctionWithNoAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -440,8 +412,6 @@ }, "MyFunction3Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -473,8 +443,6 @@ }, "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.handler", "Code": { @@ -499,8 +467,6 @@ }, "MyFunction4WithLambdaTokenAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -523,8 +489,6 @@ }, "ServerlessRestApiMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -544,8 +508,6 @@ }, "MyFunction5WithLambdaRequestAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -568,8 +530,6 @@ }, "ServerlessRestApiMyLambdaTokenAuthNoneFunctionInvokeRoleAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -589,8 +549,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -622,8 +580,6 @@ }, "MyFunction3WithLambdaTokenAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -646,8 +602,6 @@ }, "MyFunction6WithDefaultAuthorizerPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -670,8 +624,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/implicit_api_with_many_conditions.json b/tests/translator/output/implicit_api_with_many_conditions.json index e274ba50a..5d9b800cf 100644 --- a/tests/translator/output/implicit_api_with_many_conditions.json +++ b/tests/translator/output/implicit_api_with_many_conditions.json @@ -125,8 +125,6 @@ "Resources": { "helloworld7ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -149,8 +147,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentd229cbabc1" @@ -164,8 +160,6 @@ }, "helloworld1Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -197,8 +191,6 @@ }, "helloworld7": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -224,8 +216,6 @@ }, "helloworld6": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -251,8 +241,6 @@ }, "helloworldRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -284,8 +272,6 @@ }, "helloworld4": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -311,8 +297,6 @@ }, "helloworld3": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -338,8 +322,6 @@ }, "helloworld2": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -365,8 +347,6 @@ }, "helloworld1": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -392,8 +372,6 @@ }, "helloworld9": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -419,8 +397,6 @@ }, "helloApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -443,8 +419,6 @@ }, "helloworld2ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -467,8 +441,6 @@ }, "ServerlessRestApiDeploymentd229cbabc1": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -480,8 +452,6 @@ }, "helloworld3ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -504,8 +474,6 @@ }, "helloworld1ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -528,8 +496,6 @@ }, "helloworld8": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -555,8 +521,6 @@ }, "helloworld6ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -579,8 +543,6 @@ }, "helloworld4Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -612,8 +574,6 @@ }, "helloworldApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -636,8 +596,6 @@ }, "helloworld9Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -669,8 +627,6 @@ }, "helloworld5ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -693,8 +649,6 @@ }, "helloworld8ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -717,8 +671,6 @@ }, "helloRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -750,8 +702,6 @@ }, "helloworld8Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -783,8 +733,6 @@ }, "helloworld": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -810,8 +758,6 @@ }, "helloworld5Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -843,8 +789,6 @@ }, "hello": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -870,8 +814,6 @@ }, "helloworld5": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -897,8 +839,6 @@ }, "helloworld9ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -921,8 +861,6 @@ }, "helloworld6Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -954,8 +892,6 @@ }, "helloworld7Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -987,8 +923,6 @@ }, "helloworld2Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -1020,8 +954,6 @@ }, "helloworld3Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -1053,8 +985,6 @@ }, "helloworld4ApiEventPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -1077,8 +1007,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/implicit_api_with_serverless_rest_api_resource.json b/tests/translator/output/implicit_api_with_serverless_rest_api_resource.json index 78239fde0..17e8437c5 100644 --- a/tests/translator/output/implicit_api_with_serverless_rest_api_resource.json +++ b/tests/translator/output/implicit_api_with_serverless_rest_api_resource.json @@ -2,8 +2,6 @@ "Resources": { "RestApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -35,8 +33,6 @@ }, "RestApiFunctionAddItemPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -58,8 +54,6 @@ }, "GetHtmlFunctionGetHtmlPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -81,8 +75,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment127e3fb911" @@ -95,8 +87,6 @@ }, "GetHtmlFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -120,8 +110,6 @@ }, "GetHtmlFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -153,8 +141,6 @@ }, "RestApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -178,8 +164,6 @@ }, "ServerlessRestApiDeployment127e3fb911": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -190,8 +174,6 @@ }, "RestApiFunctionGetListPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -213,8 +195,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -279,8 +259,6 @@ }, "RestApiFunctionCompleteItemPermissionProd": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/implicit_http_api.json b/tests/translator/output/implicit_http_api.json index 1688f5541..146970cf6 100644 --- a/tests/translator/output/implicit_http_api.json +++ b/tests/translator/output/implicit_http_api.json @@ -2,8 +2,6 @@ "Resources": { "ServerlessHttpApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "ServerlessHttpApi" @@ -17,8 +15,6 @@ }, "HttpApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -50,8 +46,6 @@ }, "HttpApiFunction2Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -83,8 +77,6 @@ }, "HttpApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.restapi", "Code": { @@ -108,8 +100,6 @@ }, "HttpApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -131,8 +121,6 @@ }, "HttpApiFunction2": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.restapi", "Code": { @@ -156,8 +144,6 @@ }, "ServerlessHttpApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -245,8 +231,6 @@ }, "HttpApiFunction2PathParametersPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -268,8 +252,6 @@ }, "HttpApiFunction2Basic2Permission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/implicit_http_api_auth_and_simple_case.json b/tests/translator/output/implicit_http_api_auth_and_simple_case.json index bf7e31fff..4f518881f 100644 --- a/tests/translator/output/implicit_http_api_auth_and_simple_case.json +++ b/tests/translator/output/implicit_http_api_auth_and_simple_case.json @@ -2,8 +2,6 @@ "Resources": { "ServerlessHttpApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ApiId": { "Ref": "ServerlessHttpApi" @@ -17,8 +15,6 @@ }, "RestApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -50,8 +46,6 @@ }, "RestApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.restapi", "Code": { @@ -75,8 +69,6 @@ }, "RestApiFunctionSimpleCasePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -98,8 +90,6 @@ }, "ServerlessHttpApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/implicit_http_api_with_many_conditions.json b/tests/translator/output/implicit_http_api_with_many_conditions.json index f9957011b..c4b9618b8 100644 --- a/tests/translator/output/implicit_http_api_with_many_conditions.json +++ b/tests/translator/output/implicit_http_api_with_many_conditions.json @@ -116,8 +116,6 @@ "Resources": { "helloworld9HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -140,8 +138,6 @@ }, "helloworld9Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -173,8 +169,6 @@ }, "helloworld2HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -197,8 +191,6 @@ }, "ServerlessHttpApi": { "Type": "AWS::ApiGatewayV2::Api", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -691,8 +683,6 @@ }, "helloworld6HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -715,8 +705,6 @@ }, "helloworld1Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -748,8 +736,6 @@ }, "helloworld7": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -775,8 +761,6 @@ }, "helloworld6": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -802,8 +786,6 @@ }, "helloworld5": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -829,8 +811,6 @@ }, "helloworld1099Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -862,8 +842,6 @@ }, "helloworld3": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -889,8 +867,6 @@ }, "helloworld2": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -916,8 +892,6 @@ }, "helloworld1": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -943,8 +917,6 @@ }, "helloworld9": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -970,8 +942,6 @@ }, "hello": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -997,8 +967,6 @@ }, "helloRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -1030,8 +998,6 @@ }, "helloworld7HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -1054,8 +1020,6 @@ }, "helloHttpApiEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -1078,8 +1042,6 @@ }, "helloworld1HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -1102,8 +1064,6 @@ }, "helloworld5Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -1135,8 +1095,6 @@ }, "helloworld4Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -1168,8 +1126,6 @@ }, "helloworld1099HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -1192,8 +1148,6 @@ }, "helloworld5HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -1216,8 +1170,6 @@ }, "helloworld7Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -1249,8 +1201,6 @@ }, "helloworld2Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -1282,8 +1232,6 @@ }, "helloworld8Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -1315,8 +1263,6 @@ }, "helloworld4": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -1342,8 +1288,6 @@ }, "helloworld1099": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -1369,8 +1313,6 @@ }, "helloworld8HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -1393,8 +1335,6 @@ }, "ServerlessHttpApiApiGatewayDefaultStage": { "Type": "AWS::ApiGatewayV2::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AutoDeploy": true, "ApiId": { @@ -1433,8 +1373,6 @@ }, "helloworld3Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -1466,8 +1404,6 @@ }, "helloworld8": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "ZipFile": "exports.handler = async () => \u2018Hello World!'\n" @@ -1493,8 +1429,6 @@ }, "helloworld4HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -1517,8 +1451,6 @@ }, "helloworld6Role": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -1550,8 +1482,6 @@ }, "helloworld3HttpApiEventPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/inline_precedence.json b/tests/translator/output/inline_precedence.json index cd75d8dba..6ea4caaf0 100644 --- a/tests/translator/output/inline_precedence.json +++ b/tests/translator/output/inline_precedence.json @@ -2,8 +2,6 @@ "Resources": { "HelloWorldFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -34,8 +32,6 @@ }, "HelloWorldFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.lambda_handler", "Code": { diff --git a/tests/translator/output/intrinsic_functions.json b/tests/translator/output/intrinsic_functions.json index da072d990..c3bc3542c 100644 --- a/tests/translator/output/intrinsic_functions.json +++ b/tests/translator/output/intrinsic_functions.json @@ -32,8 +32,6 @@ "Resources": { "MyExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BodyS3Location": { "Bucket": "sam-demo-bucket", @@ -46,8 +44,6 @@ }, "MyTable": { "Type": "AWS::DynamoDB::Table", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "KeySchema": [ { @@ -71,14 +67,10 @@ } }, "SnsDlqQueue": { - "Type": "AWS::SNS::Topic", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::SNS::Topic" }, "MySqsDlqLambdaFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -109,14 +101,10 @@ } }, "SqsDlqQueue": { - "Type": "AWS::SQS::Queue", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::SQS::Queue" }, "ApiWithExplicitS3Uri": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BodyS3Location": { "Version": "myversion", @@ -128,8 +116,6 @@ }, "MyExplicitApiDeployment7145dd00ce": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyExplicitApi" @@ -140,8 +126,6 @@ }, "FunctionWithExplicitS3Uri": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "stream.ddb_handler", "Code": { @@ -166,8 +150,6 @@ }, "MySnsDlqLambdaFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -215,8 +197,6 @@ }, "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "TracingConfig": { "Mode": { @@ -276,8 +256,6 @@ }, "FunctionWithExplicitS3UriRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -308,8 +286,6 @@ }, "DynamoDBFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -341,8 +317,6 @@ }, "MySnsDlqLambdaFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -371,8 +345,6 @@ }, "MyNewRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -412,8 +384,6 @@ }, "DynamoDBFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "stream.ddb_handler", "Code": { @@ -437,8 +407,6 @@ }, "ApiWithExplicitS3UridevStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ApiWithExplicitS3UriDeploymenta227798f00" @@ -452,8 +420,6 @@ }, "DynamoDBFunctionMyDDBStream": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BatchSize": 200, "EventSourceArn": { @@ -470,8 +436,6 @@ }, "ApiWithExplicitS3UriDeploymenta227798f00": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ApiWithExplicitS3Uri" @@ -483,8 +447,6 @@ }, "MySqsDlqLambdaFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -535,8 +497,6 @@ }, "MyExplicitApidevStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyExplicitApiDeployment7145dd00ce" @@ -563,8 +523,6 @@ }, "MyFunctionMyApiPermissiondev": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", diff --git a/tests/translator/output/iot_rule.json b/tests/translator/output/iot_rule.json index 2785cdfce..0600c3b82 100644 --- a/tests/translator/output/iot_rule.json +++ b/tests/translator/output/iot_rule.json @@ -4,8 +4,6 @@ "Resources": { "IoTRuleFuncMyIoTRule": { "Type": "AWS::IoT::TopicRule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "TopicRulePayload": { "AwsIotSqlVersion": "beta", @@ -28,8 +26,6 @@ }, "IoTRuleFuncMyOtherIoTRule": { "Type": "AWS::IoT::TopicRule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "TopicRulePayload": { "Actions": [ @@ -51,8 +47,6 @@ }, "IoTRuleFuncMyIoTRulePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -76,8 +70,6 @@ }, "IoTRuleFuncMyOtherIoTRulePermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -101,8 +93,6 @@ }, "IoTRuleFunc": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -129,8 +119,6 @@ }, "IoTRuleFuncRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/layers_all_properties.json b/tests/translator/output/layers_all_properties.json index ffce52071..a99809489 100644 --- a/tests/translator/output/layers_all_properties.json +++ b/tests/translator/output/layers_all_properties.json @@ -38,8 +38,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Layers": [ { @@ -67,9 +65,8 @@ } }, "MyLayerd04062b365": { + "DeletionPolicy": "Delete", "Type": "AWS::Lambda::LayerVersion", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "bucket", @@ -79,9 +76,8 @@ } }, "MyLayerWithANamefda8c9ec8c": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::LayerVersion", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "bucket", @@ -92,8 +88,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" diff --git a/tests/translator/output/layers_with_intrinsics.json b/tests/translator/output/layers_with_intrinsics.json index e0f76ae9b..d8bb81b37 100644 --- a/tests/translator/output/layers_with_intrinsics.json +++ b/tests/translator/output/layers_with_intrinsics.json @@ -18,9 +18,8 @@ }, "Resources": { "LayerWithNameIntrinsiccf8baed8b9": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::LayerVersion", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "sam-demo-bucket", @@ -30,9 +29,8 @@ } }, "LayerWithRefNameIntrinsicRegion32bf7198a5": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::LayerVersion", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "sam-demo-bucket", @@ -42,9 +40,8 @@ } }, "LayerWithSubNameIntrinsicRegiond71326de24": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::LayerVersion", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "sam-demo-bucket", @@ -56,9 +53,8 @@ } }, "LayerWithRuntimesIntrinsic1a006faa85": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::LayerVersion", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "sam-demo-bucket", @@ -71,6 +67,7 @@ } }, "LayerWithSingleListRefRuntimesIntrinsic9d7a72f24a": { + "DeletionPolicy": "Retain", "Properties": { "CompatibleRuntimes": [ { @@ -83,11 +80,10 @@ }, "LayerName": "LayerWithSingleListRefRuntimesIntrinsic" }, - "Type": "AWS::Lambda::LayerVersion", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::Lambda::LayerVersion" }, "LayerWithMixedListRefRuntimesIntrinsic71fd80f592": { + "DeletionPolicy": "Retain", "Properties": { "CompatibleRuntimes": [ { @@ -101,14 +97,11 @@ }, "LayerName": "LayerWithMixedListRefRuntimesIntrinsic" }, - "Type": "AWS::Lambda::LayerVersion", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::Lambda::LayerVersion" }, "LayerWithLicenseIntrinsic965c8d0c9b": { + "DeletionPolicy": "Retain", "Type": "AWS::Lambda::LayerVersion", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Content": { "S3Bucket": "sam-demo-bucket", @@ -120,8 +113,7 @@ }, "LayerWithSubNameIntrinsic6e9b477102": { "Type": "AWS::Lambda::LayerVersion", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", + "DeletionPolicy": "Retain", "Properties": { "Content": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/no_implicit_api_with_serverless_rest_api_resource.json b/tests/translator/output/no_implicit_api_with_serverless_rest_api_resource.json index 7eb50630c..2a4b1979a 100644 --- a/tests/translator/output/no_implicit_api_with_serverless_rest_api_resource.json +++ b/tests/translator/output/no_implicit_api_with_serverless_rest_api_resource.json @@ -2,8 +2,6 @@ "Resources": { "GetHtmlFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -27,8 +25,6 @@ }, "GetHtmlFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -59,8 +55,6 @@ }, "ThumbnailFunctionImageBucketPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -74,8 +68,6 @@ }, "RestApiFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -106,8 +98,6 @@ }, "RestApiFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -131,8 +121,6 @@ }, "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -163,8 +151,6 @@ }, "Images": { "Type": "AWS::S3::Bucket", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "NotificationConfiguration": { "LambdaConfigurations": [ @@ -186,8 +172,6 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.generate_thumbails", "Code": { @@ -211,8 +195,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/s3.json b/tests/translator/output/s3.json index 4cb3d0e8b..35b92f77c 100644 --- a/tests/translator/output/s3.json +++ b/tests/translator/output/s3.json @@ -2,8 +2,6 @@ "Resources": { "Images": { "Type": "AWS::S3::Bucket", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "DependsOn": ["ThumbnailFunctionImageBucketPermission"], "Properties": { "NotificationConfiguration": { @@ -23,8 +21,6 @@ }, "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,8 +51,6 @@ }, "ThumbnailFunctionImageBucketPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -70,8 +64,6 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/s3_create_remove.json b/tests/translator/output/s3_create_remove.json index 53b2500af..297f01424 100644 --- a/tests/translator/output/s3_create_remove.json +++ b/tests/translator/output/s3_create_remove.json @@ -2,8 +2,6 @@ "Resources": { "Images": { "Type": "AWS::S3::Bucket", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "DependsOn": ["ThumbnailFunctionImageBucketPermission"], "Properties": { "NotificationConfiguration": { @@ -40,8 +38,6 @@ }, "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -72,8 +68,6 @@ }, "ThumbnailFunctionImageBucketPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -87,8 +81,6 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/s3_existing_lambda_notification_configuration.json b/tests/translator/output/s3_existing_lambda_notification_configuration.json index 4cb3d0e8b..35b92f77c 100644 --- a/tests/translator/output/s3_existing_lambda_notification_configuration.json +++ b/tests/translator/output/s3_existing_lambda_notification_configuration.json @@ -2,8 +2,6 @@ "Resources": { "Images": { "Type": "AWS::S3::Bucket", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "DependsOn": ["ThumbnailFunctionImageBucketPermission"], "Properties": { "NotificationConfiguration": { @@ -23,8 +21,6 @@ }, "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -55,8 +51,6 @@ }, "ThumbnailFunctionImageBucketPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -70,8 +64,6 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/s3_existing_other_notification_configuration.json b/tests/translator/output/s3_existing_other_notification_configuration.json index 7be36e411..425051451 100644 --- a/tests/translator/output/s3_existing_other_notification_configuration.json +++ b/tests/translator/output/s3_existing_other_notification_configuration.json @@ -2,8 +2,6 @@ "Resources": { "Images": { "Type": "AWS::S3::Bucket", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "NotificationConfiguration": { "LambdaConfigurations": [ @@ -31,8 +29,6 @@ }, "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -63,8 +59,6 @@ }, "ThumbnailFunctionImageBucketPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -78,8 +72,6 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.generate_thumbails", "Code": { diff --git a/tests/translator/output/s3_filter.json b/tests/translator/output/s3_filter.json index 1c4ea4b16..7e377d29a 100644 --- a/tests/translator/output/s3_filter.json +++ b/tests/translator/output/s3_filter.json @@ -2,8 +2,6 @@ "Resources": { "Images": { "Type": "AWS::S3::Bucket", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "DependsOn": ["ThumbnailFunctionImageBucketPermission"], "Properties": { "NotificationConfiguration": { @@ -33,8 +31,6 @@ }, "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -65,8 +61,6 @@ }, "ThumbnailFunctionImageBucketPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -80,8 +74,6 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/s3_multiple_events_same_bucket.json b/tests/translator/output/s3_multiple_events_same_bucket.json index 3a5ae0946..30ec9dbde 100644 --- a/tests/translator/output/s3_multiple_events_same_bucket.json +++ b/tests/translator/output/s3_multiple_events_same_bucket.json @@ -2,8 +2,6 @@ "Resources": { "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -34,8 +32,6 @@ }, "ThumbnailFunctionImageBucketCreatesPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -49,8 +45,6 @@ }, "Images": { "Type": "AWS::S3::Bucket", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "DependsOn": ["ThumbnailFunctionImageBucketDeletesPermission", "ThumbnailFunctionImageBucketCreatesPermission"], "Properties": { "NotificationConfiguration": { @@ -89,8 +83,6 @@ }, "ThumbnailFunctionImageBucketDeletesPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -104,8 +96,6 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/s3_multiple_functions.json b/tests/translator/output/s3_multiple_functions.json index a6d8c3e7d..fc1d47956 100644 --- a/tests/translator/output/s3_multiple_functions.json +++ b/tests/translator/output/s3_multiple_functions.json @@ -2,8 +2,6 @@ "Resources": { "FunctionOneRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -34,8 +32,6 @@ }, "FunctionTwoImageBucketPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -49,8 +45,6 @@ }, "Images": { "Type": "AWS::S3::Bucket", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "NotificationConfiguration": { "LambdaConfigurations": [ @@ -88,8 +82,6 @@ }, "FunctionTwoRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -120,8 +112,6 @@ }, "FunctionOneImageBucketPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -135,8 +125,6 @@ }, "FunctionTwo": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -160,8 +148,6 @@ }, "FunctionOne": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/s3_with_condition.json b/tests/translator/output/s3_with_condition.json index e11b44ad8..27d891710 100644 --- a/tests/translator/output/s3_with_condition.json +++ b/tests/translator/output/s3_with_condition.json @@ -10,8 +10,6 @@ "Resources": { "Images": { "Type": "AWS::S3::Bucket", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "NotificationConfiguration": { "LambdaConfigurations": [ @@ -52,8 +50,6 @@ }, "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -85,8 +81,6 @@ }, "ThumbnailFunctionImageBucketPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -101,8 +95,6 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.generate_thumbails", "Code": { diff --git a/tests/translator/output/s3_with_dependsOn.json b/tests/translator/output/s3_with_dependsOn.json index 8d994a5e4..2dc415eeb 100644 --- a/tests/translator/output/s3_with_dependsOn.json +++ b/tests/translator/output/s3_with_dependsOn.json @@ -1,14 +1,10 @@ { "Resources": { "Topic": { - "Type": "AWS::SNS::Topic", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::SNS::Topic" }, "Images": { "Type": "AWS::S3::Bucket", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "DependsOn": [ "ThumbnailFunctionImageBucketPermission", "Topic" @@ -31,8 +27,6 @@ }, "ThumbnailFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -63,8 +57,6 @@ }, "ThumbnailFunctionImageBucketPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "SourceAccount": { @@ -78,8 +70,6 @@ }, "ThumbnailFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/simple_table_ref_parameter_intrinsic.json b/tests/translator/output/simple_table_ref_parameter_intrinsic.json index 6c6f2c3eb..f2e511930 100644 --- a/tests/translator/output/simple_table_ref_parameter_intrinsic.json +++ b/tests/translator/output/simple_table_ref_parameter_intrinsic.json @@ -16,8 +16,6 @@ "Resources": { "MinimalTableRefParamLongForm": { "Type": "AWS::DynamoDB::Table", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ProvisionedThroughput": { "WriteCapacityUnits": { diff --git a/tests/translator/output/simple_table_with_extra_tags.json b/tests/translator/output/simple_table_with_extra_tags.json index 36e580e2f..a02e088cd 100644 --- a/tests/translator/output/simple_table_with_extra_tags.json +++ b/tests/translator/output/simple_table_with_extra_tags.json @@ -8,8 +8,6 @@ "Resources": { "MinimalTableWithTags": { "Type": "AWS::DynamoDB::Table", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BillingMode": "PAY_PER_REQUEST", "AttributeDefinitions": [ diff --git a/tests/translator/output/simple_table_with_table_name.json b/tests/translator/output/simple_table_with_table_name.json index d560f80d8..57b9ef7a8 100644 --- a/tests/translator/output/simple_table_with_table_name.json +++ b/tests/translator/output/simple_table_with_table_name.json @@ -8,8 +8,6 @@ "Resources": { "MinimalTableWithTableName": { "Type": "AWS::DynamoDB::Table", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "TableName": "MySimpleTable", "BillingMode": "PAY_PER_REQUEST", @@ -29,8 +27,6 @@ }, "MinimalTableWithRefTableName": { "Type": "AWS::DynamoDB::Table", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "TableName": { "Ref": "MySimpleTableParameter" @@ -52,8 +48,6 @@ }, "MinimalTableWithSubTableName": { "Type": "AWS::DynamoDB::Table", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "TableName": { "Fn::Sub": "${AWS::StackName}MySimpleTable" diff --git a/tests/translator/output/simpletable.json b/tests/translator/output/simpletable.json index f26c9fa8f..c59f7a660 100644 --- a/tests/translator/output/simpletable.json +++ b/tests/translator/output/simpletable.json @@ -2,8 +2,6 @@ "Resources": { "MinimalTable": { "Type": "AWS::DynamoDB::Table", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BillingMode": "PAY_PER_REQUEST", "AttributeDefinitions": [ @@ -22,8 +20,6 @@ }, "CompleteTable": { "Type": "AWS::DynamoDB::Table", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ProvisionedThroughput": { "WriteCapacityUnits": 10, diff --git a/tests/translator/output/simpletable_with_sse.json b/tests/translator/output/simpletable_with_sse.json index b8e931fb0..ab4c3d3f5 100644 --- a/tests/translator/output/simpletable_with_sse.json +++ b/tests/translator/output/simpletable_with_sse.json @@ -2,8 +2,6 @@ "Resources": { "TableWithSSE": { "Type": "AWS::DynamoDB::Table", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BillingMode": "PAY_PER_REQUEST", "SSESpecification": { diff --git a/tests/translator/output/sns.json b/tests/translator/output/sns.json index 1f03a50c7..8e895e2e8 100644 --- a/tests/translator/output/sns.json +++ b/tests/translator/output/sns.json @@ -1,14 +1,10 @@ { "Resources": { "Notifications": { - "Type": "AWS::SNS::Topic", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::SNS::Topic" }, "SaveNotificationFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -39,8 +35,6 @@ }, "SaveNotificationFunctionNotificationTopicPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "sns.amazonaws.com", @@ -54,8 +48,6 @@ }, "SaveNotificationFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -79,8 +71,6 @@ }, "SaveNotificationFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Endpoint": { "Fn::GetAtt": [ diff --git a/tests/translator/output/sns_existing_other_subscription.json b/tests/translator/output/sns_existing_other_subscription.json index e90235008..5c28668de 100644 --- a/tests/translator/output/sns_existing_other_subscription.json +++ b/tests/translator/output/sns_existing_other_subscription.json @@ -2,8 +2,6 @@ "Resources": { "Notifications": { "Type": "AWS::SNS::Topic", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Subscription": [ { @@ -15,8 +13,6 @@ }, "SaveNotificationFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -47,8 +43,6 @@ }, "SaveNotificationFunctionNotificationTopicPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "sns.amazonaws.com", @@ -62,8 +56,6 @@ }, "SaveNotificationFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -87,8 +79,6 @@ }, "SaveNotificationFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Endpoint": { "Fn::GetAtt": [ diff --git a/tests/translator/output/sns_existing_sqs.json b/tests/translator/output/sns_existing_sqs.json index cbcb2afee..a0e9728d8 100644 --- a/tests/translator/output/sns_existing_sqs.json +++ b/tests/translator/output/sns_existing_sqs.json @@ -1,19 +1,13 @@ { "Resources": { "Queue": { - "Type": "AWS::SQS::Queue", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::SQS::Queue" }, "Notifications": { - "Type": "AWS::SNS::Topic", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::SNS::Topic" }, "NotificationA": { "Type": "AWS::SQS::QueuePolicy", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Queues": [ { @@ -47,8 +41,6 @@ }, "SaveNotificationFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FilterPolicy": { "price_usd": [ @@ -77,8 +69,6 @@ }, "SaveNotificationFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -110,8 +100,6 @@ }, "SaveNotificationFunctionNotificationTopicEventSourceMapping": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BatchSize": 8, "Enabled": true, @@ -128,8 +116,6 @@ }, "SaveNotificationFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.save_notification", "Code": { diff --git a/tests/translator/output/sns_outside_sqs.json b/tests/translator/output/sns_outside_sqs.json index 4204cf755..5761b5cc7 100644 --- a/tests/translator/output/sns_outside_sqs.json +++ b/tests/translator/output/sns_outside_sqs.json @@ -2,8 +2,6 @@ "Resources": { "NotificationB": { "Type": "AWS::SQS::QueuePolicy", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Queues": [ "https://sqs.us-east-1.amazonaws.com/123456789012/MyQueue" @@ -29,14 +27,10 @@ } }, "Notifications": { - "Type": "AWS::SNS::Topic", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::SNS::Topic" }, "SaveNotificationFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FilterPolicy": { "price_usd": [ @@ -60,8 +54,6 @@ }, "SaveNotificationFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -93,8 +85,6 @@ }, "SaveNotificationFunctionNotificationTopicEventSourceMapping": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BatchSize": 8, "Enabled": true, @@ -106,8 +96,6 @@ }, "SaveNotificationFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.save_notification", "Code": { diff --git a/tests/translator/output/sns_sqs.json b/tests/translator/output/sns_sqs.json index 38665e31e..4ec300e3d 100644 --- a/tests/translator/output/sns_sqs.json +++ b/tests/translator/output/sns_sqs.json @@ -1,20 +1,14 @@ { "Resources": { "Notifications": { - "Type": "AWS::SNS::Topic", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::SNS::Topic" }, "SaveNotificationFunctionNotificationTopicQueue": { "Type": "AWS::SQS::Queue", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": {} }, "SaveNotificationFunctionNotificationTopicQueuePolicy": { "Type": "AWS::SQS::QueuePolicy", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Queues": [ { @@ -48,8 +42,6 @@ }, "SaveNotificationFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "FilterPolicy": { "price_usd": [ @@ -78,8 +70,6 @@ }, "SaveNotificationFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -111,8 +101,6 @@ }, "SaveNotificationFunctionNotificationTopicEventSourceMapping": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BatchSize": 10, "Enabled": true, @@ -129,8 +117,6 @@ }, "SaveNotificationFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "index.save_notification", "Code": { diff --git a/tests/translator/output/sns_topic_outside_template.json b/tests/translator/output/sns_topic_outside_template.json index 351228749..560270c86 100644 --- a/tests/translator/output/sns_topic_outside_template.json +++ b/tests/translator/output/sns_topic_outside_template.json @@ -7,8 +7,6 @@ "Resources": { "SaveNotificationFunctionNotificationTopic": { "Type": "AWS::SNS::Subscription", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Endpoint": { "Fn::GetAtt": [ @@ -24,8 +22,6 @@ }, "SaveNotificationFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" @@ -56,8 +52,6 @@ }, "SaveNotificationFunctionNotificationTopicPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "sns.amazonaws.com", @@ -71,8 +65,6 @@ }, "SaveNotificationFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", diff --git a/tests/translator/output/sqs.json b/tests/translator/output/sqs.json index 42d1560ac..36bcdb1aa 100644 --- a/tests/translator/output/sqs.json +++ b/tests/translator/output/sqs.json @@ -2,8 +2,6 @@ "Resources": { "SQSFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -33,8 +31,6 @@ }, "SQSFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -56,8 +52,6 @@ }, "SQSFunctionMySqsQueue": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BatchSize": 10, "Enabled": false, diff --git a/tests/translator/output/state_machine_with_api_auth_default_scopes.json b/tests/translator/output/state_machine_with_api_auth_default_scopes.json index 5b5c2f1e2..70042db2f 100644 --- a/tests/translator/output/state_machine_with_api_auth_default_scopes.json +++ b/tests/translator/output/state_machine_with_api_auth_default_scopes.json @@ -2,8 +2,6 @@ "Resources": { "MyApiWithCognitoAuth": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -361,8 +359,6 @@ }, "MyStateMachineCognitoWithAuthNoneRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -400,8 +396,6 @@ }, "MyStateMachineCognitoDefaultScopesNoneRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -439,8 +433,6 @@ }, "MyStateMachineCognitoDefaultAuthDefaultScopesNoneRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -478,8 +470,6 @@ }, "MyStateMachineCognitoDefaultScopesWithOverwrittenRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -517,8 +507,6 @@ }, "MyApiWithCognitoAuthProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiWithCognitoAuthDeployment57b57dfc88" @@ -531,8 +519,6 @@ }, "MyApiWithCognitoAuthDeployment57b57dfc88": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApiWithCognitoAuth" @@ -542,8 +528,6 @@ }, "MyStateMachineCognitoDefaultScopesDefaultAuthorizerRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -581,8 +565,6 @@ }, "MyStateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ @@ -624,8 +606,6 @@ }, "MyStateMachineCognitoAuthorizerWithDefaultScopesRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -663,8 +643,6 @@ }, "MyStateMachineCognitoAuthorizerScopesOverwrittenRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -702,8 +680,6 @@ }, "MyStateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", diff --git a/tests/translator/output/state_machine_with_api_authorizer.json b/tests/translator/output/state_machine_with_api_authorizer.json index 9414e5005..fba1f1847 100644 --- a/tests/translator/output/state_machine_with_api_authorizer.json +++ b/tests/translator/output/state_machine_with_api_authorizer.json @@ -2,8 +2,6 @@ "Resources": { "MyApiMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -22,8 +20,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ @@ -66,8 +62,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentaaffc688ce" @@ -80,8 +74,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -136,8 +128,6 @@ }, "StateMachineWithLambdaTokenAuthRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -175,8 +165,6 @@ }, "MyApiDeploymentc2779253ee": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -187,8 +175,6 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -232,8 +218,6 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeploymentc2779253ee" @@ -246,8 +230,6 @@ }, "ServerlessRestApiDeploymentaaffc688ce": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -258,8 +240,6 @@ }, "StateMachineWithNoAuthorizerRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -297,8 +277,6 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/state_machine_with_api_authorizer_maximum.json b/tests/translator/output/state_machine_with_api_authorizer_maximum.json index d9cd2e041..f4b6bc22f 100644 --- a/tests/translator/output/state_machine_with_api_authorizer_maximum.json +++ b/tests/translator/output/state_machine_with_api_authorizer_maximum.json @@ -2,8 +2,6 @@ "Resources": { "MyApiDeploymentde088eafc3": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -14,8 +12,6 @@ }, "MyApiMyLambdaRequestAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -34,8 +30,6 @@ }, "StateMachineWithLambdaRequestAuthorizerRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -73,8 +67,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ @@ -117,8 +109,6 @@ }, "StateMachineWithDefaultAuthorizerRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -156,8 +146,6 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -490,8 +478,6 @@ }, "MyApiMyLambdaTokenAuthAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -510,8 +496,6 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -555,8 +539,6 @@ }, "StateMachineWithLambdaTokenAuthorizerRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -594,8 +576,6 @@ }, "MyApiMyLambdaTokenAuthNoneFunctionInvokeRoleAuthorizerPermission": { "Type": "AWS::Lambda::Permission", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Action": "lambda:InvokeFunction", "Principal": "apigateway.amazonaws.com", @@ -614,8 +594,6 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeploymentde088eafc3" @@ -628,8 +606,6 @@ }, "StateMachineWithCognitoMultipleUserPoolsAuthorizerRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -667,8 +643,6 @@ }, "StateMachineWithNoAuthorizerRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { diff --git a/tests/translator/output/state_machine_with_api_resource_policy.json b/tests/translator/output/state_machine_with_api_resource_policy.json index 3d1ea852c..262ecdf37 100644 --- a/tests/translator/output/state_machine_with_api_resource_policy.json +++ b/tests/translator/output/state_machine_with_api_resource_policy.json @@ -2,8 +2,6 @@ "Resources": { "MyStateMachineGetHtmlRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -41,8 +39,6 @@ }, "ExplicitApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -296,8 +292,6 @@ }, "ExplicitApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ExplicitApiDeployment17065a95ba" @@ -310,8 +304,6 @@ }, "MyStateMachinePutHtmlRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -349,8 +341,6 @@ }, "MyStateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ @@ -392,8 +382,6 @@ }, "ExplicitApiDeployment17065a95ba": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ExplicitApi" @@ -404,8 +392,6 @@ }, "MyStateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -449,8 +435,6 @@ }, "MyStateMachinePostHtmlRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { diff --git a/tests/translator/output/state_machine_with_condition.json b/tests/translator/output/state_machine_with_condition.json index 756e0dd02..7d67abe1a 100644 --- a/tests/translator/output/state_machine_with_condition.json +++ b/tests/translator/output/state_machine_with_condition.json @@ -10,8 +10,6 @@ "Resources": { "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "StateMachineName": "MyStateMachine", diff --git a/tests/translator/output/state_machine_with_condition_and_events.json b/tests/translator/output/state_machine_with_condition_and_events.json index 5bb454a9b..413d4ac37 100644 --- a/tests/translator/output/state_machine_with_condition_and_events.json +++ b/tests/translator/output/state_machine_with_condition_and_events.json @@ -10,8 +10,6 @@ "Resources": { "StateMachineMyApiEventRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -50,8 +48,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "StateMachineName": "MyStateMachine", @@ -71,8 +67,6 @@ }, "StateMachineScheduleEventRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -111,8 +105,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeploymentaeae651245" @@ -126,8 +118,6 @@ }, "StateMachineScheduleEvent": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ScheduleExpression": "rate(1 minute)", "Targets": [ @@ -150,8 +140,6 @@ }, "StateMachineCWEvent": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -179,8 +167,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -260,8 +246,6 @@ }, "ServerlessRestApiDeploymentaeae651245": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -273,8 +257,6 @@ }, "StateMachineCWEventRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { diff --git a/tests/translator/output/state_machine_with_cwe.json b/tests/translator/output/state_machine_with_cwe.json index 177fdfe96..04164e943 100644 --- a/tests/translator/output/state_machine_with_cwe.json +++ b/tests/translator/output/state_machine_with_cwe.json @@ -2,8 +2,6 @@ "Resources": { "StateMachineCWEvent": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -30,8 +28,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "DefinitionS3Location": { @@ -48,8 +44,6 @@ }, "StateMachineCWEventRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { diff --git a/tests/translator/output/state_machine_with_definition_S3_object.json b/tests/translator/output/state_machine_with_definition_S3_object.json index a1ce2d613..e01d31fd6 100644 --- a/tests/translator/output/state_machine_with_definition_S3_object.json +++ b/tests/translator/output/state_machine_with_definition_S3_object.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -28,8 +26,6 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -78,8 +74,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -110,8 +104,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Tags": [ { diff --git a/tests/translator/output/state_machine_with_definition_S3_string.json b/tests/translator/output/state_machine_with_definition_S3_string.json index f357214d3..97f3b26e5 100644 --- a/tests/translator/output/state_machine_with_definition_S3_string.json +++ b/tests/translator/output/state_machine_with_definition_S3_string.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -28,8 +26,6 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -78,8 +74,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -110,8 +104,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Tags": [ { diff --git a/tests/translator/output/state_machine_with_definition_substitutions.json b/tests/translator/output/state_machine_with_definition_substitutions.json index f8ade0358..5bae321ef 100644 --- a/tests/translator/output/state_machine_with_definition_substitutions.json +++ b/tests/translator/output/state_machine_with_definition_substitutions.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -27,8 +25,6 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -77,8 +73,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -109,8 +103,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DefinitionSubstitutions": { "definition_substitution_1": { diff --git a/tests/translator/output/state_machine_with_eb_dlq.json b/tests/translator/output/state_machine_with_eb_dlq.json index 47aa3b4f3..e49e64256 100644 --- a/tests/translator/output/state_machine_with_eb_dlq.json +++ b/tests/translator/output/state_machine_with_eb_dlq.json @@ -2,8 +2,6 @@ "Resources": { "StateMachineCWEvent": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -33,8 +31,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "DefinitionS3Location": { @@ -51,8 +47,6 @@ }, "StateMachineCWEventRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { diff --git a/tests/translator/output/state_machine_with_eb_dlq_generated.json b/tests/translator/output/state_machine_with_eb_dlq_generated.json index 213cea8c0..7e57f8926 100644 --- a/tests/translator/output/state_machine_with_eb_dlq_generated.json +++ b/tests/translator/output/state_machine_with_eb_dlq_generated.json @@ -2,14 +2,10 @@ "Resources": { "TestDLQ": { "Type": "AWS::SQS::Queue", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": {} }, "StateMachineCWEvent": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -44,8 +40,6 @@ }, "StateMachineCWEventQueuePolicy": { "Type": "AWS::SQS::QueuePolicy", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Queues": [ { @@ -84,8 +78,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "DefinitionS3Location": { @@ -102,8 +94,6 @@ }, "StateMachineCWEventRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { diff --git a/tests/translator/output/state_machine_with_eb_retry_policy.json b/tests/translator/output/state_machine_with_eb_retry_policy.json index 3d6af1cfa..bff94e177 100644 --- a/tests/translator/output/state_machine_with_eb_retry_policy.json +++ b/tests/translator/output/state_machine_with_eb_retry_policy.json @@ -2,8 +2,6 @@ "Resources": { "StateMachineCWEvent": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -34,8 +32,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "DefinitionS3Location": { @@ -52,8 +48,6 @@ }, "StateMachineCWEventRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { diff --git a/tests/translator/output/state_machine_with_explicit_api.json b/tests/translator/output/state_machine_with_explicit_api.json index 177d66744..59f36f236 100644 --- a/tests/translator/output/state_machine_with_explicit_api.json +++ b/tests/translator/output/state_machine_with_explicit_api.json @@ -2,8 +2,6 @@ "Resources": { "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -47,8 +45,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ @@ -91,8 +87,6 @@ }, "MyApiDeployment05bc9f394c": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "MyApi" @@ -103,8 +97,6 @@ }, "MyApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "MyApiDeployment05bc9f394c" @@ -117,8 +109,6 @@ }, "StateMachineMyApiEventRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -156,8 +146,6 @@ }, "MyApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/state_machine_with_express_logging.json b/tests/translator/output/state_machine_with_express_logging.json index 2dd2a9578..ede760c3a 100644 --- a/tests/translator/output/state_machine_with_express_logging.json +++ b/tests/translator/output/state_machine_with_express_logging.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -27,8 +25,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -59,8 +55,6 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -132,14 +126,10 @@ } }, "ExpressLogGroup": { - "Type": "AWS::Logs::LogGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::Logs::LogGroup" }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Tags": [ { diff --git a/tests/translator/output/state_machine_with_implicit_api.json b/tests/translator/output/state_machine_with_implicit_api.json index 592ea0ca8..0a76883a3 100644 --- a/tests/translator/output/state_machine_with_implicit_api.json +++ b/tests/translator/output/state_machine_with_implicit_api.json @@ -2,8 +2,6 @@ "Resources": { "StateMachineMyApiEventRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -41,8 +39,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ @@ -85,8 +81,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment05bc9f394c" @@ -99,8 +93,6 @@ }, "ServerlessRestApiDeployment05bc9f394c": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -111,8 +103,6 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -156,8 +146,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/state_machine_with_implicit_api_globals.json b/tests/translator/output/state_machine_with_implicit_api_globals.json index 1acf2aa94..b8fb271d4 100644 --- a/tests/translator/output/state_machine_with_implicit_api_globals.json +++ b/tests/translator/output/state_machine_with_implicit_api_globals.json @@ -2,8 +2,6 @@ "Resources": { "StateMachineMyApiEventRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -41,8 +39,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ @@ -85,8 +81,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment1f01b589d4" @@ -99,8 +93,6 @@ }, "ServerlessRestApiDeployment1f01b589d4": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -111,8 +103,6 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -156,8 +146,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { diff --git a/tests/translator/output/state_machine_with_inline_definition.json b/tests/translator/output/state_machine_with_inline_definition.json index 52817da2b..722bc9ec7 100644 --- a/tests/translator/output/state_machine_with_inline_definition.json +++ b/tests/translator/output/state_machine_with_inline_definition.json @@ -2,8 +2,6 @@ "Resources": { "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -47,8 +45,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ diff --git a/tests/translator/output/state_machine_with_inline_definition_intrinsics.json b/tests/translator/output/state_machine_with_inline_definition_intrinsics.json index a9e507ace..7c7f91219 100644 --- a/tests/translator/output/state_machine_with_inline_definition_intrinsics.json +++ b/tests/translator/output/state_machine_with_inline_definition_intrinsics.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -28,8 +26,6 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -78,8 +74,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -110,8 +104,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DefinitionString": { "Fn::Join": [ diff --git a/tests/translator/output/state_machine_with_inline_policies.json b/tests/translator/output/state_machine_with_inline_policies.json index a9e507ace..7c7f91219 100644 --- a/tests/translator/output/state_machine_with_inline_policies.json +++ b/tests/translator/output/state_machine_with_inline_policies.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -28,8 +26,6 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -78,8 +74,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -110,8 +104,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DefinitionString": { "Fn::Join": [ diff --git a/tests/translator/output/state_machine_with_managed_policy.json b/tests/translator/output/state_machine_with_managed_policy.json index 62876da4f..82124708d 100644 --- a/tests/translator/output/state_machine_with_managed_policy.json +++ b/tests/translator/output/state_machine_with_managed_policy.json @@ -2,8 +2,6 @@ "Resources": { "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -34,8 +32,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ diff --git a/tests/translator/output/state_machine_with_permissions_boundary.json b/tests/translator/output/state_machine_with_permissions_boundary.json index 781d1e67c..b3823b73b 100644 --- a/tests/translator/output/state_machine_with_permissions_boundary.json +++ b/tests/translator/output/state_machine_with_permissions_boundary.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -28,8 +26,6 @@ }, "StateMachineMyApiEventRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "PermissionsBoundary": "arn:aws:1234:iam:boundary/CustomerCreatedPermissionsBoundary", "Policies": [ @@ -68,8 +64,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ @@ -93,8 +87,6 @@ }, "ServerlessRestApiProdStage": { "Type": "AWS::ApiGateway::Stage", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DeploymentId": { "Ref": "ServerlessRestApiDeployment05bc9f394c" @@ -107,8 +99,6 @@ }, "ServerlessRestApiDeployment05bc9f394c": { "Type": "AWS::ApiGateway::Deployment", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RestApiId": { "Ref": "ServerlessRestApi" @@ -119,8 +109,6 @@ }, "StateMachineCWEvent": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EventPattern": { "detail": { @@ -147,8 +135,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -179,8 +165,6 @@ }, "ServerlessRestApi": { "Type": "AWS::ApiGateway::RestApi", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Body": { "info": { @@ -235,8 +219,6 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -291,8 +273,6 @@ }, "StateMachineScheduleEventRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "PermissionsBoundary": "arn:aws:1234:iam:boundary/CustomerCreatedPermissionsBoundary", "Policies": [ @@ -331,8 +311,6 @@ }, "StateMachineScheduleEvent": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ScheduleExpression": "rate(1 minute)", "Targets": [ @@ -354,8 +332,6 @@ }, "StateMachineCWEventRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "PermissionsBoundary": "arn:aws:1234:iam:boundary/CustomerCreatedPermissionsBoundary", "Policies": [ diff --git a/tests/translator/output/state_machine_with_role.json b/tests/translator/output/state_machine_with_role.json index e929f3e45..0db8c03ab 100644 --- a/tests/translator/output/state_machine_with_role.json +++ b/tests/translator/output/state_machine_with_role.json @@ -2,8 +2,6 @@ "Resources": { "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "StateMachineName": "MyStateMachineWithRole", diff --git a/tests/translator/output/state_machine_with_sam_policy_templates.json b/tests/translator/output/state_machine_with_sam_policy_templates.json index 3580e8eb6..c14e8cd07 100644 --- a/tests/translator/output/state_machine_with_sam_policy_templates.json +++ b/tests/translator/output/state_machine_with_sam_policy_templates.json @@ -2,8 +2,6 @@ "Resources": { "ResolverLambda": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "resolver.handler", "Code": { @@ -27,8 +25,6 @@ }, "NestedWorkflow": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DefinitionSubstitutions": { "definition_substitution_1": { @@ -75,8 +71,6 @@ }, "StarterLambda": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "starter.handler", "Code": { @@ -100,8 +94,6 @@ }, "ProcessingWorkflow": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DefinitionSubstitutions": { "definition_substitution_4": { @@ -250,8 +242,6 @@ }, "StarterLambdaRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -282,8 +272,6 @@ }, "ProcessingWorkflowRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -449,8 +437,6 @@ }, "OutputStore": { "Type": "AWS::DynamoDB::Table", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "KeySchema": [ { @@ -469,14 +455,10 @@ } }, "ProcessingQueue": { - "Type": "AWS::SQS::Queue", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::SQS::Queue" }, "ResolverLambdaRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", diff --git a/tests/translator/output/state_machine_with_schedule.json b/tests/translator/output/state_machine_with_schedule.json index 76099c10b..8730521be 100644 --- a/tests/translator/output/state_machine_with_schedule.json +++ b/tests/translator/output/state_machine_with_schedule.json @@ -2,8 +2,6 @@ "Resources": { "StateMachineScheduleEvent": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "State": "DISABLED", "ScheduleExpression": "rate(1 minute)", @@ -27,8 +25,6 @@ }, "StateMachineScheduleEventRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -66,8 +62,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "DefinitionS3Location": { diff --git a/tests/translator/output/state_machine_with_schedule_dlq_retry_policy.json b/tests/translator/output/state_machine_with_schedule_dlq_retry_policy.json index fa7f67853..5d49175a9 100644 --- a/tests/translator/output/state_machine_with_schedule_dlq_retry_policy.json +++ b/tests/translator/output/state_machine_with_schedule_dlq_retry_policy.json @@ -2,8 +2,6 @@ "Resources": { "StateMachineScheduleEvent": { "Type": "AWS::Events::Rule", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "State": "DISABLED", "ScheduleExpression": "rate(1 minute)", @@ -34,8 +32,6 @@ }, "StateMachineScheduleEventRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Policies": [ { @@ -73,8 +69,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": "arn:aws:iam::123456123456:role/service-role/SampleRole", "DefinitionS3Location": { diff --git a/tests/translator/output/state_machine_with_standard_logging.json b/tests/translator/output/state_machine_with_standard_logging.json index 4b358bfc7..84a2a2e56 100644 --- a/tests/translator/output/state_machine_with_standard_logging.json +++ b/tests/translator/output/state_machine_with_standard_logging.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Handler": "hello.handler", "Code": { @@ -26,14 +24,10 @@ } }, "StandardLogGroup": { - "Type": "AWS::Logs::LogGroup", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete" + "Type": "AWS::Logs::LogGroup" }, "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -106,8 +100,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -138,8 +130,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Tags": [ { diff --git a/tests/translator/output/state_machine_with_tags.json b/tests/translator/output/state_machine_with_tags.json index ba81b1f62..6016da420 100644 --- a/tests/translator/output/state_machine_with_tags.json +++ b/tests/translator/output/state_machine_with_tags.json @@ -2,8 +2,6 @@ "Resources": { "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -55,8 +53,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "RoleArn": { "Fn::GetAtt": [ diff --git a/tests/translator/output/state_machine_with_xray_policies.json b/tests/translator/output/state_machine_with_xray_policies.json index 49794218d..4d23fc62d 100644 --- a/tests/translator/output/state_machine_with_xray_policies.json +++ b/tests/translator/output/state_machine_with_xray_policies.json @@ -2,8 +2,6 @@ "Resources": { "MyFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -27,8 +25,6 @@ }, "MyFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", @@ -59,8 +55,6 @@ }, "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "DefinitionS3Location": { "Bucket": "sam-demo-bucket", @@ -87,8 +81,6 @@ }, "StateMachineRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", diff --git a/tests/translator/output/state_machine_with_xray_role.json b/tests/translator/output/state_machine_with_xray_role.json index 0ac655a98..156d59d44 100644 --- a/tests/translator/output/state_machine_with_xray_role.json +++ b/tests/translator/output/state_machine_with_xray_role.json @@ -2,8 +2,6 @@ "Resources": { "StateMachine": { "Type": "AWS::StepFunctions::StateMachine", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Tags": [ { diff --git a/tests/translator/output/streams.json b/tests/translator/output/streams.json index bbb4281d9..b894b4206 100644 --- a/tests/translator/output/streams.json +++ b/tests/translator/output/streams.json @@ -2,8 +2,6 @@ "Resources": { "DynamoDBFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -25,8 +23,6 @@ }, "KinesisFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -48,8 +44,6 @@ }, "MSKFunction": { "Type": "AWS::Lambda::Function", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "Code": { "S3Bucket": "sam-demo-bucket", @@ -71,8 +65,6 @@ }, "DynamoDBFunctionMyDDBStream": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BatchSize": 200, "EventSourceArn": "arn:aws:dynamodb:us-west-2:012345678901:table/TestTable/stream/2015-05-11T21:21:33.291", @@ -84,8 +76,6 @@ }, "DynamoDBFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -115,8 +105,6 @@ }, "KinesisFunctionMyKinesisStream": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "BatchSize": 100, "Enabled": false, @@ -129,8 +117,6 @@ }, "KinesisFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", @@ -160,8 +146,6 @@ }, "MSKFunctionMyMSKStream": { "Type": "AWS::Lambda::EventSourceMapping", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "EventSourceArn": "arn:aws:kafka:us-west-2:012345678901:cluster/mycluster/6cc0432b-8618-4f44-bccc-e1fbd8fb7c4d-2", "FunctionName": { @@ -173,8 +157,6 @@ }, "MSKFunctionRole": { "Type": "AWS::IAM::Role", - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Delete", "Properties": { "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", diff --git a/tests/translator/test_resource_level_attributes.py b/tests/translator/test_resource_level_attributes.py new file mode 100644 index 000000000..ef2620567 --- /dev/null +++ b/tests/translator/test_resource_level_attributes.py @@ -0,0 +1,208 @@ +import itertools +from unittest.mock import patch + +from parameterized import parameterized + +from tests.plugins.application.test_serverless_app_plugin import mock_get_region +from tests.translator.test_translator import mock_sar_service_call, TestTranslatorEndToEnd + + +class TestResourceLevelAttributes(TestTranslatorEndToEnd): + @parameterized.expand( + itertools.product( + [ + "cognito_userpool_with_event", + "s3_with_condition", + "function_with_condition", + "basic_function", + "basic_function_withimageuri", + "basic_application", + "application_preparing_state", + "application_with_intrinsics", + "cloudwatchevent", + "eventbridgerule", + "eventbridgerule_with_dlq", + "eventbridgerule_with_retry_policy", + "eventbridgerule_schedule_properties", + "cloudwatch_logs_with_ref", + "cloudwatchlog", + "streams", + "sqs", + "function_with_amq", + "function_with_amq_kms", + "simpletable", + "simpletable_with_sse", + "implicit_api", + "explicit_api", + "api_description", + "api_endpoint_configuration", + "api_endpoint_configuration_with_vpcendpoint", + "api_with_auth_all_maximum", + "api_with_auth_all_minimum", + "api_with_auth_no_default", + "api_with_auth_with_default_scopes", + "api_with_auth_with_default_scopes_openapi", + "api_with_default_aws_iam_auth", + "api_with_default_aws_iam_auth_and_no_auth_route", + "api_with_method_aws_iam_auth", + "api_with_aws_iam_auth_overrides", + "api_with_method_settings", + "api_with_binary_media_types", + "api_with_binary_media_types_definition_body", + "api_with_minimum_compression_size", + "api_with_resource_refs", + "api_with_cors", + "api_with_cors_and_auth_no_preflight_auth", + "api_with_cors_and_auth_preflight_auth", + "api_with_cors_and_only_methods", + "api_with_cors_and_only_headers", + "api_with_cors_and_only_origins", + "api_with_cors_and_only_maxage", + "api_with_cors_and_only_credentials_false", + "api_with_cors_no_definitionbody", + "api_with_incompatible_stage_name", + "api_with_gateway_responses", + "api_with_gateway_responses_all", + "api_with_gateway_responses_minimal", + "api_with_gateway_responses_implicit", + "api_with_gateway_responses_string_status_code", + "api_cache", + "api_with_access_log_setting", + "api_with_canary_setting", + "api_with_xray_tracing", + "api_request_model", + "api_with_stage_tags", + "s3", + "s3_create_remove", + "s3_existing_lambda_notification_configuration", + "s3_existing_other_notification_configuration", + "s3_filter", + "s3_multiple_events_same_bucket", + "s3_multiple_functions", + "s3_with_dependsOn", + "sns", + "sns_sqs", + "sns_existing_sqs", + "sns_outside_sqs", + "sns_existing_other_subscription", + "sns_topic_outside_template", + "alexa_skill", + "alexa_skill_with_skill_id", + "iot_rule", + "layers_with_intrinsics", + "layers_all_properties", + "function_managed_inline_policy", + "unsupported_resources", + "intrinsic_functions", + "basic_function_with_tags", + "depends_on", + "function_event_conditions", + "function_with_dlq", + "function_with_kmskeyarn", + "function_with_alias", + "function_with_alias_intrinsics", + "function_with_alias_and_event_sources", + "function_with_resource_refs", + "function_with_global_layers", + "function_with_layers", + "function_with_many_layers", + "function_with_permissions_boundary", + "function_with_policy_templates", + "function_with_sns_event_source_all_parameters", + "function_with_conditional_managed_policy", + "function_with_conditional_managed_policy_and_ref_no_value", + "function_with_conditional_policy_template", + "function_with_conditional_policy_template_and_ref_no_value", + "function_with_request_parameters", + "function_with_signing_profile", + "global_handle_path_level_parameter", + "globals_for_function", + "globals_for_api", + "globals_for_simpletable", + "all_policy_templates", + "simple_table_ref_parameter_intrinsic", + "simple_table_with_table_name", + "function_concurrency", + "simple_table_with_extra_tags", + "explicit_api_with_invalid_events_config", + "no_implicit_api_with_serverless_rest_api_resource", + "implicit_api_deletion_policy_precedence", + "implicit_api_with_serverless_rest_api_resource", + "implicit_api_with_auth_and_conditions_max", + "implicit_api_with_many_conditions", + "implicit_and_explicit_api_with_conditions", + "inline_precedence", + "api_with_cors_and_conditions_no_definitionbody", + "api_with_auth_and_conditions_all_max", + "api_with_apikey_default_override", + "api_with_apikey_required", + "api_with_path_parameters", + "function_with_event_source_mapping", + "function_with_event_dest", + "function_with_event_dest_basic", + "function_with_event_dest_conditional", + "api_with_usageplans", + "api_with_usageplans_intrinsics", + "state_machine_with_inline_definition", + "state_machine_with_tags", + "state_machine_with_inline_definition_intrinsics", + "state_machine_with_role", + "state_machine_with_inline_policies", + "state_machine_with_sam_policy_templates", + "state_machine_with_definition_S3_string", + "state_machine_with_definition_S3_object", + "state_machine_with_definition_substitutions", + "state_machine_with_standard_logging", + "state_machine_with_express_logging", + "state_machine_with_managed_policy", + "state_machine_with_condition", + "state_machine_with_schedule", + "state_machine_with_schedule_dlq_retry_policy", + "state_machine_with_cwe", + "state_machine_with_eb_retry_policy", + "state_machine_with_eb_dlq", + "state_machine_with_eb_dlq_generated", + "state_machine_with_explicit_api", + "state_machine_with_implicit_api", + "state_machine_with_implicit_api_globals", + "state_machine_with_api_authorizer", + "state_machine_with_api_authorizer_maximum", + "state_machine_with_api_resource_policy", + "state_machine_with_api_auth_default_scopes", + "state_machine_with_condition_and_events", + "state_machine_with_xray_policies", + "state_machine_with_xray_role", + "function_with_file_system_config", + "state_machine_with_permissions_boundary", + ], + [ + ("aws", "ap-southeast-1"), + ("aws-cn", "cn-north-1"), + ("aws-us-gov", "us-gov-west-1"), + ], # Run all the above tests against each of the list of partitions to test against + ) + ) + @patch( + "samtranslator.plugins.application.serverless_app_plugin.ServerlessAppPlugin._sar_service_call", + mock_sar_service_call, + ) + @patch("botocore.client.ClientEndpointBridge._check_default_region", mock_get_region) + def test_transform_with_additional_resource_level_attributes(self, testcase, partition_with_region): + partition = partition_with_region[0] + region = partition_with_region[1] + + # add resource level attributes to input resources + manifest = self._read_input(testcase) + resources = manifest.get("Resources", []) + for _, resource in resources.items(): + resource["DeletionPolicy"] = "Delete" + resource["UpdateReplacePolicy"] = "Retain" + + # add resource level attributes to expected output resources + expected = self._read_expected_output(testcase, partition) + expected_resources = expected.get("Resources", []) + for _, expected_resource in expected_resources.items(): + expected_resource["DeletionPolicy"] = "Delete" + expected_resource["UpdateReplacePolicy"] = "Retain" + + self._compare_transform(manifest, expected, partition, region) diff --git a/tests/translator/test_translator.py b/tests/translator/test_translator.py index bbdc3fef3..47337e5af 100644 --- a/tests/translator/test_translator.py +++ b/tests/translator/test_translator.py @@ -333,13 +333,22 @@ def test_transform_success(self, testcase, partition_with_region): partition = partition_with_region[0] region = partition_with_region[1] + manifest = self._read_input(testcase) + expected = self._read_expected_output(testcase, partition) + + self._compare_transform(manifest, expected, partition, region) + + def _read_input(self, testcase): manifest = yaml_parse(open(os.path.join(INPUT_FOLDER, testcase + ".yaml"), "r")) # To uncover unicode-related bugs, convert dict to JSON string and parse JSON back to dict - manifest = json.loads(json.dumps(manifest)) + return json.loads(json.dumps(manifest)) + + def _read_expected_output(self, testcase, partition): partition_folder = partition if partition != "aws" else "" expected_filepath = os.path.join(OUTPUT_FOLDER, partition_folder, testcase + ".json") - expected = json.load(open(expected_filepath, "r")) + return json.load(open(expected_filepath, "r")) + def _compare_transform(self, manifest, expected, partition, region): with patch("boto3.session.Session.region_name", region): parameter_values = get_template_parameter_values() mock_policy_loader = MagicMock() From d2e7922a17e5216ab92c223c0949850e435aefb7 Mon Sep 17 00:00:00 2001 From: Qingchuan Ma Date: Fri, 30 Apr 2021 08:55:00 -0700 Subject: [PATCH 28/41] Skipping metadata in layer hashing --- samtranslator/model/sam_resources.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/samtranslator/model/sam_resources.py b/samtranslator/model/sam_resources.py index a23e6d27d..b0d179c2f 100644 --- a/samtranslator/model/sam_resources.py +++ b/samtranslator/model/sam_resources.py @@ -1185,6 +1185,8 @@ def _construct_lambda_layer(self, intrinsics_resolver): del hash_dict[old_logical_id]["DeletionPolicy"] if "UpdateReplacePolicy" in hash_dict.get(old_logical_id): del hash_dict[old_logical_id]["UpdateReplacePolicy"] + if "Metadata" in hash_dict.get(old_logical_id): + del hash_dict[old_logical_id]["Metadata"] new_logical_id = logical_id_generator.LogicalIdGenerator(old_logical_id, hash_dict).gen() self.logical_id = new_logical_id From 1998cee8f8dc30de4e43795da62df362bdf58cf7 Mon Sep 17 00:00:00 2001 From: Qingchuan Ma Date: Mon, 3 May 2021 13:36:50 -0700 Subject: [PATCH 29/41] Refactored the classes for TestTranslatorEndToEnd and TestResourceLevelAttributes to share the same parent class --- .../test_resource_level_attributes.py | 126 +--------- tests/translator/test_translator.py | 230 +++++++++--------- 2 files changed, 118 insertions(+), 238 deletions(-) diff --git a/tests/translator/test_resource_level_attributes.py b/tests/translator/test_resource_level_attributes.py index ef2620567..6d7d5abb0 100644 --- a/tests/translator/test_resource_level_attributes.py +++ b/tests/translator/test_resource_level_attributes.py @@ -4,10 +4,10 @@ from parameterized import parameterized from tests.plugins.application.test_serverless_app_plugin import mock_get_region -from tests.translator.test_translator import mock_sar_service_call, TestTranslatorEndToEnd +from tests.translator.test_translator import mock_sar_service_call, TestTranslator -class TestResourceLevelAttributes(TestTranslatorEndToEnd): +class TestResourceLevelAttributes(TestTranslator): @parameterized.expand( itertools.product( [ @@ -15,163 +15,41 @@ class TestResourceLevelAttributes(TestTranslatorEndToEnd): "s3_with_condition", "function_with_condition", "basic_function", - "basic_function_withimageuri", "basic_application", - "application_preparing_state", "application_with_intrinsics", "cloudwatchevent", "eventbridgerule", - "eventbridgerule_with_dlq", - "eventbridgerule_with_retry_policy", - "eventbridgerule_schedule_properties", - "cloudwatch_logs_with_ref", "cloudwatchlog", "streams", "sqs", "function_with_amq", - "function_with_amq_kms", "simpletable", - "simpletable_with_sse", "implicit_api", "explicit_api", "api_description", - "api_endpoint_configuration", - "api_endpoint_configuration_with_vpcendpoint", - "api_with_auth_all_maximum", - "api_with_auth_all_minimum", - "api_with_auth_no_default", - "api_with_auth_with_default_scopes", - "api_with_auth_with_default_scopes_openapi", - "api_with_default_aws_iam_auth", - "api_with_default_aws_iam_auth_and_no_auth_route", - "api_with_method_aws_iam_auth", - "api_with_aws_iam_auth_overrides", - "api_with_method_settings", - "api_with_binary_media_types", - "api_with_binary_media_types_definition_body", - "api_with_minimum_compression_size", - "api_with_resource_refs", - "api_with_cors", - "api_with_cors_and_auth_no_preflight_auth", - "api_with_cors_and_auth_preflight_auth", - "api_with_cors_and_only_methods", - "api_with_cors_and_only_headers", - "api_with_cors_and_only_origins", - "api_with_cors_and_only_maxage", - "api_with_cors_and_only_credentials_false", - "api_with_cors_no_definitionbody", - "api_with_incompatible_stage_name", - "api_with_gateway_responses", - "api_with_gateway_responses_all", - "api_with_gateway_responses_minimal", - "api_with_gateway_responses_implicit", - "api_with_gateway_responses_string_status_code", - "api_cache", - "api_with_access_log_setting", - "api_with_canary_setting", - "api_with_xray_tracing", - "api_request_model", - "api_with_stage_tags", "s3", - "s3_create_remove", - "s3_existing_lambda_notification_configuration", - "s3_existing_other_notification_configuration", - "s3_filter", - "s3_multiple_events_same_bucket", - "s3_multiple_functions", - "s3_with_dependsOn", "sns", - "sns_sqs", - "sns_existing_sqs", - "sns_outside_sqs", - "sns_existing_other_subscription", - "sns_topic_outside_template", "alexa_skill", - "alexa_skill_with_skill_id", "iot_rule", - "layers_with_intrinsics", "layers_all_properties", - "function_managed_inline_policy", "unsupported_resources", "intrinsic_functions", "basic_function_with_tags", "depends_on", "function_event_conditions", - "function_with_dlq", - "function_with_kmskeyarn", "function_with_alias", - "function_with_alias_intrinsics", - "function_with_alias_and_event_sources", - "function_with_resource_refs", - "function_with_global_layers", "function_with_layers", - "function_with_many_layers", - "function_with_permissions_boundary", - "function_with_policy_templates", - "function_with_sns_event_source_all_parameters", - "function_with_conditional_managed_policy", - "function_with_conditional_managed_policy_and_ref_no_value", - "function_with_conditional_policy_template", - "function_with_conditional_policy_template_and_ref_no_value", - "function_with_request_parameters", - "function_with_signing_profile", "global_handle_path_level_parameter", - "globals_for_function", - "globals_for_api", - "globals_for_simpletable", "all_policy_templates", "simple_table_ref_parameter_intrinsic", - "simple_table_with_table_name", - "function_concurrency", - "simple_table_with_extra_tags", - "explicit_api_with_invalid_events_config", - "no_implicit_api_with_serverless_rest_api_resource", - "implicit_api_deletion_policy_precedence", "implicit_api_with_serverless_rest_api_resource", - "implicit_api_with_auth_and_conditions_max", - "implicit_api_with_many_conditions", - "implicit_and_explicit_api_with_conditions", - "inline_precedence", "api_with_cors_and_conditions_no_definitionbody", "api_with_auth_and_conditions_all_max", - "api_with_apikey_default_override", "api_with_apikey_required", "api_with_path_parameters", "function_with_event_source_mapping", - "function_with_event_dest", - "function_with_event_dest_basic", - "function_with_event_dest_conditional", "api_with_usageplans", - "api_with_usageplans_intrinsics", "state_machine_with_inline_definition", - "state_machine_with_tags", - "state_machine_with_inline_definition_intrinsics", - "state_machine_with_role", - "state_machine_with_inline_policies", - "state_machine_with_sam_policy_templates", - "state_machine_with_definition_S3_string", - "state_machine_with_definition_S3_object", - "state_machine_with_definition_substitutions", - "state_machine_with_standard_logging", - "state_machine_with_express_logging", - "state_machine_with_managed_policy", - "state_machine_with_condition", - "state_machine_with_schedule", - "state_machine_with_schedule_dlq_retry_policy", - "state_machine_with_cwe", - "state_machine_with_eb_retry_policy", - "state_machine_with_eb_dlq", - "state_machine_with_eb_dlq_generated", - "state_machine_with_explicit_api", - "state_machine_with_implicit_api", - "state_machine_with_implicit_api_globals", - "state_machine_with_api_authorizer", - "state_machine_with_api_authorizer_maximum", - "state_machine_with_api_resource_policy", - "state_machine_with_api_auth_default_scopes", - "state_machine_with_condition_and_events", - "state_machine_with_xray_policies", - "state_machine_with_xray_role", "function_with_file_system_config", "state_machine_with_permissions_boundary", ], diff --git a/tests/translator/test_translator.py b/tests/translator/test_translator.py index 47337e5af..91784c1fc 100644 --- a/tests/translator/test_translator.py +++ b/tests/translator/test_translator.py @@ -138,7 +138,122 @@ def mock_sar_service_call(self, service_call_function, logical_id, *args): # api and s3 location for explicit api. -class TestTranslatorEndToEnd(TestCase): +class TestTranslator(TestCase): + def _read_input(self, testcase): + manifest = yaml_parse(open(os.path.join(INPUT_FOLDER, testcase + ".yaml"), "r")) + # To uncover unicode-related bugs, convert dict to JSON string and parse JSON back to dict + return json.loads(json.dumps(manifest)) + + def _read_expected_output(self, testcase, partition): + partition_folder = partition if partition != "aws" else "" + expected_filepath = os.path.join(OUTPUT_FOLDER, partition_folder, testcase + ".json") + return json.load(open(expected_filepath, "r")) + + def _compare_transform(self, manifest, expected, partition, region): + with patch("boto3.session.Session.region_name", region): + parameter_values = get_template_parameter_values() + mock_policy_loader = MagicMock() + mock_policy_loader.load.return_value = { + "AWSLambdaBasicExecutionRole": "arn:{}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole".format( + partition + ), + "AmazonDynamoDBFullAccess": "arn:{}:iam::aws:policy/AmazonDynamoDBFullAccess".format(partition), + "AmazonDynamoDBReadOnlyAccess": "arn:{}:iam::aws:policy/AmazonDynamoDBReadOnlyAccess".format(partition), + "AWSLambdaRole": "arn:{}:iam::aws:policy/service-role/AWSLambdaRole".format(partition), + } + if partition == "aws": + mock_policy_loader.load.return_value[ + "AWSXrayWriteOnlyAccess" + ] = "arn:aws:iam::aws:policy/AWSXrayWriteOnlyAccess" + else: + mock_policy_loader.load.return_value[ + "AWSXRayDaemonWriteAccess" + ] = "arn:{}:iam::aws:policy/AWSXRayDaemonWriteAccess".format(partition) + + output_fragment = transform(manifest, parameter_values, mock_policy_loader) + + print(json.dumps(output_fragment, indent=2)) + + # Only update the deployment Logical Id hash in Py3. + if sys.version_info.major >= 3: + self._update_logical_id_hash(expected) + self._update_logical_id_hash(output_fragment) + + self.assertEqual(deep_sort_lists(output_fragment), deep_sort_lists(expected)) + + def _update_logical_id_hash(self, resources): + """ + Brute force method for updating all APIGW Deployment LogicalIds and references to a consistent hash + """ + output_resources = resources.get("Resources", {}) + deployment_logical_id_dict = {} + rest_api_to_swagger_hash = {} + dict_of_things_to_delete = {} + + # Find all RestApis in the template + for logical_id, resource_dict in output_resources.items(): + if "AWS::ApiGateway::RestApi" == resource_dict.get("Type"): + resource_properties = resource_dict.get("Properties", {}) + if "Body" in resource_properties: + self._generate_new_deployment_hash( + logical_id, resource_properties.get("Body"), rest_api_to_swagger_hash + ) + + elif "BodyS3Location" in resource_dict.get("Properties"): + self._generate_new_deployment_hash( + logical_id, resource_properties.get("BodyS3Location"), rest_api_to_swagger_hash + ) + + # Collect all APIGW Deployments LogicalIds and generate the new ones + for logical_id, resource_dict in output_resources.items(): + if "AWS::ApiGateway::Deployment" == resource_dict.get("Type"): + resource_properties = resource_dict.get("Properties", {}) + + rest_id = resource_properties.get("RestApiId").get("Ref") + + data_hash = rest_api_to_swagger_hash.get(rest_id) + + description = resource_properties.get("Description")[: -len(data_hash)] + + resource_properties["Description"] = description + data_hash + + new_logical_id = logical_id[:-10] + data_hash[:10] + + deployment_logical_id_dict[logical_id] = new_logical_id + dict_of_things_to_delete[logical_id] = (new_logical_id, resource_dict) + + # Update References to APIGW Deployments + for logical_id, resource_dict in output_resources.items(): + if "AWS::ApiGateway::Stage" == resource_dict.get("Type"): + resource_properties = resource_dict.get("Properties", {}) + + rest_id = resource_properties.get("RestApiId", {}).get("Ref", "") + + data_hash = rest_api_to_swagger_hash.get(rest_id) + + deployment_id = resource_properties.get("DeploymentId", {}).get("Ref") + new_logical_id = deployment_logical_id_dict.get(deployment_id, "")[:-10] + new_logical_id = new_logical_id + data_hash[:10] + + resource_properties.get("DeploymentId", {})["Ref"] = new_logical_id + + # To avoid mutating the template while iterating, delete only after find everything to update + for logical_id_to_remove, tuple_to_add in dict_of_things_to_delete.items(): + output_resources[tuple_to_add[0]] = tuple_to_add[1] + del output_resources[logical_id_to_remove] + + # Update any Output References in the template + for output_key, output_value in resources.get("Outputs", {}).items(): + if output_value.get("Value").get("Ref") in deployment_logical_id_dict: + output_value["Value"]["Ref"] = deployment_logical_id_dict[output_value.get("Value").get("Ref")] + + def _generate_new_deployment_hash(self, logical_id, dict_to_hash, rest_api_to_swagger_hash): + data_bytes = json.dumps(dict_to_hash, separators=(",", ":"), sort_keys=True).encode("utf8") + data_hash = hashlib.sha1(data_bytes).hexdigest() + rest_api_to_swagger_hash[logical_id] = data_hash + + +class TestTranslatorEndToEnd(TestTranslator): @parameterized.expand( itertools.product( [ @@ -338,48 +453,6 @@ def test_transform_success(self, testcase, partition_with_region): self._compare_transform(manifest, expected, partition, region) - def _read_input(self, testcase): - manifest = yaml_parse(open(os.path.join(INPUT_FOLDER, testcase + ".yaml"), "r")) - # To uncover unicode-related bugs, convert dict to JSON string and parse JSON back to dict - return json.loads(json.dumps(manifest)) - - def _read_expected_output(self, testcase, partition): - partition_folder = partition if partition != "aws" else "" - expected_filepath = os.path.join(OUTPUT_FOLDER, partition_folder, testcase + ".json") - return json.load(open(expected_filepath, "r")) - - def _compare_transform(self, manifest, expected, partition, region): - with patch("boto3.session.Session.region_name", region): - parameter_values = get_template_parameter_values() - mock_policy_loader = MagicMock() - mock_policy_loader.load.return_value = { - "AWSLambdaBasicExecutionRole": "arn:{}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole".format( - partition - ), - "AmazonDynamoDBFullAccess": "arn:{}:iam::aws:policy/AmazonDynamoDBFullAccess".format(partition), - "AmazonDynamoDBReadOnlyAccess": "arn:{}:iam::aws:policy/AmazonDynamoDBReadOnlyAccess".format(partition), - "AWSLambdaRole": "arn:{}:iam::aws:policy/service-role/AWSLambdaRole".format(partition), - } - if partition == "aws": - mock_policy_loader.load.return_value[ - "AWSXrayWriteOnlyAccess" - ] = "arn:aws:iam::aws:policy/AWSXrayWriteOnlyAccess" - else: - mock_policy_loader.load.return_value[ - "AWSXRayDaemonWriteAccess" - ] = "arn:{}:iam::aws:policy/AWSXRayDaemonWriteAccess".format(partition) - - output_fragment = transform(manifest, parameter_values, mock_policy_loader) - - print(json.dumps(output_fragment, indent=2)) - - # Only update the deployment Logical Id hash in Py3. - if sys.version_info.major >= 3: - self._update_logical_id_hash(expected) - self._update_logical_id_hash(output_fragment) - - self.assertEqual(deep_sort_lists(output_fragment), deep_sort_lists(expected)) - @parameterized.expand( itertools.product( [ @@ -522,77 +595,6 @@ def test_transform_success_resource_policy(self, testcase, partition_with_region self.assertEqual(deep_sort_lists(output_fragment), deep_sort_lists(expected)) - def _update_logical_id_hash(self, resources): - """ - Brute force method for updating all APIGW Deployment LogicalIds and references to a consistent hash - """ - output_resources = resources.get("Resources", {}) - deployment_logical_id_dict = {} - rest_api_to_swagger_hash = {} - dict_of_things_to_delete = {} - - # Find all RestApis in the template - for logical_id, resource_dict in output_resources.items(): - if "AWS::ApiGateway::RestApi" == resource_dict.get("Type"): - resource_properties = resource_dict.get("Properties", {}) - if "Body" in resource_properties: - self._generate_new_deployment_hash( - logical_id, resource_properties.get("Body"), rest_api_to_swagger_hash - ) - - elif "BodyS3Location" in resource_dict.get("Properties"): - self._generate_new_deployment_hash( - logical_id, resource_properties.get("BodyS3Location"), rest_api_to_swagger_hash - ) - - # Collect all APIGW Deployments LogicalIds and generate the new ones - for logical_id, resource_dict in output_resources.items(): - if "AWS::ApiGateway::Deployment" == resource_dict.get("Type"): - resource_properties = resource_dict.get("Properties", {}) - - rest_id = resource_properties.get("RestApiId").get("Ref") - - data_hash = rest_api_to_swagger_hash.get(rest_id) - - description = resource_properties.get("Description")[: -len(data_hash)] - - resource_properties["Description"] = description + data_hash - - new_logical_id = logical_id[:-10] + data_hash[:10] - - deployment_logical_id_dict[logical_id] = new_logical_id - dict_of_things_to_delete[logical_id] = (new_logical_id, resource_dict) - - # Update References to APIGW Deployments - for logical_id, resource_dict in output_resources.items(): - if "AWS::ApiGateway::Stage" == resource_dict.get("Type"): - resource_properties = resource_dict.get("Properties", {}) - - rest_id = resource_properties.get("RestApiId", {}).get("Ref", "") - - data_hash = rest_api_to_swagger_hash.get(rest_id) - - deployment_id = resource_properties.get("DeploymentId", {}).get("Ref") - new_logical_id = deployment_logical_id_dict.get(deployment_id, "")[:-10] - new_logical_id = new_logical_id + data_hash[:10] - - resource_properties.get("DeploymentId", {})["Ref"] = new_logical_id - - # To avoid mutating the template while iterating, delete only after find everything to update - for logical_id_to_remove, tuple_to_add in dict_of_things_to_delete.items(): - output_resources[tuple_to_add[0]] = tuple_to_add[1] - del output_resources[logical_id_to_remove] - - # Update any Output References in the template - for output_key, output_value in resources.get("Outputs", {}).items(): - if output_value.get("Value").get("Ref") in deployment_logical_id_dict: - output_value["Value"]["Ref"] = deployment_logical_id_dict[output_value.get("Value").get("Ref")] - - def _generate_new_deployment_hash(self, logical_id, dict_to_hash, rest_api_to_swagger_hash): - data_bytes = json.dumps(dict_to_hash, separators=(",", ":"), sort_keys=True).encode("utf8") - data_hash = hashlib.sha1(data_bytes).hexdigest() - rest_api_to_swagger_hash[logical_id] = data_hash - @pytest.mark.parametrize( "testcase", From fcc452047959cb4a998ba43a9436c2c2c97a68c8 Mon Sep 17 00:00:00 2001 From: Qingchuan Ma Date: Mon, 3 May 2021 13:46:00 -0700 Subject: [PATCH 30/41] Added new translator tests for version and layer resources --- .../layer_deletion_policy_precedence.yaml | 18 ++ .../version_deletion_policy_precedence.yaml | 19 ++ .../layer_deletion_policy_precedence.json | 37 ++++ .../version_deletion_policy_precedence.json | 163 ++++++++++++++++++ .../layer_deletion_policy_precedence.json | 37 ++++ .../version_deletion_policy_precedence.json | 163 ++++++++++++++++++ .../layer_deletion_policy_precedence.json | 37 ++++ .../version_deletion_policy_precedence.json | 163 ++++++++++++++++++ tests/translator/test_translator.py | 2 + 9 files changed, 639 insertions(+) create mode 100644 tests/translator/input/layer_deletion_policy_precedence.yaml create mode 100644 tests/translator/input/version_deletion_policy_precedence.yaml create mode 100644 tests/translator/output/aws-cn/layer_deletion_policy_precedence.json create mode 100644 tests/translator/output/aws-cn/version_deletion_policy_precedence.json create mode 100644 tests/translator/output/aws-us-gov/layer_deletion_policy_precedence.json create mode 100644 tests/translator/output/aws-us-gov/version_deletion_policy_precedence.json create mode 100644 tests/translator/output/layer_deletion_policy_precedence.json create mode 100644 tests/translator/output/version_deletion_policy_precedence.json diff --git a/tests/translator/input/layer_deletion_policy_precedence.yaml b/tests/translator/input/layer_deletion_policy_precedence.yaml new file mode 100644 index 000000000..a967ed621 --- /dev/null +++ b/tests/translator/input/layer_deletion_policy_precedence.yaml @@ -0,0 +1,18 @@ +Resources: + MinimalLayer: + Type: 'AWS::Serverless::LayerVersion' + DeletionPolicy: Delete + Properties: + ContentUri: s3://sam-demo-bucket/layer.zip + RetentionPolicy: Retain + + MinimalLayer2: + Type: 'AWS::Serverless::LayerVersion' + DeletionPolicy: Delete + Properties: + ContentUri: s3://sam-demo-bucket/layer.zip + + MinimalLayer3: + Type: 'AWS::Serverless::LayerVersion' + Properties: + ContentUri: s3://sam-demo-bucket/layer.zip \ No newline at end of file diff --git a/tests/translator/input/version_deletion_policy_precedence.yaml b/tests/translator/input/version_deletion_policy_precedence.yaml new file mode 100644 index 000000000..bf868f9a6 --- /dev/null +++ b/tests/translator/input/version_deletion_policy_precedence.yaml @@ -0,0 +1,19 @@ +Resources: + MinimalFunction: + Type: 'AWS::Serverless::Function' + Properties: + CodeUri: s3://sam-demo-bucket/hello.zip + Handler: hello.handler + Runtime: python2.7 + AutoPublishAlias: live + VersionDescription: sam-testing + + MinimalFunction2: + Type: 'AWS::Serverless::Function' + DeletionPolicy: Delete + Properties: + CodeUri: s3://sam-demo-bucket/hello.zip + Handler: hello.handler + Runtime: python2.7 + AutoPublishAlias: live + VersionDescription: sam-testing \ No newline at end of file diff --git a/tests/translator/output/aws-cn/layer_deletion_policy_precedence.json b/tests/translator/output/aws-cn/layer_deletion_policy_precedence.json new file mode 100644 index 000000000..8bb610ad0 --- /dev/null +++ b/tests/translator/output/aws-cn/layer_deletion_policy_precedence.json @@ -0,0 +1,37 @@ +{ + "Resources": { + "MinimalLayer22b6609c3d": { + "Type": "AWS::Lambda::LayerVersion", + "DeletionPolicy": "Retain", + "Properties": { + "Content": { + "S3Bucket": "sam-demo-bucket", + "S3Key": "layer.zip" + }, + "LayerName": "MinimalLayer" + } + }, + "MinimalLayer2800a44a445": { + "Type": "AWS::Lambda::LayerVersion", + "DeletionPolicy": "Delete", + "Properties": { + "Content": { + "S3Bucket": "sam-demo-bucket", + "S3Key": "layer.zip" + }, + "LayerName": "MinimalLayer2" + } + }, + "MinimalLayer3ac07350a04": { + "Type": "AWS::Lambda::LayerVersion", + "DeletionPolicy": "Retain", + "Properties": { + "Content": { + "S3Bucket": "sam-demo-bucket", + "S3Key": "layer.zip" + }, + "LayerName": "MinimalLayer3" + } + } + } +} \ No newline at end of file diff --git a/tests/translator/output/aws-cn/version_deletion_policy_precedence.json b/tests/translator/output/aws-cn/version_deletion_policy_precedence.json new file mode 100644 index 000000000..1d970410a --- /dev/null +++ b/tests/translator/output/aws-cn/version_deletion_policy_precedence.json @@ -0,0 +1,163 @@ +{ + "Resources": { + "MinimalFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "sam-demo-bucket", + "S3Key": "hello.zip" + }, + "Handler": "hello.handler", + "Role": { + "Fn::GetAtt": [ + "MinimalFunctionRole", + "Arn" + ] + }, + "Runtime": "python2.7", + "Tags": [ + { + "Key": "lambda:createdBy", + "Value": "SAM" + } + ] + } + }, + "MinimalFunctionVersion640128d35d": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "Description": "sam-testing", + "FunctionName": { + "Ref": "MinimalFunction" + } + } + }, + "MinimalFunctionAliaslive": { + "Type": "AWS::Lambda::Alias", + "Properties": { + "Name": "live", + "FunctionName": { + "Ref": "MinimalFunction" + }, + "FunctionVersion": { + "Fn::GetAtt": [ + "MinimalFunctionVersion640128d35d", + "Version" + ] + } + } + }, + "MinimalFunctionRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Action": [ + "sts:AssumeRole" + ], + "Effect": "Allow", + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + } + } + ] + }, + "ManagedPolicyArns": [ + "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ], + "Tags": [ + { + "Key": "lambda:createdBy", + "Value": "SAM" + } + ] + } + }, + "MinimalFunction2": { + "Type": "AWS::Lambda::Function", + "DeletionPolicy": "Delete", + "Properties": { + "Code": { + "S3Bucket": "sam-demo-bucket", + "S3Key": "hello.zip" + }, + "Handler": "hello.handler", + "Role": { + "Fn::GetAtt": [ + "MinimalFunction2Role", + "Arn" + ] + }, + "Runtime": "python2.7", + "Tags": [ + { + "Key": "lambda:createdBy", + "Value": "SAM" + } + ] + } + }, + "MinimalFunction2Version640128d35d": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Delete", + "Properties": { + "Description": "sam-testing", + "FunctionName": { + "Ref": "MinimalFunction2" + } + } + }, + "MinimalFunction2Aliaslive": { + "Type": "AWS::Lambda::Alias", + "DeletionPolicy": "Delete", + "Properties": { + "Name": "live", + "FunctionName": { + "Ref": "MinimalFunction2" + }, + "FunctionVersion": { + "Fn::GetAtt": [ + "MinimalFunction2Version640128d35d", + "Version" + ] + } + } + }, + "MinimalFunction2Role": { + "Type": "AWS::IAM::Role", + "DeletionPolicy": "Delete", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Action": [ + "sts:AssumeRole" + ], + "Effect": "Allow", + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + } + } + ] + }, + "ManagedPolicyArns": [ + "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ], + "Tags": [ + { + "Key": "lambda:createdBy", + "Value": "SAM" + } + ] + } + } + } +} \ No newline at end of file diff --git a/tests/translator/output/aws-us-gov/layer_deletion_policy_precedence.json b/tests/translator/output/aws-us-gov/layer_deletion_policy_precedence.json new file mode 100644 index 000000000..8bb610ad0 --- /dev/null +++ b/tests/translator/output/aws-us-gov/layer_deletion_policy_precedence.json @@ -0,0 +1,37 @@ +{ + "Resources": { + "MinimalLayer22b6609c3d": { + "Type": "AWS::Lambda::LayerVersion", + "DeletionPolicy": "Retain", + "Properties": { + "Content": { + "S3Bucket": "sam-demo-bucket", + "S3Key": "layer.zip" + }, + "LayerName": "MinimalLayer" + } + }, + "MinimalLayer2800a44a445": { + "Type": "AWS::Lambda::LayerVersion", + "DeletionPolicy": "Delete", + "Properties": { + "Content": { + "S3Bucket": "sam-demo-bucket", + "S3Key": "layer.zip" + }, + "LayerName": "MinimalLayer2" + } + }, + "MinimalLayer3ac07350a04": { + "Type": "AWS::Lambda::LayerVersion", + "DeletionPolicy": "Retain", + "Properties": { + "Content": { + "S3Bucket": "sam-demo-bucket", + "S3Key": "layer.zip" + }, + "LayerName": "MinimalLayer3" + } + } + } +} \ No newline at end of file diff --git a/tests/translator/output/aws-us-gov/version_deletion_policy_precedence.json b/tests/translator/output/aws-us-gov/version_deletion_policy_precedence.json new file mode 100644 index 000000000..0beb66af0 --- /dev/null +++ b/tests/translator/output/aws-us-gov/version_deletion_policy_precedence.json @@ -0,0 +1,163 @@ +{ + "Resources": { + "MinimalFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "sam-demo-bucket", + "S3Key": "hello.zip" + }, + "Handler": "hello.handler", + "Role": { + "Fn::GetAtt": [ + "MinimalFunctionRole", + "Arn" + ] + }, + "Runtime": "python2.7", + "Tags": [ + { + "Key": "lambda:createdBy", + "Value": "SAM" + } + ] + } + }, + "MinimalFunctionVersion640128d35d": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "Description": "sam-testing", + "FunctionName": { + "Ref": "MinimalFunction" + } + } + }, + "MinimalFunctionAliaslive": { + "Type": "AWS::Lambda::Alias", + "Properties": { + "Name": "live", + "FunctionName": { + "Ref": "MinimalFunction" + }, + "FunctionVersion": { + "Fn::GetAtt": [ + "MinimalFunctionVersion640128d35d", + "Version" + ] + } + } + }, + "MinimalFunctionRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Action": [ + "sts:AssumeRole" + ], + "Effect": "Allow", + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + } + } + ] + }, + "ManagedPolicyArns": [ + "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ], + "Tags": [ + { + "Key": "lambda:createdBy", + "Value": "SAM" + } + ] + } + }, + "MinimalFunction2": { + "Type": "AWS::Lambda::Function", + "DeletionPolicy": "Delete", + "Properties": { + "Code": { + "S3Bucket": "sam-demo-bucket", + "S3Key": "hello.zip" + }, + "Handler": "hello.handler", + "Role": { + "Fn::GetAtt": [ + "MinimalFunction2Role", + "Arn" + ] + }, + "Runtime": "python2.7", + "Tags": [ + { + "Key": "lambda:createdBy", + "Value": "SAM" + } + ] + } + }, + "MinimalFunction2Version640128d35d": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Delete", + "Properties": { + "Description": "sam-testing", + "FunctionName": { + "Ref": "MinimalFunction2" + } + } + }, + "MinimalFunction2Aliaslive": { + "Type": "AWS::Lambda::Alias", + "DeletionPolicy": "Delete", + "Properties": { + "Name": "live", + "FunctionName": { + "Ref": "MinimalFunction2" + }, + "FunctionVersion": { + "Fn::GetAtt": [ + "MinimalFunction2Version640128d35d", + "Version" + ] + } + } + }, + "MinimalFunction2Role": { + "Type": "AWS::IAM::Role", + "DeletionPolicy": "Delete", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Action": [ + "sts:AssumeRole" + ], + "Effect": "Allow", + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + } + } + ] + }, + "ManagedPolicyArns": [ + "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ], + "Tags": [ + { + "Key": "lambda:createdBy", + "Value": "SAM" + } + ] + } + } + } +} \ No newline at end of file diff --git a/tests/translator/output/layer_deletion_policy_precedence.json b/tests/translator/output/layer_deletion_policy_precedence.json new file mode 100644 index 000000000..8bb610ad0 --- /dev/null +++ b/tests/translator/output/layer_deletion_policy_precedence.json @@ -0,0 +1,37 @@ +{ + "Resources": { + "MinimalLayer22b6609c3d": { + "Type": "AWS::Lambda::LayerVersion", + "DeletionPolicy": "Retain", + "Properties": { + "Content": { + "S3Bucket": "sam-demo-bucket", + "S3Key": "layer.zip" + }, + "LayerName": "MinimalLayer" + } + }, + "MinimalLayer2800a44a445": { + "Type": "AWS::Lambda::LayerVersion", + "DeletionPolicy": "Delete", + "Properties": { + "Content": { + "S3Bucket": "sam-demo-bucket", + "S3Key": "layer.zip" + }, + "LayerName": "MinimalLayer2" + } + }, + "MinimalLayer3ac07350a04": { + "Type": "AWS::Lambda::LayerVersion", + "DeletionPolicy": "Retain", + "Properties": { + "Content": { + "S3Bucket": "sam-demo-bucket", + "S3Key": "layer.zip" + }, + "LayerName": "MinimalLayer3" + } + } + } +} \ No newline at end of file diff --git a/tests/translator/output/version_deletion_policy_precedence.json b/tests/translator/output/version_deletion_policy_precedence.json new file mode 100644 index 000000000..36ab3d842 --- /dev/null +++ b/tests/translator/output/version_deletion_policy_precedence.json @@ -0,0 +1,163 @@ +{ + "Resources": { + "MinimalFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "sam-demo-bucket", + "S3Key": "hello.zip" + }, + "Handler": "hello.handler", + "Role": { + "Fn::GetAtt": [ + "MinimalFunctionRole", + "Arn" + ] + }, + "Runtime": "python2.7", + "Tags": [ + { + "Key": "lambda:createdBy", + "Value": "SAM" + } + ] + } + }, + "MinimalFunctionVersion640128d35d": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "Description": "sam-testing", + "FunctionName": { + "Ref": "MinimalFunction" + } + } + }, + "MinimalFunctionAliaslive": { + "Type": "AWS::Lambda::Alias", + "Properties": { + "Name": "live", + "FunctionName": { + "Ref": "MinimalFunction" + }, + "FunctionVersion": { + "Fn::GetAtt": [ + "MinimalFunctionVersion640128d35d", + "Version" + ] + } + } + }, + "MinimalFunctionRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Action": [ + "sts:AssumeRole" + ], + "Effect": "Allow", + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + } + } + ] + }, + "ManagedPolicyArns": [ + "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ], + "Tags": [ + { + "Key": "lambda:createdBy", + "Value": "SAM" + } + ] + } + }, + "MinimalFunction2": { + "Type": "AWS::Lambda::Function", + "DeletionPolicy": "Delete", + "Properties": { + "Code": { + "S3Bucket": "sam-demo-bucket", + "S3Key": "hello.zip" + }, + "Handler": "hello.handler", + "Role": { + "Fn::GetAtt": [ + "MinimalFunction2Role", + "Arn" + ] + }, + "Runtime": "python2.7", + "Tags": [ + { + "Key": "lambda:createdBy", + "Value": "SAM" + } + ] + } + }, + "MinimalFunction2Version640128d35d": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Delete", + "Properties": { + "Description": "sam-testing", + "FunctionName": { + "Ref": "MinimalFunction2" + } + } + }, + "MinimalFunction2Aliaslive": { + "Type": "AWS::Lambda::Alias", + "DeletionPolicy": "Delete", + "Properties": { + "Name": "live", + "FunctionName": { + "Ref": "MinimalFunction2" + }, + "FunctionVersion": { + "Fn::GetAtt": [ + "MinimalFunction2Version640128d35d", + "Version" + ] + } + } + }, + "MinimalFunction2Role": { + "Type": "AWS::IAM::Role", + "DeletionPolicy": "Delete", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Action": [ + "sts:AssumeRole" + ], + "Effect": "Allow", + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + } + } + ] + }, + "ManagedPolicyArns": [ + "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ], + "Tags": [ + { + "Key": "lambda:createdBy", + "Value": "SAM" + } + ] + } + } + } +} \ No newline at end of file diff --git a/tests/translator/test_translator.py b/tests/translator/test_translator.py index 91784c1fc..cd894cdc3 100644 --- a/tests/translator/test_translator.py +++ b/tests/translator/test_translator.py @@ -338,6 +338,7 @@ class TestTranslatorEndToEnd(TestTranslator): "iot_rule", "layers_with_intrinsics", "layers_all_properties", + "layer_deletion_policy_precedence", "function_managed_inline_policy", "unsupported_resources", "intrinsic_functions", @@ -431,6 +432,7 @@ class TestTranslatorEndToEnd(TestTranslator): "state_machine_with_xray_role", "function_with_file_system_config", "state_machine_with_permissions_boundary", + "version_deletion_policy_precedence", ], [ ("aws", "ap-southeast-1"), From 8c0462c2c369cfa5d529d8cc62f2be1560ff05f4 Mon Sep 17 00:00:00 2001 From: Qingchuan Ma Date: Mon, 3 May 2021 13:46:35 -0700 Subject: [PATCH 31/41] Added new unit tests --- tests/model/test_sam_resources.py | 8 ++++++ tests/plugins/api/test_implicit_api_plugin.py | 27 +++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/tests/model/test_sam_resources.py b/tests/model/test_sam_resources.py index e84c5b1ce..f37d82b05 100644 --- a/tests/model/test_sam_resources.py +++ b/tests/model/test_sam_resources.py @@ -332,3 +332,11 @@ def test_with_description_not_defined_in_definition_body(self): resources = sam_http_api.to_cloudformation(**self.kwargs) http_api = [x for x in resources if isinstance(x, ApiGatewayV2HttpApi)] self.assertEqual(http_api[0].Body.get("info", {}).get("description"), "new description") + + +class TestPassthroughResourceAttributes(TestCase): + def test_with_passthrough_resource_attributes(self): + expected = {"DeletionPolicy": "Delete", "UpdateReplacePolicy": "Retain", "Condition": "C1"} + function = SamFunction("foo", attributes=expected) + attributes = function.get_passthrough_resource_attributes() + self.assertEqual(attributes, expected) diff --git a/tests/plugins/api/test_implicit_api_plugin.py b/tests/plugins/api/test_implicit_api_plugin.py index 8bfd808f9..c16dc5111 100644 --- a/tests/plugins/api/test_implicit_api_plugin.py +++ b/tests/plugins/api/test_implicit_api_plugin.py @@ -813,3 +813,30 @@ def test_must_restore_if_existing_resource_present(self): # Must restore original resource template.set.assert_called_with(IMPLICIT_API_LOGICAL_ID, resource) + + +class TestImplicitApiPlugin_generate_resource_attributes(TestCase): + def setUp(self): + self.plugin = ImplicitRestApiPlugin() + self.plugin.api_conditions = {} + + def test_maybe_add_condition(self): + template_dict = {'Resources': {'ServerlessRestApi': {'Type': 'AWS::Serverless::Api'}}} + self.plugin.api_conditions = {'ServerlessRestApi': {'/{proxy+}': {'any': 'C1'}}} + self.plugin._maybe_add_condition_to_implicit_api(template_dict) + print(template_dict) + self.assertEqual(template_dict, {'Resources': {'ServerlessRestApi': {'Type': 'AWS::Serverless::Api', 'Condition': 'C1'}}}) + + def test_maybe_add_deletion_policies(self): + template_dict = {'Resources': {'ServerlessRestApi': {'Type': 'AWS::Serverless::Api'}}} + self.plugin.api_deletion_policies = {'ServerlessRestApi': {'/{proxy+}': {'any': 'Delete'}, '/{proxy++}': {'any': 'Retain'}}} + self.plugin._maybe_add_deletion_policy_to_implicit_api(template_dict) + print(template_dict) + self.assertEqual(template_dict, {'Resources': {'ServerlessRestApi': {'Type': 'AWS::Serverless::Api', 'DeletionPolicy': 'Retain'}}}) + + def test_maybe_add_update_replace_policies(self): + template_dict = {'Resources': {'ServerlessRestApi': {'Type': 'AWS::Serverless::Api'}}} + self.plugin.api_update_replace_policies = {'ServerlessRestApi': {'/{proxy+}': {'any': 'Snapshot'}, '/{proxy++}': {'any': 'Retain'}}} + self.plugin._maybe_add_update_replace_policy_to_implicit_api(template_dict) + print(template_dict) + self.assertEqual(template_dict, {'Resources': {'ServerlessRestApi': {'Type': 'AWS::Serverless::Api', 'UpdateReplacePolicy': 'Retain'}}}) From 814868af1c2265eec3a66a02548bf4d576fd8b50 Mon Sep 17 00:00:00 2001 From: Qingchuan Ma Date: Mon, 3 May 2021 13:58:21 -0700 Subject: [PATCH 32/41] Removed after transform resource plugin --- samtranslator/plugins/__init__.py | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/samtranslator/plugins/__init__.py b/samtranslator/plugins/__init__.py index 199baae51..320910028 100644 --- a/samtranslator/plugins/__init__.py +++ b/samtranslator/plugins/__init__.py @@ -155,7 +155,6 @@ class LifeCycleEvents(Enum): before_transform_template = "before_transform_template" before_transform_resource = "before_transform_resource" after_transform_template = "after_transform_template" - after_transform_resource = "after_transform_resource" class BasePlugin(object): @@ -233,16 +232,3 @@ def on_after_transform_template(self, template): :raises InvalidResourceException: If the hook decides that a SAM resource is invalid. """ pass - - def on_after_transform_resource(self, template, logical_id, transformed_resources): - """ - Hook method to execute on `after_transform_resource` life cycle event. Plugins are free to modify the - whole template or properties of the resource. - - :param string logical_id: LogicalId of the resource that is being processed - :param string resource_type: Type of the resource being processed - :param list transformed_resources: List of the resources being generated. - :return: Nothing - :raises InvalidResourceException: If the hook decides throw this exception on validation failures - """ - pass From 0cbc178072b1357f86597dd00eb057182a05dfa8 Mon Sep 17 00:00:00 2001 From: Qingchuan Ma Date: Mon, 3 May 2021 13:58:41 -0700 Subject: [PATCH 33/41] Black reformatting --- tests/plugins/api/test_implicit_api_plugin.py | 30 +++++++++++++------ 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/tests/plugins/api/test_implicit_api_plugin.py b/tests/plugins/api/test_implicit_api_plugin.py index c16dc5111..76c6eac3f 100644 --- a/tests/plugins/api/test_implicit_api_plugin.py +++ b/tests/plugins/api/test_implicit_api_plugin.py @@ -821,22 +821,34 @@ def setUp(self): self.plugin.api_conditions = {} def test_maybe_add_condition(self): - template_dict = {'Resources': {'ServerlessRestApi': {'Type': 'AWS::Serverless::Api'}}} - self.plugin.api_conditions = {'ServerlessRestApi': {'/{proxy+}': {'any': 'C1'}}} + template_dict = {"Resources": {"ServerlessRestApi": {"Type": "AWS::Serverless::Api"}}} + self.plugin.api_conditions = {"ServerlessRestApi": {"/{proxy+}": {"any": "C1"}}} self.plugin._maybe_add_condition_to_implicit_api(template_dict) print(template_dict) - self.assertEqual(template_dict, {'Resources': {'ServerlessRestApi': {'Type': 'AWS::Serverless::Api', 'Condition': 'C1'}}}) + self.assertEqual( + template_dict, {"Resources": {"ServerlessRestApi": {"Type": "AWS::Serverless::Api", "Condition": "C1"}}} + ) def test_maybe_add_deletion_policies(self): - template_dict = {'Resources': {'ServerlessRestApi': {'Type': 'AWS::Serverless::Api'}}} - self.plugin.api_deletion_policies = {'ServerlessRestApi': {'/{proxy+}': {'any': 'Delete'}, '/{proxy++}': {'any': 'Retain'}}} + template_dict = {"Resources": {"ServerlessRestApi": {"Type": "AWS::Serverless::Api"}}} + self.plugin.api_deletion_policies = { + "ServerlessRestApi": {"/{proxy+}": {"any": "Delete"}, "/{proxy++}": {"any": "Retain"}} + } self.plugin._maybe_add_deletion_policy_to_implicit_api(template_dict) print(template_dict) - self.assertEqual(template_dict, {'Resources': {'ServerlessRestApi': {'Type': 'AWS::Serverless::Api', 'DeletionPolicy': 'Retain'}}}) + self.assertEqual( + template_dict, + {"Resources": {"ServerlessRestApi": {"Type": "AWS::Serverless::Api", "DeletionPolicy": "Retain"}}}, + ) def test_maybe_add_update_replace_policies(self): - template_dict = {'Resources': {'ServerlessRestApi': {'Type': 'AWS::Serverless::Api'}}} - self.plugin.api_update_replace_policies = {'ServerlessRestApi': {'/{proxy+}': {'any': 'Snapshot'}, '/{proxy++}': {'any': 'Retain'}}} + template_dict = {"Resources": {"ServerlessRestApi": {"Type": "AWS::Serverless::Api"}}} + self.plugin.api_update_replace_policies = { + "ServerlessRestApi": {"/{proxy+}": {"any": "Snapshot"}, "/{proxy++}": {"any": "Retain"}} + } self.plugin._maybe_add_update_replace_policy_to_implicit_api(template_dict) print(template_dict) - self.assertEqual(template_dict, {'Resources': {'ServerlessRestApi': {'Type': 'AWS::Serverless::Api', 'UpdateReplacePolicy': 'Retain'}}}) + self.assertEqual( + template_dict, + {"Resources": {"ServerlessRestApi": {"Type": "AWS::Serverless::Api", "UpdateReplacePolicy": "Retain"}}}, + ) From 7a0cf6dbd097535da2f6bbf9ae5c780acb2db263 Mon Sep 17 00:00:00 2001 From: Qingchuan Ma Date: Wed, 5 May 2021 09:08:27 -0700 Subject: [PATCH 34/41] Refactoring implicit api plugin support for DeletionPolicy and UpdateReplacePolicy --- .../plugins/api/implicit_api_plugin.py | 26 +++++-------------- .../plugins/api/implicit_http_api_plugin.py | 12 ++++----- .../plugins/api/implicit_rest_api_plugin.py | 12 ++++----- tests/plugins/api/test_implicit_api_plugin.py | 4 +-- 4 files changed, 20 insertions(+), 34 deletions(-) diff --git a/samtranslator/plugins/api/implicit_api_plugin.py b/samtranslator/plugins/api/implicit_api_plugin.py index af515c2cc..abf440b08 100644 --- a/samtranslator/plugins/api/implicit_api_plugin.py +++ b/samtranslator/plugins/api/implicit_api_plugin.py @@ -267,22 +267,15 @@ def _maybe_add_deletion_policy_to_implicit_api(self, template_dict): return # Add a deletion policy to the API resource if its resources contains DeletionPolicy. - implicit_api_deletion_policies = self.api_deletion_policies[self.implicit_api_logical_id] - all_resource_method_deletion_policies = set( - [ - deletion_policy - for path, method_deletion_policies in implicit_api_deletion_policies.items() - for method, deletion_policy in method_deletion_policies.items() - ] - ) - at_least_one_resource_method = len(all_resource_method_deletion_policies) > 0 + implicit_api_deletion_policies = self.api_deletion_policies.get(self.implicit_api_logical_id) + at_least_one_resource_method = len(implicit_api_deletion_policies) > 0 one_resource_method_contains_deletion_policy = False contains_retain = False contains_delete = False # If multiple functions with multiple different policies reference the Implicit Api, # we set DeletionPolicy to Retain if Retain is present in one of the functions, # else Delete if Delete is present - for iterated_policy in all_resource_method_deletion_policies: + for iterated_policy in implicit_api_deletion_policies: if iterated_policy: one_resource_method_contains_deletion_policy = True if iterated_policy == "Retain": @@ -306,15 +299,8 @@ def _maybe_add_update_replace_policy_to_implicit_api(self, template_dict): return # Add a update replace policy to the API resource if its resources contains UpdateReplacePolicy. - implicit_api_update_replace_policies = self.api_update_replace_policies[self.implicit_api_logical_id] - all_resource_method_update_replace_policies = set( - [ - update_replace_policy - for path, method_update_replace_policies in implicit_api_update_replace_policies.items() - for method, update_replace_policy in method_update_replace_policies.items() - ] - ) - at_least_one_resource_method = len(all_resource_method_update_replace_policies) > 0 + implicit_api_update_replace_policies = self.api_update_replace_policies.get(self.implicit_api_logical_id) + at_least_one_resource_method = len(implicit_api_update_replace_policies) > 0 one_resource_method_contains_update_replace_policy = False contains_retain = False contains_snapshot = False @@ -322,7 +308,7 @@ def _maybe_add_update_replace_policy_to_implicit_api(self, template_dict): # If multiple functions with multiple different policies reference the Implicit Api, # we set UpdateReplacePolicy to Retain if Retain is present in one of the functions, # Snapshot if Snapshot is present, else Delete if Delete is present - for iterated_policy in all_resource_method_update_replace_policies: + for iterated_policy in implicit_api_update_replace_policies: if iterated_policy: one_resource_method_contains_update_replace_policy = True if iterated_policy == "Retain": diff --git a/samtranslator/plugins/api/implicit_http_api_plugin.py b/samtranslator/plugins/api/implicit_http_api_plugin.py index 922a3d3b2..95e3c8e2e 100644 --- a/samtranslator/plugins/api/implicit_http_api_plugin.py +++ b/samtranslator/plugins/api/implicit_http_api_plugin.py @@ -95,13 +95,13 @@ def _process_api_events( method_conditions = api_dict_condition.setdefault(path, {}) method_conditions[method] = condition - api_dict_deletion = self.api_deletion_policies.setdefault(api_id, {}) - method_deletion_policies = api_dict_deletion.setdefault(path, {}) - method_deletion_policies[method] = deletion_policy + api_dict_deletion = self.api_deletion_policies.setdefault(api_id, []) + if deletion_policy not in api_dict_deletion: + api_dict_deletion.append(deletion_policy) - api_dict_update_replace = self.api_update_replace_policies.setdefault(api_id, {}) - method_update_replace_policies = api_dict_update_replace.setdefault(path, {}) - method_update_replace_policies[method] = update_replace_policy + api_dict_update_replace = self.api_update_replace_policies.setdefault(api_id, []) + if update_replace_policy not in api_dict_update_replace: + api_dict_update_replace.append(update_replace_policy) self._add_api_to_swagger(logicalId, event_properties, template) if "RouteSettings" in event_properties: diff --git a/samtranslator/plugins/api/implicit_rest_api_plugin.py b/samtranslator/plugins/api/implicit_rest_api_plugin.py index 1e005a0cf..516143169 100644 --- a/samtranslator/plugins/api/implicit_rest_api_plugin.py +++ b/samtranslator/plugins/api/implicit_rest_api_plugin.py @@ -93,13 +93,13 @@ def _process_api_events( method_conditions = api_dict_condition.setdefault(path, {}) method_conditions[method] = condition - api_dict_deletion = self.api_deletion_policies.setdefault(api_id, {}) - method_deletion_policies = api_dict_deletion.setdefault(path, {}) - method_deletion_policies[method] = deletion_policy + api_dict_deletion = self.api_deletion_policies.setdefault(api_id, []) + if deletion_policy not in api_dict_deletion: + api_dict_deletion.append(deletion_policy) - api_dict_update_replace = self.api_update_replace_policies.setdefault(api_id, {}) - method_update_replace_policies = api_dict_update_replace.setdefault(path, {}) - method_update_replace_policies[method] = update_replace_policy + api_dict_update_replace = self.api_update_replace_policies.setdefault(api_id, []) + if update_replace_policy not in api_dict_update_replace: + api_dict_update_replace.append(update_replace_policy) self._add_api_to_swagger(logicalId, event_properties, template) diff --git a/tests/plugins/api/test_implicit_api_plugin.py b/tests/plugins/api/test_implicit_api_plugin.py index 76c6eac3f..cef212778 100644 --- a/tests/plugins/api/test_implicit_api_plugin.py +++ b/tests/plugins/api/test_implicit_api_plugin.py @@ -832,7 +832,7 @@ def test_maybe_add_condition(self): def test_maybe_add_deletion_policies(self): template_dict = {"Resources": {"ServerlessRestApi": {"Type": "AWS::Serverless::Api"}}} self.plugin.api_deletion_policies = { - "ServerlessRestApi": {"/{proxy+}": {"any": "Delete"}, "/{proxy++}": {"any": "Retain"}} + "ServerlessRestApi": {"Delete", "Retain"} } self.plugin._maybe_add_deletion_policy_to_implicit_api(template_dict) print(template_dict) @@ -844,7 +844,7 @@ def test_maybe_add_deletion_policies(self): def test_maybe_add_update_replace_policies(self): template_dict = {"Resources": {"ServerlessRestApi": {"Type": "AWS::Serverless::Api"}}} self.plugin.api_update_replace_policies = { - "ServerlessRestApi": {"/{proxy+}": {"any": "Snapshot"}, "/{proxy++}": {"any": "Retain"}} + "ServerlessRestApi": {"Snapshot", "Retain"} } self.plugin._maybe_add_update_replace_policy_to_implicit_api(template_dict) print(template_dict) From 1ab32c324c5c3fa6084593e8f656d4349594c201 Mon Sep 17 00:00:00 2001 From: Qingchuan Ma Date: Wed, 5 May 2021 09:16:47 -0700 Subject: [PATCH 35/41] Refactoring to improve code quality --- samtranslator/model/api/api_generator.py | 2 -- samtranslator/translator/translator.py | 3 --- tests/translator/test_resource_level_attributes.py | 4 ++-- tests/translator/test_translator.py | 4 ++-- 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/samtranslator/model/api/api_generator.py b/samtranslator/model/api/api_generator.py index e0273d08b..eef1d3d27 100644 --- a/samtranslator/model/api/api_generator.py +++ b/samtranslator/model/api/api_generator.py @@ -635,7 +635,6 @@ def _construct_usage_plan(self, rest_api_stage=None): depends_on=[self.logical_id], attributes=self.passthrough_resource_attributes, ) - # usage_plan = ApiGatewayUsagePlan(logical_id=usage_plan_logical_id, depends_on=[self.logical_id]) api_stages = list() api_stage = dict() api_stage["ApiId"] = ref(self.logical_id) @@ -695,7 +694,6 @@ def _construct_api_key(self, usage_plan_logical_id, create_usage_plan, rest_api_ depends_on=[usage_plan_logical_id], attributes=self.passthrough_resource_attributes, ) - # api_key = ApiGatewayApiKey(logical_id=api_key_logical_id, depends_on=[usage_plan_logical_id]) api_key.Enabled = True stage_key = dict() stage_key["RestApiId"] = ref(self.logical_id) diff --git a/samtranslator/translator/translator.py b/samtranslator/translator/translator.py index a994e8d8b..c7d7c415b 100644 --- a/samtranslator/translator/translator.py +++ b/samtranslator/translator/translator.py @@ -136,8 +136,6 @@ def translate(self, sam_template, parameter_values, feature_toggle=None): kwargs["shared_api_usage_plan"] = shared_api_usage_plan translated = macro.to_cloudformation(**kwargs) - # sam_plugins.act(LifeCycleEvents.after_transform_resource, template, macro.logical_id, translated) - supported_resource_refs = macro.get_resource_references(translated, supported_resource_refs) # Some resources mutate their logical ids. Track those to change all references to them: @@ -247,7 +245,6 @@ def prepare_plugins(plugins, parameters=None): make_implicit_http_api_plugin(), GlobalsPlugin(), make_policy_template_for_function_plugin(), - # ResourceAttributesPlugin(), ] plugins = [] if not plugins else plugins diff --git a/tests/translator/test_resource_level_attributes.py b/tests/translator/test_resource_level_attributes.py index 6d7d5abb0..0f8df442d 100644 --- a/tests/translator/test_resource_level_attributes.py +++ b/tests/translator/test_resource_level_attributes.py @@ -4,10 +4,10 @@ from parameterized import parameterized from tests.plugins.application.test_serverless_app_plugin import mock_get_region -from tests.translator.test_translator import mock_sar_service_call, TestTranslator +from tests.translator.test_translator import mock_sar_service_call, AbstractTestTranslator -class TestResourceLevelAttributes(TestTranslator): +class TestResourceLevelAttributes(AbstractTestTranslator): @parameterized.expand( itertools.product( [ diff --git a/tests/translator/test_translator.py b/tests/translator/test_translator.py index cd894cdc3..5a100fe38 100644 --- a/tests/translator/test_translator.py +++ b/tests/translator/test_translator.py @@ -138,7 +138,7 @@ def mock_sar_service_call(self, service_call_function, logical_id, *args): # api and s3 location for explicit api. -class TestTranslator(TestCase): +class AbstractTestTranslator(TestCase): def _read_input(self, testcase): manifest = yaml_parse(open(os.path.join(INPUT_FOLDER, testcase + ".yaml"), "r")) # To uncover unicode-related bugs, convert dict to JSON string and parse JSON back to dict @@ -253,7 +253,7 @@ def _generate_new_deployment_hash(self, logical_id, dict_to_hash, rest_api_to_sw rest_api_to_swagger_hash[logical_id] = data_hash -class TestTranslatorEndToEnd(TestTranslator): +class TestTranslatorEndToEnd(AbstractTestTranslator): @parameterized.expand( itertools.product( [ From b7867f25b5a614775bc669cc90e22b35c4b18238 Mon Sep 17 00:00:00 2001 From: Qingchuan Ma Date: Wed, 5 May 2021 09:19:43 -0700 Subject: [PATCH 36/41] Added simple documentation --- samtranslator/model/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/samtranslator/model/__init__.py b/samtranslator/model/__init__.py index 722291d98..d535fb142 100644 --- a/samtranslator/model/__init__.py +++ b/samtranslator/model/__init__.py @@ -43,7 +43,10 @@ class Resource(object): property_types = None _keywords = ["logical_id", "relative_id", "depends_on", "resource_attributes"] + # For attributes in this list, they will be passed into the translated template for the same resource itself. _supported_resource_attributes = ["DeletionPolicy", "UpdatePolicy", "Condition", "UpdateReplacePolicy", "Metadata"] + # For attributes in this list, they will be passed into the translated template for the same resource, + # as well as all the auto-generated resources that are created from this resource. _pass_through_attributes = ["Condition", "DeletionPolicy", "UpdateReplacePolicy"] # Runtime attributes that can be qureied resource. They are CloudFormation attributes like ARN, Name etc that From ea6d09bc001fdf5aa01be5098080406afc5a70af Mon Sep 17 00:00:00 2001 From: Qingchuan Ma Date: Wed, 5 May 2021 09:28:54 -0700 Subject: [PATCH 37/41] Black reformatting --- samtranslator/plugins/api/implicit_http_api_plugin.py | 4 ++-- samtranslator/plugins/api/implicit_rest_api_plugin.py | 4 ++-- tests/plugins/api/test_implicit_api_plugin.py | 8 ++------ 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/samtranslator/plugins/api/implicit_http_api_plugin.py b/samtranslator/plugins/api/implicit_http_api_plugin.py index 95e3c8e2e..0c2ef2009 100644 --- a/samtranslator/plugins/api/implicit_http_api_plugin.py +++ b/samtranslator/plugins/api/implicit_http_api_plugin.py @@ -97,11 +97,11 @@ def _process_api_events( api_dict_deletion = self.api_deletion_policies.setdefault(api_id, []) if deletion_policy not in api_dict_deletion: - api_dict_deletion.append(deletion_policy) + api_dict_deletion.append(deletion_policy) api_dict_update_replace = self.api_update_replace_policies.setdefault(api_id, []) if update_replace_policy not in api_dict_update_replace: - api_dict_update_replace.append(update_replace_policy) + api_dict_update_replace.append(update_replace_policy) self._add_api_to_swagger(logicalId, event_properties, template) if "RouteSettings" in event_properties: diff --git a/samtranslator/plugins/api/implicit_rest_api_plugin.py b/samtranslator/plugins/api/implicit_rest_api_plugin.py index 516143169..a7d7d892a 100644 --- a/samtranslator/plugins/api/implicit_rest_api_plugin.py +++ b/samtranslator/plugins/api/implicit_rest_api_plugin.py @@ -95,11 +95,11 @@ def _process_api_events( api_dict_deletion = self.api_deletion_policies.setdefault(api_id, []) if deletion_policy not in api_dict_deletion: - api_dict_deletion.append(deletion_policy) + api_dict_deletion.append(deletion_policy) api_dict_update_replace = self.api_update_replace_policies.setdefault(api_id, []) if update_replace_policy not in api_dict_update_replace: - api_dict_update_replace.append(update_replace_policy) + api_dict_update_replace.append(update_replace_policy) self._add_api_to_swagger(logicalId, event_properties, template) diff --git a/tests/plugins/api/test_implicit_api_plugin.py b/tests/plugins/api/test_implicit_api_plugin.py index cef212778..1ad927212 100644 --- a/tests/plugins/api/test_implicit_api_plugin.py +++ b/tests/plugins/api/test_implicit_api_plugin.py @@ -831,9 +831,7 @@ def test_maybe_add_condition(self): def test_maybe_add_deletion_policies(self): template_dict = {"Resources": {"ServerlessRestApi": {"Type": "AWS::Serverless::Api"}}} - self.plugin.api_deletion_policies = { - "ServerlessRestApi": {"Delete", "Retain"} - } + self.plugin.api_deletion_policies = {"ServerlessRestApi": {"Delete", "Retain"}} self.plugin._maybe_add_deletion_policy_to_implicit_api(template_dict) print(template_dict) self.assertEqual( @@ -843,9 +841,7 @@ def test_maybe_add_deletion_policies(self): def test_maybe_add_update_replace_policies(self): template_dict = {"Resources": {"ServerlessRestApi": {"Type": "AWS::Serverless::Api"}}} - self.plugin.api_update_replace_policies = { - "ServerlessRestApi": {"Snapshot", "Retain"} - } + self.plugin.api_update_replace_policies = {"ServerlessRestApi": {"Snapshot", "Retain"}} self.plugin._maybe_add_update_replace_policy_to_implicit_api(template_dict) print(template_dict) self.assertEqual( From 1252cf34a21128edcba2e228af25b64357a91765 Mon Sep 17 00:00:00 2001 From: Qingchuan Ma Date: Wed, 5 May 2021 09:30:03 -0700 Subject: [PATCH 38/41] Added input template that was missing --- .../api_with_swagger_authorizer_none.yaml | 117 ++++ .../api_with_swagger_authorizer_none.json | 475 +++++++++++++++++ .../api_with_swagger_authorizer_none.json | 499 ++++++++++++++++++ .../api_with_swagger_authorizer_none.json | 499 ++++++++++++++++++ 4 files changed, 1590 insertions(+) create mode 100644 tests/translator/input/api_with_swagger_authorizer_none.yaml create mode 100644 tests/translator/output/api_with_swagger_authorizer_none.json create mode 100644 tests/translator/output/aws-cn/api_with_swagger_authorizer_none.json create mode 100644 tests/translator/output/aws-us-gov/api_with_swagger_authorizer_none.json diff --git a/tests/translator/input/api_with_swagger_authorizer_none.yaml b/tests/translator/input/api_with_swagger_authorizer_none.yaml new file mode 100644 index 000000000..eb0ae32be --- /dev/null +++ b/tests/translator/input/api_with_swagger_authorizer_none.yaml @@ -0,0 +1,117 @@ +Resources: + MyApiWithCognitoAuth: + Type: "AWS::Serverless::Api" + Properties: + StageName: Prod + Auth: + Authorizers: + MyCognitoAuth: + UserPoolArn: !GetAtt MyUserPool.Arn + DefaultAuthorizer: MyCognitoAuth + + MyApiWithLambdaTokenAuth: + Type: "AWS::Serverless::Api" + Properties: + StageName: Prod + Auth: + Authorizers: + MyLambdaTokenAuth: + FunctionArn: !GetAtt MyAuthFn.Arn + DefaultAuthorizer: MyLambdaTokenAuth + + MyApiWithLambdaRequestAuth: + Type: "AWS::Serverless::Api" + Properties: + StageName: Prod + DefinitionBody: + swagger: 2.0 + info: + version: '1.0' + title: !Ref AWS::StackName + schemes: + - https + paths: + "/lambda-request": + get: + x-amazon-apigateway-integration: + httpMethod: POST + type: aws_proxy + uri: !Sub arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${MyFn.Arn}/invocations + passthroughBehavior: when_no_match + responses: {} + Auth: + Authorizers: + MyLambdaRequestAuth: + FunctionPayloadType: REQUEST + FunctionArn: !GetAtt MyAuthFn.Arn + Identity: + Headers: + - Authorization1 + DefaultAuthorizer: MyLambdaRequestAuth + + MyAuthFn: + Type: AWS::Serverless::Function + Properties: + InlineCode: | + exports.handler = async (event) => { + return { + statusCode: 200, + body: JSON.stringify(event), + headers: {} + } + } + Handler: index.handler + Runtime: nodejs8.10 + + MyFn: + Type: AWS::Serverless::Function + Properties: + InlineCode: | + exports.handler = async (event) => { + return { + statusCode: 200, + body: JSON.stringify(event), + headers: {} + } + } + Handler: index.handler + Runtime: nodejs8.10 + Events: + Cognito: + Type: Api + Properties: + RestApiId: !Ref MyApiWithCognitoAuth + Method: get + Auth: + Authorizer: NONE + Path: /cognito + LambdaToken: + Type: Api + Properties: + RestApiId: !Ref MyApiWithLambdaTokenAuth + Method: get + Auth: + Authorizer: NONE + Path: /lambda-token + LambdaRequest: + Type: Api + Properties: + RestApiId: !Ref MyApiWithLambdaRequestAuth + Auth: + Authorizer: NONE + Method: get + Path: /lambda-request + + MyUserPool: + Type: AWS::Cognito::UserPool + Properties: + UserPoolName: UserPoolName + Policies: + PasswordPolicy: + MinimumLength: 8 + UsernameAttributes: + - email + Schema: + - AttributeDataType: String + Name: email + Required: false \ No newline at end of file diff --git a/tests/translator/output/api_with_swagger_authorizer_none.json b/tests/translator/output/api_with_swagger_authorizer_none.json new file mode 100644 index 000000000..be6d32c56 --- /dev/null +++ b/tests/translator/output/api_with_swagger_authorizer_none.json @@ -0,0 +1,475 @@ +{ + "Resources": { + "MyFnCognitoPermissionProd": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "FunctionName": { + "Ref": "MyFn" + }, + "SourceArn": { + "Fn::Sub": [ + "arn:aws:execute-api:${AWS::Region}:${AWS::AccountId}:${__ApiId__}/${__Stage__}/GET/cognito", + { + "__Stage__": "*", + "__ApiId__": { + "Ref": "MyApiWithCognitoAuth" + } + } + ] + } + } + }, + "MyApiWithCognitoAuth": { + "Type": "AWS::ApiGateway::RestApi", + "Properties": { + "Body": { + "info": { + "version": "1.0", + "title": { + "Ref": "AWS::StackName" + } + }, + "paths": { + "/cognito": { + "get": { + "x-amazon-apigateway-integration": { + "httpMethod": "POST", + "type": "aws_proxy", + "uri": { + "Fn::Sub": "arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${MyFn.Arn}/invocations" + } + }, + "security": [ + { + "NONE": [] + } + ], + "responses": {} + } + } + }, + "swagger": "2.0", + "securityDefinitions": { + "MyCognitoAuth": { + "in": "header", + "type": "apiKey", + "name": "Authorization", + "x-amazon-apigateway-authorizer": { + "providerARNs": [ + { + "Fn::GetAtt": [ + "MyUserPool", + "Arn" + ] + } + ], + "type": "cognito_user_pools" + }, + "x-amazon-apigateway-authtype": "cognito_user_pools" + } + } + } + } + }, + "MyApiWithLambdaRequestAuthMyLambdaRequestAuthAuthorizerPermission": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "FunctionName": { + "Fn::GetAtt": [ + "MyAuthFn", + "Arn" + ] + }, + "SourceArn": { + "Fn::Sub": [ + "arn:aws:execute-api:${AWS::Region}:${AWS::AccountId}:${__ApiId__}/authorizers/*", + { + "__ApiId__": { + "Ref": "MyApiWithLambdaRequestAuth" + } + } + ] + } + } + }, + "MyApiWithLambdaRequestAuthProdStage": { + "Type": "AWS::ApiGateway::Stage", + "Properties": { + "DeploymentId": { + "Ref": "MyApiWithLambdaRequestAuthDeploymentfeb40d0e71" + }, + "RestApiId": { + "Ref": "MyApiWithLambdaRequestAuth" + }, + "StageName": "Prod" + } + }, + "MyFnLambdaTokenPermissionProd": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "FunctionName": { + "Ref": "MyFn" + }, + "SourceArn": { + "Fn::Sub": [ + "arn:aws:execute-api:${AWS::Region}:${AWS::AccountId}:${__ApiId__}/${__Stage__}/GET/lambda-token", + { + "__Stage__": "*", + "__ApiId__": { + "Ref": "MyApiWithLambdaTokenAuth" + } + } + ] + } + } + }, + "MyApiWithLambdaTokenAuthMyLambdaTokenAuthAuthorizerPermission": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "FunctionName": { + "Fn::GetAtt": [ + "MyAuthFn", + "Arn" + ] + }, + "SourceArn": { + "Fn::Sub": [ + "arn:aws:execute-api:${AWS::Region}:${AWS::AccountId}:${__ApiId__}/authorizers/*", + { + "__ApiId__": { + "Ref": "MyApiWithLambdaTokenAuth" + } + } + ] + } + } + }, + "MyFnLambdaRequestPermissionProd": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "FunctionName": { + "Ref": "MyFn" + }, + "SourceArn": { + "Fn::Sub": [ + "arn:aws:execute-api:${AWS::Region}:${AWS::AccountId}:${__ApiId__}/${__Stage__}/GET/lambda-request", + { + "__Stage__": "*", + "__ApiId__": { + "Ref": "MyApiWithLambdaRequestAuth" + } + } + ] + } + } + }, + "MyApiWithLambdaTokenAuth": { + "Type": "AWS::ApiGateway::RestApi", + "Properties": { + "Body": { + "info": { + "version": "1.0", + "title": { + "Ref": "AWS::StackName" + } + }, + "paths": { + "/lambda-token": { + "get": { + "x-amazon-apigateway-integration": { + "httpMethod": "POST", + "type": "aws_proxy", + "uri": { + "Fn::Sub": "arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${MyFn.Arn}/invocations" + } + }, + "security": [ + { + "NONE": [] + } + ], + "responses": {} + } + } + }, + "swagger": "2.0", + "securityDefinitions": { + "MyLambdaTokenAuth": { + "in": "header", + "type": "apiKey", + "name": "Authorization", + "x-amazon-apigateway-authorizer": { + "type": "token", + "authorizerUri": { + "Fn::Sub": [ + "arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${__FunctionArn__}/invocations", + { + "__FunctionArn__": { + "Fn::GetAtt": [ + "MyAuthFn", + "Arn" + ] + } + } + ] + } + }, + "x-amazon-apigateway-authtype": "custom" + } + } + } + } + }, + "MyApiWithLambdaTokenAuthProdStage": { + "Type": "AWS::ApiGateway::Stage", + "Properties": { + "DeploymentId": { + "Ref": "MyApiWithLambdaTokenAuthDeployment4644d735d8" + }, + "RestApiId": { + "Ref": "MyApiWithLambdaTokenAuth" + }, + "StageName": "Prod" + } + }, + "MyApiWithLambdaRequestAuthDeploymentfeb40d0e71": { + "Type": "AWS::ApiGateway::Deployment", + "Properties": { + "RestApiId": { + "Ref": "MyApiWithLambdaRequestAuth" + }, + "Description": "RestApi deployment id: feb40d0e712dce07ba2392d6bb86eff0c5b22b7b", + "StageName": "Stage" + } + }, + "MyUserPool": { + "Type": "AWS::Cognito::UserPool", + "Properties": { + "UsernameAttributes": [ + "email" + ], + "UserPoolName": "UserPoolName", + "Policies": { + "PasswordPolicy": { + "MinimumLength": 8 + } + }, + "Schema": [ + { + "AttributeDataType": "String", + "Required": false, + "Name": "email" + } + ] + } + }, + "MyAuthFn": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Handler": "index.handler", + "Code": { + "ZipFile": "exports.handler = async (event) => {\n return {\n statusCode: 200,\n body: JSON.stringify(event),\n headers: {}\n }\n}\n" + }, + "Role": { + "Fn::GetAtt": [ + "MyAuthFnRole", + "Arn" + ] + }, + "Runtime": "nodejs12.x", + "Tags": [ + { + "Value": "SAM", + "Key": "lambda:createdBy" + } + ] + } + }, + "MyApiWithLambdaRequestAuth": { + "Type": "AWS::ApiGateway::RestApi", + "Properties": { + "Body": { + "info": { + "version": "1.0", + "title": { + "Ref": "AWS::StackName" + } + }, + "paths": { + "/lambda-request": { + "get": { + "x-amazon-apigateway-integration": { + "httpMethod": "POST", + "passthroughBehavior": "when_no_match", + "type": "aws_proxy", + "uri": { + "Fn::Sub": "arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${MyFn.Arn}/invocations" + } + }, + "security": [ + { + "NONE": [] + } + ], + "responses": {} + } + } + }, + "swagger": 2.0, + "schemes": [ + "https" + ], + "securityDefinitions": { + "MyLambdaRequestAuth": { + "in": "header", + "type": "apiKey", + "name": "Unused", + "x-amazon-apigateway-authorizer": { + "type": "request", + "identitySource": "method.request.header.Authorization1", + "authorizerUri": { + "Fn::Sub": [ + "arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${__FunctionArn__}/invocations", + { + "__FunctionArn__": { + "Fn::GetAtt": [ + "MyAuthFn", + "Arn" + ] + } + } + ] + } + }, + "x-amazon-apigateway-authtype": "custom" + } + } + } + } + }, + "MyApiWithLambdaTokenAuthDeployment4644d735d8": { + "Type": "AWS::ApiGateway::Deployment", + "Properties": { + "RestApiId": { + "Ref": "MyApiWithLambdaTokenAuth" + }, + "Description": "RestApi deployment id: 4644d735d869a70806f7145ca725b1c8cb248fb7", + "StageName": "Stage" + } + }, + "MyAuthFnRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "ManagedPolicyArns": [ + "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ], + "Tags": [ + { + "Value": "SAM", + "Key": "lambda:createdBy" + } + ], + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Action": [ + "sts:AssumeRole" + ], + "Effect": "Allow", + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + } + } + ] + } + } + }, + "MyApiWithCognitoAuthDeploymentf67b169f98": { + "Type": "AWS::ApiGateway::Deployment", + "Properties": { + "RestApiId": { + "Ref": "MyApiWithCognitoAuth" + }, + "Description": "RestApi deployment id: f67b169f98fefb4627c6065af2d5e26ca6ea4da8", + "StageName": "Stage" + } + }, + "MyFnRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "ManagedPolicyArns": [ + "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ], + "Tags": [ + { + "Value": "SAM", + "Key": "lambda:createdBy" + } + ], + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Action": [ + "sts:AssumeRole" + ], + "Effect": "Allow", + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + } + } + ] + } + } + }, + "MyApiWithCognitoAuthProdStage": { + "Type": "AWS::ApiGateway::Stage", + "Properties": { + "DeploymentId": { + "Ref": "MyApiWithCognitoAuthDeploymentf67b169f98" + }, + "RestApiId": { + "Ref": "MyApiWithCognitoAuth" + }, + "StageName": "Prod" + } + }, + "MyFn": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Handler": "index.handler", + "Code": { + "ZipFile": "exports.handler = async (event) => {\n return {\n statusCode: 200,\n body: JSON.stringify(event),\n headers: {}\n }\n}\n" + }, + "Role": { + "Fn::GetAtt": [ + "MyFnRole", + "Arn" + ] + }, + "Runtime": "nodejs12.x", + "Tags": [ + { + "Value": "SAM", + "Key": "lambda:createdBy" + } + ] + } + } + } + } \ No newline at end of file diff --git a/tests/translator/output/aws-cn/api_with_swagger_authorizer_none.json b/tests/translator/output/aws-cn/api_with_swagger_authorizer_none.json new file mode 100644 index 000000000..8ed6a1d1d --- /dev/null +++ b/tests/translator/output/aws-cn/api_with_swagger_authorizer_none.json @@ -0,0 +1,499 @@ +{ + "Resources": { + "MyFnCognitoPermissionProd": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "FunctionName": { + "Ref": "MyFn" + }, + "SourceArn": { + "Fn::Sub": [ + "arn:aws-cn:execute-api:${AWS::Region}:${AWS::AccountId}:${__ApiId__}/${__Stage__}/GET/cognito", + { + "__Stage__": "*", + "__ApiId__": { + "Ref": "MyApiWithCognitoAuth" + } + } + ] + } + } + }, + "MyApiWithCognitoAuth": { + "Type": "AWS::ApiGateway::RestApi", + "Properties": { + "Body": { + "info": { + "version": "1.0", + "title": { + "Ref": "AWS::StackName" + } + }, + "paths": { + "/cognito": { + "get": { + "x-amazon-apigateway-integration": { + "httpMethod": "POST", + "type": "aws_proxy", + "uri": { + "Fn::Sub": "arn:aws-cn:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${MyFn.Arn}/invocations" + } + }, + "security": [ + { + "NONE": [] + } + ], + "responses": {} + } + } + }, + "swagger": "2.0", + "securityDefinitions": { + "MyCognitoAuth": { + "in": "header", + "type": "apiKey", + "name": "Authorization", + "x-amazon-apigateway-authorizer": { + "providerARNs": [ + { + "Fn::GetAtt": [ + "MyUserPool", + "Arn" + ] + } + ], + "type": "cognito_user_pools" + }, + "x-amazon-apigateway-authtype": "cognito_user_pools" + } + } + }, + "EndpointConfiguration": { + "Types": [ + "REGIONAL" + ] + }, + "Parameters": { + "endpointConfigurationTypes": "REGIONAL" + } + } + }, + "MyApiWithLambdaRequestAuthDeploymentbad519dbd8": { + "Type": "AWS::ApiGateway::Deployment", + "Properties": { + "RestApiId": { + "Ref": "MyApiWithLambdaRequestAuth" + }, + "Description": "RestApi deployment id: bad519dbd801b0e2c63dc6f2011f43bce33c262a", + "StageName": "Stage" + } + }, + "MyApiWithLambdaTokenAuthDeployment29918bbdc1": { + "Type": "AWS::ApiGateway::Deployment", + "Properties": { + "RestApiId": { + "Ref": "MyApiWithLambdaTokenAuth" + }, + "Description": "RestApi deployment id: 29918bbdc180ceedbabcf34c01ca5342e8c019cd", + "StageName": "Stage" + } + }, + "MyFnLambdaTokenPermissionProd": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "FunctionName": { + "Ref": "MyFn" + }, + "SourceArn": { + "Fn::Sub": [ + "arn:aws-cn:execute-api:${AWS::Region}:${AWS::AccountId}:${__ApiId__}/${__Stage__}/GET/lambda-token", + { + "__Stage__": "*", + "__ApiId__": { + "Ref": "MyApiWithLambdaTokenAuth" + } + } + ] + } + } + }, + "MyApiWithLambdaTokenAuthMyLambdaTokenAuthAuthorizerPermission": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "FunctionName": { + "Fn::GetAtt": [ + "MyAuthFn", + "Arn" + ] + }, + "SourceArn": { + "Fn::Sub": [ + "arn:aws-cn:execute-api:${AWS::Region}:${AWS::AccountId}:${__ApiId__}/authorizers/*", + { + "__ApiId__": { + "Ref": "MyApiWithLambdaTokenAuth" + } + } + ] + } + } + }, + "MyFnLambdaRequestPermissionProd": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "FunctionName": { + "Ref": "MyFn" + }, + "SourceArn": { + "Fn::Sub": [ + "arn:aws-cn:execute-api:${AWS::Region}:${AWS::AccountId}:${__ApiId__}/${__Stage__}/GET/lambda-request", + { + "__Stage__": "*", + "__ApiId__": { + "Ref": "MyApiWithLambdaRequestAuth" + } + } + ] + } + } + }, + "MyApiWithLambdaTokenAuth": { + "Type": "AWS::ApiGateway::RestApi", + "Properties": { + "Body": { + "info": { + "version": "1.0", + "title": { + "Ref": "AWS::StackName" + } + }, + "paths": { + "/lambda-token": { + "get": { + "x-amazon-apigateway-integration": { + "httpMethod": "POST", + "type": "aws_proxy", + "uri": { + "Fn::Sub": "arn:aws-cn:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${MyFn.Arn}/invocations" + } + }, + "security": [ + { + "NONE": [] + } + ], + "responses": {} + } + } + }, + "swagger": "2.0", + "securityDefinitions": { + "MyLambdaTokenAuth": { + "in": "header", + "type": "apiKey", + "name": "Authorization", + "x-amazon-apigateway-authorizer": { + "type": "token", + "authorizerUri": { + "Fn::Sub": [ + "arn:aws-cn:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${__FunctionArn__}/invocations", + { + "__FunctionArn__": { + "Fn::GetAtt": [ + "MyAuthFn", + "Arn" + ] + } + } + ] + } + }, + "x-amazon-apigateway-authtype": "custom" + } + } + }, + "EndpointConfiguration": { + "Types": [ + "REGIONAL" + ] + }, + "Parameters": { + "endpointConfigurationTypes": "REGIONAL" + } + } + }, + "MyApiWithLambdaTokenAuthProdStage": { + "Type": "AWS::ApiGateway::Stage", + "Properties": { + "DeploymentId": { + "Ref": "MyApiWithLambdaTokenAuthDeployment29918bbdc1" + }, + "RestApiId": { + "Ref": "MyApiWithLambdaTokenAuth" + }, + "StageName": "Prod" + } + }, + "MyApiWithLambdaRequestAuthProdStage": { + "Type": "AWS::ApiGateway::Stage", + "Properties": { + "DeploymentId": { + "Ref": "MyApiWithLambdaRequestAuthDeploymentbad519dbd8" + }, + "RestApiId": { + "Ref": "MyApiWithLambdaRequestAuth" + }, + "StageName": "Prod" + } + }, + "MyUserPool": { + "Type": "AWS::Cognito::UserPool", + "Properties": { + "UsernameAttributes": [ + "email" + ], + "UserPoolName": "UserPoolName", + "Policies": { + "PasswordPolicy": { + "MinimumLength": 8 + } + }, + "Schema": [ + { + "AttributeDataType": "String", + "Required": false, + "Name": "email" + } + ] + } + }, + "MyAuthFn": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Handler": "index.handler", + "Code": { + "ZipFile": "exports.handler = async (event) => {\n return {\n statusCode: 200,\n body: JSON.stringify(event),\n headers: {}\n }\n}\n" + }, + "Role": { + "Fn::GetAtt": [ + "MyAuthFnRole", + "Arn" + ] + }, + "Runtime": "nodejs12.x", + "Tags": [ + { + "Value": "SAM", + "Key": "lambda:createdBy" + } + ] + } + }, + "MyApiWithLambdaRequestAuth": { + "Type": "AWS::ApiGateway::RestApi", + "Properties": { + "Body": { + "info": { + "version": "1.0", + "title": { + "Ref": "AWS::StackName" + } + }, + "paths": { + "/lambda-request": { + "get": { + "x-amazon-apigateway-integration": { + "httpMethod": "POST", + "passthroughBehavior": "when_no_match", + "type": "aws_proxy", + "uri": { + "Fn::Sub": "arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${MyFn.Arn}/invocations" + } + }, + "security": [ + { + "NONE": [] + } + ], + "responses": {} + } + } + }, + "swagger": 2.0, + "schemes": [ + "https" + ], + "securityDefinitions": { + "MyLambdaRequestAuth": { + "in": "header", + "type": "apiKey", + "name": "Unused", + "x-amazon-apigateway-authorizer": { + "type": "request", + "identitySource": "method.request.header.Authorization1", + "authorizerUri": { + "Fn::Sub": [ + "arn:aws-cn:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${__FunctionArn__}/invocations", + { + "__FunctionArn__": { + "Fn::GetAtt": [ + "MyAuthFn", + "Arn" + ] + } + } + ] + } + }, + "x-amazon-apigateway-authtype": "custom" + } + } + }, + "EndpointConfiguration": { + "Types": [ + "REGIONAL" + ] + }, + "Parameters": { + "endpointConfigurationTypes": "REGIONAL" + } + } + }, + "MyApiWithCognitoAuthDeployment77726cd3cb": { + "Type": "AWS::ApiGateway::Deployment", + "Properties": { + "RestApiId": { + "Ref": "MyApiWithCognitoAuth" + }, + "Description": "RestApi deployment id: 77726cd3cb8eddd94a4856ca8d65ee0f39d03b2e", + "StageName": "Stage" + } + }, + "MyAuthFnRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "ManagedPolicyArns": [ + "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ], + "Tags": [ + { + "Value": "SAM", + "Key": "lambda:createdBy" + } + ], + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Action": [ + "sts:AssumeRole" + ], + "Effect": "Allow", + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + } + } + ] + } + } + }, + "MyFnRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "ManagedPolicyArns": [ + "arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ], + "Tags": [ + { + "Value": "SAM", + "Key": "lambda:createdBy" + } + ], + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Action": [ + "sts:AssumeRole" + ], + "Effect": "Allow", + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + } + } + ] + } + } + }, + "MyApiWithCognitoAuthProdStage": { + "Type": "AWS::ApiGateway::Stage", + "Properties": { + "DeploymentId": { + "Ref": "MyApiWithCognitoAuthDeployment77726cd3cb" + }, + "RestApiId": { + "Ref": "MyApiWithCognitoAuth" + }, + "StageName": "Prod" + } + }, + "MyFn": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Handler": "index.handler", + "Code": { + "ZipFile": "exports.handler = async (event) => {\n return {\n statusCode: 200,\n body: JSON.stringify(event),\n headers: {}\n }\n}\n" + }, + "Role": { + "Fn::GetAtt": [ + "MyFnRole", + "Arn" + ] + }, + "Runtime": "nodejs12.x", + "Tags": [ + { + "Value": "SAM", + "Key": "lambda:createdBy" + } + ] + } + }, + "MyApiWithLambdaRequestAuthMyLambdaRequestAuthAuthorizerPermission": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "FunctionName": { + "Fn::GetAtt": [ + "MyAuthFn", + "Arn" + ] + }, + "SourceArn": { + "Fn::Sub": [ + "arn:aws-cn:execute-api:${AWS::Region}:${AWS::AccountId}:${__ApiId__}/authorizers/*", + { + "__ApiId__": { + "Ref": "MyApiWithLambdaRequestAuth" + } + } + ] + } + } + } + } + } \ No newline at end of file diff --git a/tests/translator/output/aws-us-gov/api_with_swagger_authorizer_none.json b/tests/translator/output/aws-us-gov/api_with_swagger_authorizer_none.json new file mode 100644 index 000000000..1fe5153a1 --- /dev/null +++ b/tests/translator/output/aws-us-gov/api_with_swagger_authorizer_none.json @@ -0,0 +1,499 @@ +{ + "Resources": { + "MyFnCognitoPermissionProd": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "FunctionName": { + "Ref": "MyFn" + }, + "SourceArn": { + "Fn::Sub": [ + "arn:aws-us-gov:execute-api:${AWS::Region}:${AWS::AccountId}:${__ApiId__}/${__Stage__}/GET/cognito", + { + "__Stage__": "*", + "__ApiId__": { + "Ref": "MyApiWithCognitoAuth" + } + } + ] + } + } + }, + "MyApiWithCognitoAuth": { + "Type": "AWS::ApiGateway::RestApi", + "Properties": { + "Body": { + "info": { + "version": "1.0", + "title": { + "Ref": "AWS::StackName" + } + }, + "paths": { + "/cognito": { + "get": { + "x-amazon-apigateway-integration": { + "httpMethod": "POST", + "type": "aws_proxy", + "uri": { + "Fn::Sub": "arn:aws-us-gov:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${MyFn.Arn}/invocations" + } + }, + "security": [ + { + "NONE": [] + } + ], + "responses": {} + } + } + }, + "swagger": "2.0", + "securityDefinitions": { + "MyCognitoAuth": { + "in": "header", + "type": "apiKey", + "name": "Authorization", + "x-amazon-apigateway-authorizer": { + "providerARNs": [ + { + "Fn::GetAtt": [ + "MyUserPool", + "Arn" + ] + } + ], + "type": "cognito_user_pools" + }, + "x-amazon-apigateway-authtype": "cognito_user_pools" + } + } + }, + "EndpointConfiguration": { + "Types": [ + "REGIONAL" + ] + }, + "Parameters": { + "endpointConfigurationTypes": "REGIONAL" + } + } + }, + "MyApiWithLambdaRequestAuthDeployment9c20de6c65": { + "Type": "AWS::ApiGateway::Deployment", + "Properties": { + "RestApiId": { + "Ref": "MyApiWithLambdaRequestAuth" + }, + "Description": "RestApi deployment id: 9c20de6c65c8aa8750d3136af13b9a69bc7d3e5e", + "StageName": "Stage" + } + }, + "MyApiWithLambdaTokenAuthDeployment4f66714fd8": { + "Type": "AWS::ApiGateway::Deployment", + "Properties": { + "RestApiId": { + "Ref": "MyApiWithLambdaTokenAuth" + }, + "Description": "RestApi deployment id: 4f66714fd88af2798cc2462bd8ce435aa77a340c", + "StageName": "Stage" + } + }, + "MyApiWithLambdaRequestAuthMyLambdaRequestAuthAuthorizerPermission": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "FunctionName": { + "Fn::GetAtt": [ + "MyAuthFn", + "Arn" + ] + }, + "SourceArn": { + "Fn::Sub": [ + "arn:aws-us-gov:execute-api:${AWS::Region}:${AWS::AccountId}:${__ApiId__}/authorizers/*", + { + "__ApiId__": { + "Ref": "MyApiWithLambdaRequestAuth" + } + } + ] + } + } + }, + "MyApiWithCognitoAuthDeploymentbac15a89c4": { + "Type": "AWS::ApiGateway::Deployment", + "Properties": { + "RestApiId": { + "Ref": "MyApiWithCognitoAuth" + }, + "Description": "RestApi deployment id: bac15a89c4ef70c7a908f93d9f39dc7ce56fa1e3", + "StageName": "Stage" + } + }, + "MyApiWithLambdaRequestAuthProdStage": { + "Type": "AWS::ApiGateway::Stage", + "Properties": { + "DeploymentId": { + "Ref": "MyApiWithLambdaRequestAuthDeployment9c20de6c65" + }, + "RestApiId": { + "Ref": "MyApiWithLambdaRequestAuth" + }, + "StageName": "Prod" + } + }, + "MyFnLambdaTokenPermissionProd": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "FunctionName": { + "Ref": "MyFn" + }, + "SourceArn": { + "Fn::Sub": [ + "arn:aws-us-gov:execute-api:${AWS::Region}:${AWS::AccountId}:${__ApiId__}/${__Stage__}/GET/lambda-token", + { + "__Stage__": "*", + "__ApiId__": { + "Ref": "MyApiWithLambdaTokenAuth" + } + } + ] + } + } + }, + "MyFnLambdaRequestPermissionProd": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "FunctionName": { + "Ref": "MyFn" + }, + "SourceArn": { + "Fn::Sub": [ + "arn:aws-us-gov:execute-api:${AWS::Region}:${AWS::AccountId}:${__ApiId__}/${__Stage__}/GET/lambda-request", + { + "__Stage__": "*", + "__ApiId__": { + "Ref": "MyApiWithLambdaRequestAuth" + } + } + ] + } + } + }, + "MyApiWithLambdaTokenAuth": { + "Type": "AWS::ApiGateway::RestApi", + "Properties": { + "Body": { + "info": { + "version": "1.0", + "title": { + "Ref": "AWS::StackName" + } + }, + "paths": { + "/lambda-token": { + "get": { + "x-amazon-apigateway-integration": { + "httpMethod": "POST", + "type": "aws_proxy", + "uri": { + "Fn::Sub": "arn:aws-us-gov:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${MyFn.Arn}/invocations" + } + }, + "security": [ + { + "NONE": [] + } + ], + "responses": {} + } + } + }, + "swagger": "2.0", + "securityDefinitions": { + "MyLambdaTokenAuth": { + "in": "header", + "type": "apiKey", + "name": "Authorization", + "x-amazon-apigateway-authorizer": { + "type": "token", + "authorizerUri": { + "Fn::Sub": [ + "arn:aws-us-gov:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${__FunctionArn__}/invocations", + { + "__FunctionArn__": { + "Fn::GetAtt": [ + "MyAuthFn", + "Arn" + ] + } + } + ] + } + }, + "x-amazon-apigateway-authtype": "custom" + } + } + }, + "EndpointConfiguration": { + "Types": [ + "REGIONAL" + ] + }, + "Parameters": { + "endpointConfigurationTypes": "REGIONAL" + } + } + }, + "MyApiWithLambdaTokenAuthProdStage": { + "Type": "AWS::ApiGateway::Stage", + "Properties": { + "DeploymentId": { + "Ref": "MyApiWithLambdaTokenAuthDeployment4f66714fd8" + }, + "RestApiId": { + "Ref": "MyApiWithLambdaTokenAuth" + }, + "StageName": "Prod" + } + }, + "MyUserPool": { + "Type": "AWS::Cognito::UserPool", + "Properties": { + "UsernameAttributes": [ + "email" + ], + "UserPoolName": "UserPoolName", + "Policies": { + "PasswordPolicy": { + "MinimumLength": 8 + } + }, + "Schema": [ + { + "AttributeDataType": "String", + "Required": false, + "Name": "email" + } + ] + } + }, + "MyAuthFn": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Handler": "index.handler", + "Code": { + "ZipFile": "exports.handler = async (event) => {\n return {\n statusCode: 200,\n body: JSON.stringify(event),\n headers: {}\n }\n}\n" + }, + "Role": { + "Fn::GetAtt": [ + "MyAuthFnRole", + "Arn" + ] + }, + "Runtime": "nodejs12.x", + "Tags": [ + { + "Value": "SAM", + "Key": "lambda:createdBy" + } + ] + } + }, + "MyApiWithLambdaRequestAuth": { + "Type": "AWS::ApiGateway::RestApi", + "Properties": { + "Body": { + "info": { + "version": "1.0", + "title": { + "Ref": "AWS::StackName" + } + }, + "paths": { + "/lambda-request": { + "get": { + "x-amazon-apigateway-integration": { + "httpMethod": "POST", + "passthroughBehavior": "when_no_match", + "type": "aws_proxy", + "uri": { + "Fn::Sub": "arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${MyFn.Arn}/invocations" + } + }, + "security": [ + { + "NONE": [] + } + ], + "responses": {} + } + } + }, + "swagger": 2.0, + "schemes": [ + "https" + ], + "securityDefinitions": { + "MyLambdaRequestAuth": { + "in": "header", + "type": "apiKey", + "name": "Unused", + "x-amazon-apigateway-authorizer": { + "type": "request", + "identitySource": "method.request.header.Authorization1", + "authorizerUri": { + "Fn::Sub": [ + "arn:aws-us-gov:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${__FunctionArn__}/invocations", + { + "__FunctionArn__": { + "Fn::GetAtt": [ + "MyAuthFn", + "Arn" + ] + } + } + ] + } + }, + "x-amazon-apigateway-authtype": "custom" + } + } + }, + "EndpointConfiguration": { + "Types": [ + "REGIONAL" + ] + }, + "Parameters": { + "endpointConfigurationTypes": "REGIONAL" + } + } + }, + "MyApiWithLambdaTokenAuthMyLambdaTokenAuthAuthorizerPermission": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "FunctionName": { + "Fn::GetAtt": [ + "MyAuthFn", + "Arn" + ] + }, + "SourceArn": { + "Fn::Sub": [ + "arn:aws-us-gov:execute-api:${AWS::Region}:${AWS::AccountId}:${__ApiId__}/authorizers/*", + { + "__ApiId__": { + "Ref": "MyApiWithLambdaTokenAuth" + } + } + ] + } + } + }, + "MyAuthFnRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "ManagedPolicyArns": [ + "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ], + "Tags": [ + { + "Value": "SAM", + "Key": "lambda:createdBy" + } + ], + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Action": [ + "sts:AssumeRole" + ], + "Effect": "Allow", + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + } + } + ] + } + } + }, + "MyFnRole": { + "Type": "AWS::IAM::Role", + "Properties": { + "ManagedPolicyArns": [ + "arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ], + "Tags": [ + { + "Value": "SAM", + "Key": "lambda:createdBy" + } + ], + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Action": [ + "sts:AssumeRole" + ], + "Effect": "Allow", + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + } + } + ] + } + } + }, + "MyApiWithCognitoAuthProdStage": { + "Type": "AWS::ApiGateway::Stage", + "Properties": { + "DeploymentId": { + "Ref": "MyApiWithCognitoAuthDeploymentbac15a89c4" + }, + "RestApiId": { + "Ref": "MyApiWithCognitoAuth" + }, + "StageName": "Prod" + } + }, + "MyFn": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Handler": "index.handler", + "Code": { + "ZipFile": "exports.handler = async (event) => {\n return {\n statusCode: 200,\n body: JSON.stringify(event),\n headers: {}\n }\n}\n" + }, + "Role": { + "Fn::GetAtt": [ + "MyFnRole", + "Arn" + ] + }, + "Runtime": "nodejs12.x", + "Tags": [ + { + "Value": "SAM", + "Key": "lambda:createdBy" + } + ] + } + } + } + } \ No newline at end of file From 8a5c83d35fde8090d9dc5509d1ab45789c3bd590 Mon Sep 17 00:00:00 2001 From: Qingchuan Ma Date: Thu, 6 May 2021 13:27:09 -0700 Subject: [PATCH 39/41] Refactoring: use sets instead of lists for implicit api plugin --- samtranslator/plugins/api/implicit_http_api_plugin.py | 10 ++++------ samtranslator/plugins/api/implicit_rest_api_plugin.py | 10 ++++------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/samtranslator/plugins/api/implicit_http_api_plugin.py b/samtranslator/plugins/api/implicit_http_api_plugin.py index 0c2ef2009..372742632 100644 --- a/samtranslator/plugins/api/implicit_http_api_plugin.py +++ b/samtranslator/plugins/api/implicit_http_api_plugin.py @@ -95,13 +95,11 @@ def _process_api_events( method_conditions = api_dict_condition.setdefault(path, {}) method_conditions[method] = condition - api_dict_deletion = self.api_deletion_policies.setdefault(api_id, []) - if deletion_policy not in api_dict_deletion: - api_dict_deletion.append(deletion_policy) + api_dict_deletion = self.api_deletion_policies.setdefault(api_id, set()) + api_dict_deletion.add(deletion_policy) - api_dict_update_replace = self.api_update_replace_policies.setdefault(api_id, []) - if update_replace_policy not in api_dict_update_replace: - api_dict_update_replace.append(update_replace_policy) + api_dict_update_replace = self.api_update_replace_policies.setdefault(api_id, set()) + api_dict_update_replace.add(update_replace_policy) self._add_api_to_swagger(logicalId, event_properties, template) if "RouteSettings" in event_properties: diff --git a/samtranslator/plugins/api/implicit_rest_api_plugin.py b/samtranslator/plugins/api/implicit_rest_api_plugin.py index a7d7d892a..3e94309f1 100644 --- a/samtranslator/plugins/api/implicit_rest_api_plugin.py +++ b/samtranslator/plugins/api/implicit_rest_api_plugin.py @@ -93,13 +93,11 @@ def _process_api_events( method_conditions = api_dict_condition.setdefault(path, {}) method_conditions[method] = condition - api_dict_deletion = self.api_deletion_policies.setdefault(api_id, []) - if deletion_policy not in api_dict_deletion: - api_dict_deletion.append(deletion_policy) + api_dict_deletion = self.api_deletion_policies.setdefault(api_id, set()) + api_dict_deletion.add(deletion_policy) - api_dict_update_replace = self.api_update_replace_policies.setdefault(api_id, []) - if update_replace_policy not in api_dict_update_replace: - api_dict_update_replace.append(update_replace_policy) + api_dict_update_replace = self.api_update_replace_policies.setdefault(api_id, set()) + api_dict_update_replace.add(update_replace_policy) self._add_api_to_swagger(logicalId, event_properties, template) From 7f412402e905404de474864367586db7c16cf3dd Mon Sep 17 00:00:00 2001 From: Qingchuan Ma Date: Fri, 7 May 2021 13:47:19 -0700 Subject: [PATCH 40/41] Changing import to be compatible with py2.7 --- tests/translator/test_resource_level_attributes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/translator/test_resource_level_attributes.py b/tests/translator/test_resource_level_attributes.py index 0f8df442d..58754fe92 100644 --- a/tests/translator/test_resource_level_attributes.py +++ b/tests/translator/test_resource_level_attributes.py @@ -1,5 +1,5 @@ import itertools -from unittest.mock import patch +from mock import patch from parameterized import parameterized From a03cc6b2ad4a67e72020c0e20a1c87981bbea872 Mon Sep 17 00:00:00 2001 From: Qingchuan Ma Date: Fri, 7 May 2021 14:37:54 -0700 Subject: [PATCH 41/41] Changing test deployment hashes to their actual values --- .../aws-cn/implicit_api_deletion_policy_precedence.json | 6 +++--- .../aws-us-gov/implicit_api_deletion_policy_precedence.json | 6 +++--- .../output/implicit_api_deletion_policy_precedence.json | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/translator/output/aws-cn/implicit_api_deletion_policy_precedence.json b/tests/translator/output/aws-cn/implicit_api_deletion_policy_precedence.json index 51fb94bea..33a3bb123 100644 --- a/tests/translator/output/aws-cn/implicit_api_deletion_policy_precedence.json +++ b/tests/translator/output/aws-cn/implicit_api_deletion_policy_precedence.json @@ -212,12 +212,12 @@ } } }, - "ServerlessRestApiDeploymentee5319b7a1": { + "ServerlessRestApiDeployment1ec0d29ab5": { "Type": "AWS::ApiGateway::Deployment", "DeletionPolicy": "Retain", "UpdateReplacePolicy": "Retain", "Properties": { - "Description": "RestApi deployment id: ee5319b7a18445ac611d70e4da06cfbd5562d28c", + "Description": "RestApi deployment id: 1ec0d29ab5c55018bb989df31615c170b707ae21", "RestApiId": { "Ref": "ServerlessRestApi" }, @@ -230,7 +230,7 @@ "UpdateReplacePolicy": "Retain", "Properties": { "DeploymentId": { - "Ref": "ServerlessRestApiDeploymentee5319b7a1" + "Ref": "ServerlessRestApiDeployment1ec0d29ab5" }, "RestApiId": { "Ref": "ServerlessRestApi" diff --git a/tests/translator/output/aws-us-gov/implicit_api_deletion_policy_precedence.json b/tests/translator/output/aws-us-gov/implicit_api_deletion_policy_precedence.json index 091da71cb..434cc36b0 100644 --- a/tests/translator/output/aws-us-gov/implicit_api_deletion_policy_precedence.json +++ b/tests/translator/output/aws-us-gov/implicit_api_deletion_policy_precedence.json @@ -212,12 +212,12 @@ } } }, - "ServerlessRestApiDeploymentee5319b7a1": { + "ServerlessRestApiDeployment695a271271": { "Type": "AWS::ApiGateway::Deployment", "DeletionPolicy": "Retain", "UpdateReplacePolicy": "Retain", "Properties": { - "Description": "RestApi deployment id: ee5319b7a18445ac611d70e4da06cfbd5562d28c", + "Description": "RestApi deployment id: 695a271271d114dfef4fba262c839d269473d910", "RestApiId": { "Ref": "ServerlessRestApi" }, @@ -230,7 +230,7 @@ "UpdateReplacePolicy": "Retain", "Properties": { "DeploymentId": { - "Ref": "ServerlessRestApiDeploymentee5319b7a1" + "Ref": "ServerlessRestApiDeployment695a271271" }, "RestApiId": { "Ref": "ServerlessRestApi" diff --git a/tests/translator/output/implicit_api_deletion_policy_precedence.json b/tests/translator/output/implicit_api_deletion_policy_precedence.json index c01f89e25..025e04735 100644 --- a/tests/translator/output/implicit_api_deletion_policy_precedence.json +++ b/tests/translator/output/implicit_api_deletion_policy_precedence.json @@ -204,12 +204,12 @@ } } }, - "ServerlessRestApiDeploymentee5319b7a1": { + "ServerlessRestApiDeploymentbeaf67e605": { "Type": "AWS::ApiGateway::Deployment", "DeletionPolicy": "Retain", "UpdateReplacePolicy": "Retain", "Properties": { - "Description": "RestApi deployment id: ee5319b7a18445ac611d70e4da06cfbd5562d28c", + "Description": "RestApi deployment id: beaf67e605cdfc82f45c51fa5f8d9552af2ca0c6", "RestApiId": { "Ref": "ServerlessRestApi" }, @@ -222,7 +222,7 @@ "UpdateReplacePolicy": "Retain", "Properties": { "DeploymentId": { - "Ref": "ServerlessRestApiDeploymentee5319b7a1" + "Ref": "ServerlessRestApiDeploymentbeaf67e605" }, "RestApiId": { "Ref": "ServerlessRestApi"