Repository navigation
Expand file tree
/
Copy pathaws-launch-stack.json
More file actions
468 lines (461 loc) · 17.4 KB
/
Copy pathaws-launch-stack.json
File metadata and controls
468 lines (461 loc) · 17.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
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Sample Web Stack in VPC",
"Parameters": {
"AmazonMachineImageId": {
"Description": "Default AMI to use when spinning up instance (i.e. : ami-a9741ac0). Make sure that this account has rights to that AMI",
"Type": "String",
"Default": "ami-6869aa05"
},
"AWSAccountId": {
"Description": "The Amazon AWS Account Id for this group (i.e. 303225888019)",
"Type": "String",
"Default": "679179179105"
},
"AvailabilityZone": {
"Description": "Availability zone to launch instances in. Note that this can vary per account (i.e. us-east-1a,us-east-1b,us-east-1d)",
"Type": "CommaDelimitedList",
"Default": "us-east-1b,us-east-1c,us-east-1e,us-east-1d"
},
"ChefAWSAccessKey": {
"Description": "IAM AWS access key with enough rights to access ChefBucket",
"Type": "String",
"Default": "___DO NOT NEED USING ROLES___"
},
"ChefAWSSecretKey": {
"Description": "IAM AWS secret key with enough rights to access ChefBucket",
"Type": "String",
"Default": "___DO NOT NEED USING ROLES___"
},
"ChefBucket": {
"Description": "S3 bucket that stores the required Chef-related keys (i.e. testing-cloudops-cc-chef-ue1)",
"Type": "String",
"Default": "testing-cloudops-psdkapi-chef-ue1"
},
"ChefEnv": {
"Description": "Default Chef Environment of this instance (i.e. CC-STAGE-UE1-A)",
"Type": "String",
"Default": "PSDKAPI-STAGE-UE1-A"
},
"ChefOrg": {
"Description": "Default Chef Organization of this instance (i.e. testingstormcloud)",
"Type": "String",
"Default": "testingpsdkapi"
},
"ChefRole": {
"Description": "Default Chef Role of this instance (i.e. Web)",
"Type": "String",
"Default": "AppServer"
},
"ExternalELB": {
"Description": "Default ELB to attach to. Create the ELB in advance",
"Type": "String",
"Default": "test-elb"
},
"InternalELB": {
"Description": "Default ELB to attach to. Create the ELB in advance",
"Type": "String",
"Default": "test-elb"
},
"InstanceType": {
"Description": "Type of EC2 instance to launch (i.e. m1.xlarge)",
"Type": "String",
"Default": "t2.micro"
},
"IamInstanceProfile": {
"Description": "IAM instance profile",
"Type": "String",
"Default": "psdkapi-web"
},
"KeyPairName": {
"Description": "Name of an existing EC2 KeyPair (i.e. cloudops-app-stage-ue1)",
"Type": "String",
"Default": "ishant-project"
},
"WebServerPort" : {
"Description" : "The TCP port for the Web Server",
"Type" : "String",
"Default" : "80"
},
"prisubnets" : {
"Description" : "The availiability zones available",
"Type" : "CommaDelimitedList",
"Default" : "subnet-9c1329b6,subnet-ba444f87,subnet-e7e7ddbf,subnet-edc62ca4"
},
"vpcid" : {
"Description" : "VPC where the instances will be launched ",
"Type" : "String",
"Default" : "vpc-4b99ff2c"
},
"ScalingSNSTopicName": {
"Description": "Name of the scaling SNS topic configured to received autoscaling events (i.e. stormcloud-stage-ue1-autoscaling)",
"Type": "String",
"Default": "test-ue1-autoscaling"
},
"SecurityGroups": {
"Description": "Security group that is used by this group. By default, it should belong to at least 4 securty groups (i.e. testing-ssh, stormcloud, stormcloud-ccapi, stormcloud-ccweb, stormcloud-common)",
"Type": "CommaDelimitedList",
"Default": "sg-eec1af93"
},
"ASGDesiredCapacity": {
"Description": "Auto Scaling Group Desired size of the stack (must be between ASGMinSize and ASGMaxSize)",
"Type": "Number",
"Default": "1"
},
"ASGMinSize": {
"Description": "Auto Scaling Group Minimum size of the stack (i.e. 1)",
"Type": "Number",
"Default": "1"
},
"ASGMaxSize": {
"Description": "Auto Scaling Group Maximum size of the stack (i.e. 1). See https://zerowing.corp.testing.com/display/saas/App+Management+-+AWS+Service+Limits and make sure to adjust your limits",
"Type": "Number",
"Default": "1"
},
"ScalingAdjustmentAdjustDown": {
"Description": "The number of instances by which to downscale. (i.e. -1 = remove 1 server at a time)",
"Type": "Number",
"Default": "-1"
},
"ScalingAdjustmentAdjustUp": {
"Description": "The number of instances by which to upscale. (i.e. 1 = add 1 server at a time)",
"Type": "Number",
"Default": "3"
},
"ScalePolicyCoolDown": {
"Description": "The amount of time, in seconds, after a scaling activity completes before any further trigger-related scaling activities can start. (i.e. 300s = 5 min)",
"Type": "Number",
"Default": "300"
},
"ScalePolicyType": {
"Description": "Specifies whether the ScalingAdjustment is an absolute number or a percentage of the current capacity. Valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity. (i.e. ChangeInCapacity)",
"Type": "String",
"Default": "ChangeInCapacity"
},
"ELBAlarmScaleUpEvaluationPeriods": {
"Description": "The number of periods over which data is compared to the specified threshold.",
"Type": "Number",
"Default": "2"
},
"ELBAlarmScaleDownEvaluationPeriods": {
"Description": "The number of periods over which data is compared to the specified threshold.",
"Type": "Number",
"Default": "2"
},
"ELBAlarmScaleUpPeriod": {
"Description": "The period in seconds over which the specified statistic is applied. (i.e. 60s = 1 min)",
"Type": "Number",
"Default": "300"
},
"ELBAlarmScaleDownPeriod": {
"Description": "The period in seconds over which the specified statistic is applied. (i.e. 60s = 1 min)",
"Type": "Number",
"Default": "900"
},
"ELBAlarmScaleUpStatistic": {
"Description": "The statistic to apply to the alarm's associated metric (i.e. Sum)",
"Type": "String",
"Default": "Average"
},
"ELBAlarmScaleDownStatistic": {
"Description": "The statistic to apply to the alarm's associated metric (i.e. Sum)",
"Type": "String",
"Default": "Average"
},
"ELBAlarmScaleUpThreshold": {
"Description": "The value against which the specified statistic is compared. You need to update this based on data from your testing. If you set this too low, your environment will never scale, if its too high, it'll scale too frequently. Start with the example value and tweak as expected (i.e. 9000),",
"Type": "Number",
"Default": "40"
},
"ELBAlarmScaleDownThreshold": {
"Description": "The value against which the specified statistic is compared. You need to update this based on data from your testing. If you set this too low, your environment will never scale, if its too high, it'll scale too frequently. Start with the example value and tweak as expected (i.e. 9000),",
"Type": "Number",
"Default": "20"
},
"TagArchPath": {
"Type": "String",
"Description": "Path name from a root component to this instance based on architectural is-part-of relationship.",
"Default" : "test-tag-1"
},
"TagBilling": {
"Description": "Billing tag",
"Type": "String",
"Default": "unknown"
},
"TagBuildUserId": {
"Description": "Who built this stack?",
"Type": "String",
"Default": "ishant"
},
"TagClass": {
"Description": "Class Name",
"Type": "String",
"Default": "WebServer"
},
"TagComponent": {
"Description": "Product Component (i.e. Web-API)",
"Type": "String",
"Default": "App"
},
"TagCostCenter": {
"Type": "String",
"Description": "The costcenter of this resource. Format is comma separated text with one or two cost center numbers.",
"Default" : "12345677"
},
"TagEnvironment": {
"Description": "Product Environment Name (i.e. CC-STAGE-UE1-A)",
"Type": "String",
"Default": "QA"
},
"TagLoadComment": {
"Type": "String",
"Description": "A test service",
"Default": "QA"
},
"TagProduct": {
"Description": "Product Tag (i.e. Dooplo)",
"Type": "String",
"Default": "TEST"
},
"TagPlatformTech": {
"Type": "String",
"Description": "A comma-separated list of technologies used in the service. This is to give readers a general idea of what is in the service.",
"Default" : "java, tomcat, redis, Dynamo DB, Apache CXF, AWS SQS, AWS S3 encrypted bucket, log4j"
},
"TagOwner": {
"Type": "String",
"Description": "Identifies the owning organization.",
"Default" : "Tech"
},
"TagRelease": {
"Description": "Product Release (i.e. 3.5)",
"Type": "String",
"Default": "unknown"
},
"TagStackName": {
"Description": "Name of this stack",
"Type": "String",
"Default": "TEST"
}
},
"Mappings": {
"AWSInstanceType2Arch": {
"t1.micro": {
"Arch": "64"
},
"m1.small": {
"Arch": "64"
},
"m1.large": {
"Arch": "64"
},
"m1.xlarge": {
"Arch": "64"
},
"m2.xlarge": {
"Arch": "64"
},
"m2.2xlarge": {
"Arch": "64"
},
"m2.4xlarge": {
"Arch": "64"
},
"c1.medium": {
"Arch": "32"
},
"c1.xlarge": {
"Arch": "64"
},
"c3.4xlarge": {
"Arch": "64"
},
"cc1.4xlarge": {
"Arch": "64"
},
"cc2.8xlarge": {
"Arch": "64"
}
},
"AWSRegionArch2AMI": {
"us-east-1": {
"32": "ami-1111111",
"64": "ami-1111111"
},
"us-west-1": {
"32": "ami-1111111",
"64": "ami-1111111"
},
"eu-west-1": {
"32": "ami-1111111",
"64": "ami-1111111"
},
"ap-southeast-1": {
"32": "ami-1111111",
"64": "ami-1111111"
},
"ap-northeast-1": {
"32": "ami-1111111",
"64": "ami-1111111"
}
}
},
"Resources": {
"ContainerLaunchConfiguration": {
"Type": "AWS::AutoScaling::LaunchConfiguration",
"Properties": {
"AssociatePublicIpAddress" : "true",
"KeyName": {
"Ref": "KeyPairName"
},
"SecurityGroups": {
"Ref": "SecurityGroups"
},
"InstanceType": {
"Ref": "InstanceType"
},
"ImageId": {
"Ref": "AmazonMachineImageId"
},
"BlockDeviceMappings": [
{
"DeviceName": "/dev/sdb",
"VirtualName": "ephemeral0"
}
],
"UserData": {
"Fn::Base64": {
"Fn::Join": [
"",
[
"#!/bin/bash","\n",
"yum -y install httpd","\n",
"echo 'Hello testing' > ","/var/www/html/index.html","\n",
"service httpd restart",
"\n"
]
]
}
}
}
},
"ContainerAutoScalingGroup": {
"Type": "AWS::AutoScaling::AutoScalingGroup",
"Properties": {
"AvailabilityZones": {
"Ref": "AvailabilityZone"
},
"VPCZoneIdentifier" : { "Ref" : "prisubnets" },
"LaunchConfigurationName": {
"Ref": "ContainerLaunchConfiguration"
},
"HealthCheckType": "ELB",
"HealthCheckGracePeriod": "600",
"MinSize": {
"Ref": "ASGMinSize"
},
"DesiredCapacity": {
"Ref": "ASGDesiredCapacity"
},
"MaxSize": {
"Ref": "ASGMaxSize"
},
"LoadBalancerNames": [{"Ref": "ExternalELB"}],
"Tags": [
{
"Key": "Name",
"Value": {
"Fn::Join": [
"",
[
{
"Ref": "ChefEnv"
},
"_",
{
"Ref": "ChefRole"
},
"_",
"autoscaling",
""
]
]
},
"PropagateAtLaunch": "true"
},
{
"Key": "testing:ArchPath",
"Value": {
"Ref": "TagArchPath"
},
"PropagateAtLaunch": "true"
},
{
"Key": "testing:Class",
"Value": {
"Ref": "TagClass"
},
"PropagateAtLaunch": "true"
},
{
"Key": "testing:CostCenter",
"Value": {
"Ref": "TagCostCenter"
},
"PropagateAtLaunch": "true"
},
{
"Key": "testing:Environment",
"Value": {
"Ref": "TagEnvironment"
},
"PropagateAtLaunch": "true"
},
{
"Key": "testing:LoadComment",
"Value": {
"Ref": "TagLoadComment"
},
"PropagateAtLaunch": "true"
},
{
"Key": "testing:Owner",
"Value": {
"Ref": "TagOwner"
},
"PropagateAtLaunch": "true"
},
{
"Key": "testing:PlatformTech",
"Value": {
"Ref": "TagPlatformTech"
},
"PropagateAtLaunch": "true"
},
{
"Key": "release",
"Value": {
"Ref": "TagRelease"
},
"PropagateAtLaunch": "true"
},
{
"Key": "stackName",
"Value": {
"Ref": "TagStackName"
},
"PropagateAtLaunch": "true"
}
]
}
}
},
"Outputs": {
"AutoScalingGroup": {
"Value": {
"Ref": "ContainerAutoScalingGroup"
},
"Description": "The Auto Scaling Group (ASG) created from this stack."
}
}
}