-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdistributed-load-testing-on-aws.template
3554 lines (3550 loc) · 113 KB
/
distributed-load-testing-on-aws.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
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
Description: (SO0062) - Distributed Load Testing on AWS is a reference architecture to perform application load testing at scale. Version v3.2.1
AWSTemplateFormatVersion: "2010-09-09"
Metadata:
AWS::CloudFormation::Interface:
ParameterGroups:
- Label:
default: Console access
Parameters:
- AdminName
- AdminEmail
- Label:
default: Enter values here to use your own existing VPC
Parameters:
- ExistingVPCId
- ExistingSubnetA
- ExistingSubnetB
- Label:
default: Or have the solution create a new AWS Fargate VPC
Parameters:
- VpcCidrBlock
- SubnetACidrBlock
- SubnetBCidrBlock
- EgressCidr
ParameterLabels:
AdminName:
default: "* Console Administrator Name"
AdminEmail:
default: "* Console Administrator Email"
ExistingVPCId:
default: "The ID of an existing VPC in this region. Ex: `vpc-1a2b3c4d5e6f`"
ExistingSubnetA:
default: "The ID of a subnet within the existing VPC. Ex: `subnet-7h8i9j0k`"
ExistingSubnetB:
default: "The ID of a subnet within the existing VPC. Ex: `subnet-1x2y3z`"
VpcCidrBlock:
default: AWS Fargate VPC CIDR Block
SubnetACidrBlock:
default: AWS Fargate Subnet A CIDR Block
SubnetBCidrBlock:
default: AWS Fargate Subnet A CIDR Block
EgressCidr:
default: AWS Fargate SecurityGroup CIDR Block
Parameters:
AdminName:
Type: String
AllowedPattern: "[a-zA-Z0-9-]+"
ConstraintDescription: Admin username must be a minimum of 4 characters and cannot include spaces
Description: Admin user name to access the Distributed Load Testing console
MaxLength: 20
MinLength: 4
AdminEmail:
Type: String
AllowedPattern: ^[_A-Za-z0-9-\+]+(\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\.[A-Za-z0-9]+)*(\.[A-Za-z]{2,})$
ConstraintDescription: Admin email must be a valid email address
Description: Admin user email address to access the Distributed Load Testing Console
MinLength: 5
ExistingVPCId:
Type: String
AllowedPattern: (?:^$|^vpc-[a-zA-Z0-9-]+)
Description: Existing VPC ID
ExistingSubnetA:
Type: String
AllowedPattern: (?:^$|^subnet-[a-zA-Z0-9-]+)
Description: First existing subnet
ExistingSubnetB:
Type: String
AllowedPattern: (?:^$|^subnet-[a-zA-Z0-9-]+)
Description: Second existing subnet
VpcCidrBlock:
Type: String
Default: 192.168.0.0/16
AllowedPattern: (?:^$|(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/(\d{1,2}))
ConstraintDescription: The VPC CIDR block must be a valid IP CIDR range of the form x.x.x.x/x.
Description: CIDR block of the new VPC where AWS Fargate will be placed
MaxLength: 18
MinLength: 9
SubnetACidrBlock:
Type: String
Default: 192.168.0.0/20
AllowedPattern: (?:^$|(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/(\d{1,2}))
ConstraintDescription: The subnet CIDR block must be a valid IP CIDR range of the form x.x.x.x/x.
Description: CIDR block for subnet A of the AWS Fargate VPC
MaxLength: 18
MinLength: 9
SubnetBCidrBlock:
Type: String
Default: 192.168.16.0/20
AllowedPattern: (?:^$|(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/(\d{1,2}))
ConstraintDescription: The subnet CIDR block must be a valid IP CIDR range of the form x.x.x.x/x.
Description: CIDR block for subnet B of the AWS Fargate VPC
EgressCidr:
Type: String
Default: 0.0.0.0/0
AllowedPattern: (?:^$|(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/(\d{1,2}))
ConstraintDescription: The Egress CIDR block must be a valid IP CIDR range of the form x.x.x.x/x.
Description: CIDR Block to restrict the ECS container outbound access
MaxLength: 18
MinLength: 9
Rules:
ExistingVPCRule:
RuleCondition:
Fn::Not:
- Fn::Equals:
- Ref: ExistingVPCId
- ""
Assertions:
- Assert:
Fn::Not:
- Fn::Equals:
- Ref: ExistingSubnetA
- ""
AssertDescription: If an existing VPC Id is provided, 2 subnet ids need to be provided as well. You neglected to enter the first subnet id
- Assert:
Fn::Not:
- Fn::Equals:
- Ref: ExistingSubnetB
- ""
AssertDescription: If an existing VPC Id is provided, 2 subnet ids need to be provided as well. You neglected to enter the second subnet id
Mappings:
Solution:
Config:
CodeVersion: v3.2.1
ContainerImage: public.ecr.aws/aws-solutions/distributed-load-testing-on-aws-load-tester:v3.2.1
KeyPrefix: distributed-load-testing-on-aws/v3.2.1
S3Bucket: solutions
SendAnonymousUsage: "Yes"
SolutionId: SO0062
URL: https://metrics.awssolutionsbuilder.com/generic
ServiceprincipalMap:
af-south-1:
states: states.af-south-1.amazonaws.com
ap-east-1:
states: states.ap-east-1.amazonaws.com
ap-northeast-1:
states: states.ap-northeast-1.amazonaws.com
ap-northeast-2:
states: states.ap-northeast-2.amazonaws.com
ap-northeast-3:
states: states.ap-northeast-3.amazonaws.com
ap-south-1:
states: states.ap-south-1.amazonaws.com
ap-south-2:
states: states.ap-south-2.amazonaws.com
ap-southeast-1:
states: states.ap-southeast-1.amazonaws.com
ap-southeast-2:
states: states.ap-southeast-2.amazonaws.com
ap-southeast-3:
states: states.ap-southeast-3.amazonaws.com
ca-central-1:
states: states.ca-central-1.amazonaws.com
cn-north-1:
states: states.cn-north-1.amazonaws.com
cn-northwest-1:
states: states.cn-northwest-1.amazonaws.com
eu-central-1:
states: states.eu-central-1.amazonaws.com
eu-central-2:
states: states.eu-central-2.amazonaws.com
eu-north-1:
states: states.eu-north-1.amazonaws.com
eu-south-1:
states: states.eu-south-1.amazonaws.com
eu-south-2:
states: states.eu-south-2.amazonaws.com
eu-west-1:
states: states.eu-west-1.amazonaws.com
eu-west-2:
states: states.eu-west-2.amazonaws.com
eu-west-3:
states: states.eu-west-3.amazonaws.com
me-central-1:
states: states.me-central-1.amazonaws.com
me-south-1:
states: states.me-south-1.amazonaws.com
sa-east-1:
states: states.sa-east-1.amazonaws.com
us-east-1:
states: states.us-east-1.amazonaws.com
us-east-2:
states: states.us-east-2.amazonaws.com
us-gov-east-1:
states: states.us-gov-east-1.amazonaws.com
us-gov-west-1:
states: states.us-gov-west-1.amazonaws.com
us-iso-east-1:
states: states.amazonaws.com
us-iso-west-1:
states: states.amazonaws.com
us-isob-east-1:
states: states.amazonaws.com
us-west-1:
states: states.us-west-1.amazonaws.com
us-west-2:
states: states.us-west-2.amazonaws.com
Conditions:
SendAnonymousUsage:
Fn::Equals:
- Fn::FindInMap:
- Solution
- Config
- SendAnonymousUsage
- "Yes"
CreateFargateVPCResources:
Fn::Equals:
- Ref: ExistingVPCId
- ""
BoolExistingVPC:
Fn::Not:
- Fn::Equals:
- Ref: ExistingVPCId
- ""
CDKMetadataAvailable:
Fn::Or:
- Fn::Or:
- Fn::Equals:
- Ref: AWS::Region
- af-south-1
- Fn::Equals:
- Ref: AWS::Region
- ap-east-1
- Fn::Equals:
- Ref: AWS::Region
- ap-northeast-1
- Fn::Equals:
- Ref: AWS::Region
- ap-northeast-2
- Fn::Equals:
- Ref: AWS::Region
- ap-south-1
- Fn::Equals:
- Ref: AWS::Region
- ap-southeast-1
- Fn::Equals:
- Ref: AWS::Region
- ap-southeast-2
- Fn::Equals:
- Ref: AWS::Region
- ca-central-1
- Fn::Equals:
- Ref: AWS::Region
- cn-north-1
- Fn::Equals:
- Ref: AWS::Region
- cn-northwest-1
- Fn::Or:
- Fn::Equals:
- Ref: AWS::Region
- eu-central-1
- Fn::Equals:
- Ref: AWS::Region
- eu-north-1
- Fn::Equals:
- Ref: AWS::Region
- eu-south-1
- Fn::Equals:
- Ref: AWS::Region
- eu-west-1
- Fn::Equals:
- Ref: AWS::Region
- eu-west-2
- Fn::Equals:
- Ref: AWS::Region
- eu-west-3
- Fn::Equals:
- Ref: AWS::Region
- me-south-1
- Fn::Equals:
- Ref: AWS::Region
- sa-east-1
- Fn::Equals:
- Ref: AWS::Region
- us-east-1
- Fn::Equals:
- Ref: AWS::Region
- us-east-2
- Fn::Or:
- Fn::Equals:
- Ref: AWS::Region
- us-west-1
- Fn::Equals:
- Ref: AWS::Region
- us-west-2
Resources:
DLTVpcDLTFargateVpc0E6FEAB7:
Type: AWS::EC2::VPC
Properties:
CidrBlock:
Ref: VpcCidrBlock
EnableDnsHostnames: true
EnableDnsSupport: true
Tags:
- Key: Name
Value:
Ref: AWS::StackName
- Key: SolutionId
Value:
Fn::FindInMap:
- Solution
- Config
- SolutionId
Metadata:
cfn_nag:
rules_to_suppress:
- id: W60
reason: This VPC is used for the test runner Fargate tasks only, it does not require VPC flow logs.
Condition: CreateFargateVPCResources
DLTVpcDLTSubnetAAE7DDEE8:
Type: AWS::EC2::Subnet
Properties:
VpcId:
Ref: DLTVpcDLTFargateVpc0E6FEAB7
AvailabilityZone:
Fn::Select:
- 0
- Fn::GetAZs: ""
CidrBlock:
Ref: SubnetACidrBlock
Tags:
- Key: SolutionId
Value:
Fn::FindInMap:
- Solution
- Config
- SolutionId
Condition: CreateFargateVPCResources
DLTVpcDLTSubnetB294F4ED2:
Type: AWS::EC2::Subnet
Properties:
VpcId:
Ref: DLTVpcDLTFargateVpc0E6FEAB7
AvailabilityZone:
Fn::Select:
- 1
- Fn::GetAZs: ""
CidrBlock:
Ref: SubnetBCidrBlock
Tags:
- Key: SolutionId
Value:
Fn::FindInMap:
- Solution
- Config
- SolutionId
Condition: CreateFargateVPCResources
DLTVpcDLTFargateIG0E71BA5C:
Type: AWS::EC2::InternetGateway
Properties:
Tags:
- Key: SolutionId
Value:
Fn::FindInMap:
- Solution
- Config
- SolutionId
Condition: CreateFargateVPCResources
DLTVpcDLTFargateRT86406464:
Type: AWS::EC2::RouteTable
Properties:
VpcId:
Ref: DLTVpcDLTFargateVpc0E6FEAB7
Tags:
- Key: SolutionId
Value:
Fn::FindInMap:
- Solution
- Config
- SolutionId
Condition: CreateFargateVPCResources
DLTVpcDLTGatewayattachment220D400F:
Type: AWS::EC2::VPCGatewayAttachment
Properties:
VpcId:
Ref: DLTVpcDLTFargateVpc0E6FEAB7
InternetGatewayId:
Ref: DLTVpcDLTFargateIG0E71BA5C
Condition: CreateFargateVPCResources
DLTVpcDLTRouteF8F2A836:
Type: AWS::EC2::Route
Properties:
RouteTableId:
Ref: DLTVpcDLTFargateRT86406464
DestinationCidrBlock: 0.0.0.0/0
GatewayId:
Ref: DLTVpcDLTFargateIG0E71BA5C
DependsOn:
- DLTVpcDLTGatewayattachment220D400F
Condition: CreateFargateVPCResources
DLTVpcDLTRouteTableAssociationAE94A08EA:
Type: AWS::EC2::SubnetRouteTableAssociation
Properties:
RouteTableId:
Ref: DLTVpcDLTFargateRT86406464
SubnetId:
Ref: DLTVpcDLTSubnetAAE7DDEE8
Condition: CreateFargateVPCResources
DLTVpcDLTRouteTableAssociationBBED3E4B3:
Type: AWS::EC2::SubnetRouteTableAssociation
Properties:
RouteTableId:
Ref: DLTVpcDLTFargateRT86406464
SubnetId:
Ref: DLTVpcDLTSubnetB294F4ED2
Condition: CreateFargateVPCResources
DLTCommonResourcesCloudWatchLogsPolicyB29337B0:
Type: AWS::IAM::Policy
Properties:
PolicyDocument:
Statement:
- Action:
- logs:CreateLogGroup
- logs:CreateLogStream
- logs:PutLogEvents
Effect: Allow
Resource:
Fn::Join:
- ""
- - "arn:"
- Ref: AWS::Partition
- ":logs:"
- Ref: AWS::Region
- ":"
- Ref: AWS::AccountId
- :log-group:/aws/lambda/*
Version: "2012-10-17"
PolicyName: DLTCommonResourcesCloudWatchLogsPolicyB29337B0
Roles:
- Ref: DLTCustomResourceInfraCustomResourceLambdaRoleCC09066C
- Ref: DLTEcsDLTTaskExecutionRoleDE668717
- Ref: RealTimeDatarealTimeDataPublisherRoleA8976D01
- Ref: DLTLambdaFunctionLambdaResultsRole2CF2D707
- Ref: DLTLambdaFunctionDLTTestLambdaTaskRole1FDBCEDD
- Ref: DLTLambdaFunctionLambdaTaskCancelerRoleAE2C84CF
- Ref: DLTLambdaFunctionTaskStatusRole9288E645
- Ref: DLTApiDLTAPIServicesLambdaRole4465EAA4
DLTCommonResourcesLogsBucket48A2774D:
Type: AWS::S3::Bucket
Properties:
AccessControl: LogDeliveryWrite
BucketEncryption:
ServerSideEncryptionConfiguration:
- ServerSideEncryptionByDefault:
SSEAlgorithm: AES256
OwnershipControls:
Rules:
- ObjectOwnership: ObjectWriter
PublicAccessBlockConfiguration:
BlockPublicAcls: true
BlockPublicPolicy: true
IgnorePublicAcls: true
RestrictPublicBuckets: true
Tags:
- Key: SolutionId
Value:
Fn::FindInMap:
- Solution
- Config
- SolutionId
UpdateReplacePolicy: Retain
DeletionPolicy: Retain
Metadata:
cfn_nag:
rules_to_suppress:
- id: W35
reason: This is the logging bucket, it does not require logging.
- id: W51
reason: Since the bucket does not allow the public access, it does not require to have bucket policy.
DLTCommonResourcesLogsBucketPolicyAA7FFB37:
Type: AWS::S3::BucketPolicy
Properties:
Bucket:
Ref: DLTCommonResourcesLogsBucket48A2774D
PolicyDocument:
Statement:
- Action: s3:*
Condition:
Bool:
aws:SecureTransport: "false"
Effect: Deny
Principal:
AWS: "*"
Resource:
- Fn::GetAtt:
- DLTCommonResourcesLogsBucket48A2774D
- Arn
- Fn::Join:
- ""
- - Fn::GetAtt:
- DLTCommonResourcesLogsBucket48A2774D
- Arn
- /*
Version: "2012-10-17"
DLTConsoleResourcesDLTCloudFrontToS3S3Bucket4FED8B63:
Type: AWS::S3::Bucket
Properties:
BucketEncryption:
ServerSideEncryptionConfiguration:
- ServerSideEncryptionByDefault:
SSEAlgorithm: AES256
LifecycleConfiguration:
Rules:
- NoncurrentVersionTransitions:
- StorageClass: GLACIER
TransitionInDays: 90
Status: Enabled
LoggingConfiguration:
DestinationBucketName:
Ref: DLTCommonResourcesLogsBucket48A2774D
LogFilePrefix: console-bucket-access/
PublicAccessBlockConfiguration:
BlockPublicAcls: true
BlockPublicPolicy: true
IgnorePublicAcls: true
RestrictPublicBuckets: true
Tags:
- Key: SolutionId
Value:
Fn::FindInMap:
- Solution
- Config
- SolutionId
VersioningConfiguration:
Status: Enabled
UpdateReplacePolicy: Retain
DeletionPolicy: Retain
DLTConsoleResourcesDLTCloudFrontToS3S3BucketPolicyF90397AC:
Type: AWS::S3::BucketPolicy
Properties:
Bucket:
Ref: DLTConsoleResourcesDLTCloudFrontToS3S3Bucket4FED8B63
PolicyDocument:
Statement:
- Action: s3:*
Condition:
Bool:
aws:SecureTransport: "false"
Effect: Deny
Principal:
AWS: "*"
Resource:
- Fn::GetAtt:
- DLTConsoleResourcesDLTCloudFrontToS3S3Bucket4FED8B63
- Arn
- Fn::Join:
- ""
- - Fn::GetAtt:
- DLTConsoleResourcesDLTCloudFrontToS3S3Bucket4FED8B63
- Arn
- /*
- Action: s3:GetObject
Effect: Allow
Principal:
CanonicalUser:
Fn::GetAtt:
- DLTConsoleResourcesDLTCloudFrontToS3CloudFrontDistributionOrigin1S3Origin5080EA34
- S3CanonicalUserId
Resource:
Fn::Join:
- ""
- - Fn::GetAtt:
- DLTConsoleResourcesDLTCloudFrontToS3S3Bucket4FED8B63
- Arn
- /*
Version: "2012-10-17"
Metadata:
cfn_nag:
rules_to_suppress:
- id: F16
reason: Public website bucket policy requires a wildcard principal
DLTConsoleResourcesDLTCloudFrontToS3CloudFrontDistributionOrigin1S3Origin5080EA34:
Type: AWS::CloudFront::CloudFrontOriginAccessIdentity
Properties:
CloudFrontOriginAccessIdentityConfig:
Comment: Identity for DLTStackDLTConsoleResourcesDLTCloudFrontToS3CloudFrontDistributionOrigin1022BE4E8
DLTConsoleResourcesDLTCloudFrontToS3CloudFrontDistribution3EF384B4:
Type: AWS::CloudFront::Distribution
Properties:
DistributionConfig:
Comment: Website distribution for the Distributed Load Testing solution
CustomErrorResponses:
- ErrorCode: 403
ResponseCode: 200
ResponsePagePath: /index.html
- ErrorCode: 404
ResponseCode: 200
ResponsePagePath: /index.html
DefaultCacheBehavior:
CachePolicyId: 658327ea-f89d-4fab-a63d-7e88639e58f6
Compress: true
TargetOriginId: DLTStackDLTConsoleResourcesDLTCloudFrontToS3CloudFrontDistributionOrigin1022BE4E8
ViewerProtocolPolicy: redirect-to-https
DefaultRootObject: index.html
Enabled: true
HttpVersion: http2
IPV6Enabled: true
Logging:
Bucket:
Fn::GetAtt:
- DLTCommonResourcesLogsBucket48A2774D
- RegionalDomainName
Prefix: cloudfront-logs/
Origins:
- DomainName:
Fn::GetAtt:
- DLTConsoleResourcesDLTCloudFrontToS3S3Bucket4FED8B63
- RegionalDomainName
Id: DLTStackDLTConsoleResourcesDLTCloudFrontToS3CloudFrontDistributionOrigin1022BE4E8
S3OriginConfig:
OriginAccessIdentity:
Fn::Join:
- ""
- - origin-access-identity/cloudfront/
- Ref: DLTConsoleResourcesDLTCloudFrontToS3CloudFrontDistributionOrigin1S3Origin5080EA34
Tags:
- Key: SolutionId
Value:
Fn::FindInMap:
- Solution
- Config
- SolutionId
Metadata:
cfn_nag:
rules_to_suppress:
- id: W70
reason: Since the distribution uses the CloudFront domain name, CloudFront automatically sets the security policy to TLSv1 regardless of the value of MinimumProtocolVersion
DLTTestRunnerStorageDLTScenariosBucketA9290D21:
Type: AWS::S3::Bucket
Properties:
BucketEncryption:
ServerSideEncryptionConfiguration:
- ServerSideEncryptionByDefault:
SSEAlgorithm: aws:kms
CorsConfiguration:
CorsRules:
- AllowedHeaders:
- "*"
AllowedMethods:
- GET
- POST
- PUT
AllowedOrigins:
- Fn::Join:
- ""
- - https://
- Fn::GetAtt:
- DLTConsoleResourcesDLTCloudFrontToS3CloudFrontDistribution3EF384B4
- DomainName
ExposedHeaders:
- ETag
LoggingConfiguration:
DestinationBucketName:
Ref: DLTCommonResourcesLogsBucket48A2774D
LogFilePrefix: scenarios-bucket-access/
PublicAccessBlockConfiguration:
BlockPublicAcls: true
BlockPublicPolicy: true
IgnorePublicAcls: true
RestrictPublicBuckets: true
Tags:
- Key: SolutionId
Value:
Fn::FindInMap:
- Solution
- Config
- SolutionId
UpdateReplacePolicy: Retain
DeletionPolicy: Retain
DLTTestRunnerStorageDLTScenariosBucketPolicy96221788:
Type: AWS::S3::BucketPolicy
Properties:
Bucket:
Ref: DLTTestRunnerStorageDLTScenariosBucketA9290D21
PolicyDocument:
Statement:
- Action: s3:*
Condition:
Bool:
aws:SecureTransport: false
Effect: Deny
Principal:
AWS: "*"
Resource:
- Fn::GetAtt:
- DLTTestRunnerStorageDLTScenariosBucketA9290D21
- Arn
- Fn::Join:
- ""
- - Fn::GetAtt:
- DLTTestRunnerStorageDLTScenariosBucketA9290D21
- Arn
- /*
Version: "2012-10-17"
DLTTestRunnerStorageScenariosS3PolicyD20D3673:
Type: AWS::IAM::Policy
Properties:
PolicyDocument:
Statement:
- Action:
- s3:HeadObject
- s3:PutObject
- s3:GetObject
- s3:ListBucket
Effect: Allow
Resource:
- Fn::GetAtt:
- DLTTestRunnerStorageDLTScenariosBucketA9290D21
- Arn
- Fn::Join:
- ""
- - Fn::GetAtt:
- DLTTestRunnerStorageDLTScenariosBucketA9290D21
- Arn
- /*
Version: "2012-10-17"
PolicyName: DLTTestRunnerStorageScenariosS3PolicyD20D3673
Roles:
- Ref: DLTLambdaFunctionLambdaResultsRole2CF2D707
- Ref: DLTApiDLTAPIServicesLambdaRole4465EAA4
DLTTestRunnerStorageDLTScenariosTableAB6F5C2A:
Type: AWS::DynamoDB::Table
Properties:
KeySchema:
- AttributeName: testId
KeyType: HASH
AttributeDefinitions:
- AttributeName: testId
AttributeType: S
BillingMode: PAY_PER_REQUEST
PointInTimeRecoverySpecification:
PointInTimeRecoveryEnabled: true
SSESpecification:
SSEEnabled: true
Tags:
- Key: SolutionId
Value:
Fn::FindInMap:
- Solution
- Config
- SolutionId
UpdateReplacePolicy: Retain
DeletionPolicy: Retain
DLTTestRunnerStorageDLTHistoryTable46D850CC:
Type: AWS::DynamoDB::Table
Properties:
KeySchema:
- AttributeName: testId
KeyType: HASH
- AttributeName: testRunId
KeyType: RANGE
AttributeDefinitions:
- AttributeName: testId
AttributeType: S
- AttributeName: testRunId
AttributeType: S
BillingMode: PAY_PER_REQUEST
PointInTimeRecoverySpecification:
PointInTimeRecoveryEnabled: true
SSESpecification:
SSEEnabled: true
Tags:
- Key: SolutionId
Value:
Fn::FindInMap:
- Solution
- Config
- SolutionId
UpdateReplacePolicy: Retain
DeletionPolicy: Retain
DLTTestRunnerStorageHistoryDynamoDbPolicyA439CB46:
Type: AWS::IAM::Policy
Properties:
PolicyDocument:
Statement:
- Action:
- dynamodb:BatchWriteItem
- dynamodb:PutItem
- dynamodb:Query
Effect: Allow
Resource:
Fn::GetAtt:
- DLTTestRunnerStorageDLTHistoryTable46D850CC
- Arn
Version: "2012-10-17"
PolicyName: DLTTestRunnerStorageHistoryDynamoDbPolicyA439CB46
Roles:
- Ref: DLTLambdaFunctionLambdaResultsRole2CF2D707
- Ref: DLTApiDLTAPIServicesLambdaRole4465EAA4
DLTTestRunnerStorageScenarioDynamoDbPolicy8B391249:
Type: AWS::IAM::Policy
Properties:
PolicyDocument:
Statement:
- Action:
- dynamodb:DeleteItem
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:Scan
- dynamodb:UpdateItem
Effect: Allow
Resource:
Fn::GetAtt:
- DLTTestRunnerStorageDLTScenariosTableAB6F5C2A
- Arn
Version: "2012-10-17"
PolicyName: DLTTestRunnerStorageScenarioDynamoDbPolicy8B391249
Roles:
- Ref: DLTLambdaFunctionLambdaResultsRole2CF2D707
- Ref: DLTLambdaFunctionDLTTestLambdaTaskRole1FDBCEDD
- Ref: DLTLambdaFunctionTaskStatusRole9288E645
- Ref: DLTApiDLTAPIServicesLambdaRole4465EAA4
DLTCustomResourceInfraCustomResourceLambdaRoleCC09066C:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Statement:
- Action: sts:AssumeRole
Effect: Allow
Principal:
Service: lambda.amazonaws.com
Version: "2012-10-17"
Policies:
- PolicyDocument:
Statement:
- Action: s3:GetObject
Effect: Allow
Resource:
Fn::Join:
- ""
- - "arn:"
- Ref: AWS::Partition
- ":s3:::"
- Fn::Join:
- "-"
- - Fn::FindInMap:
- Solution
- Config
- S3Bucket
- Ref: AWS::Region
- /*
- Action:
- s3:PutObject
- s3:DeleteObject
Effect: Allow
Resource:
Fn::Join:
- ""
- - "arn:"
- Ref: AWS::Partition
- ":s3:::"
- Ref: DLTTestRunnerStorageDLTScenariosBucketA9290D21
- /*
- Action:
- dynamodb:PutItem
- dynamodb:DeleteItem
Effect: Allow
Resource:
Fn::Join:
- ""
- - "arn:"
- Ref: AWS::Partition
- ":dynamodb:"
- Ref: AWS::Region
- ":"
- Ref: AWS::AccountId
- :table/
- Ref: DLTTestRunnerStorageDLTScenariosTableAB6F5C2A
- Action:
- iot:DescribeEndpoint
- iot:DetachPrincipalPolicy
Effect: Allow
Resource: "*"
- Action: iot:ListTargetsForPolicy
Effect: Allow
Resource:
Fn::Join:
- ""
- - "arn:"
- Ref: AWS::Partition
- ":iot:"
- Ref: AWS::Region
- ":"
- Ref: AWS::AccountId
- :policy/*
Version: "2012-10-17"
PolicyName: CustomResourcePolicy
Tags:
- Key: SolutionId
Value:
Fn::FindInMap:
- Solution
- Config
- SolutionId
Metadata:
cfn_nag:
rules_to_suppress:
- id: W11
reason: iot:DescribeEndpoint and iot:DetachPrincipalPolicy cannot specify the resource.
DLTCustomResourceInfraCustomResourceLambdaRoleDefaultPolicyE011C696:
Type: AWS::IAM::Policy
Properties:
PolicyDocument:
Statement:
- Action: s3:PutObject
Effect: Allow
Resource:
- Fn::GetAtt:
- DLTConsoleResourcesDLTCloudFrontToS3S3Bucket4FED8B63
- Arn
- Fn::Join:
- ""
- - Fn::GetAtt:
- DLTConsoleResourcesDLTCloudFrontToS3S3Bucket4FED8B63
- Arn
- /*
Version: "2012-10-17"
PolicyName: DLTCustomResourceInfraCustomResourceLambdaRoleDefaultPolicyE011C696
Roles:
- Ref: DLTCustomResourceInfraCustomResourceLambdaRoleCC09066C
DLTCustomResourceInfraCustomResourceLambdaA4053269:
Type: AWS::Lambda::Function
Properties:
Code:
S3Bucket:
Fn::Join:
- "-"
- - Fn::FindInMap:
- Solution
- Config
- S3Bucket
- Ref: AWS::Region
S3Key:
Fn::Join:
- ""
- - Fn::FindInMap:
- Solution
- Config
- KeyPrefix
- /main-custom-resource.zip
Role:
Fn::GetAtt:
- DLTCustomResourceInfraCustomResourceLambdaRoleCC09066C
- Arn
Description: CFN Lambda backed custom resource to deploy assets to s3
Environment:
Variables:
METRIC_URL:
Fn::FindInMap:
- Solution
- Config
- URL
SOLUTION_ID:
Fn::FindInMap:
- Solution
- Config
- SolutionId
VERSION:
Fn::FindInMap:
- Solution
- Config
- CodeVersion
MAIN_REGION:
Ref: AWS::Region
DDB_TABLE:
Ref: DLTTestRunnerStorageDLTScenariosTableAB6F5C2A
S3_BUCKET:
Ref: DLTTestRunnerStorageDLTScenariosBucketA9290D21
Handler: index.handler
Runtime: nodejs16.x
Tags:
- Key: SolutionId
Value:
Fn::FindInMap:
- Solution
- Config
- SolutionId
Timeout: 120
DependsOn:
- DLTCustomResourceInfraCustomResourceLambdaRoleDefaultPolicyE011C696
- DLTCustomResourceInfraCustomResourceLambdaRoleCC09066C
Metadata:
cfn_nag:
rules_to_suppress:
- id: W58
reason: CloudWatchLogsPolicy covers a permission to write CloudWatch logs.
- id: W89
reason: VPC not needed for lambda
- id: W92
reason: Does not run concurrent executions
DLTCustomResourcesGetIotEndpoint700ABCC8:
Type: AWS::CloudFormation::CustomResource
Properties:
ServiceToken:
Fn::GetAtt:
- DLTCustomResourceInfraCustomResourceLambdaA4053269
- Arn
Resource: GetIotEndpoint
UpdateReplacePolicy: Delete
DeletionPolicy: Delete
DLTCustomResourcesCustomResourceUuidD1C03F15:
Type: AWS::CloudFormation::CustomResource