CDN Invalidation using AWS Lambda Function

  1. Create a Lambda Function and write a code.
  2. Create an API Gateway / API from which we are going to create Invalidation of CDN
Lambda Function
Inside Lambda Function
Here is your CDN ID
Attach Cloudfront full access policy
Create API this way
Click on the API endpoint
It will be there in the progress stage

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store