Skip to content

Lambda@Edge function to route S3 traffic to different regions

Notifications You must be signed in to change notification settings

codemonauts/cloudfront-s3-multiregion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Cloudfront S3 Multiregion

This Lambda@Edge function tries to find the best bucket to serve static content because Cloudfront can't directly talk to an S3 multiregion access point.

Assumptions / Setup

This script assumes that there is a bucket with the name {BASE_NAME} in the region {FALLBACK_REGION}. The buckets in all other regions are named like {BASE_NAME}-{region-name}.

Then deploy this function to us-east-1 and attach it to the Origin Request of your Cloudfront distribution.

About

Lambda@Edge function to route S3 traffic to different regions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages