- Newest
- Most votes
- Most comments
To ensure users access your S3 data through CloudFront instead of directly from S3, you need to take a few steps:
-
Set up Origin Access Control (OAC) for your CloudFront distribution. This allows CloudFront to securely access your S3 bucket.
-
Update your S3 bucket policy to only allow access from your CloudFront distribution. This prevents direct public access to your S3 objects.
-
In your S3 bucket settings, enable the "Block all public access" option. This further restricts direct access to your S3 content.
-
Provide users with the CloudFront URL to access your content instead of the S3 URL. The CloudFront URL typically looks like "d111111abcdef8.cloudfront.net/your-file-path".
-
If you're using a custom domain, make sure it's properly set up to point to your CloudFront distribution.
By implementing these steps, you'll ensure that users can only access your S3 content through CloudFront, helping to reduce your data transfer costs. If you're not comfortable making these changes yourself, consider seeking assistance from an AWS professional or your IT department.
Sources
How to access the (cloudfront) s3 objects without pre-signed url | AWS re:Post
Cloudfront OAC S3: Public Reads & Only Signed Secure Writes | AWS re:Post
Amazon S3 origins with CloudFront - Secure Content Delivery with Amazon CloudFront
Relevant content
- asked 3 years ago