Last active
July 25, 2018 01:52
-
-
Save qswitcher/05153fcce86f26b2b64af857888cb879 to your computer and use it in GitHub Desktop.
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
AWSTemplateFormatVersion: 2010-09-09 | |
Resources: | |
DeployBucket: | |
Type: 'AWS::S3::Bucket' | |
Properties: | |
# Technically we don't need the S3 bucket configured | |
# as a website, but I included it for the sake of completion. | |
WebsiteConfiguration: | |
IndexDocument: index.html | |
Distribution: | |
Type: "AWS::CloudFront::Distribution" | |
Properties: | |
DistributionConfig: | |
Origins: | |
- | |
# Use the DeployBucket as the CDN origin | |
DomainName: !GetAtt DeployBucket.DomainName | |
Id: !Ref DeployBucket | |
S3OriginConfig: | |
OriginAccessIdentity: '' | |
DefaultRootObject: index.html | |
Enabled: true | |
# Configure the caching behavior for our CDN | |
DefaultCacheBehavior: | |
MinTTL: 86400 # 1 day | |
MaxTTL: 31536000 # 1 year | |
ForwardedValues: | |
QueryString: true | |
TargetOriginId: !Ref DeployBucket | |
ViewerProtocolPolicy: "redirect-to-https" # we want to force HTTPS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment