This repository has been archived by the owner on Mar 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathstack.yml
1610 lines (1609 loc) · 65.5 KB
/
stack.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
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Resources:
SiteCert6025247C:
Type: AWS::CertificateManager::Certificate
Properties:
DomainName: dev.mysite.com
DomainValidationOptions:
- DomainName: dev.mysite.com
ValidationDomain: mysite.com
Tags:
- Key: StackName
Value: dev-mysite-com
ValidationMethod: DNS
Metadata:
aws:cdk:path: dev-mysite-com-stack/SiteCert/Resource
VpcNestedStackVpcNestedStackResourceC40EA5DD:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL:
Fn::Join:
- ""
- - https://s3.us-east-1.
- Ref: AWS::URLSuffix
- /
- Ref: AssetParameters5c7a963c90b15c1037aecc6c9526544f44734bb117d157d642865c0d1482206dS3Bucket2548A2B5
- /
- Fn::Select:
- 0
- Fn::Split:
- "||"
- Ref: AssetParameters5c7a963c90b15c1037aecc6c9526544f44734bb117d157d642865c0d1482206dS3VersionKey07AA7D40
- Fn::Select:
- 1
- Fn::Split:
- "||"
- Ref: AssetParameters5c7a963c90b15c1037aecc6c9526544f44734bb117d157d642865c0d1482206dS3VersionKey07AA7D40
Tags:
- Key: StackName
Value: dev-mysite-com
Metadata:
aws:cdk:path: dev-mysite-com-stack/Vpc.NestedStack/Vpc.NestedStackResource
AlbStackNestedStackAlbStackNestedStackResource5931881A:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL:
Fn::Join:
- ""
- - https://s3.us-east-1.
- Ref: AWS::URLSuffix
- /
- Ref: AssetParameters73253f6b5b5a311e6acf3f59981d9e4fc722f812cd20b597340cc4b144218a1aS3BucketA5B81864
- /
- Fn::Select:
- 0
- Fn::Split:
- "||"
- Ref: AssetParameters73253f6b5b5a311e6acf3f59981d9e4fc722f812cd20b597340cc4b144218a1aS3VersionKeyD17D1E5D
- Fn::Select:
- 1
- Fn::Split:
- "||"
- Ref: AssetParameters73253f6b5b5a311e6acf3f59981d9e4fc722f812cd20b597340cc4b144218a1aS3VersionKeyD17D1E5D
Parameters:
referencetodevmysitecomstackVpcNestedStackVpcNestedStackResource873B7958OutputsdevmysitecomstackVpcPublicSubnet1Subnet941F830ARef:
Fn::GetAtt:
- VpcNestedStackVpcNestedStackResourceC40EA5DD
- Outputs.devmysitecomstackVpcPublicSubnet1Subnet941F830ARef
referencetodevmysitecomstackVpcNestedStackVpcNestedStackResource873B7958OutputsdevmysitecomstackVpcPublicSubnet2SubnetD8939549Ref:
Fn::GetAtt:
- VpcNestedStackVpcNestedStackResourceC40EA5DD
- Outputs.devmysitecomstackVpcPublicSubnet2SubnetD8939549Ref
referencetodevmysitecomstackVpcNestedStackVpcNestedStackResource873B7958OutputsdevmysitecomstackVpc8106B855Ref:
Fn::GetAtt:
- VpcNestedStackVpcNestedStackResourceC40EA5DD
- Outputs.devmysitecomstackVpc8106B855Ref
referencetodevmysitecomstackSiteCert6D266B29Ref:
Ref: SiteCert6025247C
Tags:
- Key: StackName
Value: dev-mysite-com
DependsOn:
- VpcNestedStackVpcNestedStackResourceC40EA5DD
Metadata:
aws:cdk:path: dev-mysite-com-stack/AlbStack.NestedStack/AlbStack.NestedStackResource
StaticSiteStackNestedStackStaticSiteStackNestedStackResource91C04682:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL:
Fn::Join:
- ""
- - https://s3.us-east-1.
- Ref: AWS::URLSuffix
- /
- Ref: AssetParametersb4d0c6df8d1482627f105ff07ed9e98166c2571f973330d4049d18298074cb08S3Bucket682CC05E
- /
- Fn::Select:
- 0
- Fn::Split:
- "||"
- Ref: AssetParametersb4d0c6df8d1482627f105ff07ed9e98166c2571f973330d4049d18298074cb08S3VersionKeyDF569397
- Fn::Select:
- 1
- Fn::Split:
- "||"
- Ref: AssetParametersb4d0c6df8d1482627f105ff07ed9e98166c2571f973330d4049d18298074cb08S3VersionKeyDF569397
Tags:
- Key: StackName
Value: dev-mysite-com
Metadata:
aws:cdk:path: dev-mysite-com-stack/StaticSiteStack.NestedStack/StaticSiteStack.NestedStackResource
BackendAssetsStackNestedStackBackendAssetsStackNestedStackResource6CF38F1F:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL:
Fn::Join:
- ""
- - https://s3.us-east-1.
- Ref: AWS::URLSuffix
- /
- Ref: AssetParameters8196c54a515977618e306b313148bfa7a18dd8106ef6a42ea5dd77f1862bd914S3Bucket0F024384
- /
- Fn::Select:
- 0
- Fn::Split:
- "||"
- Ref: AssetParameters8196c54a515977618e306b313148bfa7a18dd8106ef6a42ea5dd77f1862bd914S3VersionKey94AE1C77
- Fn::Select:
- 1
- Fn::Split:
- "||"
- Ref: AssetParameters8196c54a515977618e306b313148bfa7a18dd8106ef6a42ea5dd77f1862bd914S3VersionKey94AE1C77
Tags:
- Key: StackName
Value: dev-mysite-com
Metadata:
aws:cdk:path: dev-mysite-com-stack/BackendAssetsStack.NestedStack/BackendAssetsStack.NestedStackResource
CloudFrontStackNestedStackCloudFrontStackNestedStackResourceA467518D:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL:
Fn::Join:
- ""
- - https://s3.us-east-1.
- Ref: AWS::URLSuffix
- /
- Ref: AssetParametersb808bafec79e9e8a1f6523f35d470e9ad4ea63bdbb2bdd4a92ecbe5946d08b10S3Bucket4CD35D24
- /
- Fn::Select:
- 0
- Fn::Split:
- "||"
- Ref: AssetParametersb808bafec79e9e8a1f6523f35d470e9ad4ea63bdbb2bdd4a92ecbe5946d08b10S3VersionKey9A440E4C
- Fn::Select:
- 1
- Fn::Split:
- "||"
- Ref: AssetParametersb808bafec79e9e8a1f6523f35d470e9ad4ea63bdbb2bdd4a92ecbe5946d08b10S3VersionKey9A440E4C
Parameters:
referencetodevmysitecomstackAlbStackNestedStackAlbStackNestedStackResourceAD0999BDOutputsdevmysitecomstackAlbStackALB6404BF3DDNSName:
Fn::GetAtt:
- AlbStackNestedStackAlbStackNestedStackResource5931881A
- Outputs.devmysitecomstackAlbStackALB6404BF3DDNSName
referencetodevmysitecomstackStaticSiteStackNestedStackStaticSiteStackNestedStackResource591C1758OutputsdevmysitecomstackStaticSiteStackStaticSiteBucketC455AC38Ref:
Fn::GetAtt:
- StaticSiteStackNestedStackStaticSiteStackNestedStackResource91C04682
- Outputs.devmysitecomstackStaticSiteStackStaticSiteBucketC455AC38Ref
referencetodevmysitecomstackBackendAssetsStackNestedStackBackendAssetsStackNestedStackResource36A5396FOutputsdevmysitecomstackBackendAssetsStackAssetsBucketF77E80DDRegionalDomainName:
Fn::GetAtt:
- BackendAssetsStackNestedStackBackendAssetsStackNestedStackResource6CF38F1F
- Outputs.devmysitecomstackBackendAssetsStackAssetsBucketF77E80DDRegionalDomainName
referencetodevmysitecomstackSiteCert6D266B29Ref:
Ref: SiteCert6025247C
Tags:
- Key: StackName
Value: dev-mysite-com
Metadata:
aws:cdk:path: dev-mysite-com-stack/CloudFrontStack.NestedStack/CloudFrontStack.NestedStackResource
EcsStackNestedStackEcsStackNestedStackResource48283A58:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL:
Fn::Join:
- ""
- - https://s3.us-east-1.
- Ref: AWS::URLSuffix
- /
- Ref: AssetParameters01bafd09f534e326695e8f2fd7e337746dd41d366003c01231df22f8112e8fb5S3Bucket6DDF043C
- /
- Fn::Select:
- 0
- Fn::Split:
- "||"
- Ref: AssetParameters01bafd09f534e326695e8f2fd7e337746dd41d366003c01231df22f8112e8fb5S3VersionKeyDC16DEC1
- Fn::Select:
- 1
- Fn::Split:
- "||"
- Ref: AssetParameters01bafd09f534e326695e8f2fd7e337746dd41d366003c01231df22f8112e8fb5S3VersionKeyDC16DEC1
Tags:
- Key: StackName
Value: dev-mysite-com
Metadata:
aws:cdk:path: dev-mysite-com-stack/EcsStack.NestedStack/EcsStack.NestedStackResource
RdsDBClusterDBSecret28397CCA:
Type: AWS::SecretsManager::Secret
Properties:
GenerateSecretString:
ExcludePunctuation: true
GenerateStringKey: password
IncludeSpace: false
SecretStringTemplate: '{"username": "postgres"}'
Name: dev-mysite-com-db-secret
Tags:
- Key: StackName
Value: dev-mysite-com
Metadata:
aws:cdk:path: dev-mysite-com-stack/RdsDBCluster/DBSecret/Resource
RdsDBClusterDBSecretArn023C20B8:
Type: AWS::SSM::Parameter
Properties:
Type: String
Value:
Ref: RdsDBClusterDBSecret28397CCA
Name: dev-mysite-com-secret-arn
Tags:
StackName: dev-mysite-com
Metadata:
aws:cdk:path: dev-mysite-com-stack/RdsDBCluster/DBSecretArn/Resource
RdsDBClusterDBSecurityGroup83AB5EDA:
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: DBSecurityGroup
SecurityGroupIngress:
- FromPort: 5432
IpProtocol: tcp
SourceSecurityGroupId:
Fn::GetAtt:
- VpcNestedStackVpcNestedStackResourceC40EA5DD
- Outputs.devmysitecomstackVpc8106B855DefaultSecurityGroup
ToPort: 5432
Tags:
- Key: StackName
Value: dev-mysite-com
VpcId:
Fn::GetAtt:
- VpcNestedStackVpcNestedStackResourceC40EA5DD
- Outputs.devmysitecomstackVpc8106B855Ref
Metadata:
aws:cdk:path: dev-mysite-com-stack/RdsDBCluster/DBSecurityGroup
RdsDBClusterCfnDBSubnetGroup38D3A78B:
Type: AWS::RDS::DBSubnetGroup
Properties:
DBSubnetGroupDescription: dev-mysite-com-db-subnet-group
SubnetIds:
- Fn::GetAtt:
- VpcNestedStackVpcNestedStackResourceC40EA5DD
- Outputs.devmysitecomstackVpcIsolatedSubnet1SubnetDCCE15C8Ref
- Fn::GetAtt:
- VpcNestedStackVpcNestedStackResourceC40EA5DD
- Outputs.devmysitecomstackVpcIsolatedSubnet2Subnet44DEA593Ref
Tags:
- Key: StackName
Value: dev-mysite-com
Metadata:
aws:cdk:path: dev-mysite-com-stack/RdsDBCluster/CfnDBSubnetGroup
RdsDBCluster25564148:
Type: AWS::RDS::DBCluster
Properties:
Engine: aurora-postgresql
DBSubnetGroupName:
Ref: RdsDBClusterCfnDBSubnetGroup38D3A78B
EnableHttpEndpoint: true
EngineMode: serverless
EngineVersion: "10.7"
MasterUsername:
Fn::Join:
- ""
- - "{{resolve:secretsmanager:"
- Ref: RdsDBClusterDBSecret28397CCA
- :SecretString:username::}}
MasterUserPassword:
Fn::Join:
- ""
- - "{{resolve:secretsmanager:"
- Ref: RdsDBClusterDBSecret28397CCA
- :SecretString:password::}}
Tags:
- Key: StackName
Value: dev-mysite-com
VpcSecurityGroupIds:
- Fn::GetAtt:
- RdsDBClusterDBSecurityGroup83AB5EDA
- GroupId
Metadata:
aws:cdk:path: dev-mysite-com-stack/RdsDBCluster/DBCluster
ElastiCacheStackNestedStackElastiCacheStackNestedStackResource4FFEBC8B:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL:
Fn::Join:
- ""
- - https://s3.us-east-1.
- Ref: AWS::URLSuffix
- /
- Ref: AssetParametersb680f5edbfcc210660aa6172b27ac9e82f502524cfb3bd087ccc61b9eb158131S3Bucket08D18C1D
- /
- Fn::Select:
- 0
- Fn::Split:
- "||"
- Ref: AssetParametersb680f5edbfcc210660aa6172b27ac9e82f502524cfb3bd087ccc61b9eb158131S3VersionKey27377FCE
- Fn::Select:
- 1
- Fn::Split:
- "||"
- Ref: AssetParametersb680f5edbfcc210660aa6172b27ac9e82f502524cfb3bd087ccc61b9eb158131S3VersionKey27377FCE
Parameters:
referencetodevmysitecomstackVpcNestedStackVpcNestedStackResource873B7958OutputsdevmysitecomstackVpc8106B855DefaultSecurityGroup:
Fn::GetAtt:
- VpcNestedStackVpcNestedStackResourceC40EA5DD
- Outputs.devmysitecomstackVpc8106B855DefaultSecurityGroup
referencetodevmysitecomstackVpcNestedStackVpcNestedStackResource873B7958OutputsdevmysitecomstackVpc8106B855Ref:
Fn::GetAtt:
- VpcNestedStackVpcNestedStackResourceC40EA5DD
- Outputs.devmysitecomstackVpc8106B855Ref
referencetodevmysitecomstackVpcNestedStackVpcNestedStackResource873B7958OutputsdevmysitecomstackVpcIsolatedSubnet1SubnetDCCE15C8Ref:
Fn::GetAtt:
- VpcNestedStackVpcNestedStackResourceC40EA5DD
- Outputs.devmysitecomstackVpcIsolatedSubnet1SubnetDCCE15C8Ref
referencetodevmysitecomstackVpcNestedStackVpcNestedStackResource873B7958OutputsdevmysitecomstackVpcIsolatedSubnet2Subnet44DEA593Ref:
Fn::GetAtt:
- VpcNestedStackVpcNestedStackResourceC40EA5DD
- Outputs.devmysitecomstackVpcIsolatedSubnet2Subnet44DEA593Ref
Tags:
- Key: StackName
Value: dev-mysite-com
Metadata:
aws:cdk:path: dev-mysite-com-stack/ElastiCacheStack.NestedStack/ElastiCacheStack.NestedStackResource
VariablesDjangoSecretKeyE4FA41EE:
Type: AWS::SecretsManager::Secret
Properties:
GenerateSecretString:
ExcludePunctuation: true
IncludeSpace: false
Tags:
- Key: StackName
Value: dev-mysite-com
Metadata:
aws:cdk:path: dev-mysite-com-stack/Variables/DjangoSecretKey/Resource
BackendBackendTaskTaskRoleD7BBECAE:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Statement:
- Action: sts:AssumeRole
Effect: Allow
Principal:
Service: ecs-tasks.amazonaws.com
Version: "2012-10-17"
Tags:
- Key: StackName
Value: dev-mysite-com
Metadata:
aws:cdk:path: dev-mysite-com-stack/Backend/BackendTask/TaskRole/Resource
BackendBackendTaskTaskRoleDefaultPolicy35F40EEC:
Type: AWS::IAM::Policy
Properties:
PolicyDocument:
Statement:
- Action:
- s3:GetObject*
- s3:GetBucket*
- s3:List*
- s3:DeleteObject*
- s3:PutObject*
- s3:Abort*
Effect: Allow
Resource:
- Fn::GetAtt:
- BackendAssetsStackNestedStackBackendAssetsStackNestedStackResource6CF38F1F
- Outputs.devmysitecomstackBackendAssetsStackAssetsBucketF77E80DDArn
- Fn::Join:
- ""
- - Fn::GetAtt:
- BackendAssetsStackNestedStackBackendAssetsStackNestedStackResource6CF38F1F
- Outputs.devmysitecomstackBackendAssetsStackAssetsBucketF77E80DDArn
- /*
- Action: secretsmanager:GetSecretValue
Effect: Allow
Resource:
Ref: VariablesDjangoSecretKeyE4FA41EE
- Action: secretsmanager:GetSecretValue
Effect: Allow
Resource:
Ref: RdsDBClusterDBSecret28397CCA
Version: "2012-10-17"
PolicyName: BackendBackendTaskTaskRoleDefaultPolicy35F40EEC
Roles:
- Ref: BackendBackendTaskTaskRoleD7BBECAE
Metadata:
aws:cdk:path: dev-mysite-com-stack/Backend/BackendTask/TaskRole/DefaultPolicy/Resource
BackendBackendTask22B2DD1D:
Type: AWS::ECS::TaskDefinition
Properties:
ContainerDefinitions:
- Command:
- /start_prod.sh
Environment:
- Name: DJANGO_SETTINGS_MODULE
Value: backend.settings.production
- Name: DEBUG
Value: ""
- Name: FULL_DOMAIN_NAME
Value: dev.mysite.com
- Name: AWS_STORAGE_BUCKET_NAME
Value:
Fn::GetAtt:
- BackendAssetsStackNestedStackBackendAssetsStackNestedStackResource6CF38F1F
- Outputs.devmysitecomstackBackendAssetsStackAssetsBucketF77E80DDRef
- Name: POSTGRES_SERVICE_HOST
Value:
Fn::GetAtt:
- RdsDBCluster25564148
- Endpoint.Address
- Name: POSTGRES_PASSWORD
Value:
Fn::Join:
- ""
- - "{{resolve:secretsmanager:"
- Ref: RdsDBClusterDBSecret28397CCA
- :SecretString:password::}}
- Name: SECRET_KEY
Value: mysecretkey123
- Name: REDIS_SERVICE_HOST
Value:
Fn::GetAtt:
- ElastiCacheStackNestedStackElastiCacheStackNestedStackResource4FFEBC8B
- Outputs.devmysitecomstackElastiCacheStackElastiCacheClusterRedisD95A8DAARedisEndpointAddress
Essential: true
Image:
Fn::Join:
- ""
- - Ref: AWS::AccountId
- .dkr.ecr.us-east-1.
- Ref: AWS::URLSuffix
- /aws-cdk/assets:3fdc94c5be2f683173c0dc26f90051b2cdc7e43b5c67f85cb1836c07eff7c887
LogConfiguration:
LogDriver: awslogs
Options:
awslogs-group:
Ref: BackendBackendTaskDjangoBackendLogGroup020EB920
awslogs-stream-prefix: Backend
awslogs-region: us-east-1
Name: DjangoBackend
PortMappings:
- ContainerPort: 8000
Protocol: tcp
Secrets:
- Name: DJANGO_SECRET_KEY
ValueFrom:
Ref: VariablesDjangoSecretKeyE4FA41EE
Cpu: "256"
ExecutionRoleArn:
Fn::GetAtt:
- BackendBackendTaskExecutionRole3B22D4E5
- Arn
Family: devmysitecomstackBackendBackendTask23526354
Memory: "512"
NetworkMode: awsvpc
RequiresCompatibilities:
- FARGATE
Tags:
- Key: StackName
Value: dev-mysite-com
TaskRoleArn:
Fn::GetAtt:
- BackendBackendTaskTaskRoleD7BBECAE
- Arn
Metadata:
aws:cdk:path: dev-mysite-com-stack/Backend/BackendTask/Resource
BackendBackendTaskDjangoBackendLogGroup020EB920:
Type: AWS::Logs::LogGroup
UpdateReplacePolicy: Retain
DeletionPolicy: Retain
Metadata:
aws:cdk:path: dev-mysite-com-stack/Backend/BackendTask/DjangoBackend/LogGroup/Resource
BackendBackendTaskExecutionRole3B22D4E5:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Statement:
- Action: sts:AssumeRole
Effect: Allow
Principal:
Service: ecs-tasks.amazonaws.com
Version: "2012-10-17"
Tags:
- Key: StackName
Value: dev-mysite-com
Metadata:
aws:cdk:path: dev-mysite-com-stack/Backend/BackendTask/ExecutionRole/Resource
BackendBackendTaskExecutionRoleDefaultPolicyDCB452D2:
Type: AWS::IAM::Policy
Properties:
PolicyDocument:
Statement:
- Action:
- ecr:BatchCheckLayerAvailability
- ecr:GetDownloadUrlForLayer
- ecr:BatchGetImage
Effect: Allow
Resource:
Fn::Join:
- ""
- - "arn:"
- Ref: AWS::Partition
- ":ecr:us-east-1:"
- Ref: AWS::AccountId
- :repository/aws-cdk/assets
- Action: ecr:GetAuthorizationToken
Effect: Allow
Resource: "*"
- Action:
- logs:CreateLogStream
- logs:PutLogEvents
Effect: Allow
Resource:
Fn::GetAtt:
- BackendBackendTaskDjangoBackendLogGroup020EB920
- Arn
- Action: secretsmanager:GetSecretValue
Effect: Allow
Resource:
Ref: VariablesDjangoSecretKeyE4FA41EE
Version: "2012-10-17"
PolicyName: BackendBackendTaskExecutionRoleDefaultPolicyDCB452D2
Roles:
- Ref: BackendBackendTaskExecutionRole3B22D4E5
Metadata:
aws:cdk:path: dev-mysite-com-stack/Backend/BackendTask/ExecutionRole/DefaultPolicy/Resource
BackendBackendSecurityGroupfromdevmysitecomstackAlbStackALBSecurityGroupFE49D4AC8000485E0E43:
Type: AWS::EC2::SecurityGroupIngress
Properties:
IpProtocol: tcp
Description: Load balancer to target
FromPort: 8000
GroupId:
Fn::GetAtt:
- VpcNestedStackVpcNestedStackResourceC40EA5DD
- Outputs.devmysitecomstackVpc8106B855DefaultSecurityGroup
SourceSecurityGroupId:
Fn::GetAtt:
- AlbStackNestedStackAlbStackNestedStackResource5931881A
- Outputs.devmysitecomstackAlbStackALBSecurityGroupDC2CC7C0GroupId
ToPort: 8000
Metadata:
aws:cdk:path: dev-mysite-com-stack/Backend/BackendSecurityGroup/from devmysitecomstackAlbStackALBSecurityGroupFE49D4AC:8000
BackendBackendSecurityGroupdevmysitecomstackAlbStackALBSecurityGroupFE49D4AC8000from0DBE26B3:
Type: AWS::EC2::SecurityGroupEgress
Properties:
GroupId:
Fn::GetAtt:
- AlbStackNestedStackAlbStackNestedStackResource5931881A
- Outputs.devmysitecomstackAlbStackALBSecurityGroupDC2CC7C0GroupId
IpProtocol: tcp
Description: Load balancer to target
DestinationSecurityGroupId:
Fn::GetAtt:
- VpcNestedStackVpcNestedStackResourceC40EA5DD
- Outputs.devmysitecomstackVpc8106B855DefaultSecurityGroup
FromPort: 8000
ToPort: 8000
Metadata:
aws:cdk:path: dev-mysite-com-stack/Backend/BackendSecurityGroup/devmysitecomstackAlbStackALBSecurityGroupFE49D4AC:8000 from
BackendBackendService9DB18AD9:
Type: AWS::ECS::Service
Properties:
Cluster:
Fn::GetAtt:
- EcsStackNestedStackEcsStackNestedStackResource48283A58
- Outputs.devmysitecomstackEcsStackEcsCluster0ECD51DBRef
DeploymentConfiguration:
MaximumPercent: 200
MinimumHealthyPercent: 50
DesiredCount: 1
EnableECSManagedTags: false
HealthCheckGracePeriodSeconds: 60
LaunchType: FARGATE
LoadBalancers:
- ContainerName: DjangoBackend
ContainerPort: 8000
TargetGroupArn:
Fn::GetAtt:
- AlbStackNestedStackAlbStackNestedStackResource5931881A
- Outputs.devmysitecomstackAlbStackALBHTTPSListenerBackendTargetGroupA82F195BRef
NetworkConfiguration:
AwsvpcConfiguration:
AssignPublicIp: ENABLED
SecurityGroups:
- Fn::GetAtt:
- VpcNestedStackVpcNestedStackResourceC40EA5DD
- Outputs.devmysitecomstackVpc8106B855DefaultSecurityGroup
Subnets:
- Fn::GetAtt:
- VpcNestedStackVpcNestedStackResourceC40EA5DD
- Outputs.devmysitecomstackVpcPublicSubnet1Subnet941F830ARef
- Fn::GetAtt:
- VpcNestedStackVpcNestedStackResourceC40EA5DD
- Outputs.devmysitecomstackVpcPublicSubnet2SubnetD8939549Ref
Tags:
- Key: StackName
Value: dev-mysite-com
TaskDefinition:
Ref: BackendBackendTask22B2DD1D
DependsOn:
- AlbStackNestedStackAlbStackNestedStackResource5931881A
Metadata:
aws:cdk:path: dev-mysite-com-stack/Backend/BackendService/Service
CeleryWorkerServiceDefaultCeleryWorkerQueueE10248A1:
Type: AWS::SQS::Queue
Properties:
QueueName: default
Tags:
- Key: StackName
Value: dev-mysite-com
Metadata:
aws:cdk:path: dev-mysite-com-stack/CeleryWorkerService/DefaultCeleryWorkerQueue/Resource
CeleryWorkerServiceCeleryDefaultWorkerServiceQueueProcessingTaskDefTaskRole57283A4B:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Statement:
- Action: sts:AssumeRole
Effect: Allow
Principal:
Service: ecs-tasks.amazonaws.com
Version: "2012-10-17"
Tags:
- Key: StackName
Value: dev-mysite-com
Metadata:
aws:cdk:path: dev-mysite-com-stack/CeleryWorkerService/CeleryDefaultWorkerService/QueueProcessingTaskDef/TaskRole/Resource
CeleryWorkerServiceCeleryDefaultWorkerServiceQueueProcessingTaskDefTaskRoleDefaultPolicyFCD0B661:
Type: AWS::IAM::Policy
Properties:
PolicyDocument:
Statement:
- Action:
- sqs:ReceiveMessage
- sqs:ChangeMessageVisibility
- sqs:GetQueueUrl
- sqs:DeleteMessage
- sqs:GetQueueAttributes
Effect: Allow
Resource:
Fn::GetAtt:
- CeleryWorkerServiceDefaultCeleryWorkerQueueE10248A1
- Arn
- Action:
- s3:GetObject*
- s3:GetBucket*
- s3:List*
- s3:DeleteObject*
- s3:PutObject*
- s3:Abort*
Effect: Allow
Resource:
- Fn::GetAtt:
- BackendAssetsStackNestedStackBackendAssetsStackNestedStackResource6CF38F1F
- Outputs.devmysitecomstackBackendAssetsStackAssetsBucketF77E80DDArn
- Fn::Join:
- ""
- - Fn::GetAtt:
- BackendAssetsStackNestedStackBackendAssetsStackNestedStackResource6CF38F1F
- Outputs.devmysitecomstackBackendAssetsStackAssetsBucketF77E80DDArn
- /*
- Action: secretsmanager:GetSecretValue
Effect: Allow
Resource:
Ref: VariablesDjangoSecretKeyE4FA41EE
- Action: secretsmanager:GetSecretValue
Effect: Allow
Resource:
Ref: RdsDBClusterDBSecret28397CCA
Version: "2012-10-17"
PolicyName: CeleryWorkerServiceCeleryDefaultWorkerServiceQueueProcessingTaskDefTaskRoleDefaultPolicyFCD0B661
Roles:
- Ref: CeleryWorkerServiceCeleryDefaultWorkerServiceQueueProcessingTaskDefTaskRole57283A4B
Metadata:
aws:cdk:path: dev-mysite-com-stack/CeleryWorkerService/CeleryDefaultWorkerService/QueueProcessingTaskDef/TaskRole/DefaultPolicy/Resource
CeleryWorkerServiceCeleryDefaultWorkerServiceQueueProcessingTaskDefB29793C2:
Type: AWS::ECS::TaskDefinition
Properties:
ContainerDefinitions:
- Command:
- celery
- worker
- -A
- backend.celery_app:app
- -l
- info
Environment:
- Name: DJANGO_SETTINGS_MODULE
Value: backend.settings.production
- Name: DEBUG
Value: ""
- Name: FULL_DOMAIN_NAME
Value: dev.mysite.com
- Name: AWS_STORAGE_BUCKET_NAME
Value:
Fn::GetAtt:
- BackendAssetsStackNestedStackBackendAssetsStackNestedStackResource6CF38F1F
- Outputs.devmysitecomstackBackendAssetsStackAssetsBucketF77E80DDRef
- Name: POSTGRES_SERVICE_HOST
Value:
Fn::GetAtt:
- RdsDBCluster25564148
- Endpoint.Address
- Name: POSTGRES_PASSWORD
Value:
Fn::Join:
- ""
- - "{{resolve:secretsmanager:"
- Ref: RdsDBClusterDBSecret28397CCA
- :SecretString:password::}}
- Name: SECRET_KEY
Value: mysecretkey123
- Name: REDIS_SERVICE_HOST
Value:
Fn::GetAtt:
- ElastiCacheStackNestedStackElastiCacheStackNestedStackResource4FFEBC8B
- Outputs.devmysitecomstackElastiCacheStackElastiCacheClusterRedisD95A8DAARedisEndpointAddress
- Name: QUEUE_NAME
Value:
Fn::GetAtt:
- CeleryWorkerServiceDefaultCeleryWorkerQueueE10248A1
- QueueName
Essential: true
Image:
Fn::Join:
- ""
- - Ref: AWS::AccountId
- .dkr.ecr.us-east-1.
- Ref: AWS::URLSuffix
- /aws-cdk/assets:3fdc94c5be2f683173c0dc26f90051b2cdc7e43b5c67f85cb1836c07eff7c887
LogConfiguration:
LogDriver: awslogs
Options:
awslogs-group:
Ref: CeleryWorkerServiceCeleryDefaultWorkerServiceQueueProcessingTaskDefQueueProcessingContainerLogGroupC1F6B27B
awslogs-stream-prefix: CeleryDefaultWorker
awslogs-region: us-east-1
Name: QueueProcessingContainer
Secrets:
- Name: DJANGO_SECRET_KEY
ValueFrom:
Ref: VariablesDjangoSecretKeyE4FA41EE
Cpu: "256"
ExecutionRoleArn:
Fn::GetAtt:
- CeleryWorkerServiceCeleryDefaultWorkerServiceQueueProcessingTaskDefExecutionRoleDC3CBC31
- Arn
Family: celery-default-worker
Memory: "512"
NetworkMode: awsvpc
RequiresCompatibilities:
- FARGATE
Tags:
- Key: StackName
Value: dev-mysite-com
TaskRoleArn:
Fn::GetAtt:
- CeleryWorkerServiceCeleryDefaultWorkerServiceQueueProcessingTaskDefTaskRole57283A4B
- Arn
Metadata:
aws:cdk:path: dev-mysite-com-stack/CeleryWorkerService/CeleryDefaultWorkerService/QueueProcessingTaskDef/Resource
CeleryWorkerServiceCeleryDefaultWorkerServiceQueueProcessingTaskDefQueueProcessingContainerLogGroupC1F6B27B:
Type: AWS::Logs::LogGroup
UpdateReplacePolicy: Retain
DeletionPolicy: Retain
Metadata:
aws:cdk:path: dev-mysite-com-stack/CeleryWorkerService/CeleryDefaultWorkerService/QueueProcessingTaskDef/QueueProcessingContainer/LogGroup/Resource
CeleryWorkerServiceCeleryDefaultWorkerServiceQueueProcessingTaskDefExecutionRoleDC3CBC31:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Statement:
- Action: sts:AssumeRole
Effect: Allow
Principal:
Service: ecs-tasks.amazonaws.com
Version: "2012-10-17"
Tags:
- Key: StackName
Value: dev-mysite-com
Metadata:
aws:cdk:path: dev-mysite-com-stack/CeleryWorkerService/CeleryDefaultWorkerService/QueueProcessingTaskDef/ExecutionRole/Resource
CeleryWorkerServiceCeleryDefaultWorkerServiceQueueProcessingTaskDefExecutionRoleDefaultPolicy61C24523:
Type: AWS::IAM::Policy
Properties:
PolicyDocument:
Statement:
- Action:
- ecr:BatchCheckLayerAvailability
- ecr:GetDownloadUrlForLayer
- ecr:BatchGetImage
Effect: Allow
Resource:
Fn::Join:
- ""
- - "arn:"
- Ref: AWS::Partition
- ":ecr:us-east-1:"
- Ref: AWS::AccountId
- :repository/aws-cdk/assets
- Action: ecr:GetAuthorizationToken
Effect: Allow
Resource: "*"
- Action:
- logs:CreateLogStream
- logs:PutLogEvents
Effect: Allow
Resource:
Fn::GetAtt:
- CeleryWorkerServiceCeleryDefaultWorkerServiceQueueProcessingTaskDefQueueProcessingContainerLogGroupC1F6B27B
- Arn
- Action: secretsmanager:GetSecretValue
Effect: Allow
Resource:
Ref: VariablesDjangoSecretKeyE4FA41EE
Version: "2012-10-17"
PolicyName: CeleryWorkerServiceCeleryDefaultWorkerServiceQueueProcessingTaskDefExecutionRoleDefaultPolicy61C24523
Roles:
- Ref: CeleryWorkerServiceCeleryDefaultWorkerServiceQueueProcessingTaskDefExecutionRoleDC3CBC31
Metadata:
aws:cdk:path: dev-mysite-com-stack/CeleryWorkerService/CeleryDefaultWorkerService/QueueProcessingTaskDef/ExecutionRole/DefaultPolicy/Resource
CeleryWorkerServiceCeleryDefaultWorkerServiceQueueProcessingFargateServiceE24E949E:
Type: AWS::ECS::Service
Properties:
Cluster:
Fn::GetAtt:
- EcsStackNestedStackEcsStackNestedStackResource48283A58
- Outputs.devmysitecomstackEcsStackEcsCluster0ECD51DBRef
DeploymentConfiguration:
MaximumPercent: 200
MinimumHealthyPercent: 50
DesiredCount: 1
EnableECSManagedTags: false
LaunchType: FARGATE
NetworkConfiguration:
AwsvpcConfiguration:
AssignPublicIp: DISABLED
SecurityGroups:
- Fn::GetAtt:
- CeleryWorkerServiceCeleryDefaultWorkerServiceQueueProcessingFargateServiceSecurityGroup5FAD8F0F
- GroupId
Subnets:
- Fn::GetAtt:
- VpcNestedStackVpcNestedStackResourceC40EA5DD
- Outputs.devmysitecomstackVpcIsolatedSubnet1SubnetDCCE15C8Ref
- Fn::GetAtt:
- VpcNestedStackVpcNestedStackResourceC40EA5DD
- Outputs.devmysitecomstackVpcIsolatedSubnet2Subnet44DEA593Ref
Tags:
- Key: StackName
Value: dev-mysite-com
TaskDefinition:
Ref: CeleryWorkerServiceCeleryDefaultWorkerServiceQueueProcessingTaskDefB29793C2
Metadata:
aws:cdk:path: dev-mysite-com-stack/CeleryWorkerService/CeleryDefaultWorkerService/QueueProcessingFargateService/Service
CeleryWorkerServiceCeleryDefaultWorkerServiceQueueProcessingFargateServiceSecurityGroup5FAD8F0F:
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: dev-mysite-com-stack/CeleryWorkerService/CeleryDefaultWorkerService/QueueProcessingFargateService/SecurityGroup
SecurityGroupEgress:
- CidrIp: 0.0.0.0/0
Description: Allow all outbound traffic by default
IpProtocol: "-1"
Tags:
- Key: StackName
Value: dev-mysite-com
VpcId:
Fn::GetAtt:
- VpcNestedStackVpcNestedStackResourceC40EA5DD
- Outputs.devmysitecomstackVpc8106B855Ref
Metadata:
aws:cdk:path: dev-mysite-com-stack/CeleryWorkerService/CeleryDefaultWorkerService/QueueProcessingFargateService/SecurityGroup/Resource
CeleryWorkerServiceCeleryDefaultWorkerServiceQueueProcessingFargateServiceTaskCountTarget98A4BA84:
Type: AWS::ApplicationAutoScaling::ScalableTarget
Properties:
MaxCapacity: 2
MinCapacity: 1
ResourceId:
Fn::Join:
- ""
- - service/
- Fn::GetAtt:
- EcsStackNestedStackEcsStackNestedStackResource48283A58
- Outputs.devmysitecomstackEcsStackEcsCluster0ECD51DBRef
- /
- Fn::GetAtt:
- CeleryWorkerServiceCeleryDefaultWorkerServiceQueueProcessingFargateServiceE24E949E
- Name
RoleARN:
Fn::Join:
- ""
- - "arn:"
- Ref: AWS::Partition
- ":iam::"
- Ref: AWS::AccountId
- :role/aws-service-role/ecs.application-autoscaling.amazonaws.com/AWSServiceRoleForApplicationAutoScaling_ECSService
ScalableDimension: ecs:service:DesiredCount
ServiceNamespace: ecs
Metadata:
aws:cdk:path: dev-mysite-com-stack/CeleryWorkerService/CeleryDefaultWorkerService/QueueProcessingFargateService/TaskCount/Target/Resource
CeleryWorkerServiceCeleryDefaultWorkerServiceQueueProcessingFargateServiceTaskCountTargetCpuScaling053CCBC0:
Type: AWS::ApplicationAutoScaling::ScalingPolicy
Properties:
PolicyName: devmysitecomstackCeleryWorkerServiceCeleryDefaultWorkerServiceQueueProcessingFargateServiceTaskCountTargetCpuScaling29C46487
PolicyType: TargetTrackingScaling
ScalingTargetId:
Ref: CeleryWorkerServiceCeleryDefaultWorkerServiceQueueProcessingFargateServiceTaskCountTarget98A4BA84
TargetTrackingScalingPolicyConfiguration:
PredefinedMetricSpecification:
PredefinedMetricType: ECSServiceAverageCPUUtilization
TargetValue: 50
Metadata:
aws:cdk:path: dev-mysite-com-stack/CeleryWorkerService/CeleryDefaultWorkerService/QueueProcessingFargateService/TaskCount/Target/CpuScaling/Resource
CeleryWorkerServiceCeleryDefaultWorkerServiceQueueProcessingFargateServiceTaskCountTargetQueueMessagesVisibleScalingLowerPolicyBC5F0028:
Type: AWS::ApplicationAutoScaling::ScalingPolicy
Properties:
PolicyName: devmysitecomstackCeleryWorkerServiceCeleryDefaultWorkerServiceQueueProcessingFargateServiceTaskCountTargetQueueMessagesVisibleScalingLowerPolicy799FDB87
PolicyType: StepScaling
ScalingTargetId:
Ref: CeleryWorkerServiceCeleryDefaultWorkerServiceQueueProcessingFargateServiceTaskCountTarget98A4BA84
StepScalingPolicyConfiguration:
AdjustmentType: ChangeInCapacity
MetricAggregationType: Maximum
StepAdjustments:
- MetricIntervalUpperBound: 0
ScalingAdjustment: -1
Metadata:
aws:cdk:path: dev-mysite-com-stack/CeleryWorkerService/CeleryDefaultWorkerService/QueueProcessingFargateService/TaskCount/Target/QueueMessagesVisibleScaling/LowerPolicy/Resource
CeleryWorkerServiceCeleryDefaultWorkerServiceQueueProcessingFargateServiceTaskCountTargetQueueMessagesVisibleScalingLowerAlarmAFD606D1:
Type: AWS::CloudWatch::Alarm
Properties:
ComparisonOperator: LessThanOrEqualToThreshold
EvaluationPeriods: 1
AlarmActions:
- Ref: CeleryWorkerServiceCeleryDefaultWorkerServiceQueueProcessingFargateServiceTaskCountTargetQueueMessagesVisibleScalingLowerPolicyBC5F0028
AlarmDescription: Lower threshold scaling alarm
Dimensions:
- Name: QueueName
Value:
Fn::GetAtt:
- CeleryWorkerServiceDefaultCeleryWorkerQueueE10248A1
- QueueName
MetricName: ApproximateNumberOfMessagesVisible
Namespace: AWS/SQS
Period: 300
Statistic: Maximum
Threshold: 0
Metadata:
aws:cdk:path: dev-mysite-com-stack/CeleryWorkerService/CeleryDefaultWorkerService/QueueProcessingFargateService/TaskCount/Target/QueueMessagesVisibleScaling/LowerAlarm/Resource
CeleryWorkerServiceCeleryDefaultWorkerServiceQueueProcessingFargateServiceTaskCountTargetQueueMessagesVisibleScalingUpperPolicyEC402468:
Type: AWS::ApplicationAutoScaling::ScalingPolicy
Properties:
PolicyName: devmysitecomstackCeleryWorkerServiceCeleryDefaultWorkerServiceQueueProcessingFargateServiceTaskCountTargetQueueMessagesVisibleScalingUpperPolicy49786727
PolicyType: StepScaling
ScalingTargetId:
Ref: CeleryWorkerServiceCeleryDefaultWorkerServiceQueueProcessingFargateServiceTaskCountTarget98A4BA84
StepScalingPolicyConfiguration:
AdjustmentType: ChangeInCapacity
MetricAggregationType: Maximum
StepAdjustments:
- MetricIntervalLowerBound: 0
MetricIntervalUpperBound: 400
ScalingAdjustment: 1
- MetricIntervalLowerBound: 400
ScalingAdjustment: 5
Metadata:
aws:cdk:path: dev-mysite-com-stack/CeleryWorkerService/CeleryDefaultWorkerService/QueueProcessingFargateService/TaskCount/Target/QueueMessagesVisibleScaling/UpperPolicy/Resource
CeleryWorkerServiceCeleryDefaultWorkerServiceQueueProcessingFargateServiceTaskCountTargetQueueMessagesVisibleScalingUpperAlarm1EB2F2E6:
Type: AWS::CloudWatch::Alarm
Properties:
ComparisonOperator: GreaterThanOrEqualToThreshold
EvaluationPeriods: 1
AlarmActions:
- Ref: CeleryWorkerServiceCeleryDefaultWorkerServiceQueueProcessingFargateServiceTaskCountTargetQueueMessagesVisibleScalingUpperPolicyEC402468
AlarmDescription: Upper threshold scaling alarm
Dimensions:
- Name: QueueName
Value:
Fn::GetAtt:
- CeleryWorkerServiceDefaultCeleryWorkerQueueE10248A1
- QueueName
MetricName: ApproximateNumberOfMessagesVisible
Namespace: AWS/SQS
Period: 300
Statistic: Maximum
Threshold: 100