-
Notifications
You must be signed in to change notification settings - Fork 402
/
vpc-bastion-fargate-rds.cfn.yml
729 lines (655 loc) · 23.5 KB
/
vpc-bastion-fargate-rds.cfn.yml
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
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
---
AWSTemplateFormatVersion: 2010-09-09
Description: SASKV5 VPC + Bastion + Fargate + Database
Parameters:
TemplateBucket:
Type: String
Default: awslabs-startup-kit-templates-deploy-v5
Description: The template bucket for the CloudFormation templates
# vpc.cfn.yml parameters
AvailabilityZone1:
Description: The first availability zone in the region
Type: AWS::EC2::AvailabilityZone::Name
ConstraintDescription: Must be a valid availability zone
AvailabilityZone2:
Description: The second availability zone in the region
Type: AWS::EC2::AvailabilityZone::Name
ConstraintDescription: Must be a valid availability zone
SSHFrom:
Description: Limit SSH access to bastion hosts to a CIDR IP block
Type: String
MinLength: 9
MaxLength: 18
Default: 0.0.0.0/0
ELBIngressPort:
Description: The ELB ingress port used by security groups
Type: Number
MinValue: 0
MaxValue: 65535
ConstraintDescription: TCP ports must be between 0 - 65535
Default: 80
AppIngressPort:
Description: The application ingress port used by security groups
Type: Number
MinValue: 0
MaxValue: 65535
ConstraintDescription: TCP ports must be between 0 - 65535
Default: 80
# bastion.cfn.yml parameters
KeyName:
Description: EC2 key pair name for bastion host SSH access
Type: AWS::EC2::KeyPair::KeyName
LogRetentionInDays:
Description: Number of days you would like your CloudWatch Logs to be retained
Type: Number
Default: 90
# For more information on the google-authenticator PAM module, see: https://github.com/google/google-authenticator-libpam
MFA:
Description: Set to true to install MFA using the google-authenticator PAM module on your bastion host
Type: String
ConstraintDescription: Value must be true or false
Default: false
AllowedValues:
- true
- false
# fargate.cfn.yml parameters
HostedZoneName:
Type: String
Description: The optional Amazon Route 53 Hosted Zone Name for the optional load balancer alias record - do not include a period at the end
Default: ""
AllowedPattern: "(^$|^((?!-)[A-Za-z0-9-]{1,63}(?<!-)\\.)+[A-Za-z]{2,6}$)" # Allow for a blank or a domain name
ConstraintDescription: Please enter a valid Route 53 Hosted Zone Name
LoadBalancerDomainName:
Type: String
Description: Optional domain name to create an Amazon Route 53 alias record for the load balancer
Default: ""
AllowedPattern: "(^$|^((?!-)[A-Za-z0-9-]{1,63}(?<!-)\\.)+[A-Za-z]{2,6}$)" # Allow for a blank or a domain name
ConstraintDescription: Please enter a valid domain name
LoadBalancerAlarmEvaluationPeriods:
Description: The number of periods over which data is compared to the threshold
Type: Number
Default: 2
MinValue: 2
ConstraintDescription: Must be at least one
LoadBalancerAlarmEvaluationPeriodSeconds:
Description: The time over which the specified statistic is applied. Specify time in seconds, in multiples of 60
Type: Number
Default: 300
MinValue: 60
ConstraintDescription: Must be at least 60 seconds
LoadBalancerLatencySeconds:
Description: LoadBalancer latency threshold, in seconds
Type: Number
Default: 2
MinValue: 1
ConstraintDescription: Must be atleast one
EnableLBAlarm:
Description: Set to true to enable load balancer latency alarm
Type: String
ConstraintDescription: Value must be true or false
Default: false
AllowedValues:
- true
- false
AppProtocol:
Type: String
Description: The application server protocol
Default: HTTP
AllowedValues:
- HTTP
- HTTPS
ConstraintDescription: Specify either HTTTP or HTTPS
SSLCertificateArn:
Type: String
Description: The optional SSL/TLS certificate ARN
MinLength: 0
MaxLength: 2048
Default: ""
HealthCheckPath:
Type: String
Description: The path for the Application Load Balancer health check
Default: /
MinLength: 1
MaxLength: 255
ConstraintDescription: Value must be between 1 and 255 characters
GitSourceRepo:
Type: String
Description: CodeCommit or GitHub source repository - must contain a Dockerfile in the base
GitBranch:
Type: String
Default: master
Description: CodeCommit or GitHub git repository branch - change triggers a new build
GitHubToken:
Type: String
NoEcho: true
Description: "GitHub API token - leave blank if using CodeCommit - see: https://github.com/blog/1509-personal-api-tokens"
GitHubUser:
Type: String
Description: GitHub username or organization - leave blank if using CodeCommit
CodeBuildDockerImage:
Type: String
Default: aws/codebuild/docker:17.09.0
SeedDockerImage:
Type: String
Default: registry.hub.docker.com/library/nginx:1.13
Description: Initial image before CodePipeline is executed. Existing application images in ECR should override this parameter
DefaultContainerCpu:
Type: Number
Description: "Amount of CPU for the container - options available: https://aws.amazon.com/fargate/pricing/"
Default: 256
MinValue: 256
MaxValue: 4096
ConstraintDescription: "Value must be between 256 and 4096 - see: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#task_size"
DefaultContainerMemory:
Type: Number
Description: "Amount of memory for the container - options available: https://aws.amazon.com/fargate/pricing/"
Default: 512
MinValue: 512
MaxValue: 30720
ConstraintDescription: "Value must be between 512 and 30720 - see: https://aws.amazon.com/fargate/pricing/"
# Scaling params
DefaultServiceScaleEvaluationPeriods:
Description: The number of periods over which data is compared to the specified threshold
Type: Number
Default: 2
MinValue: 2
DefaultServiceCpuScaleOutThreshold:
Type: Number
Description: Average CPU % value to trigger auto scaling out
Default: 50
MinValue: 0
MaxValue: 100
ConstraintDescription: Value must be between 0 and 100
DefaultServiceCpuScaleInThreshold:
Type: Number
Description: Average CPU % value to trigger auto scaling down
Default: 25
MinValue: 0
MaxValue: 100
ConstraintDescription: Value must be between 0 and 100
DefaultTaskMinContainerCount:
Type: Number
Description: Minimum number of containers to run for the service
Default: 1
MinValue: 1
ConstraintDescription: Value must be at least one
DefaultTaskMaxContainerCount:
Type: Number
Description: Maximum number of containers to run for the service when auto scaling out
Default: 2
MinValue: 1
ConstraintDescription: Value must be at least one
ContainerLogRetentionInDays:
Type: Number
Default: 7
Description: Number of days to retain container logs
MaxTaggedContainerImagesToRetain:
Type: Number
Description: The number of tagged container images to retain before expiring
MinValue: 1
MaxValue: 100
ConstraintDescription: Value must be between 1 and 100
Default: 20
DaysToRetainUntaggedContainerImages:
Type: Number
Description: The number days to retain untagged container images before expiring
MinValue: 1
MaxValue: 100
ConstraintDescription: Value must be between 1 and 100
Default: 7
EnvironmentName:
Type: String
Description: Environment name - dev or prod
Default: dev
AllowedValues:
- dev
- prod
ConstraintDescription: Specify either dev or prod
# aurora.cfn.yml and/or db.cfn.yml parameters
DatabaseUser:
Default: startupadmin
Type: String
Description: Database admin account name
MinLength: 5
MaxLength: 16
AllowedPattern: "[a-zA-Z][a-zA-Z0-9]*"
ConstraintDescription: Name must begin with a letter and contain only alphanumeric characters
DatabasePassword:
NoEcho: true
Type: String
Description: Database admin account password
MinLength: 6
MaxLength: 41
AllowedPattern: "[a-zA-Z0-9]*"
ConstraintDescription: Password must contain only alphanumeric characters
DatabaseName:
Default: StartupDB
Type: String
Description: Database name
MinLength: 1
MaxLength: 30
AllowedPattern: "[a-zA-Z][a-zA-Z0-9]*"
ConstraintDescription: Name must begin with a letter and contain only alphanumeric characters
DatabaseEngine:
Default: aurora
Type: String
Description: Database engines - Aurora MySQL, Aurora PostgreSQL, PostgreSQL, MariaDB and MySQL
ConstraintDescription: Choose an engine from the drop down
AllowedValues:
- aurora
- aurora-postgresql
- postgres
- mariadb
- mysql
EncryptionAtRest:
Default: false
Type: String
Description: The optional flag for encryption at rest (db.t2.small and above)
ConstraintDescription: Only true or false are allowed
AllowedValues:
- true
- false
DatabaseSize:
Default: 5
Type: String
Description: Database storage size in gigabytes (GB) - Not applicable for Aurora
MinLength: 1
AllowedPattern: "[5-9]|[1-9][0-9]+"
ConstraintDescription: Enter a size of at least 5 GB
DatabaseInstanceClass:
Default: db.t2.small
Type: String
Description: "Database instance class, e.g. db.t2.micro (free tier) - Engine support: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.DBInstanceClass.html"
ConstraintDescription: DB instance class not supported
AllowedValues:
- db.t2.micro
- db.t2.small
- db.t2.medium
- db.t2.large
- db.t2.xlarge
- db.t2.2xlarge
- db.m4.large
- db.m4.xlarge
- db.m4.2xlarge
- db.m4.4xlarge
- db.m4.10xlarge
- db.m4.16xlarge
- db.r4.large
- db.r4.xlarge
- db.r4.2xlarge
- db.r4.4xlarge
- db.r4.8xlarge
- db.r4.16xlarge
DatabaseEnableAlarms:
Default: false
Type: String
Description: Set to true to enable (additional charges - https://aws.amazon.com/cloudwatch/pricing/ - aurora, postgres, mariadb, mysql)
ConstraintDescription: Only true or false are allowed
AllowedValues:
- true
- false
DatabaseEnhancedMonitoring:
Default: false
Type: String
Description: The optional flag for enhanced monitoring (additional charges apply - https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Monitoring.OS.htm - aurora, postgres, mariadb, mysql)
ConstraintDescription: Only true or false are allowed
AllowedValues:
- true
- false
DatabaseAlarmMaxCpuPercent:
Description: Database CPU % max for alarm (aurora, postgres, mariadb, mysql)
Type: Number
Default: 80
MinValue: 1
MaxValue: 99
ConstraintDescription: Must be a percentage between 1-99%
DatabaseAlarmReadLatencyMaxSeconds:
Description: Read latency max in seconds for alarm (aurora, postgres, mariadb, mysql)
Type: Number
Default: 1
MinValue: 1
ConstraintDescription: Must at least one
DatabaseAlarmWriteLatencyMaxSeconds:
Description: Write latency max in seconds for alarm (aurora, postgres, mariadb, mysql)
Type: Number
Default: 1
MinValue: 1
ConstraintDescription: Must at least one
DatabaseAlarmEvaluationPeriods:
Description: The number of periods over which data is compared to the specified threshold (aurora, postgres, mariadb, mysql)
Type: Number
Default: 2
MinValue: 2
ConstraintDescription: Must be at least one
DatabaseAlarmEvaluationPeriodSeconds:
Description: The time over which the specified statistic is applied. Specify time in seconds, in multiples of 60. Enhanced monitoring must be enabled if less than 500 second (aurora, postgres, mariadb, mysql)
Type: Number
Default: 300
MinValue: 60
ConstraintDescription: Must be at least 60 seconds
# Default is 500 MB
DatabaseAlarmMinFreeSpaceInBytes:
Default: 524288000
Type: Number
Description: Number of min free space bytes for alarm (postgres, mariadb, mysql)
MinValue: 1
ConstraintDescription: A value of one byte or more
# Default is 200 MB
DatabaseAlarmSwapUsageInBytes:
Default: 209715200
Type: Number
Description: Number of swap usage bytes for alarm (postgres, mariadb, mysql)
MinValue: 1
ConstraintDescription: A value of one byte or more
Metadata:
AWS::CloudFormation::Interface:
ParameterGroups:
- Label:
default: Environment
Parameters:
- EnvironmentName
- Label:
default: Region Availability Zones
Parameters:
- AvailabilityZone1
- AvailabilityZone2
- Label:
default: Bastion
Parameters:
- KeyName
- LogRetentionInDays
- MFA
- SSHFrom
- Label:
default: Database
Parameters:
- DatabaseEngine
- DatabaseInstanceClass
- DatabaseUser
- DatabasePassword
- DatabaseName
- DatabaseSize
- EncryptionAtRest
- DatabaseEnableAlarms
- DatabaseEnhancedMonitoring
- DatabaseAlarmMaxCpuPercent
- DatabaseAlarmReadLatencyMaxSeconds
- DatabaseAlarmWriteLatencyMaxSeconds
- DatabaseAlarmEvaluationPeriods
- DatabaseAlarmEvaluationPeriodSeconds
- DatabaseAlarmMinFreeSpaceInBytes
- DatabaseAlarmSwapUsageInBytes
- Label:
default: Application Global
Parameters:
- AppIngressPort
- AppProtocol
- Label:
default: Initial Service
Parameters:
- HealthCheckPath
- DefaultContainerCpu
- DefaultContainerMemory
- DefaultServiceScaleEvaluationPeriods
- DefaultServiceCpuScaleOutThreshold
- DefaultServiceCpuScaleInThreshold
- DefaultTaskMinContainerCount
- DefaultTaskMaxContainerCount
- ContainerLogRetentionInDays
- Label:
default: Load Balancer
Parameters:
- ELBIngressPort
- HostedZoneName
- LoadBalancerDomainName
- SSLCertificateArn
- EnableLBAlarm
- LoadBalancerLatencySeconds
- LoadBalancerAlarmEvaluationPeriodSeconds
- LoadBalancerAlarmEvaluationPeriods
- Label:
default: Initial Service CI/CD
Parameters:
- CodeBuildDockerImage
- SeedDockerImage
- GitSourceRepo
- GitBranch
- GitHubUser
- GitHubToken
- Label:
default: Elastic Container Registry
Parameters:
- MaxTaggedContainerImagesToRetain
- DaysToRetainUntaggedContainerImages
ParameterLabels:
AvailabilityZone1:
default: Availability Zone 1
AvailabilityZone2:
default: Availability Zone 2
ELBIngressPort:
default: Port
AppIngressPort:
default: Port
AppProtocol:
default: Protocol
KeyName:
default: EC2 Key Pair
LogRetentionInDays:
default: Log Retention
MFA:
default: Multi-Factor
SSHFrom:
default: SSH Whitelist
TemplateBucket:
default: CloudFormation Bucket
EnvironmentName:
default: Environment
MaxTaggedContainerImagesToRetain:
default: Tagged Images Max
DaysToRetainUntaggedContainerImages:
default: Untagged Images
GitSourceRepo:
default: Git Repo
GitBranch:
default: Git Branch
GitHubUser:
default: GitHub User
GitHubToken:
default: GitHub Token
HealthCheckPath:
default: Health Check Path
DefaultContainerCpu:
default: CPU
DefaultContainerMemory:
default: Memory
DefaultServiceScaleEvaluationPeriods:
default: Scale Periods
DefaultServiceCpuScaleOutThreshold:
default: Scale Out CPU
DefaultServiceCpuScaleInThreshold:
default: Scale In CPU
DefaultTaskMinContainerCount:
default: Min Containers
DefaultTaskMaxContainerCount:
default: Max Containers
ContainerLogRetentionInDays:
default: Log Retention
HostedZoneName:
default: Hosted Zone
LoadBalancerDomainName:
default: Domain
SSLCertificateArn:
default: SSL Certificate
SeedDockerImage:
default: Initial Image
CodeBuildDockerImage:
default: CodeBuild Image
DatabaseUser:
default: User
DatabasePassword:
default: Password
DatabaseName:
default: Name
DatabaseSize:
default: Size
DatabaseEngine:
default: Engine
EncryptionAtRest:
default: Encryption at Rest
DatabaseInstanceClass:
default: Instance Type
DatabaseAlarmMaxCpuPercent:
default: Alarm Max CPU%
DatabaseAlarmReadLatencyMaxSeconds:
default: Alarm Max Read Latency
DatabaseAlarmWriteLatencyMaxSeconds:
default: Alarm Max Write Latency
DatabaseAlarmEvaluationPeriods:
default: Alarm Period(s)
DatabaseAlarmEvaluationPeriodSeconds:
default: Alarm Period Seconds
DatabaseEnhancedMonitoring:
default: Enhanced Monitoring
DatabaseAlarmMinFreeSpaceInBytes:
default: Min Free Space
DatabaseAlarmSwapUsageInBytes:
default: Max Swap Use
DatabaseEnableAlarms:
default: Enable Alarms
EnableLBAlarm:
default: Enable LB Alarm
LoadBalancerAlarmEvaluationPeriods:
default: LB Alarm Periods
LoadBalancerAlarmEvaluationPeriodSeconds:
default: LB Alarm Seconds
LoadBalancerLatencySeconds:
default: LB Latency Threshold
Conditions:
IsProd: !Equals [ !Ref EnvironmentName, prod ]
IsAurora: !Or [ !Equals [ !Ref DatabaseEngine, aurora ], !Equals [ !Ref DatabaseEngine, aurora-postgresql ] ]
IsNotAurora: !Not [ Condition: IsAurora ]
Resources:
VpcStack:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: !Sub https://s3.amazonaws.com/${TemplateBucket}/templates/vpc.cfn.yml
Parameters:
AvailabilityZone1: !Ref AvailabilityZone1
AvailabilityZone2: !Ref AvailabilityZone2
SSHFrom: !Ref SSHFrom
ELBIngressPort: !Ref ELBIngressPort
AppIngressPort: !Ref AppIngressPort
SingleNatGateway: !If [ IsProd, false, true ]
BastionStack:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: !Sub https://s3.amazonaws.com/${TemplateBucket}/templates/bastion.cfn.yml
Parameters:
NetworkStackName: !GetAtt VpcStack.Outputs.Name
KeyName: !Ref KeyName
LogRetentionInDays: !Ref LogRetentionInDays
MFA: !Ref MFA
DependsOn: VpcStack
AuroraStack:
Type: AWS::CloudFormation::Stack
Condition: IsAurora
Properties:
TemplateURL: !Sub https://s3.amazonaws.com/${TemplateBucket}/templates/aurora.cfn.yml
Parameters:
NetworkStackName: !GetAtt VpcStack.Outputs.Name
EnvironmentName: !Ref EnvironmentName
DatabaseEngine: !Ref DatabaseEngine
DatabaseInstanceClass: !Ref DatabaseInstanceClass
DatabaseUser: !Ref DatabaseUser
DatabasePassword: !Ref DatabasePassword
DatabaseName: !Ref DatabaseName
EncryptionAtRest: !Ref EncryptionAtRest
EnableAlarms: !Ref DatabaseEnableAlarms
EnhancedMonitoring: !Ref DatabaseEnhancedMonitoring
DatabaseAlarmMaxCpuPercent: !Ref DatabaseAlarmMaxCpuPercent
DatabaseAlarmReadLatencyMaxSeconds: !Ref DatabaseAlarmReadLatencyMaxSeconds
DatabaseAlarmWriteLatencyMaxSeconds: !Ref DatabaseAlarmWriteLatencyMaxSeconds
DatabaseAlarmEvaluationPeriods: !Ref DatabaseAlarmEvaluationPeriods
DatabaseAlarmEvaluationPeriodSeconds: !Ref DatabaseAlarmEvaluationPeriodSeconds
DependsOn: VpcStack
RdsStack:
Type: AWS::CloudFormation::Stack
Condition: IsNotAurora
Properties:
TemplateURL: !Sub https://s3.amazonaws.com/${TemplateBucket}/templates/db.cfn.yml
Parameters:
NetworkStackName: !GetAtt VpcStack.Outputs.Name
EnvironmentName: !Ref EnvironmentName
DatabaseEngine: !Ref DatabaseEngine
DatabaseInstanceClass: !Ref DatabaseInstanceClass
DatabaseUser: !Ref DatabaseUser
DatabasePassword: !Ref DatabasePassword
DatabaseName: !Ref DatabaseName
EncryptionAtRest: !Ref EncryptionAtRest
DatabaseSize: !Ref DatabaseSize
EnableAlarms: !Ref DatabaseEnableAlarms
EnhancedMonitoring: !Ref DatabaseEnhancedMonitoring
DatabaseAlarmMaxCpuPercent: !Ref DatabaseAlarmMaxCpuPercent
DatabaseAlarmReadLatencyMaxSeconds: !Ref DatabaseAlarmReadLatencyMaxSeconds
DatabaseAlarmWriteLatencyMaxSeconds: !Ref DatabaseAlarmWriteLatencyMaxSeconds
DatabaseAlarmEvaluationPeriods: !Ref DatabaseAlarmEvaluationPeriods
DatabaseAlarmEvaluationPeriodSeconds: !Ref DatabaseAlarmEvaluationPeriodSeconds
DatabaseAlarmMinFreeSpaceInBytes: !Ref DatabaseAlarmMinFreeSpaceInBytes
DatabaseAlarmSwapUsageInBytes: !Ref DatabaseAlarmSwapUsageInBytes
DependsOn: VpcStack
FargateStack:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: !Sub https://s3.amazonaws.com/${TemplateBucket}/templates/fargate.cfn.yml
Parameters:
NetworkStackName: !GetAtt VpcStack.Outputs.Name
DatabaseStackName: !If [ IsAurora, !GetAtt AuroraStack.Outputs.Name, !GetAtt RdsStack.Outputs.Name ]
HostedZoneName: !Ref HostedZoneName
LoadBalancerDomainName: !Ref LoadBalancerDomainName
AppProtocol: !Ref AppProtocol
SSLCertificateArn: !Ref SSLCertificateArn
HealthCheckPath: !Ref HealthCheckPath
GitSourceRepo: !Ref GitSourceRepo
GitBranch: !Ref GitBranch
GitHubToken: !Ref GitHubToken
GitHubUser: !Ref GitHubUser
CodeBuildDockerImage: !Ref CodeBuildDockerImage
SeedDockerImage: !Ref SeedDockerImage
DefaultContainerCpu: !Ref DefaultContainerCpu
DefaultContainerMemory: !Ref DefaultContainerMemory
DefaultServiceScaleEvaluationPeriods: !Ref DefaultServiceScaleEvaluationPeriods
DefaultServiceCpuScaleOutThreshold: !Ref DefaultServiceCpuScaleOutThreshold
DefaultServiceCpuScaleInThreshold: !Ref DefaultServiceCpuScaleInThreshold
DefaultTaskMinContainerCount: !Ref DefaultTaskMinContainerCount
DefaultTaskMaxContainerCount: !Ref DefaultTaskMaxContainerCount
ContainerLogRetentionInDays: !Ref ContainerLogRetentionInDays
MaxTaggedContainerImagesToRetain: !Ref MaxTaggedContainerImagesToRetain
DaysToRetainUntaggedContainerImages: !Ref DaysToRetainUntaggedContainerImages
EnvironmentName: !Ref EnvironmentName
EnableLBAlarm: !Ref EnableLBAlarm
LoadBalancerLatencySeconds: !Ref LoadBalancerLatencySeconds
LoadBalancerAlarmEvaluationPeriodSeconds: !Ref LoadBalancerAlarmEvaluationPeriodSeconds
LoadBalancerAlarmEvaluationPeriods: !Ref LoadBalancerAlarmEvaluationPeriods
Outputs:
VpcStackName:
Value: !GetAtt VpcStack.Outputs.Name
Export:
Name: !Sub ${AWS::StackName}-VpcStackName
BastionStackName:
Value: !GetAtt BastionStack.Outputs.Name
Export:
Name: !Sub ${AWS::StackName}-BastionStackName
FargateStackName:
Value: !GetAtt FargateStack.Outputs.Name
Export:
Name: !Sub ${AWS::StackName}-FargateStackName
AuroraStackName:
Value: !GetAtt AuroraStack.Outputs.Name
Condition: IsAurora
Export:
Name: !Sub ${AWS::StackName}-DatabaseStackName
RdsStackName:
Value: !GetAtt RdsStack.Outputs.Name
Condition: IsNotAurora
Export:
Name: !Sub ${AWS::StackName}-DatabaseStackName