-
Notifications
You must be signed in to change notification settings - Fork 4.4k
feat(cloudfront): add support for TrustedKeyGroups in Distribution and CloudFrontWebDistribution #12847
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
mergify
merged 13 commits into
aws:master
from
robertd:robertd/cloudfront-keygroups-integration
Feb 4, 2021
Merged
feat(cloudfront): add support for TrustedKeyGroups in Distribution and CloudFrontWebDistribution #12847
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
51d8dd0
feat(cloudfront): add support for TrustedKeyGroups in Distribution an…
robertd 1f02dc8
Fix typos
robertd 844a080
fix typo
robertd 01d3863
Update README.md with examples
robertd 08ef5e5
fix headers
robertd 1989b20
Merge branch 'master' into robertd/cloudfront-keygroups-integration
robertd c1b8a93
Merge branch 'master' into robertd/cloudfront-keygroups-integration
robertd e59379e
update readme
robertd a9777b1
fix casing
robertd 3562c36
bring back TrustedSigners in test
robertd 2e00072
make code pretty :)
robertd 9c7b0d2
Merge branch 'master' into robertd/cloudfront-keygroups-integration
robertd e92ec54
Merge branch 'master' into robertd/cloudfront-keygroups-integration
mergify[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
packages/@aws-cdk/aws-cloudfront/test/integ.distribution-key-group.expected.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| { | ||
| "Resources": { | ||
| "MyPublicKey78071F3D": { | ||
| "Type": "AWS::CloudFront::PublicKey", | ||
| "Properties": { | ||
| "PublicKeyConfig": { | ||
| "CallerReference": "c8752fac3fe06fc93f3fbd12d7e0282d8967409e4d", | ||
| "EncodedKey": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAudf8/iNkQgdvjEdm6xYS\nJAyxd/kGTbJfQNg9YhInb7TSm0dGu0yx8yZ3fnpmxuRPqJIlaVr+fT4YRl71gEYa\ndlhHmnVegyPNjP9dNqZ7zwNqMEPOPnS/NOHbJj1KYKpn1f8pPNycQ5MQCntKGnSj\n6fc+nbcC0joDvGz80xuy1W4hLV9oC9c3GT26xfZb2jy9MVtA3cppNuTwqrFi3t6e\n0iGpraxZlT5wewjZLpQkngqYr6s3aucPAZVsGTEYPo4nD5mswmtZOm+tgcOrivtD\n/3sD/qZLQ6c5siqyS8aTraD6y+VXugujfarTU65IeZ6QAUbLMsWuZOIi5Jn8zAwx\nNQIDAQAB\n-----END PUBLIC KEY-----", | ||
| "Name": "integdistributionkeygroupMyPublicKeyC0F3B115" | ||
| } | ||
| } | ||
| }, | ||
| "MyKeyGroupAF22FD35": { | ||
| "Type": "AWS::CloudFront::KeyGroup", | ||
| "Properties": { | ||
| "KeyGroupConfig": { | ||
| "Items": [ | ||
| { | ||
| "Ref": "MyPublicKey78071F3D" | ||
| } | ||
| ], | ||
| "Name": "integdistributionkeygroupMyKeyGroupF179E01A" | ||
| } | ||
| } | ||
| }, | ||
| "DistB3B78991": { | ||
| "Type": "AWS::CloudFront::Distribution", | ||
| "Properties": { | ||
| "DistributionConfig": { | ||
| "DefaultCacheBehavior": { | ||
| "CachePolicyId": "658327ea-f89d-4fab-a63d-7e88639e58f6", | ||
| "Compress": true, | ||
| "TargetOriginId": "integdistributionkeygroupDistOrigin1B9677703", | ||
| "TrustedKeyGroups": [ | ||
| { | ||
| "Ref": "MyKeyGroupAF22FD35" | ||
| } | ||
| ], | ||
| "ViewerProtocolPolicy": "allow-all" | ||
| }, | ||
| "Enabled": true, | ||
| "HttpVersion": "http2", | ||
| "IPV6Enabled": true, | ||
| "Origins": [ | ||
| { | ||
| "CustomOriginConfig": { | ||
| "OriginProtocolPolicy": "https-only" | ||
| }, | ||
| "DomainName": "www.example.com", | ||
| "Id": "integdistributionkeygroupDistOrigin1B9677703" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
32 changes: 32 additions & 0 deletions
32
packages/@aws-cdk/aws-cloudfront/test/integ.distribution-key-group.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| import * as cdk from '@aws-cdk/core'; | ||
| import * as cloudfront from '../lib'; | ||
| import { TestOrigin } from './test-origin'; | ||
|
|
||
| const app = new cdk.App(); | ||
| const stack = new cdk.Stack(app, 'integ-distribution-key-group'); | ||
| const publicKey = `-----BEGIN PUBLIC KEY----- | ||
| MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAudf8/iNkQgdvjEdm6xYS | ||
| JAyxd/kGTbJfQNg9YhInb7TSm0dGu0yx8yZ3fnpmxuRPqJIlaVr+fT4YRl71gEYa | ||
| dlhHmnVegyPNjP9dNqZ7zwNqMEPOPnS/NOHbJj1KYKpn1f8pPNycQ5MQCntKGnSj | ||
| 6fc+nbcC0joDvGz80xuy1W4hLV9oC9c3GT26xfZb2jy9MVtA3cppNuTwqrFi3t6e | ||
| 0iGpraxZlT5wewjZLpQkngqYr6s3aucPAZVsGTEYPo4nD5mswmtZOm+tgcOrivtD | ||
| /3sD/qZLQ6c5siqyS8aTraD6y+VXugujfarTU65IeZ6QAUbLMsWuZOIi5Jn8zAwx | ||
| NQIDAQAB | ||
| -----END PUBLIC KEY-----`; | ||
|
|
||
| new cloudfront.Distribution(stack, 'Dist', { | ||
| defaultBehavior: { | ||
| origin: new TestOrigin('www.example.com'), | ||
| trustedKeyGroups: [ | ||
| new cloudfront.KeyGroup(stack, 'MyKeyGroup', { | ||
| items: [ | ||
| new cloudfront.PublicKey(stack, 'MyPublicKey', { | ||
| encodedKey: publicKey, | ||
| }), | ||
| ], | ||
| }), | ||
| ], | ||
| }, | ||
| }); | ||
|
|
||
| app.synth(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.