Skip to content

Conversation

@danielcondemarin
Copy link
Contributor

@danielcondemarin danielcondemarin commented Aug 28, 2019

Motivation

I want to serve my private S3 assets through CloudFront. That is users shouldn't be able to access S3 objects directly via S3 urls etc.

Proposal

Update component api to support this use case:

# serverless.yml
distribution:
  component: '@serverless/aws-cloudfront'
  inputs:
    origins:
      - url: https://mybucket.s3.amazonaws.com
        private: true

By setting the private flag to true the component will detect this and:

The approach is described here in more detail: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-restricting-access-to-s3.html

@danielcondemarin danielcondemarin changed the title initial commit serving private S3 content through CloudFront Aug 28, 2019
@danielcondemarin danielcondemarin changed the title serving private S3 content through CloudFront Serving private S3 content through CloudFront Aug 28, 2019
@eahefnawy
Copy link
Member

Thanks @danielcondemarin ... I like that single boolean input.

@danielcondemarin danielcondemarin marked this pull request as ready for review August 29, 2019 21:42
@danielcondemarin
Copy link
Contributor Author

@eahefnawy This is ready to review now 👍

Copy link
Member

@eahefnawy eahefnawy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @danielcondemarin ... LG2M 🎉

@eahefnawy eahefnawy merged commit 1d621df into serverless-components:master Sep 4, 2019
thiagozf pushed a commit to thiagozf/aws-cloudfront that referenced this pull request Apr 28, 2020
…e-private-S3-content-through-cloudfront

Serving private S3 content through CloudFront
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants