https://github.com/jweyrich/cloudfront-invalidate-dist
☁ Make your AWS CodePipeline invoke this Lambda function to invalidate a CloudFront distribution.
https://github.com/jweyrich/cloudfront-invalidate-dist
aws aws-lambda cloudfront cloudfront-distributions codepipeline invalidation serverless
Last synced: 3 months ago
JSON representation
☁ Make your AWS CodePipeline invoke this Lambda function to invalidate a CloudFront distribution.
- Host: GitHub
- URL: https://github.com/jweyrich/cloudfront-invalidate-dist
- Owner: jweyrich
- License: other
- Created: 2018-11-14T13:38:58.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-04-10T20:10:25.000Z (over 2 years ago)
- Last Synced: 2025-04-01T20:41:52.238Z (3 months ago)
- Topics: aws, aws-lambda, cloudfront, cloudfront-distributions, codepipeline, invalidation, serverless
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/cloudfront-invalidate-dist
- Size: 75.2 KB
- Stars: 20
- Watchers: 2
- Forks: 13
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
CloudFront Invalidate Distribution
Make your AWS CodePipeline invoke this Lambda function to invalidate a CloudFront distribution.
### Prerequisites
Install the [Serverless Framework](https://serverless.com/) if you don't have it.
npm install -g serverless
### Deploy
git clone https://github.com/jweyrich/cloudfront-invalidate-dist.git
cd cloudfront-invalidate-dist
serverless deploy [--aws-profile yourProfile]### Configure your CodePipeline
1. Open your CodePipeline
2. Create a new stage
3. Add a new action
4. In 'Action Provider' select 'AWS Lambda'
5. In 'Function name' select the deployed function
6. In 'User parameters' specify the desired CloudFront distribution and paths to be invalidated. Example:`{ "distributionId": "FP7AWS1WBJLKSX", "objectPaths": [ "/*" ] }`
7. Save the action
8. Test### Examples of User Parameters
{ "distributionId": "FP7AWS1WBJLKSX", "objectPaths": [ "/*" ] }
{ "distributionId": "FP7AWS1WBJLKSX", "objectPaths": [ "/foo", "/bar/baz.jpg", "/bar/baz/*" ] }