-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into benisrae/nested-sta…
…cks-dependencies
- Loading branch information
Showing
35 changed files
with
542 additions
and
617 deletions.
There are no files selected for viewing
This file contains 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 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 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
112 changes: 112 additions & 0 deletions
112
packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-custom-s3.expected.json
This file contains 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,112 @@ | ||
{ | ||
"Resources": { | ||
"Bucket83908E77": { | ||
"Type": "AWS::S3::Bucket", | ||
"Properties": { | ||
"WebsiteConfiguration": { | ||
"ErrorDocument": "404.html", | ||
"IndexDocument": "index.html" | ||
} | ||
}, | ||
"UpdateReplacePolicy": "Retain", | ||
"DeletionPolicy": "Retain" | ||
}, | ||
"BucketPolicyE9A3008A": { | ||
"Type": "AWS::S3::BucketPolicy", | ||
"Properties": { | ||
"Bucket": { | ||
"Ref": "Bucket83908E77" | ||
}, | ||
"PolicyDocument": { | ||
"Statement": [ | ||
{ | ||
"Action": "s3:GetObject", | ||
"Effect": "Allow", | ||
"Principal": "*", | ||
"Resource": { | ||
"Fn::Join": [ | ||
"", | ||
[ | ||
{ | ||
"Fn::GetAtt": [ | ||
"Bucket83908E77", | ||
"Arn" | ||
] | ||
}, | ||
"/*" | ||
] | ||
] | ||
} | ||
} | ||
], | ||
"Version": "2012-10-17" | ||
} | ||
} | ||
}, | ||
"DistributionCFDistribution882A7313": { | ||
"Type": "AWS::CloudFront::Distribution", | ||
"Properties": { | ||
"DistributionConfig": { | ||
"DefaultCacheBehavior": { | ||
"AllowedMethods": [ | ||
"GET", | ||
"HEAD" | ||
], | ||
"CachedMethods": [ | ||
"GET", | ||
"HEAD" | ||
], | ||
"Compress": true, | ||
"ForwardedValues": { | ||
"Cookies": { | ||
"Forward": "none" | ||
}, | ||
"QueryString": false | ||
}, | ||
"TargetOriginId": "origin1", | ||
"ViewerProtocolPolicy": "redirect-to-https" | ||
}, | ||
"DefaultRootObject": "index.html", | ||
"Enabled": true, | ||
"HttpVersion": "http2", | ||
"IPV6Enabled": true, | ||
"Origins": [ | ||
{ | ||
"CustomOriginConfig": { | ||
"HTTPPort": 80, | ||
"HTTPSPort": 443, | ||
"OriginKeepaliveTimeout": 5, | ||
"OriginProtocolPolicy": "http-only", | ||
"OriginReadTimeout": 30, | ||
"OriginSSLProtocols": [ | ||
"TLSv1.2" | ||
] | ||
}, | ||
"DomainName": { | ||
"Fn::Select": [ | ||
2, | ||
{ | ||
"Fn::Split": [ | ||
"/", | ||
{ | ||
"Fn::GetAtt": [ | ||
"Bucket83908E77", | ||
"WebsiteURL" | ||
] | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
"Id": "origin1" | ||
} | ||
], | ||
"PriceClass": "PriceClass_200", | ||
"ViewerCertificate": { | ||
"CloudFrontDefaultCertificate": true | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-custom-s3.ts
This file contains 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,34 @@ | ||
import s3 = require('@aws-cdk/aws-s3'); | ||
import { App, Construct, Stack } from "@aws-cdk/core"; | ||
import cloudfront = require('../lib'); | ||
|
||
class TestStack extends Stack { | ||
constructor(scope: Construct, id: string) { | ||
super(scope, id); | ||
|
||
const bucket = new s3.Bucket(this, `Bucket`, { | ||
publicReadAccess: true, | ||
websiteIndexDocument: "index.html", | ||
websiteErrorDocument: "404.html", | ||
}); | ||
|
||
new cloudfront.CloudFrontWebDistribution(this, `Distribution`, { | ||
viewerProtocolPolicy: cloudfront.ViewerProtocolPolicy.REDIRECT_TO_HTTPS, | ||
priceClass: cloudfront.PriceClass.PRICE_CLASS_200, | ||
originConfigs: [ | ||
{ | ||
behaviors: [ { isDefaultBehavior: true } ], | ||
customOriginSource: { | ||
originProtocolPolicy: cloudfront.OriginProtocolPolicy.HTTP_ONLY, | ||
domainName: bucket.bucketWebsiteDomainName | ||
}, | ||
} | ||
] | ||
} | ||
); | ||
} | ||
} | ||
|
||
const app = new App(); | ||
new TestStack(app, 'cloudfront-custom-s3-integ'); | ||
app.synth(); |
This file contains 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 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.