-
Notifications
You must be signed in to change notification settings - Fork 0
/
ecs-refarch-continuous-deployment.yaml
108 lines (92 loc) · 3.26 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
99
100
101
102
103
104
105
106
107
108
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
Repository: !GetAtt Service.Outputs.Repository
StackName: !GetAtt Service.Outputs.StackName
TemplateBucket: ecs-refarch-continuous-deployment
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
Service:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://s3.amazonaws.com/ecs-refarch-continuous-deployment/templates/service.yaml
Parameters:
Cluster: !GetAtt Cluster.Outputs.ClusterName
TargetGroup: !GetAtt LoadBalancer.Outputs.TargetGroup
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