-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added end to end test for referencing custom codedeploy configurations.
- Loading branch information
1 parent
759fb8d
commit d7f0089
Showing
4 changed files
with
436 additions
and
0 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
tests/translator/input/function_with_custom_codedeploy_deployment_preference.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Resources: | ||
MinimalFunction: | ||
Type: 'AWS::Serverless::Function' | ||
Properties: | ||
CodeUri: s3://sam-demo-bucket/hello.zip | ||
Handler: hello.handler | ||
Runtime: python2.7 | ||
AutoPublishAlias: live | ||
DeploymentPreference: | ||
Type: TestDeploymentConfiguration |
142 changes: 142 additions & 0 deletions
142
tests/translator/output/aws-cn/function_with_custom_codedeploy_deployment_preference.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
{ | ||
"Resources": { | ||
"MinimalFunctionDeploymentGroup": { | ||
"Type": "AWS::CodeDeploy::DeploymentGroup", | ||
"Properties": { | ||
"ApplicationName": { | ||
"Ref": "ServerlessDeploymentApplication" | ||
}, | ||
"AutoRollbackConfiguration": { | ||
"Enabled": true, | ||
"Events": [ | ||
"DEPLOYMENT_FAILURE", | ||
"DEPLOYMENT_STOP_ON_ALARM", | ||
"DEPLOYMENT_STOP_ON_REQUEST" | ||
] | ||
}, | ||
"ServiceRoleArn": { | ||
"Fn::GetAtt": [ | ||
"CodeDeployServiceRole", | ||
"Arn" | ||
] | ||
}, | ||
"DeploymentConfigName": "TestDeploymentConfiguration", | ||
"DeploymentStyle": { | ||
"DeploymentType": "BLUE_GREEN", | ||
"DeploymentOption": "WITH_TRAFFIC_CONTROL" | ||
} | ||
} | ||
}, | ||
"MinimalFunctionRole": { | ||
"Type": "AWS::IAM::Role", | ||
"Properties": { | ||
"ManagedPolicyArns": [ | ||
"arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" | ||
], | ||
"AssumeRolePolicyDocument": { | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Action": [ | ||
"sts:AssumeRole" | ||
], | ||
"Effect": "Allow", | ||
"Principal": { | ||
"Service": [ | ||
"lambda.amazonaws.com" | ||
] | ||
} | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"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": [ | ||
{ | ||
"Value": "SAM", | ||
"Key": "lambda:createdBy" | ||
} | ||
] | ||
} | ||
}, | ||
"CodeDeployServiceRole": { | ||
"Type": "AWS::IAM::Role", | ||
"Properties": { | ||
"ManagedPolicyArns": [ | ||
"arn:aws:iam::aws:policy/service-role/AWSCodeDeployRoleForLambda" | ||
], | ||
"AssumeRolePolicyDocument": { | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Action": [ | ||
"sts:AssumeRole" | ||
], | ||
"Effect": "Allow", | ||
"Principal": { | ||
"Service": [ | ||
"codedeploy.amazonaws.com" | ||
] | ||
} | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"ServerlessDeploymentApplication": { | ||
"Type": "AWS::CodeDeploy::Application", | ||
"Properties": { | ||
"ComputePlatform": "Lambda" | ||
} | ||
}, | ||
"MinimalFunctionVersion640128d35d": { | ||
"DeletionPolicy": "Retain", | ||
"Type": "AWS::Lambda::Version", | ||
"Properties": { | ||
"FunctionName": { | ||
"Ref": "MinimalFunction" | ||
} | ||
} | ||
}, | ||
"MinimalFunctionAliaslive": { | ||
"Type": "AWS::Lambda::Alias", | ||
"UpdatePolicy": { | ||
"CodeDeployLambdaAliasUpdate": { | ||
"ApplicationName": { | ||
"Ref": "ServerlessDeploymentApplication" | ||
}, | ||
"DeploymentGroupName": { | ||
"Ref": "MinimalFunctionDeploymentGroup" | ||
} | ||
} | ||
}, | ||
"Properties": { | ||
"FunctionVersion": { | ||
"Fn::GetAtt": [ | ||
"MinimalFunctionVersion640128d35d", | ||
"Version" | ||
] | ||
}, | ||
"FunctionName": { | ||
"Ref": "MinimalFunction" | ||
}, | ||
"Name": "live" | ||
} | ||
} | ||
} | ||
} |
142 changes: 142 additions & 0 deletions
142
...s/translator/output/aws-us-gov/function_with_custom_codedeploy_deployment_preference.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
{ | ||
"Resources": { | ||
"MinimalFunctionDeploymentGroup": { | ||
"Type": "AWS::CodeDeploy::DeploymentGroup", | ||
"Properties": { | ||
"ApplicationName": { | ||
"Ref": "ServerlessDeploymentApplication" | ||
}, | ||
"AutoRollbackConfiguration": { | ||
"Enabled": true, | ||
"Events": [ | ||
"DEPLOYMENT_FAILURE", | ||
"DEPLOYMENT_STOP_ON_ALARM", | ||
"DEPLOYMENT_STOP_ON_REQUEST" | ||
] | ||
}, | ||
"ServiceRoleArn": { | ||
"Fn::GetAtt": [ | ||
"CodeDeployServiceRole", | ||
"Arn" | ||
] | ||
}, | ||
"DeploymentConfigName": "TestDeploymentConfiguration", | ||
"DeploymentStyle": { | ||
"DeploymentType": "BLUE_GREEN", | ||
"DeploymentOption": "WITH_TRAFFIC_CONTROL" | ||
} | ||
} | ||
}, | ||
"MinimalFunctionRole": { | ||
"Type": "AWS::IAM::Role", | ||
"Properties": { | ||
"ManagedPolicyArns": [ | ||
"arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" | ||
], | ||
"AssumeRolePolicyDocument": { | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Action": [ | ||
"sts:AssumeRole" | ||
], | ||
"Effect": "Allow", | ||
"Principal": { | ||
"Service": [ | ||
"lambda.amazonaws.com" | ||
] | ||
} | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"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": [ | ||
{ | ||
"Value": "SAM", | ||
"Key": "lambda:createdBy" | ||
} | ||
] | ||
} | ||
}, | ||
"CodeDeployServiceRole": { | ||
"Type": "AWS::IAM::Role", | ||
"Properties": { | ||
"ManagedPolicyArns": [ | ||
"arn:aws:iam::aws:policy/service-role/AWSCodeDeployRoleForLambda" | ||
], | ||
"AssumeRolePolicyDocument": { | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Action": [ | ||
"sts:AssumeRole" | ||
], | ||
"Effect": "Allow", | ||
"Principal": { | ||
"Service": [ | ||
"codedeploy.amazonaws.com" | ||
] | ||
} | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"ServerlessDeploymentApplication": { | ||
"Type": "AWS::CodeDeploy::Application", | ||
"Properties": { | ||
"ComputePlatform": "Lambda" | ||
} | ||
}, | ||
"MinimalFunctionVersion640128d35d": { | ||
"DeletionPolicy": "Retain", | ||
"Type": "AWS::Lambda::Version", | ||
"Properties": { | ||
"FunctionName": { | ||
"Ref": "MinimalFunction" | ||
} | ||
} | ||
}, | ||
"MinimalFunctionAliaslive": { | ||
"Type": "AWS::Lambda::Alias", | ||
"UpdatePolicy": { | ||
"CodeDeployLambdaAliasUpdate": { | ||
"ApplicationName": { | ||
"Ref": "ServerlessDeploymentApplication" | ||
}, | ||
"DeploymentGroupName": { | ||
"Ref": "MinimalFunctionDeploymentGroup" | ||
} | ||
} | ||
}, | ||
"Properties": { | ||
"FunctionVersion": { | ||
"Fn::GetAtt": [ | ||
"MinimalFunctionVersion640128d35d", | ||
"Version" | ||
] | ||
}, | ||
"FunctionName": { | ||
"Ref": "MinimalFunction" | ||
}, | ||
"Name": "live" | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.