commit | author | age
|
0850ad
|
1 |
{ |
S |
2 |
"AWSTemplateFormatVersion": "2010-09-09", |
|
3 |
"Parameters": { }, |
|
4 |
"Mappings": { |
|
5 |
"RegionMapping": { |
|
6 |
"us-east-1": { |
0c3c12
|
7 |
"AMI": "ami-b63769a1" |
0850ad
|
8 |
}, |
S |
9 |
"us-east-2": { |
0c3c12
|
10 |
"AMI": "ami-0932686c" |
0850ad
|
11 |
}, |
S |
12 |
"us-west-1": { |
0c3c12
|
13 |
"AMI": "ami-2cade64c" |
0850ad
|
14 |
}, |
S |
15 |
"us-west-2": { |
3b64e5
|
16 |
"AMI": "ami-6f68cf0f" |
0850ad
|
17 |
}, |
S |
18 |
"eu-west-1": { |
0c3c12
|
19 |
"AMI": "ami-02ace471" |
0850ad
|
20 |
}, |
S |
21 |
"eu-central-1": { |
0c3c12
|
22 |
"AMI": "ami-e4c63e8b" |
0850ad
|
23 |
}, |
S |
24 |
"ap-northeast-1": { |
0c3c12
|
25 |
"AMI": "ami-5de0433c" |
0850ad
|
26 |
}, |
S |
27 |
"ap-northeast-2": { |
|
28 |
"AMI": "ami-44db152a" |
|
29 |
}, |
|
30 |
"ap-southeast-1": { |
0c3c12
|
31 |
"AMI": "ami-2c95344f" |
0850ad
|
32 |
}, |
S |
33 |
"ap-southeast-2": { |
0c3c12
|
34 |
"AMI": "ami-39ac915a" |
0850ad
|
35 |
}, |
S |
36 |
"sa-east-1": { |
0c3c12
|
37 |
"AMI": "ami-7de77b11" |
S |
38 |
}, |
|
39 |
"ap-south-1": { |
|
40 |
"AMI": "ami-cdbdd7a2" |
0850ad
|
41 |
} |
S |
42 |
}, |
|
43 |
"DNSMapping": { |
|
44 |
"us-east-1": { |
|
45 |
"domain": "us-east-1.compute.internal" |
|
46 |
}, |
|
47 |
"us-west-1": { |
|
48 |
"domain": "us-west-1.compute.internal" |
|
49 |
}, |
|
50 |
"us-west-2": { |
|
51 |
"domain": "us-west-2.compute.internal" |
|
52 |
}, |
|
53 |
"eu-west-1": { |
|
54 |
"domain": "eu-west-1.compute.internal" |
|
55 |
}, |
|
56 |
"eu-central-1": { |
|
57 |
"domain": "eu-central-1.compute.internal" |
|
58 |
}, |
|
59 |
"ap-northeast-1": { |
|
60 |
"domain": "ap-northeast-1.compute.internal" |
|
61 |
}, |
|
62 |
"ap-northeast-2": { |
|
63 |
"domain": "ap-northeast-2.compute.internal" |
|
64 |
}, |
|
65 |
"ap-southeast-1": { |
|
66 |
"domain": "ap-southeast-1.compute.internal" |
|
67 |
}, |
|
68 |
"ap-southeast-2": { |
|
69 |
"domain": "ap-southeast-2.compute.internal" |
|
70 |
}, |
|
71 |
"sa-east-1": { |
|
72 |
"domain": "sa-east-1.compute.internal" |
0c3c12
|
73 |
}, |
S |
74 |
"ap-south-1": { |
|
75 |
"domain": "ap-south-1.compute.internal" |
0850ad
|
76 |
} |
S |
77 |
} |
|
78 |
}, |
|
79 |
"Resources": { |
|
80 |
"Vpc": { |
|
81 |
"Type": "AWS::EC2::VPC", |
|
82 |
"Properties": { |
|
83 |
"CidrBlock": "192.199.0.0/16", |
|
84 |
"EnableDnsSupport": "true", |
|
85 |
"EnableDnsHostnames": "true", |
|
86 |
"Tags": [ |
|
87 |
{ |
|
88 |
"Key": "Name", |
123384
|
89 |
"Value": "{{vpcid_name_tag}}" |
0850ad
|
90 |
}, |
S |
91 |
{ |
|
92 |
"Key": "Hostlication", |
|
93 |
"Value": { |
|
94 |
"Ref": "AWS::StackId" |
|
95 |
} |
|
96 |
} |
|
97 |
] |
|
98 |
} |
|
99 |
}, |
|
100 |
"VpcInternetGateway": { |
|
101 |
"Type": "AWS::EC2::InternetGateway", |
|
102 |
"Properties": {} |
|
103 |
}, |
|
104 |
"VpcGA": { |
|
105 |
"Type": "AWS::EC2::VPCGatewayAttachment", |
|
106 |
"Properties": { |
|
107 |
"InternetGatewayId": { |
|
108 |
"Ref": "VpcInternetGateway" |
|
109 |
}, |
|
110 |
"VpcId": { |
|
111 |
"Ref": "Vpc" |
|
112 |
} |
|
113 |
} |
|
114 |
}, |
|
115 |
"VpcRouteTable": { |
|
116 |
"Type": "AWS::EC2::RouteTable", |
|
117 |
"Properties": { |
|
118 |
"VpcId": { |
|
119 |
"Ref": "Vpc" |
|
120 |
} |
|
121 |
} |
|
122 |
}, |
|
123 |
"VPCRouteInternetGateway": { |
c795f3
|
124 |
"DependsOn" : "VpcGA", |
GC |
125 |
"Type": "AWS::EC2::Route", |
|
126 |
"Properties": { |
|
127 |
"GatewayId": { |
|
128 |
"Ref": "VpcInternetGateway" |
|
129 |
}, |
|
130 |
"DestinationCidrBlock": "0.0.0.0/0", |
|
131 |
"RouteTableId": { |
|
132 |
"Ref": "VpcRouteTable" |
|
133 |
} |
0850ad
|
134 |
} |
S |
135 |
}, |
|
136 |
"PublicSubnet": { |
|
137 |
"Type": "AWS::EC2::Subnet", |
|
138 |
"DependsOn": [ |
|
139 |
"Vpc" |
|
140 |
], |
|
141 |
"Properties": { |
|
142 |
"CidrBlock": "192.199.0.0/24", |
|
143 |
"Tags": [ |
|
144 |
{ |
|
145 |
"Key": "Name", |
|
146 |
"Value": "{{project_tag}}" |
|
147 |
}, |
|
148 |
{ |
|
149 |
"Key": "Hostlication", |
|
150 |
"Value": { |
|
151 |
"Ref": "AWS::StackId" |
|
152 |
} |
|
153 |
} |
|
154 |
], |
|
155 |
"MapPublicIpOnLaunch": "true", |
|
156 |
"VpcId": { |
|
157 |
"Ref": "Vpc" |
|
158 |
} |
|
159 |
} |
|
160 |
}, |
|
161 |
"PublicSubnetRTA": { |
|
162 |
"Type": "AWS::EC2::SubnetRouteTableAssociation", |
|
163 |
"Properties": { |
|
164 |
"RouteTableId": { |
|
165 |
"Ref": "VpcRouteTable" |
|
166 |
}, |
|
167 |
"SubnetId": { |
|
168 |
"Ref": "PublicSubnet" |
|
169 |
} |
|
170 |
} |
|
171 |
}, |
|
172 |
"HostSG": { |
|
173 |
"Type": "AWS::EC2::SecurityGroup", |
|
174 |
"Properties": { |
|
175 |
"GroupDescription": "Host", |
|
176 |
"VpcId": { |
|
177 |
"Ref": "Vpc" |
|
178 |
}, |
|
179 |
"Tags": [ |
|
180 |
{ |
|
181 |
"Key": "Name", |
|
182 |
"Value": "host_sg" |
|
183 |
} |
|
184 |
] |
|
185 |
} |
|
186 |
}, |
|
187 |
"HostUDPPorts": { |
|
188 |
"Type": "AWS::EC2::SecurityGroupIngress", |
|
189 |
"Properties": { |
|
190 |
"GroupId": { |
|
191 |
"Fn::GetAtt": [ |
|
192 |
"HostSG", |
|
193 |
"GroupId" |
|
194 |
] |
|
195 |
}, |
|
196 |
"IpProtocol": "udp", |
|
197 |
"FromPort": "0", |
|
198 |
"ToPort": "65535", |
|
199 |
"CidrIp": "0.0.0.0/0" |
|
200 |
} |
|
201 |
}, |
|
202 |
"HostTCPPorts": { |
|
203 |
"Type": "AWS::EC2::SecurityGroupIngress", |
|
204 |
"Properties": { |
|
205 |
"GroupId": { |
|
206 |
"Fn::GetAtt": [ |
|
207 |
"HostSG", |
|
208 |
"GroupId" |
|
209 |
] |
|
210 |
}, |
|
211 |
"IpProtocol": "tcp", |
|
212 |
"FromPort": "0", |
|
213 |
"ToPort": "65535", |
|
214 |
"CidrIp": "0.0.0.0/0" |
|
215 |
} |
|
216 |
}, |
|
217 |
"zoneinternalidns": { |
|
218 |
"Type": "AWS::Route53::HostedZone", |
|
219 |
"Properties": { |
|
220 |
"Name": "{{ zone_internal_dns }}", |
|
221 |
"VPCs" : [{ |
|
222 |
"VPCId": { "Ref" : "Vpc" }, |
|
223 |
"VPCRegion": { "Ref": "AWS::Region" } } ], |
|
224 |
"HostedZoneConfig": { |
|
225 |
"Comment": "Created By ansible agnostic deployer" |
|
226 |
} |
|
227 |
} |
|
228 |
}, |
|
229 |
"BastionDNS": { |
|
230 |
"Type": "AWS::Route53::RecordSetGroup", |
740db3
|
231 |
"DependsOn": [ "BastionEIP" ], |
0850ad
|
232 |
"Properties": { |
S |
233 |
"HostedZoneId": "{{HostedZoneId}}", |
|
234 |
"RecordSets": [ |
|
235 |
{ |
|
236 |
"Name": "{{bastion_public_dns}}", |
|
237 |
"Type": "A", |
|
238 |
"TTL": "10", |
|
239 |
"ResourceRecords": [ |
|
240 |
{ |
|
241 |
"Fn::GetAtt": [ |
|
242 |
"Bastion", |
44feb0
|
243 |
"PublicIp" |
S |
244 |
] |
|
245 |
} |
|
246 |
] |
|
247 |
} |
|
248 |
] |
|
249 |
} |
|
250 |
}, |
|
251 |
"LoadBalancerDNS": { |
|
252 |
"Type": "AWS::Route53::RecordSetGroup", |
740db3
|
253 |
"DependsOn": [ "LoadBalancerEIP" ], |
S |
254 |
|
44feb0
|
255 |
"Properties": { |
S |
256 |
"HostedZoneId": "{{HostedZoneId}}", |
|
257 |
"RecordSets": [ |
|
258 |
{ |
|
259 |
"Name": "loadbalancer.{{subdomain_base}}", |
|
260 |
"Type": "A", |
|
261 |
"TTL": "10", |
|
262 |
"ResourceRecords": [ |
|
263 |
{ |
|
264 |
"Fn::GetAtt": [ |
|
265 |
"LoadBalancer", |
0850ad
|
266 |
"PublicIp" |
S |
267 |
] |
|
268 |
} |
|
269 |
] |
|
270 |
} |
|
271 |
] |
|
272 |
} |
|
273 |
}, |
|
274 |
"CloudDNS": { |
|
275 |
"Type": "AWS::Route53::RecordSetGroup", |
740db3
|
276 |
"DependsOn": "infranode{{infranode_instance_count}}EIP", |
0850ad
|
277 |
"Properties": { |
S |
278 |
"HostedZoneId": "{{HostedZoneId}}", |
|
279 |
"RecordSets": [ |
680a86
|
280 |
{ |
S |
281 |
"Name" : "{{cloudapps_dns}}", |
|
282 |
"Type" : "A", |
|
283 |
"TTL" : "900", |
|
284 |
"ResourceRecords" : [ |
|
285 |
{% for c in range(1,(infranode_instance_count|int)+1) %} |
|
286 |
|
|
287 |
{ "Fn::GetAtt": [ "infranode{{loop.index}}", "PublicIp" ] }{% if loop.index < infranode_instance_count %},{% endif %} |
|
288 |
|
|
289 |
{% endfor %} |
|
290 |
]}] |
|
291 |
}}, |
0850ad
|
292 |
"Bastion": { |
S |
293 |
"Type": "AWS::EC2::Instance", |
|
294 |
"Properties": { |
|
295 |
"ImageId": { |
|
296 |
"Fn::FindInMap": [ |
|
297 |
"RegionMapping", |
|
298 |
{ |
|
299 |
"Ref": "AWS::Region" |
|
300 |
}, |
|
301 |
"AMI" |
|
302 |
] |
|
303 |
}, |
|
304 |
"InstanceType": "{{bastion_instance_type}}", |
|
305 |
"KeyName": "{{key_name}}", |
|
306 |
"SecurityGroupIds": [ |
|
307 |
{ |
|
308 |
"Fn::GetAtt": [ |
|
309 |
"HostSG", |
|
310 |
"GroupId" |
|
311 |
] |
|
312 |
} |
|
313 |
], |
|
314 |
"SubnetId": { |
|
315 |
"Ref": "PublicSubnet" |
|
316 |
}, |
|
317 |
"Tags": [ |
|
318 |
{ |
|
319 |
"Key": "Name", |
|
320 |
"Value": "bastion" |
|
321 |
}, |
|
322 |
{ |
|
323 |
"Key": "AnsibleGroup", |
|
324 |
"Value": "bastions" |
|
325 |
}, |
|
326 |
{ |
|
327 |
"Key": "Project", |
|
328 |
"Value": "{{project_tag}}" |
|
329 |
}, |
|
330 |
{ |
|
331 |
"Key": "{{ project_tag }}", |
|
332 |
"Value": "bastion" |
d9abab
|
333 |
}, |
GC |
334 |
{ |
8e4b67
|
335 |
"Key": "internaldns", |
GC |
336 |
"Value": "bastion.{{chomped_zone_internal_dns}}" |
|
337 |
}, |
|
338 |
{ |
d9abab
|
339 |
"Key": "owner", |
GC |
340 |
"Value": "{{ email | default('unknown')}}" |
680a86
|
341 |
} |
8fd65b
|
342 |
], |
GC |
343 |
"BlockDeviceMappings": [ |
|
344 |
{ |
|
345 |
"DeviceName": "/dev/sda1", |
|
346 |
"Ebs": { |
|
347 |
"VolumeSize": {{ rootfs_size_bastion }} |
|
348 |
} |
|
349 |
} |
680a86
|
350 |
] |
S |
351 |
} |
|
352 |
}, |
740db3
|
353 |
"BastionEIP" : { |
c795f3
|
354 |
"Type" : "AWS::EC2::EIP", |
GC |
355 |
"DependsOn": ["VpcGA"], |
|
356 |
"Properties" : { |
|
357 |
"InstanceId" : { |
|
358 |
"Ref" : "Bastion" |
|
359 |
} |
|
360 |
} |
|
361 |
}, |
680a86
|
362 |
"BastionInternalDNS": { |
S |
363 |
"Type": "AWS::Route53::RecordSetGroup", |
|
364 |
"Properties": { |
|
365 |
"HostedZoneId" : { "Ref" : "zoneinternalidns" }, |
|
366 |
|
|
367 |
"RecordSets": [ |
|
368 |
{ |
|
369 |
"Name": "bastion.{{zone_internal_dns}}", |
|
370 |
"Type": "A", |
|
371 |
"TTL": "10", |
|
372 |
"ResourceRecords": [ |
|
373 |
{ |
|
374 |
"Fn::GetAtt": [ |
|
375 |
"Bastion", |
|
376 |
"PrivateIp" |
|
377 |
] |
|
378 |
} |
|
379 |
] |
0850ad
|
380 |
} |
S |
381 |
] |
|
382 |
} |
44feb0
|
383 |
}, |
S |
384 |
"LoadBalancer": { |
|
385 |
"Type": "AWS::EC2::Instance", |
|
386 |
"Properties": { |
|
387 |
"ImageId": { |
|
388 |
"Fn::FindInMap": [ |
|
389 |
"RegionMapping", |
|
390 |
{ |
|
391 |
"Ref": "AWS::Region" |
|
392 |
}, |
|
393 |
"AMI" |
|
394 |
] |
|
395 |
}, |
|
396 |
"InstanceType": "{{loadbalancer_instance_type}}", |
|
397 |
"KeyName": "{{key_name}}", |
|
398 |
"SecurityGroupIds": [ |
|
399 |
{ |
|
400 |
"Fn::GetAtt": [ |
|
401 |
"HostSG", |
|
402 |
"GroupId" |
|
403 |
] |
|
404 |
} |
|
405 |
], |
|
406 |
"SubnetId": { |
|
407 |
"Ref": "PublicSubnet" |
|
408 |
}, |
|
409 |
"Tags": [ |
|
410 |
{ |
|
411 |
"Key": "Name", |
|
412 |
"Value": "loadbalancer" |
|
413 |
}, |
|
414 |
{ |
|
415 |
"Key": "AnsibleGroup", |
|
416 |
"Value": "loadbalancers" |
|
417 |
}, |
|
418 |
{ |
|
419 |
"Key": "Project", |
|
420 |
"Value": "{{project_tag}}" |
|
421 |
}, |
|
422 |
{ |
|
423 |
"Key": "{{ project_tag }}", |
|
424 |
"Value": "loadbalancer" |
d9abab
|
425 |
}, |
GC |
426 |
{ |
8e4b67
|
427 |
"Key": "internaldns", |
GC |
428 |
"Value": "loadbalancer1.{{chomped_zone_internal_dns}}" |
|
429 |
}, |
|
430 |
{ |
d9abab
|
431 |
"Key": "owner", |
GC |
432 |
"Value": "{{ email | default('unknown')}}" |
44feb0
|
433 |
} |
S |
434 |
] |
|
435 |
} |
680a86
|
436 |
}, |
740db3
|
437 |
"LoadBalancerEIP" : { |
c795f3
|
438 |
"Type" : "AWS::EC2::EIP", |
GC |
439 |
"DependsOn": [ "VpcGA" ], |
|
440 |
"Properties" : { |
|
441 |
"InstanceId" : { "Ref" : "LoadBalancer" } |
|
442 |
} |
|
443 |
}, |
680a86
|
444 |
"LoadBalancerInternalDNS": { |
S |
445 |
"Type": "AWS::Route53::RecordSetGroup", |
|
446 |
"Properties": { |
|
447 |
"HostedZoneId" : { "Ref" : "zoneinternalidns" }, |
|
448 |
|
|
449 |
"RecordSets": [ |
|
450 |
{ |
|
451 |
"Name": "loadbalancer1.{{zone_internal_dns}}", |
|
452 |
"Type": "A", |
|
453 |
"TTL": "10", |
|
454 |
"ResourceRecords": [ |
|
455 |
{ |
|
456 |
"Fn::GetAtt": [ |
|
457 |
"LoadBalancer", |
|
458 |
"PrivateIp" |
|
459 |
] |
|
460 |
} |
|
461 |
] |
|
462 |
} |
|
463 |
] |
|
464 |
} |
|
465 |
}, |
ed1286
|
466 |
{% for c in range(1,(master_instance_count|int)+1) %} |
680a86
|
467 |
|
33d649
|
468 |
"master{{c}}": { |
S |
469 |
"Type": "AWS::EC2::Instance", |
|
470 |
"Properties": { |
|
471 |
"ImageId": { |
|
472 |
"Fn::FindInMap": [ |
|
473 |
"RegionMapping", |
|
474 |
{ |
|
475 |
"Ref": "AWS::Region" |
|
476 |
}, |
|
477 |
"AMI" |
|
478 |
] |
|
479 |
}, |
|
480 |
"InstanceType": "{{master_instance_type}}", |
|
481 |
"KeyName": "{{key_name}}", |
|
482 |
"SecurityGroupIds": [ |
|
483 |
{ |
|
484 |
"Fn::GetAtt": [ |
|
485 |
"HostSG", |
|
486 |
"GroupId" |
|
487 |
] |
|
488 |
} |
|
489 |
], |
|
490 |
|
|
491 |
"SubnetId": { |
|
492 |
"Ref": "PublicSubnet" |
|
493 |
}, |
|
494 |
"Tags": [ |
|
495 |
{ |
|
496 |
"Key": "Name", |
740db3
|
497 |
"Value": "master{{loop.index}}" |
33d649
|
498 |
}, |
S |
499 |
{ |
|
500 |
"Key": "AnsibleGroup", |
|
501 |
"Value": "masters" |
|
502 |
}, |
|
503 |
{ |
|
504 |
"Key": "Project", |
|
505 |
"Value": "{{project_tag}}" |
|
506 |
}, |
|
507 |
{ |
|
508 |
"Key": "{{ project_tag }}", |
|
509 |
"Value": "master" |
8e4b67
|
510 |
}, |
GC |
511 |
{ |
|
512 |
"Key": "internaldns", |
|
513 |
"Value": "master{{loop.index}}.{{chomped_zone_internal_dns}}" |
d9abab
|
514 |
}, |
GC |
515 |
{ |
|
516 |
"Key": "owner", |
|
517 |
"Value": "{{ email | default('unknown')}}" |
33d649
|
518 |
} |
S |
519 |
], |
|
520 |
"BlockDeviceMappings": [ |
|
521 |
{ |
8426aa
|
522 |
"DeviceName": "/dev/sda1", |
33d649
|
523 |
"Ebs": { |
8fd65b
|
524 |
"VolumeSize": {{ rootfs_size_master }} |
33d649
|
525 |
} |
S |
526 |
}, |
|
527 |
{ |
0fa5c6
|
528 |
"DeviceName": "{{ docker_device }}", |
33d649
|
529 |
"Ebs": { |
S |
530 |
"VolumeType": "gp2", |
|
531 |
"VolumeSize": 20 |
|
532 |
} |
|
533 |
} |
|
534 |
] |
|
535 |
} |
|
536 |
}, |
|
537 |
"master{{loop.index}}DNS": { |
|
538 |
"Type": "AWS::Route53::RecordSetGroup", |
|
539 |
"Properties": { |
|
540 |
"HostedZoneId" : { "Ref" : "zoneinternalidns" }, |
|
541 |
|
|
542 |
"RecordSets": [ |
|
543 |
{ |
|
544 |
"Name": "master{{loop.index}}.{{zone_internal_dns}}", |
|
545 |
"Type": "A", |
|
546 |
"TTL": "10", |
|
547 |
"ResourceRecords": [ |
|
548 |
{ |
|
549 |
"Fn::GetAtt": [ |
|
550 |
"master{{loop.index}}", |
|
551 |
"PrivateIp" |
|
552 |
] |
|
553 |
} |
|
554 |
] |
|
555 |
} |
|
556 |
] |
|
557 |
} |
|
558 |
}, |
ed1286
|
559 |
{% endfor %} |
33d649
|
560 |
|
S |
561 |
|
|
562 |
{% for c in range(1,(node_instance_count|int)+1) %} |
|
563 |
|
|
564 |
"node{{loop.index}}": { |
680a86
|
565 |
"Type": "AWS::EC2::Instance", |
S |
566 |
"Properties": { |
|
567 |
"ImageId": { |
|
568 |
"Fn::FindInMap": [ |
|
569 |
"RegionMapping", |
|
570 |
{ |
|
571 |
"Ref": "AWS::Region" |
|
572 |
}, |
|
573 |
"AMI" |
|
574 |
] |
|
575 |
}, |
33d649
|
576 |
"InstanceType": "{{node_instance_type}}", |
680a86
|
577 |
"KeyName": "{{key_name}}", |
S |
578 |
"SecurityGroupIds": [ |
|
579 |
{ |
|
580 |
"Fn::GetAtt": [ |
|
581 |
"HostSG", |
|
582 |
"GroupId" |
|
583 |
] |
|
584 |
} |
|
585 |
], |
|
586 |
"SubnetId": { |
|
587 |
"Ref": "PublicSubnet" |
|
588 |
}, |
|
589 |
"Tags": [ |
|
590 |
{ |
|
591 |
"Key": "Name", |
740db3
|
592 |
"Value": "node{{loop.index}}" |
680a86
|
593 |
}, |
S |
594 |
{ |
|
595 |
"Key": "AnsibleGroup", |
33d649
|
596 |
"Value": "nodes" |
680a86
|
597 |
}, |
S |
598 |
{ |
|
599 |
"Key": "Project", |
|
600 |
"Value": "{{project_tag}}" |
|
601 |
}, |
|
602 |
{ |
|
603 |
"Key": "{{ project_tag }}", |
33d649
|
604 |
"Value": "node" |
8e4b67
|
605 |
}, |
GC |
606 |
{ |
|
607 |
"Key": "internaldns", |
|
608 |
"Value": "node{{loop.index}}.{{chomped_zone_internal_dns}}" |
d9abab
|
609 |
}, |
GC |
610 |
{ |
|
611 |
"Key": "owner", |
|
612 |
"Value": "{{ email | default('unknown')}}" |
33d649
|
613 |
} |
S |
614 |
], |
|
615 |
"BlockDeviceMappings": [ |
|
616 |
{ |
8426aa
|
617 |
"DeviceName": "/dev/sda1", |
33d649
|
618 |
"Ebs": { |
8fd65b
|
619 |
"VolumeSize": {{ rootfs_size_node }} |
33d649
|
620 |
} |
S |
621 |
}, |
|
622 |
{ |
0fa5c6
|
623 |
"DeviceName": "{{ docker_device }}", |
33d649
|
624 |
"Ebs": { |
S |
625 |
"VolumeType": "gp2", |
|
626 |
"VolumeSize": 100 |
|
627 |
} |
680a86
|
628 |
} |
S |
629 |
] |
|
630 |
} |
|
631 |
|
33d649
|
632 |
}, |
680a86
|
633 |
|
33d649
|
634 |
"node{{loop.index}}DNS": { |
S |
635 |
"Type": "AWS::Route53::RecordSetGroup", |
|
636 |
"Properties": { |
|
637 |
"HostedZoneId" : { "Ref" : "zoneinternalidns" }, |
680a86
|
638 |
|
33d649
|
639 |
"RecordSets": [ |
680a86
|
640 |
{ |
33d649
|
641 |
"Name": "node{{loop.index}}.{{zone_internal_dns}}", |
S |
642 |
"Type": "A", |
|
643 |
"TTL": "10", |
|
644 |
"ResourceRecords": [ |
|
645 |
{ |
|
646 |
"Fn::GetAtt": [ |
|
647 |
"node{{loop.index}}", |
|
648 |
"PrivateIp" |
|
649 |
] |
|
650 |
} |
|
651 |
] |
|
652 |
} |
680a86
|
653 |
] |
33d649
|
654 |
} |
S |
655 |
}, |
|
656 |
{% endfor %} |
680a86
|
657 |
|
S |
658 |
|
|
659 |
|
33d649
|
660 |
{% for c in range(1,(infranode_instance_count|int)+1) %} |
S |
661 |
|
|
662 |
|
|
663 |
"infranode{{loop.index}}": { |
|
664 |
"Type": "AWS::EC2::Instance", |
|
665 |
"Properties": { |
|
666 |
"ImageId": { |
|
667 |
"Fn::FindInMap": [ |
|
668 |
"RegionMapping", |
680a86
|
669 |
{ |
33d649
|
670 |
"Ref": "AWS::Region" |
S |
671 |
}, |
|
672 |
"AMI" |
680a86
|
673 |
] |
33d649
|
674 |
}, |
S |
675 |
"InstanceType": "{{infranode_instance_type}}", |
|
676 |
"KeyName": "{{key_name}}", |
|
677 |
"SecurityGroupIds": [ |
680a86
|
678 |
{ |
33d649
|
679 |
"Fn::GetAtt": [ |
S |
680 |
"HostSG", |
|
681 |
"GroupId" |
|
682 |
] |
|
683 |
} |
|
684 |
], |
|
685 |
"SubnetId": { |
|
686 |
"Ref": "PublicSubnet" |
680a86
|
687 |
}, |
33d649
|
688 |
"Tags": [ |
680a86
|
689 |
{ |
33d649
|
690 |
"Key": "Name", |
740db3
|
691 |
"Value": "infranode{{loop.index}}" |
680a86
|
692 |
}, |
33d649
|
693 |
{ |
S |
694 |
"Key": "AnsibleGroup", |
|
695 |
"Value": "infranodes" |
|
696 |
}, |
|
697 |
{ |
|
698 |
"Key": "Project", |
|
699 |
"Value": "{{project_tag}}" |
|
700 |
}, |
|
701 |
{ |
|
702 |
"Key": "{{ project_tag }}", |
|
703 |
"Value": "infranode" |
8e4b67
|
704 |
}, |
GC |
705 |
{ |
|
706 |
"Key": "internaldns", |
|
707 |
"Value": "infranode{{loop.index}}.{{chomped_zone_internal_dns}}" |
d9abab
|
708 |
}, |
GC |
709 |
{ |
|
710 |
"Key": "owner", |
|
711 |
"Value": "{{ email | default('unknown')}}" |
33d649
|
712 |
} |
S |
713 |
], |
|
714 |
"BlockDeviceMappings": [ |
|
715 |
{ |
8426aa
|
716 |
"DeviceName": "/dev/sda1", |
33d649
|
717 |
"Ebs": { |
8fd65b
|
718 |
"VolumeSize": {{ rootfs_size_infranode }} |
680a86
|
719 |
} |
33d649
|
720 |
}, |
S |
721 |
{ |
0fa5c6
|
722 |
"DeviceName": "{{ docker_device }}", |
33d649
|
723 |
"Ebs": { |
S |
724 |
"VolumeType": "gp2", |
|
725 |
"VolumeSize": 50 |
|
726 |
} |
|
727 |
} |
|
728 |
] |
|
729 |
} |
680a86
|
730 |
|
33d649
|
731 |
}, |
740db3
|
732 |
"infranode{{loop.index}}EIP" : { |
c795f3
|
733 |
"Type" : "AWS::EC2::EIP", |
GC |
734 |
"DependsOn": [ "VpcGA" ], |
|
735 |
"Properties" : { |
|
736 |
"InstanceId" : { "Ref" : "infranode{{loop.index}}" } |
|
737 |
} |
|
738 |
}, |
33d649
|
739 |
"infranode{{loop.index}}DNS": { |
S |
740 |
"Type": "AWS::Route53::RecordSetGroup", |
|
741 |
"Properties": { |
|
742 |
"HostedZoneId" : { "Ref" : "zoneinternalidns" }, |
|
743 |
|
|
744 |
"RecordSets": [ |
|
745 |
{ |
|
746 |
"Name": "infranode{{loop.index}}.{{zone_internal_dns}}", |
|
747 |
"Type": "A", |
|
748 |
"TTL": "10", |
|
749 |
"ResourceRecords": [ |
|
750 |
{ |
|
751 |
"Fn::GetAtt": [ |
|
752 |
"infranode{{loop.index}}", |
|
753 |
"PrivateIp" |
|
754 |
] |
|
755 |
} |
|
756 |
] |
|
757 |
} |
|
758 |
] |
|
759 |
} |
|
760 |
}, |
|
761 |
|
|
762 |
{% endfor %} |
|
763 |
|
|
764 |
|
|
765 |
|
|
766 |
{% for c in range(1,(support_instance_count|int)+1) %} |
|
767 |
"support{{loop.index}}": { |
|
768 |
"Type": "AWS::EC2::Instance", |
|
769 |
"Properties": { |
|
770 |
"ImageId": { |
|
771 |
"Fn::FindInMap": [ |
|
772 |
"RegionMapping", |
|
773 |
{ |
|
774 |
"Ref": "AWS::Region" |
|
775 |
}, |
|
776 |
"AMI" |
|
777 |
] |
|
778 |
}, |
|
779 |
"InstanceType": "{{support_instance_type}}", |
|
780 |
"KeyName": "{{key_name}}", |
|
781 |
"SecurityGroupIds": [ |
|
782 |
{ |
|
783 |
"Fn::GetAtt": [ |
|
784 |
"HostSG", |
|
785 |
"GroupId" |
|
786 |
] |
|
787 |
} |
|
788 |
], |
|
789 |
"SubnetId": { |
|
790 |
"Ref": "PublicSubnet" |
|
791 |
}, |
|
792 |
"Tags": [ |
|
793 |
{ |
|
794 |
"Key": "Name", |
740db3
|
795 |
"Value": "support{{loop.index}}" |
33d649
|
796 |
}, |
S |
797 |
{ |
|
798 |
"Key": "AnsibleGroup", |
|
799 |
"Value": "support" |
|
800 |
}, |
|
801 |
{ |
|
802 |
"Key": "Project", |
|
803 |
"Value": "{{project_tag}}" |
|
804 |
}, |
|
805 |
{ |
|
806 |
"Key": "{{ project_tag }}", |
|
807 |
"Value": "support" |
d9abab
|
808 |
}, |
GC |
809 |
{ |
8e4b67
|
810 |
"Key": "internaldns", |
GC |
811 |
"Value": "support{{loop.index}}.{{chomped_zone_internal_dns}}" |
|
812 |
}, |
|
813 |
{ |
d9abab
|
814 |
"Key": "owner", |
GC |
815 |
"Value": "{{ email | default('unknown')}}" |
33d649
|
816 |
} |
S |
817 |
], |
|
818 |
"BlockDeviceMappings": [ |
|
819 |
{ |
8426aa
|
820 |
"DeviceName": "/dev/sda1", |
33d649
|
821 |
"Ebs": { |
8fd65b
|
822 |
"VolumeSize": {{ rootfs_size_support }} |
33d649
|
823 |
} |
S |
824 |
}, |
|
825 |
{ |
0fa5c6
|
826 |
"DeviceName": "{{ nfs_pvs }}", |
33d649
|
827 |
"Ebs": { |
S |
828 |
"VolumeType": "gp2", |
0fa5c6
|
829 |
"VolumeSize": {{ nfs_size }} |
33d649
|
830 |
} |
S |
831 |
} |
|
832 |
] |
|
833 |
} |
|
834 |
|
|
835 |
}, |
|
836 |
"support{{loop.index}}DNS": { |
|
837 |
"Type": "AWS::Route53::RecordSetGroup", |
|
838 |
"Properties": { |
|
839 |
"HostedZoneId" : { "Ref" : "zoneinternalidns" }, |
|
840 |
|
|
841 |
"RecordSets": [ |
|
842 |
{ |
|
843 |
"Name": "support{{loop.index}}.{{zone_internal_dns}}", |
|
844 |
"Type": "A", |
|
845 |
"TTL": "10", |
|
846 |
"ResourceRecords": [ |
|
847 |
{ |
|
848 |
"Fn::GetAtt": [ |
|
849 |
"support{{loop.index}}", |
|
850 |
"PrivateIp" |
|
851 |
] |
|
852 |
} |
|
853 |
] |
|
854 |
} |
|
855 |
] |
|
856 |
} |
|
857 |
}, |
ed1286
|
858 |
{% endfor %} |
680a86
|
859 |
|
S |
860 |
}, |
0850ad
|
861 |
"Outputs": { |
S |
862 |
"Route53internalzoneOutput": { |
|
863 |
"Description": "The ID of the internal route 53 zone", |
|
864 |
"Value": { |
|
865 |
"Ref": "zoneinternalidns" |
|
866 |
} |
|
867 |
} |
680a86
|
868 |
}} |