@wolsok/spa-cdk-stack 0.1.0 → 1.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3230 @@
1
+ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
+
3
+ exports[`SpaCdkStack > should create an extra BucketDeployment when using addExtraAssets 1`] = `
4
+ {
5
+ "Outputs": {
6
+ "TestSpaStackTestSpaStackARecord44B4DC9F": {
7
+ "Value": "test-domain.com",
8
+ },
9
+ "TestSpaStackTestSpaStackDistributionId87BB8166": {
10
+ "Value": {
11
+ "Ref": "TestSpaStackDistributionB76F2A7E",
12
+ },
13
+ },
14
+ "TestSpaStackTestSpaStackSiteF9552F35": {
15
+ "Value": "https://test-domain.com",
16
+ },
17
+ "TestSpaStackTestSpaStacksCertificate3188AB03": {
18
+ "Value": {
19
+ "Ref": "TestSpaStackCertificate88463A20",
20
+ },
21
+ },
22
+ "TestSpaStacktestdomaincomBucket419DCC62": {
23
+ "Value": {
24
+ "Ref": "TestSpaStackBucketAD480A08",
25
+ },
26
+ },
27
+ },
28
+ "Parameters": {
29
+ "BootstrapVersion": {
30
+ "Default": "/cdk-bootstrap/hnb659fds/version",
31
+ "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]",
32
+ "Type": "AWS::SSM::Parameter::Value<String>",
33
+ },
34
+ },
35
+ "Resources": {
36
+ "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBB049752D": {
37
+ "DependsOn": [
38
+ "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBServiceRoleDefaultPolicy0801355D",
39
+ "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBServiceRole739949D8",
40
+ ],
41
+ "Properties": {
42
+ "Code": {
43
+ "S3Bucket": "cdk-hnb659fds-assets-123456789-us-east-1",
44
+ "S3Key": "3423a042b818e31c1e34a19d6689ab2e5f9b70fcbe9e71df66f241b20a200bd9.zip",
45
+ },
46
+ "Environment": {
47
+ "Variables": {
48
+ "AWS_CA_BUNDLE": "/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem",
49
+ },
50
+ },
51
+ "Handler": "index.handler",
52
+ "Layers": [
53
+ {
54
+ "Ref": "TestSpaStackDeployWithInvalidation1AwsCliLayerBA18C0E3",
55
+ },
56
+ ],
57
+ "MemorySize": 1024,
58
+ "Role": {
59
+ "Fn::GetAtt": [
60
+ "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBServiceRole739949D8",
61
+ "Arn",
62
+ ],
63
+ },
64
+ "Runtime": "python3.13",
65
+ "Timeout": 900,
66
+ },
67
+ "Type": "AWS::Lambda::Function",
68
+ },
69
+ "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBServiceRole739949D8": {
70
+ "Properties": {
71
+ "AssumeRolePolicyDocument": {
72
+ "Statement": [
73
+ {
74
+ "Action": "sts:AssumeRole",
75
+ "Effect": "Allow",
76
+ "Principal": {
77
+ "Service": "lambda.amazonaws.com",
78
+ },
79
+ },
80
+ ],
81
+ "Version": "2012-10-17",
82
+ },
83
+ "ManagedPolicyArns": [
84
+ {
85
+ "Fn::Join": [
86
+ "",
87
+ [
88
+ "arn:",
89
+ {
90
+ "Ref": "AWS::Partition",
91
+ },
92
+ ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole",
93
+ ],
94
+ ],
95
+ },
96
+ ],
97
+ },
98
+ "Type": "AWS::IAM::Role",
99
+ },
100
+ "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBServiceRoleDefaultPolicy0801355D": {
101
+ "Properties": {
102
+ "PolicyDocument": {
103
+ "Statement": [
104
+ {
105
+ "Action": [
106
+ "s3:GetObject*",
107
+ "s3:GetBucket*",
108
+ "s3:List*",
109
+ ],
110
+ "Effect": "Allow",
111
+ "Resource": [
112
+ {
113
+ "Fn::Join": [
114
+ "",
115
+ [
116
+ "arn:",
117
+ {
118
+ "Ref": "AWS::Partition",
119
+ },
120
+ ":s3:::cdk-hnb659fds-assets-123456789-us-east-1",
121
+ ],
122
+ ],
123
+ },
124
+ {
125
+ "Fn::Join": [
126
+ "",
127
+ [
128
+ "arn:",
129
+ {
130
+ "Ref": "AWS::Partition",
131
+ },
132
+ ":s3:::cdk-hnb659fds-assets-123456789-us-east-1/*",
133
+ ],
134
+ ],
135
+ },
136
+ ],
137
+ },
138
+ {
139
+ "Action": [
140
+ "s3:GetObject*",
141
+ "s3:GetBucket*",
142
+ "s3:List*",
143
+ "s3:DeleteObject*",
144
+ "s3:PutObject",
145
+ "s3:PutObjectLegalHold",
146
+ "s3:PutObjectRetention",
147
+ "s3:PutObjectTagging",
148
+ "s3:PutObjectVersionTagging",
149
+ "s3:Abort*",
150
+ ],
151
+ "Effect": "Allow",
152
+ "Resource": [
153
+ {
154
+ "Fn::GetAtt": [
155
+ "TestSpaStackBucketAD480A08",
156
+ "Arn",
157
+ ],
158
+ },
159
+ {
160
+ "Fn::Join": [
161
+ "",
162
+ [
163
+ {
164
+ "Fn::GetAtt": [
165
+ "TestSpaStackBucketAD480A08",
166
+ "Arn",
167
+ ],
168
+ },
169
+ "/*",
170
+ ],
171
+ ],
172
+ },
173
+ ],
174
+ },
175
+ {
176
+ "Action": [
177
+ "cloudfront:GetInvalidation",
178
+ "cloudfront:CreateInvalidation",
179
+ ],
180
+ "Effect": "Allow",
181
+ "Resource": "*",
182
+ },
183
+ ],
184
+ "Version": "2012-10-17",
185
+ },
186
+ "PolicyName": "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBServiceRoleDefaultPolicy0801355D",
187
+ "Roles": [
188
+ {
189
+ "Ref": "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBServiceRole739949D8",
190
+ },
191
+ ],
192
+ },
193
+ "Type": "AWS::IAM::Policy",
194
+ },
195
+ "CustomS3AutoDeleteObjectsCustomResourceProviderHandler9D90184F": {
196
+ "DependsOn": [
197
+ "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092",
198
+ ],
199
+ "Properties": {
200
+ "Code": {
201
+ "S3Bucket": "cdk-hnb659fds-assets-123456789-us-east-1",
202
+ "S3Key": "faa95a81ae7d7373f3e1f242268f904eb748d8d0fdd306e8a6fe515a1905a7d6.zip",
203
+ },
204
+ "Description": {
205
+ "Fn::Join": [
206
+ "",
207
+ [
208
+ "Lambda function for auto-deleting objects in ",
209
+ {
210
+ "Ref": "TestSpaStackBucketAD480A08",
211
+ },
212
+ " S3 bucket.",
213
+ ],
214
+ ],
215
+ },
216
+ "Handler": "index.handler",
217
+ "MemorySize": 128,
218
+ "Role": {
219
+ "Fn::GetAtt": [
220
+ "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092",
221
+ "Arn",
222
+ ],
223
+ },
224
+ "Runtime": "nodejs22.x",
225
+ "Timeout": 900,
226
+ },
227
+ "Type": "AWS::Lambda::Function",
228
+ },
229
+ "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092": {
230
+ "Properties": {
231
+ "AssumeRolePolicyDocument": {
232
+ "Statement": [
233
+ {
234
+ "Action": "sts:AssumeRole",
235
+ "Effect": "Allow",
236
+ "Principal": {
237
+ "Service": "lambda.amazonaws.com",
238
+ },
239
+ },
240
+ ],
241
+ "Version": "2012-10-17",
242
+ },
243
+ "ManagedPolicyArns": [
244
+ {
245
+ "Fn::Sub": "arn:\${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole",
246
+ },
247
+ ],
248
+ },
249
+ "Type": "AWS::IAM::Role",
250
+ },
251
+ "TestSpaStackBucketAD480A08": {
252
+ "DeletionPolicy": "Delete",
253
+ "Properties": {
254
+ "BucketName": "test-domain.com-spa-data",
255
+ "PublicAccessBlockConfiguration": {
256
+ "BlockPublicAcls": true,
257
+ "BlockPublicPolicy": true,
258
+ "IgnorePublicAcls": true,
259
+ "RestrictPublicBuckets": true,
260
+ },
261
+ "Tags": [
262
+ {
263
+ "Key": "aws-cdk:auto-delete-objects",
264
+ "Value": "true",
265
+ },
266
+ {
267
+ "Key": "aws-cdk:cr-owned:23fee1fe",
268
+ "Value": "true",
269
+ },
270
+ {
271
+ "Key": "aws-cdk:cr-owned:5ac0cd57",
272
+ "Value": "true",
273
+ },
274
+ {
275
+ "Key": "aws-cdk:cr-owned:ffab5150",
276
+ "Value": "true",
277
+ },
278
+ ],
279
+ "WebsiteConfiguration": {
280
+ "ErrorDocument": "index.html",
281
+ "IndexDocument": "index.html",
282
+ },
283
+ },
284
+ "Type": "AWS::S3::Bucket",
285
+ "UpdateReplacePolicy": "Delete",
286
+ },
287
+ "TestSpaStackBucketAutoDeleteObjectsCustomResource8C240E97": {
288
+ "DeletionPolicy": "Delete",
289
+ "DependsOn": [
290
+ "TestSpaStackBucketPolicyE95A6639",
291
+ ],
292
+ "Properties": {
293
+ "BucketName": {
294
+ "Ref": "TestSpaStackBucketAD480A08",
295
+ },
296
+ "ServiceToken": {
297
+ "Fn::GetAtt": [
298
+ "CustomS3AutoDeleteObjectsCustomResourceProviderHandler9D90184F",
299
+ "Arn",
300
+ ],
301
+ },
302
+ },
303
+ "Type": "Custom::S3AutoDeleteObjects",
304
+ "UpdateReplacePolicy": "Delete",
305
+ },
306
+ "TestSpaStackBucketPolicyE95A6639": {
307
+ "Properties": {
308
+ "Bucket": {
309
+ "Ref": "TestSpaStackBucketAD480A08",
310
+ },
311
+ "PolicyDocument": {
312
+ "Statement": [
313
+ {
314
+ "Action": [
315
+ "s3:PutBucketPolicy",
316
+ "s3:GetBucket*",
317
+ "s3:List*",
318
+ "s3:DeleteObject*",
319
+ ],
320
+ "Effect": "Allow",
321
+ "Principal": {
322
+ "AWS": {
323
+ "Fn::GetAtt": [
324
+ "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092",
325
+ "Arn",
326
+ ],
327
+ },
328
+ },
329
+ "Resource": [
330
+ {
331
+ "Fn::GetAtt": [
332
+ "TestSpaStackBucketAD480A08",
333
+ "Arn",
334
+ ],
335
+ },
336
+ {
337
+ "Fn::Join": [
338
+ "",
339
+ [
340
+ {
341
+ "Fn::GetAtt": [
342
+ "TestSpaStackBucketAD480A08",
343
+ "Arn",
344
+ ],
345
+ },
346
+ "/*",
347
+ ],
348
+ ],
349
+ },
350
+ ],
351
+ },
352
+ {
353
+ "Action": "s3:GetObject",
354
+ "Condition": {
355
+ "StringEquals": {
356
+ "AWS:SourceArn": {
357
+ "Fn::Join": [
358
+ "",
359
+ [
360
+ "arn:",
361
+ {
362
+ "Ref": "AWS::Partition",
363
+ },
364
+ ":cloudfront::",
365
+ {
366
+ "Ref": "AWS::AccountId",
367
+ },
368
+ ":distribution/",
369
+ {
370
+ "Ref": "TestSpaStackDistributionB76F2A7E",
371
+ },
372
+ ],
373
+ ],
374
+ },
375
+ },
376
+ },
377
+ "Effect": "Allow",
378
+ "Principal": {
379
+ "Service": "cloudfront.amazonaws.com",
380
+ },
381
+ "Resource": {
382
+ "Fn::Join": [
383
+ "",
384
+ [
385
+ {
386
+ "Fn::GetAtt": [
387
+ "TestSpaStackBucketAD480A08",
388
+ "Arn",
389
+ ],
390
+ },
391
+ "/*",
392
+ ],
393
+ ],
394
+ },
395
+ },
396
+ ],
397
+ "Version": "2012-10-17",
398
+ },
399
+ },
400
+ "Type": "AWS::S3::BucketPolicy",
401
+ },
402
+ "TestSpaStackCertificate88463A20": {
403
+ "Properties": {
404
+ "DomainName": "test-domain.com",
405
+ "DomainValidationOptions": [
406
+ {
407
+ "DomainName": "test-domain.com",
408
+ },
409
+ ],
410
+ "SubjectAlternativeNames": [],
411
+ "Tags": [
412
+ {
413
+ "Key": "Name",
414
+ "Value": "TestSpaStack/TestSpaStack/Certificate",
415
+ },
416
+ ],
417
+ "ValidationMethod": "DNS",
418
+ },
419
+ "Type": "AWS::CertificateManager::Certificate",
420
+ },
421
+ "TestSpaStackDeployWithInvalidation1AwsCliLayerBA18C0E3": {
422
+ "Properties": {
423
+ "Content": {
424
+ "S3Bucket": "cdk-hnb659fds-assets-123456789-us-east-1",
425
+ "S3Key": "c49d356cac773d491c5f7ac148995a1181498a8e289429f8612a7f7e3814f535.zip",
426
+ },
427
+ "Description": "/opt/awscli/aws",
428
+ },
429
+ "Type": "AWS::Lambda::LayerVersion",
430
+ },
431
+ "TestSpaStackDeployWithInvalidation1CustomResource1024MiBDA77345F": {
432
+ "DeletionPolicy": "Delete",
433
+ "Properties": {
434
+ "DestinationBucketName": {
435
+ "Ref": "TestSpaStackBucketAD480A08",
436
+ },
437
+ "DistributionId": {
438
+ "Ref": "TestSpaStackDistributionB76F2A7E",
439
+ },
440
+ "DistributionPaths": [
441
+ "/*",
442
+ ],
443
+ "OutputObjectKeys": true,
444
+ "Prune": true,
445
+ "ServiceToken": {
446
+ "Fn::GetAtt": [
447
+ "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBB049752D",
448
+ "Arn",
449
+ ],
450
+ },
451
+ "SourceBucketNames": [
452
+ "cdk-hnb659fds-assets-123456789-us-east-1",
453
+ ],
454
+ "SourceObjectKeys": [
455
+ "226338cf3d8df99aff2ad8781a74dfe716bdb86a9a55efdbb988d0329e55784e.zip",
456
+ ],
457
+ "SystemMetadata": {
458
+ "cache-control": "no-cache",
459
+ },
460
+ "WaitForDistributionInvalidation": true,
461
+ },
462
+ "Type": "Custom::CDKBucketDeployment",
463
+ "UpdateReplacePolicy": "Delete",
464
+ },
465
+ "TestSpaStackDeployWithInvalidation2AwsCliLayer4C103DD9": {
466
+ "DependsOn": [
467
+ "TestSpaStackDeployWithInvalidation1AwsCliLayerBA18C0E3",
468
+ "TestSpaStackDeployWithInvalidation1CustomResource1024MiBDA77345F",
469
+ ],
470
+ "Properties": {
471
+ "Content": {
472
+ "S3Bucket": "cdk-hnb659fds-assets-123456789-us-east-1",
473
+ "S3Key": "c49d356cac773d491c5f7ac148995a1181498a8e289429f8612a7f7e3814f535.zip",
474
+ },
475
+ "Description": "/opt/awscli/aws",
476
+ },
477
+ "Type": "AWS::Lambda::LayerVersion",
478
+ },
479
+ "TestSpaStackDeployWithInvalidation2CustomResource1024MiBCCBCCC1C": {
480
+ "DeletionPolicy": "Delete",
481
+ "DependsOn": [
482
+ "TestSpaStackDeployWithInvalidation1AwsCliLayerBA18C0E3",
483
+ "TestSpaStackDeployWithInvalidation1CustomResource1024MiBDA77345F",
484
+ ],
485
+ "Properties": {
486
+ "DestinationBucketName": {
487
+ "Ref": "TestSpaStackBucketAD480A08",
488
+ },
489
+ "DistributionId": {
490
+ "Ref": "TestSpaStackDistributionB76F2A7E",
491
+ },
492
+ "DistributionPaths": [
493
+ "/*",
494
+ ],
495
+ "OutputObjectKeys": true,
496
+ "Prune": false,
497
+ "ServiceToken": {
498
+ "Fn::GetAtt": [
499
+ "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBB049752D",
500
+ "Arn",
501
+ ],
502
+ },
503
+ "SourceBucketNames": [
504
+ "cdk-hnb659fds-assets-123456789-us-east-1",
505
+ ],
506
+ "SourceObjectKeys": [
507
+ "6cb995cbc0e98502c08737dd41e937e60aaa12bf14a18ba9269206cdc90f5dbf.zip",
508
+ ],
509
+ "SystemMetadata": {
510
+ "cache-control": "max-age=31536000",
511
+ },
512
+ "WaitForDistributionInvalidation": true,
513
+ },
514
+ "Type": "Custom::CDKBucketDeployment",
515
+ "UpdateReplacePolicy": "Delete",
516
+ },
517
+ "TestSpaStackDeployWithInvalidation3AwsCliLayer60F92F7F": {
518
+ "DependsOn": [
519
+ "TestSpaStackDeployWithInvalidation2AwsCliLayer4C103DD9",
520
+ "TestSpaStackDeployWithInvalidation2CustomResource1024MiBCCBCCC1C",
521
+ ],
522
+ "Properties": {
523
+ "Content": {
524
+ "S3Bucket": "cdk-hnb659fds-assets-123456789-us-east-1",
525
+ "S3Key": "c49d356cac773d491c5f7ac148995a1181498a8e289429f8612a7f7e3814f535.zip",
526
+ },
527
+ "Description": "/opt/awscli/aws",
528
+ },
529
+ "Type": "AWS::Lambda::LayerVersion",
530
+ },
531
+ "TestSpaStackDeployWithInvalidation3CustomResource1024MiB2A9CDE31": {
532
+ "DeletionPolicy": "Delete",
533
+ "DependsOn": [
534
+ "TestSpaStackDeployWithInvalidation2AwsCliLayer4C103DD9",
535
+ "TestSpaStackDeployWithInvalidation2CustomResource1024MiBCCBCCC1C",
536
+ ],
537
+ "Properties": {
538
+ "DestinationBucketName": {
539
+ "Ref": "TestSpaStackBucketAD480A08",
540
+ },
541
+ "DistributionId": {
542
+ "Ref": "TestSpaStackDistributionB76F2A7E",
543
+ },
544
+ "DistributionPaths": [
545
+ "/*",
546
+ ],
547
+ "OutputObjectKeys": true,
548
+ "Prune": false,
549
+ "ServiceToken": {
550
+ "Fn::GetAtt": [
551
+ "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBB049752D",
552
+ "Arn",
553
+ ],
554
+ },
555
+ "SourceBucketNames": [
556
+ "cdk-hnb659fds-assets-123456789-us-east-1",
557
+ ],
558
+ "SourceObjectKeys": [
559
+ "3ea4a6eff43d13007d010f66f8587f95225886c56bb76e9c1dddd64e4826b5d5.zip",
560
+ ],
561
+ "SystemMetadata": {
562
+ "cache-control": "max-age=31536000",
563
+ },
564
+ "WaitForDistributionInvalidation": true,
565
+ },
566
+ "Type": "Custom::CDKBucketDeployment",
567
+ "UpdateReplacePolicy": "Delete",
568
+ },
569
+ "TestSpaStackDistributionB76F2A7E": {
570
+ "Properties": {
571
+ "DistributionConfig": {
572
+ "Aliases": [
573
+ "test-domain.com",
574
+ ],
575
+ "CustomErrorResponses": [
576
+ {
577
+ "ErrorCachingMinTTL": 1800,
578
+ "ErrorCode": 403,
579
+ "ResponseCode": 200,
580
+ "ResponsePagePath": "/index.html",
581
+ },
582
+ ],
583
+ "DefaultCacheBehavior": {
584
+ "AllowedMethods": [
585
+ "GET",
586
+ "HEAD",
587
+ "OPTIONS",
588
+ ],
589
+ "CachePolicyId": "658327ea-f89d-4fab-a63d-7e88639e58f6",
590
+ "Compress": true,
591
+ "ResponseHeadersPolicyId": {
592
+ "Ref": "TestSpaStackResponseHeadersPolicyEA652AD7",
593
+ },
594
+ "TargetOriginId": "TestSpaStackDistributionOrigin126C831C0",
595
+ "ViewerProtocolPolicy": "redirect-to-https",
596
+ },
597
+ "DefaultRootObject": "index.html",
598
+ "Enabled": true,
599
+ "HttpVersion": "http2and3",
600
+ "IPV6Enabled": true,
601
+ "Origins": [
602
+ {
603
+ "DomainName": {
604
+ "Fn::GetAtt": [
605
+ "TestSpaStackBucketAD480A08",
606
+ "RegionalDomainName",
607
+ ],
608
+ },
609
+ "Id": "TestSpaStackDistributionOrigin126C831C0",
610
+ "OriginAccessControlId": {
611
+ "Fn::GetAtt": [
612
+ "TestSpaStackDistributionOrigin1S3OriginAccessControlB7839C34",
613
+ "Id",
614
+ ],
615
+ },
616
+ "S3OriginConfig": {
617
+ "OriginAccessIdentity": "",
618
+ },
619
+ },
620
+ ],
621
+ "ViewerCertificate": {
622
+ "AcmCertificateArn": {
623
+ "Ref": "TestSpaStackCertificate88463A20",
624
+ },
625
+ "MinimumProtocolVersion": "TLSv1.2_2021",
626
+ "SslSupportMethod": "sni-only",
627
+ },
628
+ },
629
+ },
630
+ "Type": "AWS::CloudFront::Distribution",
631
+ },
632
+ "TestSpaStackDistributionOrigin1S3OriginAccessControlB7839C34": {
633
+ "Properties": {
634
+ "OriginAccessControlConfig": {
635
+ "Name": "TestSpaStackDistributionOrigin1S3OriginAccessControl98722011",
636
+ "OriginAccessControlOriginType": "s3",
637
+ "SigningBehavior": "always",
638
+ "SigningProtocol": "sigv4",
639
+ },
640
+ },
641
+ "Type": "AWS::CloudFront::OriginAccessControl",
642
+ },
643
+ "TestSpaStackResponseHeadersPolicyEA652AD7": {
644
+ "Properties": {
645
+ "ResponseHeadersPolicyConfig": {
646
+ "CorsConfig": {
647
+ "AccessControlAllowCredentials": false,
648
+ "AccessControlAllowHeaders": {
649
+ "Items": [
650
+ "*",
651
+ ],
652
+ },
653
+ "AccessControlAllowMethods": {
654
+ "Items": [
655
+ "GET",
656
+ "HEAD",
657
+ "OPTIONS",
658
+ ],
659
+ },
660
+ "AccessControlAllowOrigins": {
661
+ "Items": [
662
+ "https://test-domain.com",
663
+ "http://localhost",
664
+ "http://127.0.0.1",
665
+ ],
666
+ },
667
+ "OriginOverride": true,
668
+ },
669
+ "Name": "TestSpaStackResponseHeadersPolicy28139784",
670
+ },
671
+ },
672
+ "Type": "AWS::CloudFront::ResponseHeadersPolicy",
673
+ },
674
+ },
675
+ "Rules": {
676
+ "CheckBootstrapVersion": {
677
+ "Assertions": [
678
+ {
679
+ "Assert": {
680
+ "Fn::Not": [
681
+ {
682
+ "Fn::Contains": [
683
+ [
684
+ "1",
685
+ "2",
686
+ "3",
687
+ "4",
688
+ "5",
689
+ ],
690
+ {
691
+ "Ref": "BootstrapVersion",
692
+ },
693
+ ],
694
+ },
695
+ ],
696
+ },
697
+ "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI.",
698
+ },
699
+ ],
700
+ },
701
+ },
702
+ }
703
+ `;
704
+
705
+ exports[`SpaCdkStack > should create an extra BucketDeployment when using addExtraAssets with cache control 1`] = `
706
+ {
707
+ "Outputs": {
708
+ "TestSpaStackTestSpaStackARecord44B4DC9F": {
709
+ "Value": "test-domain.com",
710
+ },
711
+ "TestSpaStackTestSpaStackDistributionId87BB8166": {
712
+ "Value": {
713
+ "Ref": "TestSpaStackDistributionB76F2A7E",
714
+ },
715
+ },
716
+ "TestSpaStackTestSpaStackSiteF9552F35": {
717
+ "Value": "https://test-domain.com",
718
+ },
719
+ "TestSpaStackTestSpaStacksCertificate3188AB03": {
720
+ "Value": {
721
+ "Ref": "TestSpaStackCertificate88463A20",
722
+ },
723
+ },
724
+ "TestSpaStacktestdomaincomBucket419DCC62": {
725
+ "Value": {
726
+ "Ref": "TestSpaStackBucketAD480A08",
727
+ },
728
+ },
729
+ },
730
+ "Parameters": {
731
+ "BootstrapVersion": {
732
+ "Default": "/cdk-bootstrap/hnb659fds/version",
733
+ "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]",
734
+ "Type": "AWS::SSM::Parameter::Value<String>",
735
+ },
736
+ },
737
+ "Resources": {
738
+ "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBB049752D": {
739
+ "DependsOn": [
740
+ "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBServiceRoleDefaultPolicy0801355D",
741
+ "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBServiceRole739949D8",
742
+ ],
743
+ "Properties": {
744
+ "Code": {
745
+ "S3Bucket": "cdk-hnb659fds-assets-123456789-us-east-1",
746
+ "S3Key": "3423a042b818e31c1e34a19d6689ab2e5f9b70fcbe9e71df66f241b20a200bd9.zip",
747
+ },
748
+ "Environment": {
749
+ "Variables": {
750
+ "AWS_CA_BUNDLE": "/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem",
751
+ },
752
+ },
753
+ "Handler": "index.handler",
754
+ "Layers": [
755
+ {
756
+ "Ref": "TestSpaStackDeployWithInvalidation1AwsCliLayerBA18C0E3",
757
+ },
758
+ ],
759
+ "MemorySize": 1024,
760
+ "Role": {
761
+ "Fn::GetAtt": [
762
+ "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBServiceRole739949D8",
763
+ "Arn",
764
+ ],
765
+ },
766
+ "Runtime": "python3.13",
767
+ "Timeout": 900,
768
+ },
769
+ "Type": "AWS::Lambda::Function",
770
+ },
771
+ "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBServiceRole739949D8": {
772
+ "Properties": {
773
+ "AssumeRolePolicyDocument": {
774
+ "Statement": [
775
+ {
776
+ "Action": "sts:AssumeRole",
777
+ "Effect": "Allow",
778
+ "Principal": {
779
+ "Service": "lambda.amazonaws.com",
780
+ },
781
+ },
782
+ ],
783
+ "Version": "2012-10-17",
784
+ },
785
+ "ManagedPolicyArns": [
786
+ {
787
+ "Fn::Join": [
788
+ "",
789
+ [
790
+ "arn:",
791
+ {
792
+ "Ref": "AWS::Partition",
793
+ },
794
+ ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole",
795
+ ],
796
+ ],
797
+ },
798
+ ],
799
+ },
800
+ "Type": "AWS::IAM::Role",
801
+ },
802
+ "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBServiceRoleDefaultPolicy0801355D": {
803
+ "Properties": {
804
+ "PolicyDocument": {
805
+ "Statement": [
806
+ {
807
+ "Action": [
808
+ "s3:GetObject*",
809
+ "s3:GetBucket*",
810
+ "s3:List*",
811
+ ],
812
+ "Effect": "Allow",
813
+ "Resource": [
814
+ {
815
+ "Fn::Join": [
816
+ "",
817
+ [
818
+ "arn:",
819
+ {
820
+ "Ref": "AWS::Partition",
821
+ },
822
+ ":s3:::cdk-hnb659fds-assets-123456789-us-east-1",
823
+ ],
824
+ ],
825
+ },
826
+ {
827
+ "Fn::Join": [
828
+ "",
829
+ [
830
+ "arn:",
831
+ {
832
+ "Ref": "AWS::Partition",
833
+ },
834
+ ":s3:::cdk-hnb659fds-assets-123456789-us-east-1/*",
835
+ ],
836
+ ],
837
+ },
838
+ ],
839
+ },
840
+ {
841
+ "Action": [
842
+ "s3:GetObject*",
843
+ "s3:GetBucket*",
844
+ "s3:List*",
845
+ "s3:DeleteObject*",
846
+ "s3:PutObject",
847
+ "s3:PutObjectLegalHold",
848
+ "s3:PutObjectRetention",
849
+ "s3:PutObjectTagging",
850
+ "s3:PutObjectVersionTagging",
851
+ "s3:Abort*",
852
+ ],
853
+ "Effect": "Allow",
854
+ "Resource": [
855
+ {
856
+ "Fn::GetAtt": [
857
+ "TestSpaStackBucketAD480A08",
858
+ "Arn",
859
+ ],
860
+ },
861
+ {
862
+ "Fn::Join": [
863
+ "",
864
+ [
865
+ {
866
+ "Fn::GetAtt": [
867
+ "TestSpaStackBucketAD480A08",
868
+ "Arn",
869
+ ],
870
+ },
871
+ "/*",
872
+ ],
873
+ ],
874
+ },
875
+ ],
876
+ },
877
+ {
878
+ "Action": [
879
+ "cloudfront:GetInvalidation",
880
+ "cloudfront:CreateInvalidation",
881
+ ],
882
+ "Effect": "Allow",
883
+ "Resource": "*",
884
+ },
885
+ ],
886
+ "Version": "2012-10-17",
887
+ },
888
+ "PolicyName": "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBServiceRoleDefaultPolicy0801355D",
889
+ "Roles": [
890
+ {
891
+ "Ref": "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBServiceRole739949D8",
892
+ },
893
+ ],
894
+ },
895
+ "Type": "AWS::IAM::Policy",
896
+ },
897
+ "CustomS3AutoDeleteObjectsCustomResourceProviderHandler9D90184F": {
898
+ "DependsOn": [
899
+ "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092",
900
+ ],
901
+ "Properties": {
902
+ "Code": {
903
+ "S3Bucket": "cdk-hnb659fds-assets-123456789-us-east-1",
904
+ "S3Key": "faa95a81ae7d7373f3e1f242268f904eb748d8d0fdd306e8a6fe515a1905a7d6.zip",
905
+ },
906
+ "Description": {
907
+ "Fn::Join": [
908
+ "",
909
+ [
910
+ "Lambda function for auto-deleting objects in ",
911
+ {
912
+ "Ref": "TestSpaStackBucketAD480A08",
913
+ },
914
+ " S3 bucket.",
915
+ ],
916
+ ],
917
+ },
918
+ "Handler": "index.handler",
919
+ "MemorySize": 128,
920
+ "Role": {
921
+ "Fn::GetAtt": [
922
+ "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092",
923
+ "Arn",
924
+ ],
925
+ },
926
+ "Runtime": "nodejs22.x",
927
+ "Timeout": 900,
928
+ },
929
+ "Type": "AWS::Lambda::Function",
930
+ },
931
+ "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092": {
932
+ "Properties": {
933
+ "AssumeRolePolicyDocument": {
934
+ "Statement": [
935
+ {
936
+ "Action": "sts:AssumeRole",
937
+ "Effect": "Allow",
938
+ "Principal": {
939
+ "Service": "lambda.amazonaws.com",
940
+ },
941
+ },
942
+ ],
943
+ "Version": "2012-10-17",
944
+ },
945
+ "ManagedPolicyArns": [
946
+ {
947
+ "Fn::Sub": "arn:\${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole",
948
+ },
949
+ ],
950
+ },
951
+ "Type": "AWS::IAM::Role",
952
+ },
953
+ "TestSpaStackBucketAD480A08": {
954
+ "DeletionPolicy": "Delete",
955
+ "Properties": {
956
+ "BucketName": "test-domain.com-spa-data",
957
+ "PublicAccessBlockConfiguration": {
958
+ "BlockPublicAcls": true,
959
+ "BlockPublicPolicy": true,
960
+ "IgnorePublicAcls": true,
961
+ "RestrictPublicBuckets": true,
962
+ },
963
+ "Tags": [
964
+ {
965
+ "Key": "aws-cdk:auto-delete-objects",
966
+ "Value": "true",
967
+ },
968
+ {
969
+ "Key": "aws-cdk:cr-owned:23fee1fe",
970
+ "Value": "true",
971
+ },
972
+ {
973
+ "Key": "aws-cdk:cr-owned:5ac0cd57",
974
+ "Value": "true",
975
+ },
976
+ {
977
+ "Key": "aws-cdk:cr-owned:ffab5150",
978
+ "Value": "true",
979
+ },
980
+ ],
981
+ "WebsiteConfiguration": {
982
+ "ErrorDocument": "index.html",
983
+ "IndexDocument": "index.html",
984
+ },
985
+ },
986
+ "Type": "AWS::S3::Bucket",
987
+ "UpdateReplacePolicy": "Delete",
988
+ },
989
+ "TestSpaStackBucketAutoDeleteObjectsCustomResource8C240E97": {
990
+ "DeletionPolicy": "Delete",
991
+ "DependsOn": [
992
+ "TestSpaStackBucketPolicyE95A6639",
993
+ ],
994
+ "Properties": {
995
+ "BucketName": {
996
+ "Ref": "TestSpaStackBucketAD480A08",
997
+ },
998
+ "ServiceToken": {
999
+ "Fn::GetAtt": [
1000
+ "CustomS3AutoDeleteObjectsCustomResourceProviderHandler9D90184F",
1001
+ "Arn",
1002
+ ],
1003
+ },
1004
+ },
1005
+ "Type": "Custom::S3AutoDeleteObjects",
1006
+ "UpdateReplacePolicy": "Delete",
1007
+ },
1008
+ "TestSpaStackBucketPolicyE95A6639": {
1009
+ "Properties": {
1010
+ "Bucket": {
1011
+ "Ref": "TestSpaStackBucketAD480A08",
1012
+ },
1013
+ "PolicyDocument": {
1014
+ "Statement": [
1015
+ {
1016
+ "Action": [
1017
+ "s3:PutBucketPolicy",
1018
+ "s3:GetBucket*",
1019
+ "s3:List*",
1020
+ "s3:DeleteObject*",
1021
+ ],
1022
+ "Effect": "Allow",
1023
+ "Principal": {
1024
+ "AWS": {
1025
+ "Fn::GetAtt": [
1026
+ "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092",
1027
+ "Arn",
1028
+ ],
1029
+ },
1030
+ },
1031
+ "Resource": [
1032
+ {
1033
+ "Fn::GetAtt": [
1034
+ "TestSpaStackBucketAD480A08",
1035
+ "Arn",
1036
+ ],
1037
+ },
1038
+ {
1039
+ "Fn::Join": [
1040
+ "",
1041
+ [
1042
+ {
1043
+ "Fn::GetAtt": [
1044
+ "TestSpaStackBucketAD480A08",
1045
+ "Arn",
1046
+ ],
1047
+ },
1048
+ "/*",
1049
+ ],
1050
+ ],
1051
+ },
1052
+ ],
1053
+ },
1054
+ {
1055
+ "Action": "s3:GetObject",
1056
+ "Condition": {
1057
+ "StringEquals": {
1058
+ "AWS:SourceArn": {
1059
+ "Fn::Join": [
1060
+ "",
1061
+ [
1062
+ "arn:",
1063
+ {
1064
+ "Ref": "AWS::Partition",
1065
+ },
1066
+ ":cloudfront::",
1067
+ {
1068
+ "Ref": "AWS::AccountId",
1069
+ },
1070
+ ":distribution/",
1071
+ {
1072
+ "Ref": "TestSpaStackDistributionB76F2A7E",
1073
+ },
1074
+ ],
1075
+ ],
1076
+ },
1077
+ },
1078
+ },
1079
+ "Effect": "Allow",
1080
+ "Principal": {
1081
+ "Service": "cloudfront.amazonaws.com",
1082
+ },
1083
+ "Resource": {
1084
+ "Fn::Join": [
1085
+ "",
1086
+ [
1087
+ {
1088
+ "Fn::GetAtt": [
1089
+ "TestSpaStackBucketAD480A08",
1090
+ "Arn",
1091
+ ],
1092
+ },
1093
+ "/*",
1094
+ ],
1095
+ ],
1096
+ },
1097
+ },
1098
+ ],
1099
+ "Version": "2012-10-17",
1100
+ },
1101
+ },
1102
+ "Type": "AWS::S3::BucketPolicy",
1103
+ },
1104
+ "TestSpaStackCertificate88463A20": {
1105
+ "Properties": {
1106
+ "DomainName": "test-domain.com",
1107
+ "DomainValidationOptions": [
1108
+ {
1109
+ "DomainName": "test-domain.com",
1110
+ },
1111
+ ],
1112
+ "SubjectAlternativeNames": [],
1113
+ "Tags": [
1114
+ {
1115
+ "Key": "Name",
1116
+ "Value": "TestSpaStack/TestSpaStack/Certificate",
1117
+ },
1118
+ ],
1119
+ "ValidationMethod": "DNS",
1120
+ },
1121
+ "Type": "AWS::CertificateManager::Certificate",
1122
+ },
1123
+ "TestSpaStackDeployWithInvalidation1AwsCliLayerBA18C0E3": {
1124
+ "Properties": {
1125
+ "Content": {
1126
+ "S3Bucket": "cdk-hnb659fds-assets-123456789-us-east-1",
1127
+ "S3Key": "c49d356cac773d491c5f7ac148995a1181498a8e289429f8612a7f7e3814f535.zip",
1128
+ },
1129
+ "Description": "/opt/awscli/aws",
1130
+ },
1131
+ "Type": "AWS::Lambda::LayerVersion",
1132
+ },
1133
+ "TestSpaStackDeployWithInvalidation1CustomResource1024MiBDA77345F": {
1134
+ "DeletionPolicy": "Delete",
1135
+ "Properties": {
1136
+ "DestinationBucketName": {
1137
+ "Ref": "TestSpaStackBucketAD480A08",
1138
+ },
1139
+ "DistributionId": {
1140
+ "Ref": "TestSpaStackDistributionB76F2A7E",
1141
+ },
1142
+ "DistributionPaths": [
1143
+ "/*",
1144
+ ],
1145
+ "OutputObjectKeys": true,
1146
+ "Prune": true,
1147
+ "ServiceToken": {
1148
+ "Fn::GetAtt": [
1149
+ "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBB049752D",
1150
+ "Arn",
1151
+ ],
1152
+ },
1153
+ "SourceBucketNames": [
1154
+ "cdk-hnb659fds-assets-123456789-us-east-1",
1155
+ ],
1156
+ "SourceObjectKeys": [
1157
+ "226338cf3d8df99aff2ad8781a74dfe716bdb86a9a55efdbb988d0329e55784e.zip",
1158
+ ],
1159
+ "SystemMetadata": {
1160
+ "cache-control": "no-cache",
1161
+ },
1162
+ "WaitForDistributionInvalidation": true,
1163
+ },
1164
+ "Type": "Custom::CDKBucketDeployment",
1165
+ "UpdateReplacePolicy": "Delete",
1166
+ },
1167
+ "TestSpaStackDeployWithInvalidation2AwsCliLayer4C103DD9": {
1168
+ "DependsOn": [
1169
+ "TestSpaStackDeployWithInvalidation1AwsCliLayerBA18C0E3",
1170
+ "TestSpaStackDeployWithInvalidation1CustomResource1024MiBDA77345F",
1171
+ ],
1172
+ "Properties": {
1173
+ "Content": {
1174
+ "S3Bucket": "cdk-hnb659fds-assets-123456789-us-east-1",
1175
+ "S3Key": "c49d356cac773d491c5f7ac148995a1181498a8e289429f8612a7f7e3814f535.zip",
1176
+ },
1177
+ "Description": "/opt/awscli/aws",
1178
+ },
1179
+ "Type": "AWS::Lambda::LayerVersion",
1180
+ },
1181
+ "TestSpaStackDeployWithInvalidation2CustomResource1024MiBCCBCCC1C": {
1182
+ "DeletionPolicy": "Delete",
1183
+ "DependsOn": [
1184
+ "TestSpaStackDeployWithInvalidation1AwsCliLayerBA18C0E3",
1185
+ "TestSpaStackDeployWithInvalidation1CustomResource1024MiBDA77345F",
1186
+ ],
1187
+ "Properties": {
1188
+ "DestinationBucketName": {
1189
+ "Ref": "TestSpaStackBucketAD480A08",
1190
+ },
1191
+ "DistributionId": {
1192
+ "Ref": "TestSpaStackDistributionB76F2A7E",
1193
+ },
1194
+ "DistributionPaths": [
1195
+ "/*",
1196
+ ],
1197
+ "OutputObjectKeys": true,
1198
+ "Prune": false,
1199
+ "ServiceToken": {
1200
+ "Fn::GetAtt": [
1201
+ "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBB049752D",
1202
+ "Arn",
1203
+ ],
1204
+ },
1205
+ "SourceBucketNames": [
1206
+ "cdk-hnb659fds-assets-123456789-us-east-1",
1207
+ ],
1208
+ "SourceObjectKeys": [
1209
+ "6cb995cbc0e98502c08737dd41e937e60aaa12bf14a18ba9269206cdc90f5dbf.zip",
1210
+ ],
1211
+ "SystemMetadata": {
1212
+ "cache-control": "max-age=31536000",
1213
+ },
1214
+ "WaitForDistributionInvalidation": true,
1215
+ },
1216
+ "Type": "Custom::CDKBucketDeployment",
1217
+ "UpdateReplacePolicy": "Delete",
1218
+ },
1219
+ "TestSpaStackDeployWithInvalidation3AwsCliLayer60F92F7F": {
1220
+ "DependsOn": [
1221
+ "TestSpaStackDeployWithInvalidation2AwsCliLayer4C103DD9",
1222
+ "TestSpaStackDeployWithInvalidation2CustomResource1024MiBCCBCCC1C",
1223
+ ],
1224
+ "Properties": {
1225
+ "Content": {
1226
+ "S3Bucket": "cdk-hnb659fds-assets-123456789-us-east-1",
1227
+ "S3Key": "c49d356cac773d491c5f7ac148995a1181498a8e289429f8612a7f7e3814f535.zip",
1228
+ },
1229
+ "Description": "/opt/awscli/aws",
1230
+ },
1231
+ "Type": "AWS::Lambda::LayerVersion",
1232
+ },
1233
+ "TestSpaStackDeployWithInvalidation3CustomResource1024MiB2A9CDE31": {
1234
+ "DeletionPolicy": "Delete",
1235
+ "DependsOn": [
1236
+ "TestSpaStackDeployWithInvalidation2AwsCliLayer4C103DD9",
1237
+ "TestSpaStackDeployWithInvalidation2CustomResource1024MiBCCBCCC1C",
1238
+ ],
1239
+ "Properties": {
1240
+ "DestinationBucketName": {
1241
+ "Ref": "TestSpaStackBucketAD480A08",
1242
+ },
1243
+ "DistributionId": {
1244
+ "Ref": "TestSpaStackDistributionB76F2A7E",
1245
+ },
1246
+ "DistributionPaths": [
1247
+ "/*",
1248
+ ],
1249
+ "OutputObjectKeys": true,
1250
+ "Prune": false,
1251
+ "ServiceToken": {
1252
+ "Fn::GetAtt": [
1253
+ "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBB049752D",
1254
+ "Arn",
1255
+ ],
1256
+ },
1257
+ "SourceBucketNames": [
1258
+ "cdk-hnb659fds-assets-123456789-us-east-1",
1259
+ ],
1260
+ "SourceObjectKeys": [
1261
+ "3ea4a6eff43d13007d010f66f8587f95225886c56bb76e9c1dddd64e4826b5d5.zip",
1262
+ ],
1263
+ "SystemMetadata": {
1264
+ "cache-control": "max-age=123456",
1265
+ },
1266
+ "WaitForDistributionInvalidation": true,
1267
+ },
1268
+ "Type": "Custom::CDKBucketDeployment",
1269
+ "UpdateReplacePolicy": "Delete",
1270
+ },
1271
+ "TestSpaStackDistributionB76F2A7E": {
1272
+ "Properties": {
1273
+ "DistributionConfig": {
1274
+ "Aliases": [
1275
+ "test-domain.com",
1276
+ ],
1277
+ "CustomErrorResponses": [
1278
+ {
1279
+ "ErrorCachingMinTTL": 1800,
1280
+ "ErrorCode": 403,
1281
+ "ResponseCode": 200,
1282
+ "ResponsePagePath": "/index.html",
1283
+ },
1284
+ ],
1285
+ "DefaultCacheBehavior": {
1286
+ "AllowedMethods": [
1287
+ "GET",
1288
+ "HEAD",
1289
+ "OPTIONS",
1290
+ ],
1291
+ "CachePolicyId": "658327ea-f89d-4fab-a63d-7e88639e58f6",
1292
+ "Compress": true,
1293
+ "ResponseHeadersPolicyId": {
1294
+ "Ref": "TestSpaStackResponseHeadersPolicyEA652AD7",
1295
+ },
1296
+ "TargetOriginId": "TestSpaStackDistributionOrigin126C831C0",
1297
+ "ViewerProtocolPolicy": "redirect-to-https",
1298
+ },
1299
+ "DefaultRootObject": "index.html",
1300
+ "Enabled": true,
1301
+ "HttpVersion": "http2and3",
1302
+ "IPV6Enabled": true,
1303
+ "Origins": [
1304
+ {
1305
+ "DomainName": {
1306
+ "Fn::GetAtt": [
1307
+ "TestSpaStackBucketAD480A08",
1308
+ "RegionalDomainName",
1309
+ ],
1310
+ },
1311
+ "Id": "TestSpaStackDistributionOrigin126C831C0",
1312
+ "OriginAccessControlId": {
1313
+ "Fn::GetAtt": [
1314
+ "TestSpaStackDistributionOrigin1S3OriginAccessControlB7839C34",
1315
+ "Id",
1316
+ ],
1317
+ },
1318
+ "S3OriginConfig": {
1319
+ "OriginAccessIdentity": "",
1320
+ },
1321
+ },
1322
+ ],
1323
+ "ViewerCertificate": {
1324
+ "AcmCertificateArn": {
1325
+ "Ref": "TestSpaStackCertificate88463A20",
1326
+ },
1327
+ "MinimumProtocolVersion": "TLSv1.2_2021",
1328
+ "SslSupportMethod": "sni-only",
1329
+ },
1330
+ },
1331
+ },
1332
+ "Type": "AWS::CloudFront::Distribution",
1333
+ },
1334
+ "TestSpaStackDistributionOrigin1S3OriginAccessControlB7839C34": {
1335
+ "Properties": {
1336
+ "OriginAccessControlConfig": {
1337
+ "Name": "TestSpaStackDistributionOrigin1S3OriginAccessControl98722011",
1338
+ "OriginAccessControlOriginType": "s3",
1339
+ "SigningBehavior": "always",
1340
+ "SigningProtocol": "sigv4",
1341
+ },
1342
+ },
1343
+ "Type": "AWS::CloudFront::OriginAccessControl",
1344
+ },
1345
+ "TestSpaStackResponseHeadersPolicyEA652AD7": {
1346
+ "Properties": {
1347
+ "ResponseHeadersPolicyConfig": {
1348
+ "CorsConfig": {
1349
+ "AccessControlAllowCredentials": false,
1350
+ "AccessControlAllowHeaders": {
1351
+ "Items": [
1352
+ "*",
1353
+ ],
1354
+ },
1355
+ "AccessControlAllowMethods": {
1356
+ "Items": [
1357
+ "GET",
1358
+ "HEAD",
1359
+ "OPTIONS",
1360
+ ],
1361
+ },
1362
+ "AccessControlAllowOrigins": {
1363
+ "Items": [
1364
+ "https://test-domain.com",
1365
+ "http://localhost",
1366
+ "http://127.0.0.1",
1367
+ ],
1368
+ },
1369
+ "OriginOverride": true,
1370
+ },
1371
+ "Name": "TestSpaStackResponseHeadersPolicy28139784",
1372
+ },
1373
+ },
1374
+ "Type": "AWS::CloudFront::ResponseHeadersPolicy",
1375
+ },
1376
+ },
1377
+ "Rules": {
1378
+ "CheckBootstrapVersion": {
1379
+ "Assertions": [
1380
+ {
1381
+ "Assert": {
1382
+ "Fn::Not": [
1383
+ {
1384
+ "Fn::Contains": [
1385
+ [
1386
+ "1",
1387
+ "2",
1388
+ "3",
1389
+ "4",
1390
+ "5",
1391
+ ],
1392
+ {
1393
+ "Ref": "BootstrapVersion",
1394
+ },
1395
+ ],
1396
+ },
1397
+ ],
1398
+ },
1399
+ "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI.",
1400
+ },
1401
+ ],
1402
+ },
1403
+ },
1404
+ }
1405
+ `;
1406
+
1407
+ exports[`SpaCdkStack > should match snapshot 1`] = `
1408
+ {
1409
+ "Outputs": {
1410
+ "TestSpaStackTestSpaStackARecord44B4DC9F": {
1411
+ "Value": "test-domain.com",
1412
+ },
1413
+ "TestSpaStackTestSpaStackDistributionId87BB8166": {
1414
+ "Value": {
1415
+ "Ref": "TestSpaStackDistributionB76F2A7E",
1416
+ },
1417
+ },
1418
+ "TestSpaStackTestSpaStackSiteF9552F35": {
1419
+ "Value": "https://test-domain.com",
1420
+ },
1421
+ "TestSpaStackTestSpaStacksCertificate3188AB03": {
1422
+ "Value": {
1423
+ "Ref": "TestSpaStackCertificate88463A20",
1424
+ },
1425
+ },
1426
+ "TestSpaStacktestdomaincomBucket419DCC62": {
1427
+ "Value": {
1428
+ "Ref": "TestSpaStackBucketAD480A08",
1429
+ },
1430
+ },
1431
+ },
1432
+ "Parameters": {
1433
+ "BootstrapVersion": {
1434
+ "Default": "/cdk-bootstrap/hnb659fds/version",
1435
+ "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]",
1436
+ "Type": "AWS::SSM::Parameter::Value<String>",
1437
+ },
1438
+ },
1439
+ "Resources": {
1440
+ "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBB049752D": {
1441
+ "DependsOn": [
1442
+ "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBServiceRoleDefaultPolicy0801355D",
1443
+ "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBServiceRole739949D8",
1444
+ ],
1445
+ "Properties": {
1446
+ "Code": {
1447
+ "S3Bucket": "cdk-hnb659fds-assets-123456789-us-east-1",
1448
+ "S3Key": "3423a042b818e31c1e34a19d6689ab2e5f9b70fcbe9e71df66f241b20a200bd9.zip",
1449
+ },
1450
+ "Environment": {
1451
+ "Variables": {
1452
+ "AWS_CA_BUNDLE": "/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem",
1453
+ },
1454
+ },
1455
+ "Handler": "index.handler",
1456
+ "Layers": [
1457
+ {
1458
+ "Ref": "TestSpaStackDeployWithInvalidation1AwsCliLayerBA18C0E3",
1459
+ },
1460
+ ],
1461
+ "MemorySize": 1024,
1462
+ "Role": {
1463
+ "Fn::GetAtt": [
1464
+ "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBServiceRole739949D8",
1465
+ "Arn",
1466
+ ],
1467
+ },
1468
+ "Runtime": "python3.13",
1469
+ "Timeout": 900,
1470
+ },
1471
+ "Type": "AWS::Lambda::Function",
1472
+ },
1473
+ "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBServiceRole739949D8": {
1474
+ "Properties": {
1475
+ "AssumeRolePolicyDocument": {
1476
+ "Statement": [
1477
+ {
1478
+ "Action": "sts:AssumeRole",
1479
+ "Effect": "Allow",
1480
+ "Principal": {
1481
+ "Service": "lambda.amazonaws.com",
1482
+ },
1483
+ },
1484
+ ],
1485
+ "Version": "2012-10-17",
1486
+ },
1487
+ "ManagedPolicyArns": [
1488
+ {
1489
+ "Fn::Join": [
1490
+ "",
1491
+ [
1492
+ "arn:",
1493
+ {
1494
+ "Ref": "AWS::Partition",
1495
+ },
1496
+ ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole",
1497
+ ],
1498
+ ],
1499
+ },
1500
+ ],
1501
+ },
1502
+ "Type": "AWS::IAM::Role",
1503
+ },
1504
+ "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBServiceRoleDefaultPolicy0801355D": {
1505
+ "Properties": {
1506
+ "PolicyDocument": {
1507
+ "Statement": [
1508
+ {
1509
+ "Action": [
1510
+ "s3:GetObject*",
1511
+ "s3:GetBucket*",
1512
+ "s3:List*",
1513
+ ],
1514
+ "Effect": "Allow",
1515
+ "Resource": [
1516
+ {
1517
+ "Fn::Join": [
1518
+ "",
1519
+ [
1520
+ "arn:",
1521
+ {
1522
+ "Ref": "AWS::Partition",
1523
+ },
1524
+ ":s3:::cdk-hnb659fds-assets-123456789-us-east-1",
1525
+ ],
1526
+ ],
1527
+ },
1528
+ {
1529
+ "Fn::Join": [
1530
+ "",
1531
+ [
1532
+ "arn:",
1533
+ {
1534
+ "Ref": "AWS::Partition",
1535
+ },
1536
+ ":s3:::cdk-hnb659fds-assets-123456789-us-east-1/*",
1537
+ ],
1538
+ ],
1539
+ },
1540
+ ],
1541
+ },
1542
+ {
1543
+ "Action": [
1544
+ "s3:GetObject*",
1545
+ "s3:GetBucket*",
1546
+ "s3:List*",
1547
+ "s3:DeleteObject*",
1548
+ "s3:PutObject",
1549
+ "s3:PutObjectLegalHold",
1550
+ "s3:PutObjectRetention",
1551
+ "s3:PutObjectTagging",
1552
+ "s3:PutObjectVersionTagging",
1553
+ "s3:Abort*",
1554
+ ],
1555
+ "Effect": "Allow",
1556
+ "Resource": [
1557
+ {
1558
+ "Fn::GetAtt": [
1559
+ "TestSpaStackBucketAD480A08",
1560
+ "Arn",
1561
+ ],
1562
+ },
1563
+ {
1564
+ "Fn::Join": [
1565
+ "",
1566
+ [
1567
+ {
1568
+ "Fn::GetAtt": [
1569
+ "TestSpaStackBucketAD480A08",
1570
+ "Arn",
1571
+ ],
1572
+ },
1573
+ "/*",
1574
+ ],
1575
+ ],
1576
+ },
1577
+ ],
1578
+ },
1579
+ {
1580
+ "Action": [
1581
+ "cloudfront:GetInvalidation",
1582
+ "cloudfront:CreateInvalidation",
1583
+ ],
1584
+ "Effect": "Allow",
1585
+ "Resource": "*",
1586
+ },
1587
+ ],
1588
+ "Version": "2012-10-17",
1589
+ },
1590
+ "PolicyName": "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBServiceRoleDefaultPolicy0801355D",
1591
+ "Roles": [
1592
+ {
1593
+ "Ref": "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBServiceRole739949D8",
1594
+ },
1595
+ ],
1596
+ },
1597
+ "Type": "AWS::IAM::Policy",
1598
+ },
1599
+ "CustomS3AutoDeleteObjectsCustomResourceProviderHandler9D90184F": {
1600
+ "DependsOn": [
1601
+ "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092",
1602
+ ],
1603
+ "Properties": {
1604
+ "Code": {
1605
+ "S3Bucket": "cdk-hnb659fds-assets-123456789-us-east-1",
1606
+ "S3Key": "faa95a81ae7d7373f3e1f242268f904eb748d8d0fdd306e8a6fe515a1905a7d6.zip",
1607
+ },
1608
+ "Description": {
1609
+ "Fn::Join": [
1610
+ "",
1611
+ [
1612
+ "Lambda function for auto-deleting objects in ",
1613
+ {
1614
+ "Ref": "TestSpaStackBucketAD480A08",
1615
+ },
1616
+ " S3 bucket.",
1617
+ ],
1618
+ ],
1619
+ },
1620
+ "Handler": "index.handler",
1621
+ "MemorySize": 128,
1622
+ "Role": {
1623
+ "Fn::GetAtt": [
1624
+ "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092",
1625
+ "Arn",
1626
+ ],
1627
+ },
1628
+ "Runtime": "nodejs22.x",
1629
+ "Timeout": 900,
1630
+ },
1631
+ "Type": "AWS::Lambda::Function",
1632
+ },
1633
+ "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092": {
1634
+ "Properties": {
1635
+ "AssumeRolePolicyDocument": {
1636
+ "Statement": [
1637
+ {
1638
+ "Action": "sts:AssumeRole",
1639
+ "Effect": "Allow",
1640
+ "Principal": {
1641
+ "Service": "lambda.amazonaws.com",
1642
+ },
1643
+ },
1644
+ ],
1645
+ "Version": "2012-10-17",
1646
+ },
1647
+ "ManagedPolicyArns": [
1648
+ {
1649
+ "Fn::Sub": "arn:\${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole",
1650
+ },
1651
+ ],
1652
+ },
1653
+ "Type": "AWS::IAM::Role",
1654
+ },
1655
+ "TestSpaStackBucketAD480A08": {
1656
+ "DeletionPolicy": "Delete",
1657
+ "Properties": {
1658
+ "BucketName": "test-domain.com-spa-data",
1659
+ "PublicAccessBlockConfiguration": {
1660
+ "BlockPublicAcls": true,
1661
+ "BlockPublicPolicy": true,
1662
+ "IgnorePublicAcls": true,
1663
+ "RestrictPublicBuckets": true,
1664
+ },
1665
+ "Tags": [
1666
+ {
1667
+ "Key": "aws-cdk:auto-delete-objects",
1668
+ "Value": "true",
1669
+ },
1670
+ {
1671
+ "Key": "aws-cdk:cr-owned:23fee1fe",
1672
+ "Value": "true",
1673
+ },
1674
+ {
1675
+ "Key": "aws-cdk:cr-owned:ffab5150",
1676
+ "Value": "true",
1677
+ },
1678
+ ],
1679
+ "WebsiteConfiguration": {
1680
+ "ErrorDocument": "index.html",
1681
+ "IndexDocument": "index.html",
1682
+ },
1683
+ },
1684
+ "Type": "AWS::S3::Bucket",
1685
+ "UpdateReplacePolicy": "Delete",
1686
+ },
1687
+ "TestSpaStackBucketAutoDeleteObjectsCustomResource8C240E97": {
1688
+ "DeletionPolicy": "Delete",
1689
+ "DependsOn": [
1690
+ "TestSpaStackBucketPolicyE95A6639",
1691
+ ],
1692
+ "Properties": {
1693
+ "BucketName": {
1694
+ "Ref": "TestSpaStackBucketAD480A08",
1695
+ },
1696
+ "ServiceToken": {
1697
+ "Fn::GetAtt": [
1698
+ "CustomS3AutoDeleteObjectsCustomResourceProviderHandler9D90184F",
1699
+ "Arn",
1700
+ ],
1701
+ },
1702
+ },
1703
+ "Type": "Custom::S3AutoDeleteObjects",
1704
+ "UpdateReplacePolicy": "Delete",
1705
+ },
1706
+ "TestSpaStackBucketPolicyE95A6639": {
1707
+ "Properties": {
1708
+ "Bucket": {
1709
+ "Ref": "TestSpaStackBucketAD480A08",
1710
+ },
1711
+ "PolicyDocument": {
1712
+ "Statement": [
1713
+ {
1714
+ "Action": [
1715
+ "s3:PutBucketPolicy",
1716
+ "s3:GetBucket*",
1717
+ "s3:List*",
1718
+ "s3:DeleteObject*",
1719
+ ],
1720
+ "Effect": "Allow",
1721
+ "Principal": {
1722
+ "AWS": {
1723
+ "Fn::GetAtt": [
1724
+ "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092",
1725
+ "Arn",
1726
+ ],
1727
+ },
1728
+ },
1729
+ "Resource": [
1730
+ {
1731
+ "Fn::GetAtt": [
1732
+ "TestSpaStackBucketAD480A08",
1733
+ "Arn",
1734
+ ],
1735
+ },
1736
+ {
1737
+ "Fn::Join": [
1738
+ "",
1739
+ [
1740
+ {
1741
+ "Fn::GetAtt": [
1742
+ "TestSpaStackBucketAD480A08",
1743
+ "Arn",
1744
+ ],
1745
+ },
1746
+ "/*",
1747
+ ],
1748
+ ],
1749
+ },
1750
+ ],
1751
+ },
1752
+ {
1753
+ "Action": "s3:GetObject",
1754
+ "Condition": {
1755
+ "StringEquals": {
1756
+ "AWS:SourceArn": {
1757
+ "Fn::Join": [
1758
+ "",
1759
+ [
1760
+ "arn:",
1761
+ {
1762
+ "Ref": "AWS::Partition",
1763
+ },
1764
+ ":cloudfront::",
1765
+ {
1766
+ "Ref": "AWS::AccountId",
1767
+ },
1768
+ ":distribution/",
1769
+ {
1770
+ "Ref": "TestSpaStackDistributionB76F2A7E",
1771
+ },
1772
+ ],
1773
+ ],
1774
+ },
1775
+ },
1776
+ },
1777
+ "Effect": "Allow",
1778
+ "Principal": {
1779
+ "Service": "cloudfront.amazonaws.com",
1780
+ },
1781
+ "Resource": {
1782
+ "Fn::Join": [
1783
+ "",
1784
+ [
1785
+ {
1786
+ "Fn::GetAtt": [
1787
+ "TestSpaStackBucketAD480A08",
1788
+ "Arn",
1789
+ ],
1790
+ },
1791
+ "/*",
1792
+ ],
1793
+ ],
1794
+ },
1795
+ },
1796
+ ],
1797
+ "Version": "2012-10-17",
1798
+ },
1799
+ },
1800
+ "Type": "AWS::S3::BucketPolicy",
1801
+ },
1802
+ "TestSpaStackCertificate88463A20": {
1803
+ "Properties": {
1804
+ "DomainName": "test-domain.com",
1805
+ "DomainValidationOptions": [
1806
+ {
1807
+ "DomainName": "test-domain.com",
1808
+ },
1809
+ ],
1810
+ "SubjectAlternativeNames": [],
1811
+ "Tags": [
1812
+ {
1813
+ "Key": "Name",
1814
+ "Value": "TestSpaStack/TestSpaStack/Certificate",
1815
+ },
1816
+ ],
1817
+ "ValidationMethod": "DNS",
1818
+ },
1819
+ "Type": "AWS::CertificateManager::Certificate",
1820
+ },
1821
+ "TestSpaStackDeployWithInvalidation1AwsCliLayerBA18C0E3": {
1822
+ "Properties": {
1823
+ "Content": {
1824
+ "S3Bucket": "cdk-hnb659fds-assets-123456789-us-east-1",
1825
+ "S3Key": "c49d356cac773d491c5f7ac148995a1181498a8e289429f8612a7f7e3814f535.zip",
1826
+ },
1827
+ "Description": "/opt/awscli/aws",
1828
+ },
1829
+ "Type": "AWS::Lambda::LayerVersion",
1830
+ },
1831
+ "TestSpaStackDeployWithInvalidation1CustomResource1024MiBDA77345F": {
1832
+ "DeletionPolicy": "Delete",
1833
+ "Properties": {
1834
+ "DestinationBucketName": {
1835
+ "Ref": "TestSpaStackBucketAD480A08",
1836
+ },
1837
+ "DistributionId": {
1838
+ "Ref": "TestSpaStackDistributionB76F2A7E",
1839
+ },
1840
+ "DistributionPaths": [
1841
+ "/*",
1842
+ ],
1843
+ "OutputObjectKeys": true,
1844
+ "Prune": true,
1845
+ "ServiceToken": {
1846
+ "Fn::GetAtt": [
1847
+ "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBB049752D",
1848
+ "Arn",
1849
+ ],
1850
+ },
1851
+ "SourceBucketNames": [
1852
+ "cdk-hnb659fds-assets-123456789-us-east-1",
1853
+ ],
1854
+ "SourceObjectKeys": [
1855
+ "226338cf3d8df99aff2ad8781a74dfe716bdb86a9a55efdbb988d0329e55784e.zip",
1856
+ ],
1857
+ "SystemMetadata": {
1858
+ "cache-control": "no-cache",
1859
+ },
1860
+ "WaitForDistributionInvalidation": true,
1861
+ },
1862
+ "Type": "Custom::CDKBucketDeployment",
1863
+ "UpdateReplacePolicy": "Delete",
1864
+ },
1865
+ "TestSpaStackDeployWithInvalidation2AwsCliLayer4C103DD9": {
1866
+ "DependsOn": [
1867
+ "TestSpaStackDeployWithInvalidation1AwsCliLayerBA18C0E3",
1868
+ "TestSpaStackDeployWithInvalidation1CustomResource1024MiBDA77345F",
1869
+ ],
1870
+ "Properties": {
1871
+ "Content": {
1872
+ "S3Bucket": "cdk-hnb659fds-assets-123456789-us-east-1",
1873
+ "S3Key": "c49d356cac773d491c5f7ac148995a1181498a8e289429f8612a7f7e3814f535.zip",
1874
+ },
1875
+ "Description": "/opt/awscli/aws",
1876
+ },
1877
+ "Type": "AWS::Lambda::LayerVersion",
1878
+ },
1879
+ "TestSpaStackDeployWithInvalidation2CustomResource1024MiBCCBCCC1C": {
1880
+ "DeletionPolicy": "Delete",
1881
+ "DependsOn": [
1882
+ "TestSpaStackDeployWithInvalidation1AwsCliLayerBA18C0E3",
1883
+ "TestSpaStackDeployWithInvalidation1CustomResource1024MiBDA77345F",
1884
+ ],
1885
+ "Properties": {
1886
+ "DestinationBucketName": {
1887
+ "Ref": "TestSpaStackBucketAD480A08",
1888
+ },
1889
+ "DistributionId": {
1890
+ "Ref": "TestSpaStackDistributionB76F2A7E",
1891
+ },
1892
+ "DistributionPaths": [
1893
+ "/*",
1894
+ ],
1895
+ "OutputObjectKeys": true,
1896
+ "Prune": false,
1897
+ "ServiceToken": {
1898
+ "Fn::GetAtt": [
1899
+ "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBB049752D",
1900
+ "Arn",
1901
+ ],
1902
+ },
1903
+ "SourceBucketNames": [
1904
+ "cdk-hnb659fds-assets-123456789-us-east-1",
1905
+ ],
1906
+ "SourceObjectKeys": [
1907
+ "6cb995cbc0e98502c08737dd41e937e60aaa12bf14a18ba9269206cdc90f5dbf.zip",
1908
+ ],
1909
+ "SystemMetadata": {
1910
+ "cache-control": "max-age=31536000",
1911
+ },
1912
+ "WaitForDistributionInvalidation": true,
1913
+ },
1914
+ "Type": "Custom::CDKBucketDeployment",
1915
+ "UpdateReplacePolicy": "Delete",
1916
+ },
1917
+ "TestSpaStackDistributionB76F2A7E": {
1918
+ "Properties": {
1919
+ "DistributionConfig": {
1920
+ "Aliases": [
1921
+ "test-domain.com",
1922
+ ],
1923
+ "CustomErrorResponses": [
1924
+ {
1925
+ "ErrorCachingMinTTL": 1800,
1926
+ "ErrorCode": 403,
1927
+ "ResponseCode": 200,
1928
+ "ResponsePagePath": "/index.html",
1929
+ },
1930
+ ],
1931
+ "DefaultCacheBehavior": {
1932
+ "AllowedMethods": [
1933
+ "GET",
1934
+ "HEAD",
1935
+ "OPTIONS",
1936
+ ],
1937
+ "CachePolicyId": "658327ea-f89d-4fab-a63d-7e88639e58f6",
1938
+ "Compress": true,
1939
+ "ResponseHeadersPolicyId": {
1940
+ "Ref": "TestSpaStackResponseHeadersPolicyEA652AD7",
1941
+ },
1942
+ "TargetOriginId": "TestSpaStackDistributionOrigin126C831C0",
1943
+ "ViewerProtocolPolicy": "redirect-to-https",
1944
+ },
1945
+ "DefaultRootObject": "index.html",
1946
+ "Enabled": true,
1947
+ "HttpVersion": "http2and3",
1948
+ "IPV6Enabled": true,
1949
+ "Origins": [
1950
+ {
1951
+ "DomainName": {
1952
+ "Fn::GetAtt": [
1953
+ "TestSpaStackBucketAD480A08",
1954
+ "RegionalDomainName",
1955
+ ],
1956
+ },
1957
+ "Id": "TestSpaStackDistributionOrigin126C831C0",
1958
+ "OriginAccessControlId": {
1959
+ "Fn::GetAtt": [
1960
+ "TestSpaStackDistributionOrigin1S3OriginAccessControlB7839C34",
1961
+ "Id",
1962
+ ],
1963
+ },
1964
+ "S3OriginConfig": {
1965
+ "OriginAccessIdentity": "",
1966
+ },
1967
+ },
1968
+ ],
1969
+ "ViewerCertificate": {
1970
+ "AcmCertificateArn": {
1971
+ "Ref": "TestSpaStackCertificate88463A20",
1972
+ },
1973
+ "MinimumProtocolVersion": "TLSv1.2_2021",
1974
+ "SslSupportMethod": "sni-only",
1975
+ },
1976
+ },
1977
+ },
1978
+ "Type": "AWS::CloudFront::Distribution",
1979
+ },
1980
+ "TestSpaStackDistributionOrigin1S3OriginAccessControlB7839C34": {
1981
+ "Properties": {
1982
+ "OriginAccessControlConfig": {
1983
+ "Name": "TestSpaStackDistributionOrigin1S3OriginAccessControl98722011",
1984
+ "OriginAccessControlOriginType": "s3",
1985
+ "SigningBehavior": "always",
1986
+ "SigningProtocol": "sigv4",
1987
+ },
1988
+ },
1989
+ "Type": "AWS::CloudFront::OriginAccessControl",
1990
+ },
1991
+ "TestSpaStackResponseHeadersPolicyEA652AD7": {
1992
+ "Properties": {
1993
+ "ResponseHeadersPolicyConfig": {
1994
+ "CorsConfig": {
1995
+ "AccessControlAllowCredentials": false,
1996
+ "AccessControlAllowHeaders": {
1997
+ "Items": [
1998
+ "*",
1999
+ ],
2000
+ },
2001
+ "AccessControlAllowMethods": {
2002
+ "Items": [
2003
+ "GET",
2004
+ "HEAD",
2005
+ "OPTIONS",
2006
+ ],
2007
+ },
2008
+ "AccessControlAllowOrigins": {
2009
+ "Items": [
2010
+ "https://test-domain.com",
2011
+ "http://localhost",
2012
+ "http://127.0.0.1",
2013
+ ],
2014
+ },
2015
+ "OriginOverride": true,
2016
+ },
2017
+ "Name": "TestSpaStackResponseHeadersPolicy28139784",
2018
+ },
2019
+ },
2020
+ "Type": "AWS::CloudFront::ResponseHeadersPolicy",
2021
+ },
2022
+ },
2023
+ "Rules": {
2024
+ "CheckBootstrapVersion": {
2025
+ "Assertions": [
2026
+ {
2027
+ "Assert": {
2028
+ "Fn::Not": [
2029
+ {
2030
+ "Fn::Contains": [
2031
+ [
2032
+ "1",
2033
+ "2",
2034
+ "3",
2035
+ "4",
2036
+ "5",
2037
+ ],
2038
+ {
2039
+ "Ref": "BootstrapVersion",
2040
+ },
2041
+ ],
2042
+ },
2043
+ ],
2044
+ },
2045
+ "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI.",
2046
+ },
2047
+ ],
2048
+ },
2049
+ },
2050
+ }
2051
+ `;
2052
+
2053
+ exports[`SpaCdkStack > should match snapshot setting bucket removal policy to retain 1`] = `
2054
+ {
2055
+ "Outputs": {
2056
+ "TestSpaStackTestSpaStackARecord44B4DC9F": {
2057
+ "Value": "test-domain.com",
2058
+ },
2059
+ "TestSpaStackTestSpaStackDistributionId87BB8166": {
2060
+ "Value": {
2061
+ "Ref": "TestSpaStackDistributionB76F2A7E",
2062
+ },
2063
+ },
2064
+ "TestSpaStackTestSpaStackSiteF9552F35": {
2065
+ "Value": "https://test-domain.com",
2066
+ },
2067
+ "TestSpaStackTestSpaStacksCertificate3188AB03": {
2068
+ "Value": {
2069
+ "Ref": "TestSpaStackCertificate88463A20",
2070
+ },
2071
+ },
2072
+ "TestSpaStacktestdomaincomBucket419DCC62": {
2073
+ "Value": {
2074
+ "Ref": "TestSpaStackBucketAD480A08",
2075
+ },
2076
+ },
2077
+ },
2078
+ "Parameters": {
2079
+ "BootstrapVersion": {
2080
+ "Default": "/cdk-bootstrap/hnb659fds/version",
2081
+ "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]",
2082
+ "Type": "AWS::SSM::Parameter::Value<String>",
2083
+ },
2084
+ },
2085
+ "Resources": {
2086
+ "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBB049752D": {
2087
+ "DependsOn": [
2088
+ "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBServiceRoleDefaultPolicy0801355D",
2089
+ "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBServiceRole739949D8",
2090
+ ],
2091
+ "Properties": {
2092
+ "Code": {
2093
+ "S3Bucket": "cdk-hnb659fds-assets-123456789-us-east-1",
2094
+ "S3Key": "3423a042b818e31c1e34a19d6689ab2e5f9b70fcbe9e71df66f241b20a200bd9.zip",
2095
+ },
2096
+ "Environment": {
2097
+ "Variables": {
2098
+ "AWS_CA_BUNDLE": "/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem",
2099
+ },
2100
+ },
2101
+ "Handler": "index.handler",
2102
+ "Layers": [
2103
+ {
2104
+ "Ref": "TestSpaStackDeployWithInvalidation1AwsCliLayerBA18C0E3",
2105
+ },
2106
+ ],
2107
+ "MemorySize": 1024,
2108
+ "Role": {
2109
+ "Fn::GetAtt": [
2110
+ "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBServiceRole739949D8",
2111
+ "Arn",
2112
+ ],
2113
+ },
2114
+ "Runtime": "python3.13",
2115
+ "Timeout": 900,
2116
+ },
2117
+ "Type": "AWS::Lambda::Function",
2118
+ },
2119
+ "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBServiceRole739949D8": {
2120
+ "Properties": {
2121
+ "AssumeRolePolicyDocument": {
2122
+ "Statement": [
2123
+ {
2124
+ "Action": "sts:AssumeRole",
2125
+ "Effect": "Allow",
2126
+ "Principal": {
2127
+ "Service": "lambda.amazonaws.com",
2128
+ },
2129
+ },
2130
+ ],
2131
+ "Version": "2012-10-17",
2132
+ },
2133
+ "ManagedPolicyArns": [
2134
+ {
2135
+ "Fn::Join": [
2136
+ "",
2137
+ [
2138
+ "arn:",
2139
+ {
2140
+ "Ref": "AWS::Partition",
2141
+ },
2142
+ ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole",
2143
+ ],
2144
+ ],
2145
+ },
2146
+ ],
2147
+ },
2148
+ "Type": "AWS::IAM::Role",
2149
+ },
2150
+ "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBServiceRoleDefaultPolicy0801355D": {
2151
+ "Properties": {
2152
+ "PolicyDocument": {
2153
+ "Statement": [
2154
+ {
2155
+ "Action": [
2156
+ "s3:GetObject*",
2157
+ "s3:GetBucket*",
2158
+ "s3:List*",
2159
+ ],
2160
+ "Effect": "Allow",
2161
+ "Resource": [
2162
+ {
2163
+ "Fn::Join": [
2164
+ "",
2165
+ [
2166
+ "arn:",
2167
+ {
2168
+ "Ref": "AWS::Partition",
2169
+ },
2170
+ ":s3:::cdk-hnb659fds-assets-123456789-us-east-1",
2171
+ ],
2172
+ ],
2173
+ },
2174
+ {
2175
+ "Fn::Join": [
2176
+ "",
2177
+ [
2178
+ "arn:",
2179
+ {
2180
+ "Ref": "AWS::Partition",
2181
+ },
2182
+ ":s3:::cdk-hnb659fds-assets-123456789-us-east-1/*",
2183
+ ],
2184
+ ],
2185
+ },
2186
+ ],
2187
+ },
2188
+ {
2189
+ "Action": [
2190
+ "s3:GetObject*",
2191
+ "s3:GetBucket*",
2192
+ "s3:List*",
2193
+ "s3:DeleteObject*",
2194
+ "s3:PutObject",
2195
+ "s3:PutObjectLegalHold",
2196
+ "s3:PutObjectRetention",
2197
+ "s3:PutObjectTagging",
2198
+ "s3:PutObjectVersionTagging",
2199
+ "s3:Abort*",
2200
+ ],
2201
+ "Effect": "Allow",
2202
+ "Resource": [
2203
+ {
2204
+ "Fn::GetAtt": [
2205
+ "TestSpaStackBucketAD480A08",
2206
+ "Arn",
2207
+ ],
2208
+ },
2209
+ {
2210
+ "Fn::Join": [
2211
+ "",
2212
+ [
2213
+ {
2214
+ "Fn::GetAtt": [
2215
+ "TestSpaStackBucketAD480A08",
2216
+ "Arn",
2217
+ ],
2218
+ },
2219
+ "/*",
2220
+ ],
2221
+ ],
2222
+ },
2223
+ ],
2224
+ },
2225
+ {
2226
+ "Action": [
2227
+ "cloudfront:GetInvalidation",
2228
+ "cloudfront:CreateInvalidation",
2229
+ ],
2230
+ "Effect": "Allow",
2231
+ "Resource": "*",
2232
+ },
2233
+ ],
2234
+ "Version": "2012-10-17",
2235
+ },
2236
+ "PolicyName": "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBServiceRoleDefaultPolicy0801355D",
2237
+ "Roles": [
2238
+ {
2239
+ "Ref": "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBServiceRole739949D8",
2240
+ },
2241
+ ],
2242
+ },
2243
+ "Type": "AWS::IAM::Policy",
2244
+ },
2245
+ "TestSpaStackBucketAD480A08": {
2246
+ "DeletionPolicy": "RetainExceptOnCreate",
2247
+ "Properties": {
2248
+ "BucketName": "test-domain.com-spa-data",
2249
+ "PublicAccessBlockConfiguration": {
2250
+ "BlockPublicAcls": true,
2251
+ "BlockPublicPolicy": true,
2252
+ "IgnorePublicAcls": true,
2253
+ "RestrictPublicBuckets": true,
2254
+ },
2255
+ "Tags": [
2256
+ {
2257
+ "Key": "aws-cdk:cr-owned:23fee1fe",
2258
+ "Value": "true",
2259
+ },
2260
+ {
2261
+ "Key": "aws-cdk:cr-owned:ffab5150",
2262
+ "Value": "true",
2263
+ },
2264
+ ],
2265
+ "WebsiteConfiguration": {
2266
+ "ErrorDocument": "index.html",
2267
+ "IndexDocument": "index.html",
2268
+ },
2269
+ },
2270
+ "Type": "AWS::S3::Bucket",
2271
+ "UpdateReplacePolicy": "Retain",
2272
+ },
2273
+ "TestSpaStackBucketPolicyE95A6639": {
2274
+ "Properties": {
2275
+ "Bucket": {
2276
+ "Ref": "TestSpaStackBucketAD480A08",
2277
+ },
2278
+ "PolicyDocument": {
2279
+ "Statement": [
2280
+ {
2281
+ "Action": "s3:GetObject",
2282
+ "Condition": {
2283
+ "StringEquals": {
2284
+ "AWS:SourceArn": {
2285
+ "Fn::Join": [
2286
+ "",
2287
+ [
2288
+ "arn:",
2289
+ {
2290
+ "Ref": "AWS::Partition",
2291
+ },
2292
+ ":cloudfront::",
2293
+ {
2294
+ "Ref": "AWS::AccountId",
2295
+ },
2296
+ ":distribution/",
2297
+ {
2298
+ "Ref": "TestSpaStackDistributionB76F2A7E",
2299
+ },
2300
+ ],
2301
+ ],
2302
+ },
2303
+ },
2304
+ },
2305
+ "Effect": "Allow",
2306
+ "Principal": {
2307
+ "Service": "cloudfront.amazonaws.com",
2308
+ },
2309
+ "Resource": {
2310
+ "Fn::Join": [
2311
+ "",
2312
+ [
2313
+ {
2314
+ "Fn::GetAtt": [
2315
+ "TestSpaStackBucketAD480A08",
2316
+ "Arn",
2317
+ ],
2318
+ },
2319
+ "/*",
2320
+ ],
2321
+ ],
2322
+ },
2323
+ },
2324
+ ],
2325
+ "Version": "2012-10-17",
2326
+ },
2327
+ },
2328
+ "Type": "AWS::S3::BucketPolicy",
2329
+ },
2330
+ "TestSpaStackCertificate88463A20": {
2331
+ "Properties": {
2332
+ "DomainName": "test-domain.com",
2333
+ "DomainValidationOptions": [
2334
+ {
2335
+ "DomainName": "test-domain.com",
2336
+ },
2337
+ ],
2338
+ "SubjectAlternativeNames": [],
2339
+ "Tags": [
2340
+ {
2341
+ "Key": "Name",
2342
+ "Value": "TestSpaStack/TestSpaStack/Certificate",
2343
+ },
2344
+ ],
2345
+ "ValidationMethod": "DNS",
2346
+ },
2347
+ "Type": "AWS::CertificateManager::Certificate",
2348
+ },
2349
+ "TestSpaStackDeployWithInvalidation1AwsCliLayerBA18C0E3": {
2350
+ "Properties": {
2351
+ "Content": {
2352
+ "S3Bucket": "cdk-hnb659fds-assets-123456789-us-east-1",
2353
+ "S3Key": "c49d356cac773d491c5f7ac148995a1181498a8e289429f8612a7f7e3814f535.zip",
2354
+ },
2355
+ "Description": "/opt/awscli/aws",
2356
+ },
2357
+ "Type": "AWS::Lambda::LayerVersion",
2358
+ },
2359
+ "TestSpaStackDeployWithInvalidation1CustomResource1024MiBDA77345F": {
2360
+ "DeletionPolicy": "Delete",
2361
+ "Properties": {
2362
+ "DestinationBucketName": {
2363
+ "Ref": "TestSpaStackBucketAD480A08",
2364
+ },
2365
+ "DistributionId": {
2366
+ "Ref": "TestSpaStackDistributionB76F2A7E",
2367
+ },
2368
+ "DistributionPaths": [
2369
+ "/*",
2370
+ ],
2371
+ "OutputObjectKeys": true,
2372
+ "Prune": true,
2373
+ "ServiceToken": {
2374
+ "Fn::GetAtt": [
2375
+ "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBB049752D",
2376
+ "Arn",
2377
+ ],
2378
+ },
2379
+ "SourceBucketNames": [
2380
+ "cdk-hnb659fds-assets-123456789-us-east-1",
2381
+ ],
2382
+ "SourceObjectKeys": [
2383
+ "226338cf3d8df99aff2ad8781a74dfe716bdb86a9a55efdbb988d0329e55784e.zip",
2384
+ ],
2385
+ "SystemMetadata": {
2386
+ "cache-control": "no-cache",
2387
+ },
2388
+ "WaitForDistributionInvalidation": true,
2389
+ },
2390
+ "Type": "Custom::CDKBucketDeployment",
2391
+ "UpdateReplacePolicy": "Delete",
2392
+ },
2393
+ "TestSpaStackDeployWithInvalidation2AwsCliLayer4C103DD9": {
2394
+ "DependsOn": [
2395
+ "TestSpaStackDeployWithInvalidation1AwsCliLayerBA18C0E3",
2396
+ "TestSpaStackDeployWithInvalidation1CustomResource1024MiBDA77345F",
2397
+ ],
2398
+ "Properties": {
2399
+ "Content": {
2400
+ "S3Bucket": "cdk-hnb659fds-assets-123456789-us-east-1",
2401
+ "S3Key": "c49d356cac773d491c5f7ac148995a1181498a8e289429f8612a7f7e3814f535.zip",
2402
+ },
2403
+ "Description": "/opt/awscli/aws",
2404
+ },
2405
+ "Type": "AWS::Lambda::LayerVersion",
2406
+ },
2407
+ "TestSpaStackDeployWithInvalidation2CustomResource1024MiBCCBCCC1C": {
2408
+ "DeletionPolicy": "Delete",
2409
+ "DependsOn": [
2410
+ "TestSpaStackDeployWithInvalidation1AwsCliLayerBA18C0E3",
2411
+ "TestSpaStackDeployWithInvalidation1CustomResource1024MiBDA77345F",
2412
+ ],
2413
+ "Properties": {
2414
+ "DestinationBucketName": {
2415
+ "Ref": "TestSpaStackBucketAD480A08",
2416
+ },
2417
+ "DistributionId": {
2418
+ "Ref": "TestSpaStackDistributionB76F2A7E",
2419
+ },
2420
+ "DistributionPaths": [
2421
+ "/*",
2422
+ ],
2423
+ "OutputObjectKeys": true,
2424
+ "Prune": false,
2425
+ "ServiceToken": {
2426
+ "Fn::GetAtt": [
2427
+ "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBB049752D",
2428
+ "Arn",
2429
+ ],
2430
+ },
2431
+ "SourceBucketNames": [
2432
+ "cdk-hnb659fds-assets-123456789-us-east-1",
2433
+ ],
2434
+ "SourceObjectKeys": [
2435
+ "6cb995cbc0e98502c08737dd41e937e60aaa12bf14a18ba9269206cdc90f5dbf.zip",
2436
+ ],
2437
+ "SystemMetadata": {
2438
+ "cache-control": "max-age=31536000",
2439
+ },
2440
+ "WaitForDistributionInvalidation": true,
2441
+ },
2442
+ "Type": "Custom::CDKBucketDeployment",
2443
+ "UpdateReplacePolicy": "Delete",
2444
+ },
2445
+ "TestSpaStackDistributionB76F2A7E": {
2446
+ "Properties": {
2447
+ "DistributionConfig": {
2448
+ "Aliases": [
2449
+ "test-domain.com",
2450
+ ],
2451
+ "CustomErrorResponses": [
2452
+ {
2453
+ "ErrorCachingMinTTL": 1800,
2454
+ "ErrorCode": 403,
2455
+ "ResponseCode": 200,
2456
+ "ResponsePagePath": "/index.html",
2457
+ },
2458
+ ],
2459
+ "DefaultCacheBehavior": {
2460
+ "AllowedMethods": [
2461
+ "GET",
2462
+ "HEAD",
2463
+ "OPTIONS",
2464
+ ],
2465
+ "CachePolicyId": "658327ea-f89d-4fab-a63d-7e88639e58f6",
2466
+ "Compress": true,
2467
+ "ResponseHeadersPolicyId": {
2468
+ "Ref": "TestSpaStackResponseHeadersPolicyEA652AD7",
2469
+ },
2470
+ "TargetOriginId": "TestSpaStackDistributionOrigin126C831C0",
2471
+ "ViewerProtocolPolicy": "redirect-to-https",
2472
+ },
2473
+ "DefaultRootObject": "index.html",
2474
+ "Enabled": true,
2475
+ "HttpVersion": "http2and3",
2476
+ "IPV6Enabled": true,
2477
+ "Origins": [
2478
+ {
2479
+ "DomainName": {
2480
+ "Fn::GetAtt": [
2481
+ "TestSpaStackBucketAD480A08",
2482
+ "RegionalDomainName",
2483
+ ],
2484
+ },
2485
+ "Id": "TestSpaStackDistributionOrigin126C831C0",
2486
+ "OriginAccessControlId": {
2487
+ "Fn::GetAtt": [
2488
+ "TestSpaStackDistributionOrigin1S3OriginAccessControlB7839C34",
2489
+ "Id",
2490
+ ],
2491
+ },
2492
+ "S3OriginConfig": {
2493
+ "OriginAccessIdentity": "",
2494
+ },
2495
+ },
2496
+ ],
2497
+ "ViewerCertificate": {
2498
+ "AcmCertificateArn": {
2499
+ "Ref": "TestSpaStackCertificate88463A20",
2500
+ },
2501
+ "MinimumProtocolVersion": "TLSv1.2_2021",
2502
+ "SslSupportMethod": "sni-only",
2503
+ },
2504
+ },
2505
+ },
2506
+ "Type": "AWS::CloudFront::Distribution",
2507
+ },
2508
+ "TestSpaStackDistributionOrigin1S3OriginAccessControlB7839C34": {
2509
+ "Properties": {
2510
+ "OriginAccessControlConfig": {
2511
+ "Name": "TestSpaStackDistributionOrigin1S3OriginAccessControl98722011",
2512
+ "OriginAccessControlOriginType": "s3",
2513
+ "SigningBehavior": "always",
2514
+ "SigningProtocol": "sigv4",
2515
+ },
2516
+ },
2517
+ "Type": "AWS::CloudFront::OriginAccessControl",
2518
+ },
2519
+ "TestSpaStackResponseHeadersPolicyEA652AD7": {
2520
+ "Properties": {
2521
+ "ResponseHeadersPolicyConfig": {
2522
+ "CorsConfig": {
2523
+ "AccessControlAllowCredentials": false,
2524
+ "AccessControlAllowHeaders": {
2525
+ "Items": [
2526
+ "*",
2527
+ ],
2528
+ },
2529
+ "AccessControlAllowMethods": {
2530
+ "Items": [
2531
+ "GET",
2532
+ "HEAD",
2533
+ "OPTIONS",
2534
+ ],
2535
+ },
2536
+ "AccessControlAllowOrigins": {
2537
+ "Items": [
2538
+ "https://test-domain.com",
2539
+ "http://localhost",
2540
+ "http://127.0.0.1",
2541
+ ],
2542
+ },
2543
+ "OriginOverride": true,
2544
+ },
2545
+ "Name": "TestSpaStackResponseHeadersPolicy28139784",
2546
+ },
2547
+ },
2548
+ "Type": "AWS::CloudFront::ResponseHeadersPolicy",
2549
+ },
2550
+ },
2551
+ "Rules": {
2552
+ "CheckBootstrapVersion": {
2553
+ "Assertions": [
2554
+ {
2555
+ "Assert": {
2556
+ "Fn::Not": [
2557
+ {
2558
+ "Fn::Contains": [
2559
+ [
2560
+ "1",
2561
+ "2",
2562
+ "3",
2563
+ "4",
2564
+ "5",
2565
+ ],
2566
+ {
2567
+ "Ref": "BootstrapVersion",
2568
+ },
2569
+ ],
2570
+ },
2571
+ ],
2572
+ },
2573
+ "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI.",
2574
+ },
2575
+ ],
2576
+ },
2577
+ },
2578
+ }
2579
+ `;
2580
+
2581
+ exports[`SpaCdkStack > should use the main domain name even if a subdomain is provided 1`] = `
2582
+ {
2583
+ "Outputs": {
2584
+ "TestSpaStackTestSpaStackARecord44B4DC9F": {
2585
+ "Value": "subdomain.test-domain.com",
2586
+ },
2587
+ "TestSpaStackTestSpaStackDistributionId87BB8166": {
2588
+ "Value": {
2589
+ "Ref": "TestSpaStackDistributionB76F2A7E",
2590
+ },
2591
+ },
2592
+ "TestSpaStackTestSpaStackSiteF9552F35": {
2593
+ "Value": "https://subdomain.test-domain.com",
2594
+ },
2595
+ "TestSpaStackTestSpaStacksCertificate3188AB03": {
2596
+ "Value": {
2597
+ "Ref": "TestSpaStackCertificate88463A20",
2598
+ },
2599
+ },
2600
+ "TestSpaStacksubdomaintestdomaincomBucketA0C909A0": {
2601
+ "Value": {
2602
+ "Ref": "TestSpaStackBucketAD480A08",
2603
+ },
2604
+ },
2605
+ },
2606
+ "Parameters": {
2607
+ "BootstrapVersion": {
2608
+ "Default": "/cdk-bootstrap/hnb659fds/version",
2609
+ "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]",
2610
+ "Type": "AWS::SSM::Parameter::Value<String>",
2611
+ },
2612
+ },
2613
+ "Resources": {
2614
+ "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBB049752D": {
2615
+ "DependsOn": [
2616
+ "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBServiceRoleDefaultPolicy0801355D",
2617
+ "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBServiceRole739949D8",
2618
+ ],
2619
+ "Properties": {
2620
+ "Code": {
2621
+ "S3Bucket": "cdk-hnb659fds-assets-123456789-us-east-1",
2622
+ "S3Key": "3423a042b818e31c1e34a19d6689ab2e5f9b70fcbe9e71df66f241b20a200bd9.zip",
2623
+ },
2624
+ "Environment": {
2625
+ "Variables": {
2626
+ "AWS_CA_BUNDLE": "/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem",
2627
+ },
2628
+ },
2629
+ "Handler": "index.handler",
2630
+ "Layers": [
2631
+ {
2632
+ "Ref": "TestSpaStackDeployWithInvalidation1AwsCliLayerBA18C0E3",
2633
+ },
2634
+ ],
2635
+ "MemorySize": 1024,
2636
+ "Role": {
2637
+ "Fn::GetAtt": [
2638
+ "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBServiceRole739949D8",
2639
+ "Arn",
2640
+ ],
2641
+ },
2642
+ "Runtime": "python3.13",
2643
+ "Timeout": 900,
2644
+ },
2645
+ "Type": "AWS::Lambda::Function",
2646
+ },
2647
+ "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBServiceRole739949D8": {
2648
+ "Properties": {
2649
+ "AssumeRolePolicyDocument": {
2650
+ "Statement": [
2651
+ {
2652
+ "Action": "sts:AssumeRole",
2653
+ "Effect": "Allow",
2654
+ "Principal": {
2655
+ "Service": "lambda.amazonaws.com",
2656
+ },
2657
+ },
2658
+ ],
2659
+ "Version": "2012-10-17",
2660
+ },
2661
+ "ManagedPolicyArns": [
2662
+ {
2663
+ "Fn::Join": [
2664
+ "",
2665
+ [
2666
+ "arn:",
2667
+ {
2668
+ "Ref": "AWS::Partition",
2669
+ },
2670
+ ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole",
2671
+ ],
2672
+ ],
2673
+ },
2674
+ ],
2675
+ },
2676
+ "Type": "AWS::IAM::Role",
2677
+ },
2678
+ "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBServiceRoleDefaultPolicy0801355D": {
2679
+ "Properties": {
2680
+ "PolicyDocument": {
2681
+ "Statement": [
2682
+ {
2683
+ "Action": [
2684
+ "s3:GetObject*",
2685
+ "s3:GetBucket*",
2686
+ "s3:List*",
2687
+ ],
2688
+ "Effect": "Allow",
2689
+ "Resource": [
2690
+ {
2691
+ "Fn::Join": [
2692
+ "",
2693
+ [
2694
+ "arn:",
2695
+ {
2696
+ "Ref": "AWS::Partition",
2697
+ },
2698
+ ":s3:::cdk-hnb659fds-assets-123456789-us-east-1",
2699
+ ],
2700
+ ],
2701
+ },
2702
+ {
2703
+ "Fn::Join": [
2704
+ "",
2705
+ [
2706
+ "arn:",
2707
+ {
2708
+ "Ref": "AWS::Partition",
2709
+ },
2710
+ ":s3:::cdk-hnb659fds-assets-123456789-us-east-1/*",
2711
+ ],
2712
+ ],
2713
+ },
2714
+ ],
2715
+ },
2716
+ {
2717
+ "Action": [
2718
+ "s3:GetObject*",
2719
+ "s3:GetBucket*",
2720
+ "s3:List*",
2721
+ "s3:DeleteObject*",
2722
+ "s3:PutObject",
2723
+ "s3:PutObjectLegalHold",
2724
+ "s3:PutObjectRetention",
2725
+ "s3:PutObjectTagging",
2726
+ "s3:PutObjectVersionTagging",
2727
+ "s3:Abort*",
2728
+ ],
2729
+ "Effect": "Allow",
2730
+ "Resource": [
2731
+ {
2732
+ "Fn::GetAtt": [
2733
+ "TestSpaStackBucketAD480A08",
2734
+ "Arn",
2735
+ ],
2736
+ },
2737
+ {
2738
+ "Fn::Join": [
2739
+ "",
2740
+ [
2741
+ {
2742
+ "Fn::GetAtt": [
2743
+ "TestSpaStackBucketAD480A08",
2744
+ "Arn",
2745
+ ],
2746
+ },
2747
+ "/*",
2748
+ ],
2749
+ ],
2750
+ },
2751
+ ],
2752
+ },
2753
+ {
2754
+ "Action": [
2755
+ "cloudfront:GetInvalidation",
2756
+ "cloudfront:CreateInvalidation",
2757
+ ],
2758
+ "Effect": "Allow",
2759
+ "Resource": "*",
2760
+ },
2761
+ ],
2762
+ "Version": "2012-10-17",
2763
+ },
2764
+ "PolicyName": "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBServiceRoleDefaultPolicy0801355D",
2765
+ "Roles": [
2766
+ {
2767
+ "Ref": "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBServiceRole739949D8",
2768
+ },
2769
+ ],
2770
+ },
2771
+ "Type": "AWS::IAM::Policy",
2772
+ },
2773
+ "CustomS3AutoDeleteObjectsCustomResourceProviderHandler9D90184F": {
2774
+ "DependsOn": [
2775
+ "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092",
2776
+ ],
2777
+ "Properties": {
2778
+ "Code": {
2779
+ "S3Bucket": "cdk-hnb659fds-assets-123456789-us-east-1",
2780
+ "S3Key": "faa95a81ae7d7373f3e1f242268f904eb748d8d0fdd306e8a6fe515a1905a7d6.zip",
2781
+ },
2782
+ "Description": {
2783
+ "Fn::Join": [
2784
+ "",
2785
+ [
2786
+ "Lambda function for auto-deleting objects in ",
2787
+ {
2788
+ "Ref": "TestSpaStackBucketAD480A08",
2789
+ },
2790
+ " S3 bucket.",
2791
+ ],
2792
+ ],
2793
+ },
2794
+ "Handler": "index.handler",
2795
+ "MemorySize": 128,
2796
+ "Role": {
2797
+ "Fn::GetAtt": [
2798
+ "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092",
2799
+ "Arn",
2800
+ ],
2801
+ },
2802
+ "Runtime": "nodejs22.x",
2803
+ "Timeout": 900,
2804
+ },
2805
+ "Type": "AWS::Lambda::Function",
2806
+ },
2807
+ "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092": {
2808
+ "Properties": {
2809
+ "AssumeRolePolicyDocument": {
2810
+ "Statement": [
2811
+ {
2812
+ "Action": "sts:AssumeRole",
2813
+ "Effect": "Allow",
2814
+ "Principal": {
2815
+ "Service": "lambda.amazonaws.com",
2816
+ },
2817
+ },
2818
+ ],
2819
+ "Version": "2012-10-17",
2820
+ },
2821
+ "ManagedPolicyArns": [
2822
+ {
2823
+ "Fn::Sub": "arn:\${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole",
2824
+ },
2825
+ ],
2826
+ },
2827
+ "Type": "AWS::IAM::Role",
2828
+ },
2829
+ "TestSpaStackBucketAD480A08": {
2830
+ "DeletionPolicy": "Delete",
2831
+ "Properties": {
2832
+ "BucketName": "subdomain.test-domain.com-spa-data",
2833
+ "PublicAccessBlockConfiguration": {
2834
+ "BlockPublicAcls": true,
2835
+ "BlockPublicPolicy": true,
2836
+ "IgnorePublicAcls": true,
2837
+ "RestrictPublicBuckets": true,
2838
+ },
2839
+ "Tags": [
2840
+ {
2841
+ "Key": "aws-cdk:auto-delete-objects",
2842
+ "Value": "true",
2843
+ },
2844
+ {
2845
+ "Key": "aws-cdk:cr-owned:23fee1fe",
2846
+ "Value": "true",
2847
+ },
2848
+ {
2849
+ "Key": "aws-cdk:cr-owned:ffab5150",
2850
+ "Value": "true",
2851
+ },
2852
+ ],
2853
+ "WebsiteConfiguration": {
2854
+ "ErrorDocument": "index.html",
2855
+ "IndexDocument": "index.html",
2856
+ },
2857
+ },
2858
+ "Type": "AWS::S3::Bucket",
2859
+ "UpdateReplacePolicy": "Delete",
2860
+ },
2861
+ "TestSpaStackBucketAutoDeleteObjectsCustomResource8C240E97": {
2862
+ "DeletionPolicy": "Delete",
2863
+ "DependsOn": [
2864
+ "TestSpaStackBucketPolicyE95A6639",
2865
+ ],
2866
+ "Properties": {
2867
+ "BucketName": {
2868
+ "Ref": "TestSpaStackBucketAD480A08",
2869
+ },
2870
+ "ServiceToken": {
2871
+ "Fn::GetAtt": [
2872
+ "CustomS3AutoDeleteObjectsCustomResourceProviderHandler9D90184F",
2873
+ "Arn",
2874
+ ],
2875
+ },
2876
+ },
2877
+ "Type": "Custom::S3AutoDeleteObjects",
2878
+ "UpdateReplacePolicy": "Delete",
2879
+ },
2880
+ "TestSpaStackBucketPolicyE95A6639": {
2881
+ "Properties": {
2882
+ "Bucket": {
2883
+ "Ref": "TestSpaStackBucketAD480A08",
2884
+ },
2885
+ "PolicyDocument": {
2886
+ "Statement": [
2887
+ {
2888
+ "Action": [
2889
+ "s3:PutBucketPolicy",
2890
+ "s3:GetBucket*",
2891
+ "s3:List*",
2892
+ "s3:DeleteObject*",
2893
+ ],
2894
+ "Effect": "Allow",
2895
+ "Principal": {
2896
+ "AWS": {
2897
+ "Fn::GetAtt": [
2898
+ "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092",
2899
+ "Arn",
2900
+ ],
2901
+ },
2902
+ },
2903
+ "Resource": [
2904
+ {
2905
+ "Fn::GetAtt": [
2906
+ "TestSpaStackBucketAD480A08",
2907
+ "Arn",
2908
+ ],
2909
+ },
2910
+ {
2911
+ "Fn::Join": [
2912
+ "",
2913
+ [
2914
+ {
2915
+ "Fn::GetAtt": [
2916
+ "TestSpaStackBucketAD480A08",
2917
+ "Arn",
2918
+ ],
2919
+ },
2920
+ "/*",
2921
+ ],
2922
+ ],
2923
+ },
2924
+ ],
2925
+ },
2926
+ {
2927
+ "Action": "s3:GetObject",
2928
+ "Condition": {
2929
+ "StringEquals": {
2930
+ "AWS:SourceArn": {
2931
+ "Fn::Join": [
2932
+ "",
2933
+ [
2934
+ "arn:",
2935
+ {
2936
+ "Ref": "AWS::Partition",
2937
+ },
2938
+ ":cloudfront::",
2939
+ {
2940
+ "Ref": "AWS::AccountId",
2941
+ },
2942
+ ":distribution/",
2943
+ {
2944
+ "Ref": "TestSpaStackDistributionB76F2A7E",
2945
+ },
2946
+ ],
2947
+ ],
2948
+ },
2949
+ },
2950
+ },
2951
+ "Effect": "Allow",
2952
+ "Principal": {
2953
+ "Service": "cloudfront.amazonaws.com",
2954
+ },
2955
+ "Resource": {
2956
+ "Fn::Join": [
2957
+ "",
2958
+ [
2959
+ {
2960
+ "Fn::GetAtt": [
2961
+ "TestSpaStackBucketAD480A08",
2962
+ "Arn",
2963
+ ],
2964
+ },
2965
+ "/*",
2966
+ ],
2967
+ ],
2968
+ },
2969
+ },
2970
+ ],
2971
+ "Version": "2012-10-17",
2972
+ },
2973
+ },
2974
+ "Type": "AWS::S3::BucketPolicy",
2975
+ },
2976
+ "TestSpaStackCertificate88463A20": {
2977
+ "Properties": {
2978
+ "DomainName": "test-domain.com",
2979
+ "DomainValidationOptions": [
2980
+ {
2981
+ "DomainName": "test-domain.com",
2982
+ },
2983
+ {
2984
+ "DomainName": "subdomain.test-domain.com",
2985
+ },
2986
+ ],
2987
+ "SubjectAlternativeNames": [
2988
+ "subdomain.test-domain.com",
2989
+ ],
2990
+ "Tags": [
2991
+ {
2992
+ "Key": "Name",
2993
+ "Value": "TestSpaStack/TestSpaStack/Certificate",
2994
+ },
2995
+ ],
2996
+ "ValidationMethod": "DNS",
2997
+ },
2998
+ "Type": "AWS::CertificateManager::Certificate",
2999
+ },
3000
+ "TestSpaStackDeployWithInvalidation1AwsCliLayerBA18C0E3": {
3001
+ "Properties": {
3002
+ "Content": {
3003
+ "S3Bucket": "cdk-hnb659fds-assets-123456789-us-east-1",
3004
+ "S3Key": "c49d356cac773d491c5f7ac148995a1181498a8e289429f8612a7f7e3814f535.zip",
3005
+ },
3006
+ "Description": "/opt/awscli/aws",
3007
+ },
3008
+ "Type": "AWS::Lambda::LayerVersion",
3009
+ },
3010
+ "TestSpaStackDeployWithInvalidation1CustomResource1024MiBDA77345F": {
3011
+ "DeletionPolicy": "Delete",
3012
+ "Properties": {
3013
+ "DestinationBucketName": {
3014
+ "Ref": "TestSpaStackBucketAD480A08",
3015
+ },
3016
+ "DistributionId": {
3017
+ "Ref": "TestSpaStackDistributionB76F2A7E",
3018
+ },
3019
+ "DistributionPaths": [
3020
+ "/*",
3021
+ ],
3022
+ "OutputObjectKeys": true,
3023
+ "Prune": true,
3024
+ "ServiceToken": {
3025
+ "Fn::GetAtt": [
3026
+ "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBB049752D",
3027
+ "Arn",
3028
+ ],
3029
+ },
3030
+ "SourceBucketNames": [
3031
+ "cdk-hnb659fds-assets-123456789-us-east-1",
3032
+ ],
3033
+ "SourceObjectKeys": [
3034
+ "226338cf3d8df99aff2ad8781a74dfe716bdb86a9a55efdbb988d0329e55784e.zip",
3035
+ ],
3036
+ "SystemMetadata": {
3037
+ "cache-control": "no-cache",
3038
+ },
3039
+ "WaitForDistributionInvalidation": true,
3040
+ },
3041
+ "Type": "Custom::CDKBucketDeployment",
3042
+ "UpdateReplacePolicy": "Delete",
3043
+ },
3044
+ "TestSpaStackDeployWithInvalidation2AwsCliLayer4C103DD9": {
3045
+ "DependsOn": [
3046
+ "TestSpaStackDeployWithInvalidation1AwsCliLayerBA18C0E3",
3047
+ "TestSpaStackDeployWithInvalidation1CustomResource1024MiBDA77345F",
3048
+ ],
3049
+ "Properties": {
3050
+ "Content": {
3051
+ "S3Bucket": "cdk-hnb659fds-assets-123456789-us-east-1",
3052
+ "S3Key": "c49d356cac773d491c5f7ac148995a1181498a8e289429f8612a7f7e3814f535.zip",
3053
+ },
3054
+ "Description": "/opt/awscli/aws",
3055
+ },
3056
+ "Type": "AWS::Lambda::LayerVersion",
3057
+ },
3058
+ "TestSpaStackDeployWithInvalidation2CustomResource1024MiBCCBCCC1C": {
3059
+ "DeletionPolicy": "Delete",
3060
+ "DependsOn": [
3061
+ "TestSpaStackDeployWithInvalidation1AwsCliLayerBA18C0E3",
3062
+ "TestSpaStackDeployWithInvalidation1CustomResource1024MiBDA77345F",
3063
+ ],
3064
+ "Properties": {
3065
+ "DestinationBucketName": {
3066
+ "Ref": "TestSpaStackBucketAD480A08",
3067
+ },
3068
+ "DistributionId": {
3069
+ "Ref": "TestSpaStackDistributionB76F2A7E",
3070
+ },
3071
+ "DistributionPaths": [
3072
+ "/*",
3073
+ ],
3074
+ "OutputObjectKeys": true,
3075
+ "Prune": false,
3076
+ "ServiceToken": {
3077
+ "Fn::GetAtt": [
3078
+ "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1024MiBB049752D",
3079
+ "Arn",
3080
+ ],
3081
+ },
3082
+ "SourceBucketNames": [
3083
+ "cdk-hnb659fds-assets-123456789-us-east-1",
3084
+ ],
3085
+ "SourceObjectKeys": [
3086
+ "6cb995cbc0e98502c08737dd41e937e60aaa12bf14a18ba9269206cdc90f5dbf.zip",
3087
+ ],
3088
+ "SystemMetadata": {
3089
+ "cache-control": "max-age=31536000",
3090
+ },
3091
+ "WaitForDistributionInvalidation": true,
3092
+ },
3093
+ "Type": "Custom::CDKBucketDeployment",
3094
+ "UpdateReplacePolicy": "Delete",
3095
+ },
3096
+ "TestSpaStackDistributionB76F2A7E": {
3097
+ "Properties": {
3098
+ "DistributionConfig": {
3099
+ "Aliases": [
3100
+ "subdomain.test-domain.com",
3101
+ ],
3102
+ "CustomErrorResponses": [
3103
+ {
3104
+ "ErrorCachingMinTTL": 1800,
3105
+ "ErrorCode": 403,
3106
+ "ResponseCode": 200,
3107
+ "ResponsePagePath": "/index.html",
3108
+ },
3109
+ ],
3110
+ "DefaultCacheBehavior": {
3111
+ "AllowedMethods": [
3112
+ "GET",
3113
+ "HEAD",
3114
+ "OPTIONS",
3115
+ ],
3116
+ "CachePolicyId": "658327ea-f89d-4fab-a63d-7e88639e58f6",
3117
+ "Compress": true,
3118
+ "ResponseHeadersPolicyId": {
3119
+ "Ref": "TestSpaStackResponseHeadersPolicyEA652AD7",
3120
+ },
3121
+ "TargetOriginId": "TestSpaStackDistributionOrigin126C831C0",
3122
+ "ViewerProtocolPolicy": "redirect-to-https",
3123
+ },
3124
+ "DefaultRootObject": "index.html",
3125
+ "Enabled": true,
3126
+ "HttpVersion": "http2and3",
3127
+ "IPV6Enabled": true,
3128
+ "Origins": [
3129
+ {
3130
+ "DomainName": {
3131
+ "Fn::GetAtt": [
3132
+ "TestSpaStackBucketAD480A08",
3133
+ "RegionalDomainName",
3134
+ ],
3135
+ },
3136
+ "Id": "TestSpaStackDistributionOrigin126C831C0",
3137
+ "OriginAccessControlId": {
3138
+ "Fn::GetAtt": [
3139
+ "TestSpaStackDistributionOrigin1S3OriginAccessControlB7839C34",
3140
+ "Id",
3141
+ ],
3142
+ },
3143
+ "S3OriginConfig": {
3144
+ "OriginAccessIdentity": "",
3145
+ },
3146
+ },
3147
+ ],
3148
+ "ViewerCertificate": {
3149
+ "AcmCertificateArn": {
3150
+ "Ref": "TestSpaStackCertificate88463A20",
3151
+ },
3152
+ "MinimumProtocolVersion": "TLSv1.2_2021",
3153
+ "SslSupportMethod": "sni-only",
3154
+ },
3155
+ },
3156
+ },
3157
+ "Type": "AWS::CloudFront::Distribution",
3158
+ },
3159
+ "TestSpaStackDistributionOrigin1S3OriginAccessControlB7839C34": {
3160
+ "Properties": {
3161
+ "OriginAccessControlConfig": {
3162
+ "Name": "TestSpaStackDistributionOrigin1S3OriginAccessControl98722011",
3163
+ "OriginAccessControlOriginType": "s3",
3164
+ "SigningBehavior": "always",
3165
+ "SigningProtocol": "sigv4",
3166
+ },
3167
+ },
3168
+ "Type": "AWS::CloudFront::OriginAccessControl",
3169
+ },
3170
+ "TestSpaStackResponseHeadersPolicyEA652AD7": {
3171
+ "Properties": {
3172
+ "ResponseHeadersPolicyConfig": {
3173
+ "CorsConfig": {
3174
+ "AccessControlAllowCredentials": false,
3175
+ "AccessControlAllowHeaders": {
3176
+ "Items": [
3177
+ "*",
3178
+ ],
3179
+ },
3180
+ "AccessControlAllowMethods": {
3181
+ "Items": [
3182
+ "GET",
3183
+ "HEAD",
3184
+ "OPTIONS",
3185
+ ],
3186
+ },
3187
+ "AccessControlAllowOrigins": {
3188
+ "Items": [
3189
+ "https://subdomain.test-domain.com",
3190
+ "http://localhost",
3191
+ "http://127.0.0.1",
3192
+ ],
3193
+ },
3194
+ "OriginOverride": true,
3195
+ },
3196
+ "Name": "TestSpaStackResponseHeadersPolicy28139784",
3197
+ },
3198
+ },
3199
+ "Type": "AWS::CloudFront::ResponseHeadersPolicy",
3200
+ },
3201
+ },
3202
+ "Rules": {
3203
+ "CheckBootstrapVersion": {
3204
+ "Assertions": [
3205
+ {
3206
+ "Assert": {
3207
+ "Fn::Not": [
3208
+ {
3209
+ "Fn::Contains": [
3210
+ [
3211
+ "1",
3212
+ "2",
3213
+ "3",
3214
+ "4",
3215
+ "5",
3216
+ ],
3217
+ {
3218
+ "Ref": "BootstrapVersion",
3219
+ },
3220
+ ],
3221
+ },
3222
+ ],
3223
+ },
3224
+ "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI.",
3225
+ },
3226
+ ],
3227
+ },
3228
+ },
3229
+ }
3230
+ `;