Amazon CloudFront with Amazon CloudFront Functions to Amazon S3

Amazon CloudFront → CloudFront Functions → Amazon S3

CloudFront with CloudFront Functions to S3

This pattern deploys an Amazon Cloudfront distribution, an Amazon Cloudfront Function and a Amazon S3 Bucket and demonstrates how to implement an A/B testing solution.
Using Cloudfront Functions, you are dynamically changing the URI to display either the old home page or new home page randomly.

< 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/cloudfront-cff-s3-cdk-python

Deploy

cdk deploy


Testing

See the GitHub repo for testing instructions.

Cleanup

1. In the source folder, from the command line enter:
cdk destroy
2. See additional notes in the repo.

Additional resources

Created by:

Corneliu Croitoru

Corneliu Croitoru

Developer at heart, in 2018 joined AWS as a Solution Architect and since 2021 building, jointly with customers, the most exciting and innovative prototypes on AWS.

Follow on LinkedIn