-
-
Save richardgrantserverless/03df6c219550194fc501044b26f1b63f 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
resources: | |
Outputs: | |
ScreenshotBucket: | |
Description: "Screenshot bucket name" | |
Value: ${self:custom.bucket_name} | |
CloudFrontUrl: | |
Description: "CloudFront url" | |
Value: {"Fn::GetAtt": "CloudFrontEndpoint.DomainName"} | |
Resources: | |
# Create an endpoint for the S3 bucket in CloudFront | |
# this configuration basically just sets up a forwarding of requests | |
# to S3, and forces all traffic to https | |
CloudFrontEndpoint: | |
Type: AWS::CloudFront::Distribution | |
Properties: | |
DistributionConfig: | |
Enabled: True | |
DefaultCacheBehavior: | |
TargetOriginId: ScreenshotBucketOrigin | |
ViewerProtocolPolicy: redirect-to-https | |
ForwardedValues: | |
QueryString: True | |
Origins: | |
- | |
Id: ScreenshotBucketOrigin | |
DomainName: ${self:custom.bucket_name}.s3.amazonaws.com | |
CustomOriginConfig: | |
OriginProtocolPolicy: http-only |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment