Skip to content

Commit e2987eb

Browse files
authored
feat(route53-patterns): HttpsRedirect use Distribution as the default CloudFront distribution (under feature flag) (#34312)
### Issue # (if applicable) Closes #31546 ### Reason for this change `CloudFrontWebDistribution` is deprecated ### Description of changes `HttpsRedirect` use `Distribution` instead of deprecated `CloudFrontWebDistribution` under feature flag Please check template comments for explanation on each removed param: - Most of them are safe to remove since most are default - `ForwardedValues` is deprecated and replaced by `CachePolicyId` Extra: - Fix SecurityGuardian BucketEncryption of 2 related integs ### Description of how you validated changes Unit + Integ ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent adddfd0 commit e2987eb

23 files changed

+1402
-557
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-route53-patterns/test/integ.hosted-redirect-same-region.js.snapshot/cdk.out

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-route53-patterns/test/integ.hosted-redirect-same-region.js.snapshot/integ-https-redirect-same-region.assets.json

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-route53-patterns/test/integ.hosted-redirect-same-region.js.snapshot/integ-https-redirect-same-region.template.json

Lines changed: 22 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@
2929
"redirectRedirectBucketAA44E2FE": {
3030
"Type": "AWS::S3::Bucket",
3131
"Properties": {
32+
"BucketEncryption": {
33+
"ServerSideEncryptionConfiguration": [
34+
{
35+
"ServerSideEncryptionByDefault": {
36+
"SSEAlgorithm": "aws:kms"
37+
}
38+
}
39+
]
40+
},
3241
"PublicAccessBlockConfiguration": {
3342
"BlockPublicAcls": true,
3443
"BlockPublicPolicy": true,
@@ -45,7 +54,7 @@
4554
"UpdateReplacePolicy": "Delete",
4655
"DeletionPolicy": "Delete"
4756
},
48-
"redirectRedirectDistributionCFDistribution1A4C48E3": {
57+
"redirectRedirectDistribution5423F951": {
4958
"Type": "AWS::CloudFront::Distribution",
5059
"Properties": {
5160
"DistributionConfig": {
@@ -54,22 +63,9 @@
5463
],
5564
"Comment": "Redirect to aws.amazon.com from integ-same-region.example.com",
5665
"DefaultCacheBehavior": {
57-
"AllowedMethods": [
58-
"GET",
59-
"HEAD"
60-
],
61-
"CachedMethods": [
62-
"GET",
63-
"HEAD"
64-
],
66+
"CachePolicyId": "658327ea-f89d-4fab-a63d-7e88639e58f6",
6567
"Compress": true,
66-
"ForwardedValues": {
67-
"Cookies": {
68-
"Forward": "none"
69-
},
70-
"QueryString": false
71-
},
72-
"TargetOriginId": "origin1",
68+
"TargetOriginId": "integhttpsredirectsameregionredirectRedirectDistributionOrigin1609D30F4",
7369
"ViewerProtocolPolicy": "redirect-to-https"
7470
},
7571
"DefaultRootObject": "",
@@ -78,14 +74,8 @@
7874
"IPV6Enabled": true,
7975
"Origins": [
8076
{
81-
"ConnectionAttempts": 3,
82-
"ConnectionTimeout": 10,
8377
"CustomOriginConfig": {
84-
"HTTPPort": 80,
85-
"HTTPSPort": 443,
86-
"OriginKeepaliveTimeout": 5,
8778
"OriginProtocolPolicy": "http-only",
88-
"OriginReadTimeout": 30,
8979
"OriginSSLProtocols": [
9080
"TLSv1.2"
9181
]
@@ -106,14 +96,15 @@
10696
}
10797
]
10898
},
109-
"Id": "origin1"
99+
"Id": "integhttpsredirectsameregionredirectRedirectDistributionOrigin1609D30F4"
110100
}
111101
],
112102
"PriceClass": "PriceClass_All",
113103
"ViewerCertificate": {
114104
"AcmCertificateArn": {
115105
"Ref": "redirectRedirectCertificateD6C59F7F"
116106
},
107+
"MinimumProtocolVersion": "TLSv1.2_2021",
117108
"SslSupportMethod": "sni-only"
118109
}
119110
}
@@ -122,12 +113,10 @@
122113
"redirectRedirectAliasRecorde7728a9F2A656C": {
123114
"Type": "AWS::Route53::RecordSet",
124115
"Properties": {
125-
"Name": "integ-same-region.example.com.",
126-
"Type": "A",
127116
"AliasTarget": {
128117
"DNSName": {
129118
"Fn::GetAtt": [
130-
"redirectRedirectDistributionCFDistribution1A4C48E3",
119+
"redirectRedirectDistribution5423F951",
131120
"DomainName"
132121
]
133122
},
@@ -141,18 +130,18 @@
141130
]
142131
}
143132
},
144-
"HostedZoneId": "Z23ABC4XYZL05B"
133+
"HostedZoneId": "Z23ABC4XYZL05B",
134+
"Name": "integ-same-region.example.com.",
135+
"Type": "A"
145136
}
146137
},
147138
"redirectRedirectAliasRecordSixe7728a9391F03E": {
148139
"Type": "AWS::Route53::RecordSet",
149140
"Properties": {
150-
"Name": "integ-same-region.example.com.",
151-
"Type": "AAAA",
152141
"AliasTarget": {
153142
"DNSName": {
154143
"Fn::GetAtt": [
155-
"redirectRedirectDistributionCFDistribution1A4C48E3",
144+
"redirectRedirectDistribution5423F951",
156145
"DomainName"
157146
]
158147
},
@@ -166,7 +155,9 @@
166155
]
167156
}
168157
},
169-
"HostedZoneId": "Z23ABC4XYZL05B"
158+
"HostedZoneId": "Z23ABC4XYZL05B",
159+
"Name": "integ-same-region.example.com.",
160+
"Type": "AAAA"
170161
}
171162
}
172163
},

packages/@aws-cdk-testing/framework-integ/test/aws-route53-patterns/test/integ.hosted-redirect-same-region.js.snapshot/integ.json

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-route53-patterns/test/integ.hosted-redirect-same-region.js.snapshot/integtestDefaultTestDeployAssert24D5C536.assets.json

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)