Skip to content

A Lambda@Edge function to be used with AWS Cloudfront to serve the index.html file of a subdirectory in an S3 bucket.

Notifications You must be signed in to change notification settings

kusakusakusa/cloudfront-s3-index-extension-remover

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

A Lambda@Edge function to be used with AWS Cloudfront to serve the index.html file of a subdirectory in an S3 bucket.

Inspiration

This service is inspired by this guide from AWS.

Usage

TODO explain the use of each function

Deployment

sls deploy --stage prod
  • Go to Lamda in AWS Console, select the latest version for both functions.
  • Create trigger for Cloudfront and select to deploy to Lambda@Edge. deploy to Lambda@Edge
  • If you created this trigger before, you can just select to use existing trigger. Existing Lambda@Edge trigger is present
  • Change the Cache behavior according to your needs. These are the behaviours setup in Cloudfront.
  • Select Origin request for the Cloudfront event option.
  • Click Deploy and wait for the changes to propagate to all of the Cloudfront distribution.
  • You may need to invalidate your caches in Cloudfront.
  • The logs will be appear in an edge location near your location. Be sure to change the region if the you do not see the logs in your current selcted region in the AWS console.

About

A Lambda@Edge function to be used with AWS Cloudfront to serve the index.html file of a subdirectory in an S3 bucket.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published