Created
June 22, 2020 04:21
-
-
Save Leonti/96553e78bf79c7b57353140eb5f9d3f3 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
CloudFrontDistribution: | |
Type: AWS::CloudFront::Distribution | |
Properties: | |
DistributionConfig: | |
Aliases: | |
- !Ref DomainName | |
CustomErrorResponses: | |
- ErrorCachingMinTTL: 60 | |
ErrorCode: 404 | |
ResponseCode: 200 | |
ResponsePagePath: '/index.html' | |
- ErrorCachingMinTTL: 60 | |
ErrorCode: 403 | |
ResponseCode: 200 | |
ResponsePagePath: '/index.html' | |
DefaultCacheBehavior: | |
AllowedMethods: | |
- GET | |
- HEAD | |
CachedMethods: | |
- GET | |
- HEAD | |
Compress: true | |
DefaultTTL: 86400 | |
ForwardedValues: | |
Cookies: | |
Forward: none | |
QueryString: true | |
MaxTTL: 31536000 | |
SmoothStreaming: false | |
TargetOriginId: !Sub 'S3-${AWS::StackName}-root' | |
ViewerProtocolPolicy: 'redirect-to-https' | |
DefaultRootObject: 'index.html' | |
Enabled: true | |
HttpVersion: http2 | |
IPV6Enabled: true | |
Logging: | |
Bucket: !GetAtt S3BucketLogs.DomainName | |
IncludeCookies: false | |
Prefix: 'cdn/' | |
Origins: | |
- CustomOriginConfig: | |
HTTPPort: 80 | |
HTTPSPort: 443 | |
OriginKeepaliveTimeout: 5 | |
OriginProtocolPolicy: 'https-only' | |
OriginReadTimeout: 30 | |
OriginSSLProtocols: | |
- TLSv1 | |
- TLSv1.1 | |
- TLSv1.2 | |
DomainName: !GetAtt S3BucketRoot.DomainName | |
Id: !Sub 'S3-${AWS::StackName}-root' | |
PriceClass: PriceClass_All | |
ViewerCertificate: | |
AcmCertificateArn: !Ref CertificateManagerCertificate | |
SslSupportMethod: sni-only |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment