forked from awslabs/ecs-refarch-continuous-deployment
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ecs-refarch-continuous-deployment.yaml
98 lines (83 loc) · 2.88 KB
/
ecs-refarch-continuous-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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
Description: >
This template illustrates how to use AWS CodeBuild and AWS CodePipeline to
achieve continuous deployment of source code from a GitHub repository via a
Docker container to an Amazon EC2 Container Service cluster.
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.
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)
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:
Cluster:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://s3.amazonaws.com/ecs-refarch-continuous-deployment/templates/ecs-cluster.yaml
Parameters:
SourceSecurityGroup: !GetAtt LoadBalancer.Outputs.SecurityGroup
Subnets: !GetAtt VPC.Outputs.Subnets
VpcId: !GetAtt VPC.Outputs.VpcId
DeploymentPipeline:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://s3.amazonaws.com/ecs-refarch-continuous-deployment/templates/deployment-pipeline.yaml
Parameters:
Cluster: !GetAtt Cluster.Outputs.ClusterName
GitHubUser: !Ref GitHubUser
GitHubToken: !Ref GitHubToken
GitHubRepo: !Ref GitHubRepo
GitHubBranch: !Ref GitHubBranch
TargetGroup: !GetAtt LoadBalancer.Outputs.TargetGroup
TemplateBucket: !Sub ecs-refarch-continuous-deployment-${AWS::Region}
LoadBalancer:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://s3.amazonaws.com/ecs-refarch-continuous-deployment/templates/load-balancer.yaml
Parameters:
Subnets: !GetAtt VPC.Outputs.Subnets
VpcId: !GetAtt VPC.Outputs.VpcId
VPC:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://s3.amazonaws.com/ecs-refarch-continuous-deployment/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:
ServiceUrl:
Description: The sample service that is being continuously deployed.
Value: !GetAtt LoadBalancer.Outputs.ServiceUrl
PipelineUrl:
Description: The continuous deployment pipeline in the AWS Management Console.
Value: !GetAtt DeploymentPipeline.Outputs.PipelineUrl