forked from aws-samples/ecs-blue-green-deployment
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ecs-blue-green-deployment.yaml
84 lines (71 loc) · 2.25 KB
/
ecs-blue-green-deployment.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
Description: >
This template illustrates reference architecture for Blue/Green Deployment on ECS. For further reference, please review BluegreenRepo ==> https://github.com/awslabs/ecs-blue-green-deployment
Parameters:
GitHubUser:
Type: String
Description: Your username on GitHub.
GitHubRepo:
Type: String
Default: ecs-demo-php-simple-app
Description: The repo name of the sample service.
AllowedPattern: "[A-Za-z0-9_.-]*"
MaxLength: 50
GitHubBranch:
Type: String
Default: master
Description: The branch of the repo to continuously deploy.
GitHubToken:
Type: String
Description: >
Token for the user specified above. (https://github.com/settings/tokens)
TemplateBucket:
Type: String
Description: >
S3 Bucket used for nested templates
Metadata:
AWS::CloudFormation::Interface:
ParameterLabels:
GitHubUser:
default: "User"
GitHubRepo:
default: "Repo"
GitHubBranch:
default: "Branch"
GitHubToken:
default: "Personal Access Token"
ParameterGroups:
- Label:
default: GitHub Configuration
Parameters:
- GitHubRepo
- GitHubBranch
- GitHubUser
- GitHubToken
Resources:
DeploymentPipeline:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: !Sub https://s3.amazonaws.com/${TemplateBucket}/templates/deployment-pipeline.yaml
Parameters:
GitHubUser: !Ref GitHubUser
GitHubToken: !Ref GitHubToken
GitHubRepo: !Ref GitHubRepo
GitHubBranch: !Ref GitHubBranch
TemplateBucket: !Ref TemplateBucket
Subnet1: !GetAtt VPC.Outputs.Subnet1
Subnet2: !GetAtt VPC.Outputs.Subnet2
VpcId: !GetAtt VPC.Outputs.VpcId
VpcCIDR: 10.215.0.0/16
VPC:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: !Sub https://s3.amazonaws.com/${TemplateBucket}/templates/vpc.yaml
Parameters:
Name: !Ref AWS::StackName
VpcCIDR: 10.215.0.0/16
Subnet1CIDR: 10.215.10.0/24
Subnet2CIDR: 10.215.20.0/24
Outputs:
PipelineUrl:
Description: The continuous deployment pipeline in the AWS Management Console.
Value: !GetAtt DeploymentPipeline.Outputs.PipelineUrl