-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.template
executable file
·649 lines (648 loc) · 19.3 KB
/
main.template
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
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
---
AWSTemplateFormatVersion: 2010-09-09
Description: Enterprise Accelerator - Provides nesting for required stacks to deploy
a full sample web application with reverse proxy, ELBs, IAM, and other resources
(for demonstration/POC/testing)
Metadata:
AWS::CloudFormation::Interface:
ParameterGroups:
- Label:
default: 'Please provide the following parameter values:'
Parameters:
- pDBEngine
- pDBPassword
- pNotifyEmail
- pEC2KeyPairBastion
- pEC2KeyPair
- pSupportsConfig
- pAvailabilityZoneA
- pAvailabilityZoneB
- Label:
default: AWS Quick Start Configuration
Parameters:
- QSS3BucketName
- QSS3KeyPrefix
- QSS3SSLKeyPrefix
ParameterLabels:
pDBEngine:
default: Database Engine
pDBPassword:
default: Database Password
pNotifyEmail:
default: Notification Email Address
pEC2KeyPairBastion:
default: Existing SSH Key for the Bastion Instance
pEC2KeyPair:
default: Existing SSH Key for Other Instances
pSupportsConfig:
default: Support Config
pAvailabilityZoneA:
default: First Availability Zone
pAvailabilityZoneB:
default: Second Availability zone
pVPCTenancy:
default: Instance tenancy
QSS3BucketName:
default: Quick Start S3 Bucket Name
QSS3KeyPrefix:
default: Quick Start S3 Key Prefix
QSS3SSLKeyPrefix:
default: Quick Start S3 SSL Key Prefix
Stack:
Value: 0
VersionDate:
Value: 20160518
Identifier:
Value: main
Input:
Description: Input of all required parameters in nested stacks
Output:
Description: N/A
Parameters:
pDBEngine:
Description: The database engine to create. Note. Not all engines are supported in all regions. Future engine changes will require instance replacement.
AllowedValues:
- aurora
- aurora-mysql
- aurora-postgresql
- mariadb
- mysql
- oracle-ee
- oracle-se2
- oracle-se1
- oracle-se
- postgres
- sqlserver-ee
- sqlserver-se
- sqlserver-ex
- sqlserver-web
Type: String
pDBPassword:
Description: Mixed alphanumeric and must be between 8 and 28 characters and contain
at least one capital letter
NoEcho: true
Type: String
MinLength: 8
MaxLength: 28
AllowedPattern: '[a-zA-Z0-9!^*\-_+]*'
ConstraintDescription: Can only contain alphanumeric characters or the following
special characters !^*-_+, between 8 and 28 characters
pNotifyEmail:
Description: Notification email address for security events (you will receive
a confirmation email)
Type: String
Default: [email protected]
pEC2KeyPairBastion:
Description: The SSH key pair in your account to use for the bastion host login
Type: AWS::EC2::KeyPair::KeyName
pEC2KeyPair:
Description: The SSH key pair in your account to use for all other EC2 instance
logins
Type: AWS::EC2::KeyPair::KeyName
pSupportsConfig:
Description: Is AWS Config Rules already configured for this region? Use 'No'
if you are uncertain. The AWS Config rules feature is currently available in
the AWS Regions listed on the http://docs.aws.amazon.com/general/latest/gr/rande.html#awsconfig_region
page
AllowedValues:
- 'Yes'
- 'No'
Default: 'No'
Type: String
pAvailabilityZoneA:
Description: Availability Zone 1
Type: AWS::EC2::AvailabilityZone::Name
pAvailabilityZoneB:
Description: Availability Zone 2
Type: AWS::EC2::AvailabilityZone::Name
pVPCTenancy:
Description: (Optional)If you require Dedicated tendency, VPC tenancy can be set
to dedicated. As of May 2017 the BAA no longer requires this.
Type: String
Default: default
AllowedValues:
- default
- dedicated
QSS3BucketName:
AllowedPattern: ^[0-9a-zA-Z]+([0-9a-zA-Z-.]*[0-9a-zA-Z])*$
ConstraintDescription: Quick Start bucket name can include numbers, lowercase
letters, uppercase letters, periods (.), and hyphens (-). It cannot start or
end with a hyphen (-).
Default: quickstart-reference
Description: S3 bucket name for the Quick Start assets. Quick Start bucket name
can include numbers, lowercase letters, uppercase letters, and hyphens (-).
It cannot start or end with a hyphen (-).
Type: String
QSS3KeyPrefix:
AllowedPattern: ^[0-9a-zA-Z-]+(/[0-9a-zA-Z-]+)*$
ConstraintDescription: Quick Start key prefix can include numbers, lowercase letters,
uppercase letters, hyphens (-), and forward slash (/). It cannot start or end
with forward slash (/) because they are automatically appended.
Default: enterprise-accelerator/hipaa/latest
Description: S3 key prefix for the Quick Start assets. Quick Start key prefix
can include numbers, lowercase letters, uppercase letters, hyphens (-), and
forward slash (/). It cannot start or end with forward slash (/) because they
are automatically appended.
Type: String
QSS3SSLKeyPrefix:
AllowedPattern: ^[0-9a-zA-Z-]+(/[0-9a-zA-Z-]+)*$
ConstraintDescription: Quick Start SSL key prefix can include numbers, lowercase letters,
uppercase letters, hyphens (-), and forward slash (/). It cannot start or end
with forward slash (/) because they are automatically appended.
Default: enterprise-accelerator/hipaa/latest
Description: S3 SSL key prefix for the Quick Start. Upload your SSL common.key (private key) and common.crt files (these names are required) in
PEM format to this prefix. Quick Start S3 SSL key prefix can include numbers, lowercase letters, uppercase letters, hyphens (-), and
forward slash (/). It cannot start or end with forward slash (/) because they
are automatically appended.
Type: String
Mappings:
AWSInfoRegionMap:
ap-northeast-1:
Partition: aws
QuickStartS3URL: https://s3.amazonaws.com
ap-northeast-2:
Partition: aws
QuickStartS3URL: https://s3.amazonaws.com
ap-south-1:
Partition: aws
QuickStartS3URL: https://s3.amazonaws.com
ap-southeast-1:
Partition: aws
QuickStartS3URL: https://s3.amazonaws.com
ap-southeast-2:
Partition: aws
QuickStartS3URL: https://s3.amazonaws.com
ca-central-1:
Partition: aws
QuickStartS3URL: https://s3.amazonaws.com
eu-central-1:
Partition: aws
QuickStartS3URL: https://s3.amazonaws.com
eu-west-1:
Partition: aws
QuickStartS3URL: https://s3.amazonaws.com
eu-west-2:
Partition: aws
QuickStartS3URL: https://s3.amazonaws.com
sa-east-1:
Partition: aws
QuickStartS3URL: https://s3.amazonaws.com
us-east-1:
Partition: aws
QuickStartS3URL: https://s3.amazonaws.com
us-east-2:
Partition: aws
QuickStartS3URL: https://s3.amazonaws.com
us-gov-west-1:
Partition: aws-us-gov
QuickStartS3URL: https://s3-us-gov-west-1.amazonaws.com
us-west-1:
Partition: aws
QuickStartS3URL: https://s3.amazonaws.com
us-west-2:
Partition: aws
QuickStartS3URL: https://s3.amazonaws.com
CustomVariables:
vResourceEnvironmentTagKey:
Value: Environment
vResourceEnvironmentTagValue:
Value: development
RegionServiceSupport:
us-east-1:
ConfigRules: true
NatGateway: true
Glacier: true
us-east-2:
ConfigRules: true
NatGateway: true
Glacier: true
us-west-1:
ConfigRules: true
NatGateway: true
Glacier: true
us-west-2:
ConfigRules: true
NatGateway: true
Glacier: true
ca-central-1:
ConfigRules: true
NatGateway: true
Glacier: true
eu-central-1:
NatGateway: true
ConfigRules: true
Glacier: true
eu-west-1:
ConfigRules: true
NatGateway: true
Glacier: true
eu-west-2:
ConfigRules: true
NatGateway: true
Glacier: true
ap-northeast-1:
ConfigRules: true
NatGateway: true
Glacier: true
ap-northeast-2:
ConfigRules: true
NatGateway: true
Glacier: true
ap-south-1:
ConfigRules: true
NatGateway: true
Glacier: true
ap-southeast-1:
ConfigRules: true
NatGateway: true
Glacier: false
ap-southeast-2:
ConfigRules: true
NatGateway: true
Glacier: true
sa-east-1:
ConfigRules: true
NatGateway: true
Glacier: false
us-gov-west-1:
ConfigRules: true
NatGateway: true
Glacier: false
AWSAMIRegionMap:
AMI:
AMZNLINUXHVM: amzn-ami-hvm-2017.09.1.20180103-x86_64-gp2
ap-northeast-1:
AMZNLINUXHVM: ami-19910c7f
InstanceType: t2.small
InstanceTypeDatabase: db.t2.small
ap-northeast-2:
AMZNLINUXHVM: ami-7bef4f15
InstanceType: t2.small
InstanceTypeDatabase: db.t2.small
ap-south-1:
AMZNLINUXHVM: ami-4c045023
InstanceType: t2.small
InstanceTypeDatabase: db.t2.small
ap-southeast-1:
AMZNLINUXHVM: ami-1c99ee60
InstanceType: t2.small
InstanceTypeDatabase: db.t2.small
ap-southeast-2:
AMZNLINUXHVM: ami-33996b51
InstanceType: t2.small
InstanceTypeDatabase: db.t2.small
ca-central-1:
AMZNLINUXHVM: ami-e5cc4981
InstanceType: t2.small
InstanceTypeDatabase: db.t2.small
eu-central-1:
AMZNLINUXHVM: ami-06a83869
InstanceType: t2.small
InstanceTypeDatabase: db.t2.small
eu-west-1:
AMZNLINUXHVM: ami-075eca7e
InstanceType: t2.small
InstanceTypeDatabase: db.t2.small
eu-west-2:
AMZNLINUXHVM: ami-63243c07
InstanceType: t2.small
InstanceTypeDatabase: db.t2.small
sa-east-1:
AMZNLINUXHVM: ami-9582c1f9
InstanceType: t2.small
InstanceTypeDatabase: db.m3.large
us-east-1:
AMZNLINUXHVM: ami-5583d42f
InstanceType: t2.small
InstanceTypeDatabase: db.t2.small
us-east-2:
AMZNLINUXHVM: ami-e81b308d
InstanceType: t2.small
InstanceTypeDatabase: db.t2.small
us-gov-west-1:
AMZNLINUXHVM: ami-ffa61d9e
InstanceType: t2.small
InstanceTypeDatabase: db.m3.large
us-west-1:
AMZNLINUXHVM: ami-2f99984f
InstanceType: t2.small
InstanceTypeDatabase: db.t2.small
us-west-2:
AMZNLINUXHVM: ami-a142e9d9
InstanceType: t2.small
InstanceTypeDatabase: db.t2.small
Conditions:
LoadConfigRulesTemplate:
!Equals
- !Ref pSupportsConfig
- 'Yes'
LaunchAsDedicatedInstance:
!Equals
- !Ref pVPCTenancy
- dedicated
Resources:
IamTemplate:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL:
!Sub
- ${QuickStartS3URL}/${QSS3BucketName}/${QSS3KeyPrefix}/iam.template
- QuickStartS3URL:
!FindInMap
- AWSInfoRegionMap
- !Ref AWS::Region
- QuickStartS3URL
TimeoutInMinutes: 20
LoggingTemplate:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL:
!Sub
- ${QuickStartS3URL}/${QSS3BucketName}/${QSS3KeyPrefix}/logging.template
- QuickStartS3URL:
!FindInMap
- AWSInfoRegionMap
- !Ref AWS::Region
- QuickStartS3URL
TimeoutInMinutes: 20
Parameters:
pNotifyEmail: !Ref pNotifyEmail
pSupportsGlacier:
!FindInMap
- RegionServiceSupport
- !Ref AWS::Region
- Glacier
ProductionVpcTemplate:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL:
!Sub
- ${QuickStartS3URL}/${QSS3BucketName}/${QSS3KeyPrefix}/vpc-production.template
- QuickStartS3URL:
!FindInMap
- AWSInfoRegionMap
- !Ref AWS::Region
- QuickStartS3URL
TimeoutInMinutes: 20
Parameters:
pRegionAZ1Name: !Ref pAvailabilityZoneA
pRegionAZ2Name: !Ref pAvailabilityZoneB
pProductionVPCName: Production VPC
pBastionSSHCIDR: 0.0.0.0/0
pDMZSubnetACIDR: 10.100.10.0/24
pDMZSubnetBCIDR: 10.100.20.0/24
pManagementCIDR: 10.10.0.0/16
pAppPrivateSubnetACIDR: 10.100.96.0/21
pAppPrivateSubnetBCIDR: 10.100.119.0/21
pDBPrivateSubnetACIDR: 10.100.194.0/21
pDBPrivateSubnetBCIDR: 10.100.212.0/21
pVPCTenancy: !Ref pVPCTenancy
pEnvironment:
!FindInMap
- CustomVariables
- vResourceEnvironmentTagValue
- Value
pEC2KeyPair: !Ref pEC2KeyPair
pSupportsNatGateway:
!FindInMap
- RegionServiceSupport
- !Ref AWS::Region
- NatGateway
pNatAmi:
!FindInMap
- AWSAMIRegionMap
- !Ref AWS::Region
- AMZNLINUXHVM
pNatInstanceType:
!FindInMap
- AWSAMIRegionMap
- !Ref AWS::Region
- InstanceType
QuickStartS3URL:
!FindInMap
- AWSInfoRegionMap
- !Ref AWS::Region
- QuickStartS3URL
QSS3BucketName: !Ref QSS3BucketName
QSS3KeyPrefix: !Ref QSS3KeyPrefix
ManagementVpcTemplate:
Type: AWS::CloudFormation::Stack
DependsOn: ProductionVpcTemplate
Properties:
TemplateURL:
!Sub
- ${QuickStartS3URL}/${QSS3BucketName}/${QSS3KeyPrefix}/vpc-management.template
- QuickStartS3URL:
!FindInMap
- AWSInfoRegionMap
- !Ref AWS::Region
- QuickStartS3URL
TimeoutInMinutes: 20
Parameters:
pProductionVPC:
!GetAtt
- ProductionVpcTemplate
- Outputs.rVPCProduction
pRouteTableProdPrivate:
!GetAtt
- ProductionVpcTemplate
- Outputs.rRouteTableProdPrivate
pRouteTableProdPublic:
!GetAtt
- ProductionVpcTemplate
- Outputs.rRouteTableProdPublic
pProductionCIDR: 10.100.0.0/16
pBastionSSHCIDR: 0.0.0.0/0
pManagementCIDR: 10.10.0.0/16
pManagementDMZSubnetACIDR: 10.10.1.0/24
pManagementDMZSubnetBCIDR: 10.10.2.0/24
pManagementPrivateSubnetACIDR: 10.10.20.0/24
pManagementPrivateSubnetBCIDR: 10.10.30.0/24
pManagementVPCName: Management VPC
pEC2KeyPairBastion: !Ref pEC2KeyPairBastion
pEC2KeyPair: !Ref pEC2KeyPair
pVPCTenancy: !Ref pVPCTenancy
pBastionAmi:
!FindInMap
- AWSAMIRegionMap
- !Ref AWS::Region
- AMZNLINUXHVM
pRegionAZ1Name: !Ref pAvailabilityZoneA
pRegionAZ2Name: !Ref pAvailabilityZoneB
pEnvironment:
!FindInMap
- CustomVariables
- vResourceEnvironmentTagValue
- Value
pBastionInstanceType:
!If
- LaunchAsDedicatedInstance
- t2.small
- t2.small
pSupportsNatGateway:
!FindInMap
- RegionServiceSupport
- !Ref AWS::Region
- NatGateway
pNatAmi:
!FindInMap
- AWSAMIRegionMap
- !Ref AWS::Region
- AMZNLINUXHVM
pNatInstanceType:
!FindInMap
- AWSAMIRegionMap
- !Ref AWS::Region
- InstanceType
QuickStartS3URL:
!FindInMap
- AWSInfoRegionMap
- !Ref AWS::Region
- QuickStartS3URL
QSS3BucketName: !Ref QSS3BucketName
QSS3KeyPrefix: !Ref QSS3KeyPrefix
ConfigRulesTemplate:
Type: AWS::CloudFormation::Stack
Condition: LoadConfigRulesTemplate
DependsOn:
- IamTemplate
- ProductionVpcTemplate
- ManagementVpcTemplate
- LoggingTemplate
Properties:
TemplateURL:
!Sub
- ${QuickStartS3URL}/${QSS3BucketName}/${QSS3KeyPrefix}/config-rules.template
- QuickStartS3URL:
!FindInMap
- AWSInfoRegionMap
- !Ref AWS::Region
- QuickStartS3URL
TimeoutInMinutes: 20
Parameters:
pRequiredTagKey:
!FindInMap
- CustomVariables
- vResourceEnvironmentTagKey
- Value
ApplicationTemplate:
Type: AWS::CloudFormation::Stack
DependsOn: ProductionVpcTemplate
Properties:
TemplateURL:
!Sub
- ${QuickStartS3URL}/${QSS3BucketName}/${QSS3KeyPrefix}/application.template
- QuickStartS3URL:
!FindInMap
- AWSInfoRegionMap
- !Ref AWS::Region
- QuickStartS3URL
TimeoutInMinutes: 30
Parameters:
pSecurityAlarmTopic:
!GetAtt
- LoggingTemplate
- Outputs.rSecurityAlarmTopic
pEC2KeyPair: !Ref pEC2KeyPair
pProductionCIDR: 10.100.0.0/16
pProductionVPC:
!GetAtt
- ProductionVpcTemplate
- Outputs.rVPCProduction
pDMZSubnetA:
!GetAtt
- ProductionVpcTemplate
- Outputs.rDMZSubnetA
pDMZSubnetB:
!GetAtt
- ProductionVpcTemplate
- Outputs.rDMZSubnetB
pAppPrivateSubnetA:
!GetAtt
- ProductionVpcTemplate
- Outputs.rAppPrivateSubnetA
pAppPrivateSubnetB:
!GetAtt
- ProductionVpcTemplate
- Outputs.rAppPrivateSubnetB
pWebInstanceType:
!FindInMap
- AWSAMIRegionMap
- !Ref AWS::Region
- InstanceType
pAppInstanceType:
!FindInMap
- AWSAMIRegionMap
- !Ref AWS::Region
- InstanceType
pDBPrivateSubnetA:
!GetAtt
- ProductionVpcTemplate
- Outputs.rDBPrivateSubnetA
pDBPrivateSubnetB:
!GetAtt
- ProductionVpcTemplate
- Outputs.rDBPrivateSubnetB
pManagementCIDR: 10.10.0.0/16
pRegionAZ1Name: !Ref pAvailabilityZoneA
pRegionAZ2Name: !Ref pAvailabilityZoneB
pWebServerAMI:
!FindInMap
- AWSAMIRegionMap
- !Ref AWS::Region
- AMZNLINUXHVM
pAppAmi:
!FindInMap
- AWSAMIRegionMap
- !Ref AWS::Region
- AMZNLINUXHVM
pDBEngine: !Ref pDBEngine
pDBUser: testuserdb
pDBName: testDB
pDBPassword: !Ref pDBPassword
pDBClass:
!FindInMap
- AWSAMIRegionMap
- !Ref AWS::Region
- InstanceTypeDatabase
pDBAllocatedStorage: 10
pEnvironment:
!FindInMap
- CustomVariables
- vResourceEnvironmentTagValue
- Value
pBastionSSHCIDR: 0.0.0.0/0
pSupportsGlacier:
!FindInMap
- RegionServiceSupport
- !Ref AWS::Region
- Glacier
QuickStartS3URL:
!FindInMap
- AWSInfoRegionMap
- !Ref AWS::Region
- QuickStartS3URL
QSS3BucketName: !Ref QSS3BucketName
QSS3KeyPrefix: !Ref QSS3KeyPrefix
QSS3SSLKeyPrefix: !Ref QSS3SSLKeyPrefix
Outputs:
TemplateType:
Value: Standard Multi-Tier Web Application
TemplateVersion:
Value: 2.0
BastionIP:
Description: Use this IP via SSH to connect to Bastion Instance
Value:
!GetAtt
- ManagementVpcTemplate
- Outputs.rBastionInstanceIP
WebsiteURL:
Value:
!GetAtt
- ApplicationTemplate
- Outputs.WebsiteURL
Help:
Description: For assistance or questions regarding this quickstart please email
Value: ''
...