Skip to content

Commit 1b35c4e

Browse files
authored
feat(cloudfront): add origin group selection criteria to L2 Distribution and L2 OriginGroup (#32740)
### Issue # (if applicable) Closes #<issue number here>. ### Reason for this change add origin selection criteria to L2 Distribution & L2 OriginGroup add unit + integration tests ### Description of changes Add Selection Criteria to Distribution L2 construct. CFN docs can be found here: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-origingroup.html#cfn-cloudfront-distribution-origingroup-selectioncriteria ### Description of how you validated changes Added unit + integration tests for this new feature - by default it can be undefined, so shouldn't impact other configurations. ### 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 78bcd09 commit 1b35c4e

15 files changed

+803
-3
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront-origins/test/integ.origin-group-selection-criteria.js.snapshot/cdk.out

+1
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-cloudfront-origins/test/integ.origin-group-selection-criteria.js.snapshot/cloudfront-origin-group-selection-criteria.assets.json

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
{
2+
"Resources": {
3+
"cg1": {
4+
"Type": "AWS::MediaPackageV2::ChannelGroup",
5+
"Properties": {
6+
"ChannelGroupName": "channelGroup1"
7+
}
8+
},
9+
"cg2": {
10+
"Type": "AWS::MediaPackageV2::ChannelGroup",
11+
"Properties": {
12+
"ChannelGroupName": "channelGroup2"
13+
}
14+
},
15+
"Distribution830FAC52": {
16+
"Type": "AWS::CloudFront::Distribution",
17+
"Properties": {
18+
"DistributionConfig": {
19+
"CacheBehaviors": [
20+
{
21+
"CachePolicyId": "658327ea-f89d-4fab-a63d-7e88639e58f6",
22+
"Compress": true,
23+
"PathPattern": "/video",
24+
"TargetOriginId": "cloudfrontorigingroupselectioncriteriaDistributionOriginGroup1518D308D",
25+
"ViewerProtocolPolicy": "allow-all"
26+
}
27+
],
28+
"DefaultCacheBehavior": {
29+
"CachePolicyId": "658327ea-f89d-4fab-a63d-7e88639e58f6",
30+
"Compress": true,
31+
"TargetOriginId": "cloudfrontorigingroupselectioncriteriaDistributionOriginGroup1518D308D",
32+
"ViewerProtocolPolicy": "allow-all"
33+
},
34+
"Enabled": true,
35+
"HttpVersion": "http2",
36+
"IPV6Enabled": true,
37+
"OriginGroups": {
38+
"Items": [
39+
{
40+
"FailoverCriteria": {
41+
"StatusCodes": {
42+
"Items": [
43+
404
44+
],
45+
"Quantity": 1
46+
}
47+
},
48+
"Id": "cloudfrontorigingroupselectioncriteriaDistributionOriginGroup1518D308D",
49+
"Members": {
50+
"Items": [
51+
{
52+
"OriginId": "cloudfrontorigingroupselectioncriteriaDistributionOrigin1AA511FA4"
53+
},
54+
{
55+
"OriginId": "cloudfrontorigingroupselectioncriteriaDistributionOrigin2AFDC8F08"
56+
}
57+
],
58+
"Quantity": 2
59+
},
60+
"SelectionCriteria": "media-quality-based"
61+
}
62+
],
63+
"Quantity": 1
64+
},
65+
"Origins": [
66+
{
67+
"CustomOriginConfig": {
68+
"OriginProtocolPolicy": "https-only",
69+
"OriginSSLProtocols": [
70+
"TLSv1.2"
71+
]
72+
},
73+
"DomainName": {
74+
"Fn::GetAtt": [
75+
"cg1",
76+
"EgressDomain"
77+
]
78+
},
79+
"Id": "cloudfrontorigingroupselectioncriteriaDistributionOrigin1AA511FA4"
80+
},
81+
{
82+
"CustomOriginConfig": {
83+
"OriginProtocolPolicy": "https-only",
84+
"OriginSSLProtocols": [
85+
"TLSv1.2"
86+
]
87+
},
88+
"DomainName": {
89+
"Fn::GetAtt": [
90+
"cg2",
91+
"EgressDomain"
92+
]
93+
},
94+
"Id": "cloudfrontorigingroupselectioncriteriaDistributionOrigin2AFDC8F08"
95+
}
96+
]
97+
}
98+
}
99+
}
100+
},
101+
"Parameters": {
102+
"BootstrapVersion": {
103+
"Type": "AWS::SSM::Parameter::Value<String>",
104+
"Default": "/cdk-bootstrap/hnb659fds/version",
105+
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
106+
}
107+
},
108+
"Rules": {
109+
"CheckBootstrapVersion": {
110+
"Assertions": [
111+
{
112+
"Assert": {
113+
"Fn::Not": [
114+
{
115+
"Fn::Contains": [
116+
[
117+
"1",
118+
"2",
119+
"3",
120+
"4",
121+
"5"
122+
],
123+
{
124+
"Ref": "BootstrapVersion"
125+
}
126+
]
127+
}
128+
]
129+
},
130+
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
131+
}
132+
]
133+
}
134+
}
135+
}

packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront-origins/test/integ.origin-group-selection-criteria.js.snapshot/integ.json

+12
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-cloudfront-origins/test/integ.origin-group-selection-criteria.js.snapshot/manifest.json

+125
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-cloudfront-origins/test/integ.origin-group-selection-criteria.js.snapshot/origingroupselectioncriteriaDefaultTestDeployAssert18CEDA1E.assets.json

+19
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-cloudfront-origins/test/integ.origin-group-selection-criteria.js.snapshot/origingroupselectioncriteriaDefaultTestDeployAssert18CEDA1E.template.json

+36
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)