This repository was archived by the owner on Dec 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathmaster.template.json
More file actions
242 lines (236 loc) · 10.4 KB
/
Copy pathmaster.template.json
File metadata and controls
242 lines (236 loc) · 10.4 KB
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "Build a Application Cluster with an ELB and an Autoscaling Group Associated with it.",
"Parameters" : {
"TemplateBucket" : {
"Description" : "S3 bucket where templates are stored.",
"Type" : "String",
"Default" : "bootstrap"
},
"ELBLoadBalancerName" : {
"Description" : "Name for the loadbalancer. LoadBalancer name cannot contain characters that are not letters, or digits or the dash.",
"Type" : "String",
"Default" : "testing001"
},
"ELBSecurityGroups" : {
"Description" : "Existing Security group for the load balancer. Value of property SecurityGroupIds must be of type List of String.",
"Type" : "AWS::EC2::SecurityGroup::Id",
"Default" : "sg-******"
},
"ELBSubnets" : {
"Description" : "Subnet list for the load balancer. Should be public for internet-facing, and private for internal subnet.",
"Type" : "String",
"Default" : "subnet-******,subnet-******"
},
"ELBScheme" : {
"Description" : "LoadBalancer scheme. Internal or internet-facing.",
"Type" : "String",
"Default" : "internet-facing",
"AllowedValues" : [ "internet-facing", "internal" ]
},
"ELBListenersLoadBalancerPort" : {
"Description" : "LoadBalancer external port.",
"Default" : "80",
"Type" : "Number"
},
"ELBListenersInstancePort" : {
"Description" : "The TCP port on which the instance server is listening.",
"Default" : "80",
"Type" : "Number"
},
"ELBListenersProtocol" : {
"Description" : "Specifies the protocol to use for routing traffic to back-end instances—HTTP, HTTPS, TCP, or SSL.",
"Type" : "String",
"Default" : "HTTP",
"AllowedValues" : [ "HTTP", "HTTPS", "TCP", "SSL" ],
"ConstraintDescription" : "Must be HTTP, HTTPS, TCP, or SSL. "
},
"ELBHealthCheckTarget" : {
"Description" : "Specifies the instance's protocol and port to check. The protocol can be TCP, HTTP, HTTPS, or SSL. The range of valid ports is 1 through 65535. For TCP and SSL, you specify a port pair. For example, you can specify TCP:5000 or SSL:5000. For HTTP or HTTPS, you specify a port and a path to ping (HTTP or HTTPS:port/PathToPing). For example, you can specify HTTP:80/health .",
"Default" : "TCP:80",
"Type" : "String"
},
"ELBHealthCheckHealthyThreshold" : {
"Description" : "The number of consecutive health probe successes required before moving the instance to the Healthy state.",
"Default" : "5",
"Type" : "Number"
},
"ELBHealthCheckUnhealthyThreshold" : {
"Description" : "The number of consecutive health probe failures required before moving the instance to the Unhealthy state.",
"Type" : "String",
"Default" : "2"
},
"ELBHealthCheckInterval" : {
"Description" : "The approximate interval, in seconds, between health checks of an individual instance.",
"Type" : "Number",
"Default" : "60"
},
"ELBHealthCheckTimeout" : {
"Description" : "The amount of time, in seconds, during which no response means a failed health probe. This value must be less than the value for Interval.",
"Default" : "30",
"Type" : "Number"
},
"ELBR53DNSName" : {
"Description" : "DNS name for the ELB to be added in Route53. The final end endpoint for the ELB will be <ELBDNSName>.<AWS-Region>.<Environment>.<ELBHostedZone> .",
"Type" : "String",
"Default" : "notification"
},
"ELBR53HostedZone" : {
"Type" : "String",
"Description" : "The DNS name of an existing Amazon Route 53 hosted zone. DNS record for the LoadBalancer will be added in this zone.",
"AllowedPattern" : "(?!-)[a-zA-Z0-9-.]{1,63}(?<!-)",
"ConstraintDescription" : "Must be a valid DNS zone name.",
"Default" : "test.com"
},
"InstanceType" : {
"Description" : "AppServer EC2 instance type",
"Type" : "String",
"Default" : "t2.micro",
"AllowedValues" : [ "t2.micro", "t2.small", "t2.medium", "m1.small", "m1.medium", "m1.large", "m1.xlarge", "m2.xlarge", "m2.2xlarge", "m2.4xlarge", "m3.medium", "m3.large", "m3.xlarge", "m3.2xlarge", "c1.medium", "c1.xlarge", "c3.large", "c3.xlarge", "c3.2xlarge", "c3.4xlarge", "c3.8xlarge", "g2.2xlarge", "r3.large", "r3.xlarge", "r3.2xlarge", "r3.4xlarge", "r3.8xlarge", "i2.xlarge", "i2.2xlarge", "i2.4xlarge", "i2.8xlarge", "hi1.4xlarge", "hs1.8xlarge", "cr1.8xlarge", "cc2.8xlarge", "cg1.4xlarge" ]
,
"ConstraintDescription" : "Must be a valid EC2 instance type."
},
"KeyName" : {
"Description" : "Name of an existing EC2 KeyPair to enable SSH access to the instances",
"Type" : "AWS::EC2::KeyPair::KeyName",
"ConstraintDescription" : "must be the name of an existing EC2 KeyPair."
},
"InstanceSecurityGroup" : {
"Description" : "Security Group for the instances.",
"Type" : "AWS::EC2::SecurityGroup::Id",
"Default": "sg-******"
},
"ServiceELB" : {
"Description" : "LoadBalancer to attach the instances to.",
"Type" : "String"
},
"InstanceAvailabilityZones" : {
"Description" : "A list of avilability zones in which instances will be launched. ",
"Type" : "String",
"Default" : "us-east-1a,us-east-1b"
},
"ASGDesiredCapacity" : {
"Description" : "The desired capacity for the Auto Scaling group",
"Default" : "1",
"Type" : "Number"
},
"ASGHealthCheckGracePeriod" : {
"Description" : "The length of time in seconds after a new EC2 instance comes into service that Auto Scaling starts checking its health.",
"Default" : "600",
"Type" : "Number"
},
"ASGHealthCheckType": {
"Description" : "The service you want the health status from, Amazon EC2 or Elastic Load Balancer. Valid values are EC2 or ELB.",
"Default" : "ELB",
"Type" : "String",
"AllowedValues" : [ "ELB", "EC2" ]
},
"ASGMinSize" : {
"Description" : "The minimum size of the Auto Scaling group.",
"Type" : "Number",
"Default" : "1"
},
"ASGMaxSize" : {
"Description" : "The maximum size of the Auto Scaling group.",
"Type" : "Number",
"Default" : "2"
},
"InstanceSubnets" : {
"Description" : "A list of subnet identifiers of Amazon Virtual Private Cloud (Amazon VPCs). The subnets that you specify for VPCZoneIdentifier must reside in the Availability Zones that you specify with the AvailabilityZones parameter.",
"Default" : "subnet-******,subnet-******",
"Type" : "String"
},
"InstanceAMI" : {
"Description" : "AMI to use for instances.",
"Default" : "ami-146e2a7c",
"Type" : "String"
},
"InstanceIAMRole" : {
"Description" : "IAM Role to be attached to the instances.",
"Default" : "bootstrap",
"Type" : "String"
},
"Environment" : {
"Description" : "Instance Environment.",
"Default" : "env",
"Type" : "String"
},
"Role" : {
"Description" : "Instance Role.",
"Default" : "service-stack",
"Type" : "String"
}
},
"Mappings" : {
},
"Resources" : {
"LoadBalancer" : {
"Type" : "AWS::CloudFormation::Stack",
"Metadata" : {
"Comment" : "Elastic LoadBalancer, with DNS record added in route53."
},
"Properties" : {
"TemplateURL" : { "Fn::Join" : ["/", [ "https://s3.amazonaws.com", { "Ref" : "TemplateBucket" }, "cloudformation/templates", "ELB.template.json" ]]},
"Parameters" : {
"ELBLoadBalancerName" : { "Ref" : "ELBLoadBalancerName" },
"ELBSecurityGroups" : { "Ref" : "ELBSecurityGroups" },
"ELBSubnets" : { "Ref" : "ELBSubnets" },
"ELBScheme" : { "Ref" : "ELBScheme" },
"ELBListenersLoadBalancerPort" : { "Ref" : "ELBListenersLoadBalancerPort" },
"ELBListenersInstancePort" : { "Ref" : "ELBListenersInstancePort" },
"ELBListenersProtocol" : { "Ref" : "ELBListenersProtocol" },
"ELBHealthCheckTarget" : { "Ref" : "ELBHealthCheckTarget" },
"ELBHealthCheckHealthyThreshold" : { "Ref" : "ELBHealthCheckHealthyThreshold" },
"ELBHealthCheckUnhealthyThreshold" : { "Ref" : "ELBHealthCheckUnhealthyThreshold" },
"ELBHealthCheckInterval" : { "Ref" : "ELBHealthCheckInterval" },
"ELBHealthCheckTimeout" : { "Ref" : "ELBHealthCheckTimeout" },
"Environment" : { "Ref" : "Environment" },
"Role" : { "Ref" : "Role" },
"ELBR53DNSName" : { "Ref" : "ELBR53DNSName" },
"ELBR53HostedZone" : { "Ref" : "ELBR53HostedZone" }
}
}
},
"ApplicationAutoScalingGroup" : {
"Type" : "AWS::CloudFormation::Stack",
"Metadata" : {
"Comment" : "Application Autoscaling Group."
},
"DependsOn" : "LoadBalancer",
"Properties" : {
"TemplateURL" : { "Fn::Join" : ["/", [ "https://s3.amazonaws.com", { "Ref" : "TemplateBucket" }, "cloudformation/templates", "AutoScalingGroup.template.json" ]]},
"Parameters" : {
"InstanceType" : { "Ref" : "InstanceType" },
"InstanceSecurityGroup" : { "Ref" : "InstanceSecurityGroup" },
"KeyName" : { "Ref" : "KeyName" },
"Role" : { "Ref" : "Role" },
"Environment" : { "Ref" : "Environment" },
"ServiceELB" : { "Fn::GetAtt" : [ "LoadBalancer", "Outputs.LoadBalancerName" ] },
"InstanceAvailabilityZones" : { "Ref" : "InstanceAvailabilityZones" },
"ASGDesiredCapacity" : { "Ref" : "ASGDesiredCapacity" },
"ASGHealthCheckGracePeriod" : { "Ref" : "ASGHealthCheckGracePeriod" },
"ASGHealthCheckType": { "Ref" : "ASGHealthCheckType" },
"ASGMinSize" : { "Ref" : "ASGMinSize" },
"ASGMaxSize" : { "Ref" : "ASGMaxSize" },
"InstanceSubnets" : { "Ref" : "InstanceSubnets" },
"InstanceAMI" : { "Ref" : "InstanceAMI" },
"InstanceIAMRole" : { "Ref" : "InstanceIAMRole" }
}
}
}
},
"Outputs" : {
"LoadBalancerName" : {
"Value" : { "Fn::GetAtt" : [ "LoadBalancer", "Outputs.LoadBalancerName" ] },
"Description" : "Name of the created LoadBalancer."
},
"LoadBalancerURL" : {
"Value" : { "Fn::GetAtt" : [ "LoadBalancer", "Outputs.LoadBalancerURL" ] },
"Description" : "URL for the created LoadBalancer."
},
"LoadBalancerDNSName" : {
"Value" : { "Fn::GetAtt" : [ "LoadBalancer", "Outputs.LoadBalancerDNSName" ] },
"Description" : "DNS name of the created LoadBalancer."
}
}
}