Created
April 10, 2020 23:17
-
-
Save kalda341/45eaf0937c7ca1a8d97d6425cfbb707a to your computer and use it in GitHub Desktop.
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
| ember_distribution = template.add_resource(Distribution( | |
| 'EmberDistribution', | |
| DistributionConfig=DistributionConfig( | |
| Enabled=True, | |
| DefaultRootObject='index.html', | |
| # Allow us to have nice urls (without #) | |
| CustomErrorResponses=[ | |
| CustomErrorResponse( | |
| ErrorCachingMinTTL=5, | |
| ErrorCode=404, | |
| ResponseCode=200, | |
| ResponsePagePath='/index.html' | |
| ) | |
| ], | |
| Aliases=[ | |
| domain_name | |
| ], | |
| Origins=[ | |
| Origin( | |
| DomainName=bucket_domain_name, | |
| Id='S3Origin', | |
| S3OriginConfig=S3OriginConfig() | |
| ) | |
| ], | |
| DefaultCacheBehavior=DefaultCacheBehavior( | |
| Compress=True, | |
| AllowedMethods=[ | |
| 'GET', | |
| 'HEAD', | |
| 'OPTIONS' | |
| ], | |
| ForwardedValues=ForwardedValues( | |
| QueryString=False | |
| ), | |
| # How long CloudFront caches for. When the origin adds a Cache-Control max-age directive: | |
| # CloudFront caching depends on the values of the CloudFront minimum TTL and maximum TTL, | |
| # and the Cache-Control max-age directive: | |
| # Minimum TTL < max-age < maximum TTL: | |
| # CloudFront caches objects for the value of the Cache-Control max-age directive. | |
| # max-age < minimum TTL: | |
| # CloudFront caches objects for the value of the CloudFront minimum TTL. | |
| # max-age > maximum TTL: | |
| # CloudFront caches objects for the value of the CloudFront maximum TTL. | |
| MaxTTL=3600, | |
| DefaultTTL=300, | |
| MinTTL=0, | |
| TargetOriginId='S3Origin', | |
| ViewerProtocolPolicy='redirect-to-https', | |
| ), | |
| ViewerCertificate=ViewerCertificate( | |
| AcmCertificateArn=Ref(certificate), | |
| SslSupportMethod='sni-only' | |
| ), | |
| HttpVersion='http2' | |
| ) | |
| )) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment