Skip to content

davesc63/aws-cloudfront-cache-invalidation-codepipeline

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

AWS CloudFront Cache Invalidation

This is a small function that can be invoked to invalidate the cache of a CloudFront Distribution.

Updated slightly from the aws-cloudfront-cache-invalidation script to send a response to CodePipeline on success.

The purpose of this function is to be called as required as a standalone function when you need your cache invalidated and the functionality is not in-built to the tool or service you are using. Example: This function is called during the Deploy stage of a CodePipeline to invalidate the cache of a CloudFront Distribution for a static website hosted in Amazon S3

How to use

  1. Create a new Lambda function
  2. Select Python 3.8 as the runtime
  3. Copy the source code into your function
  4. Create execution role and assign permissions to your cloudfront distribution
  5. Create an Environment Variable with a key of DISTRIBUTION_ID and a value of your CloudFront Distribution
  6. Deploy function

Note This function invalidates the entire cache. To select paths update the *items sections within the function

About

AWS CloudFront Cache Invalidation with response to CodePipeline

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages