Amazon CloudFront to Amazon S3 with OAI

CloudFront → S3

Create a CloudFront distribution to S3 using OAI.

This python CDK Construct deploys an S3 bucket that is encrypted via S3 managed encryption as well as configured to host a website. The CloudFront distributions is configured to serve the website contents hosted in the S3 bucket over the CloudFront distribution network. The CloudFront Domain URL is obfuscated and restricted to users who access the CloudFront Orign Access Identity (OAI.).

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/s3-cloudfront-oai-cdk-python

Deploy

npm installcdk deploy


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

1. Delete the stack: npx cdk destroy.
2. Confirm the stack has been deleted: aws cloudformation list-stacks --query "StackSummaries[?contains(StackName,'STACK_NAME')].StackStatus".

Created by:

Faraz Haider

Faraz Haider

I am a Associate Cloud Consultant with Amazon Web Services and Serverless Enthusiast.

Follow on LinkedIn