You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a small function that can be invoked to invalidate the cache of a CloudFront Distribution.
4
+
5
+
Updated slightly from the aws-cloudfront-cache-invalidation script to send a response to CodePipeline on success.
6
+
7
+
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.
8
+
**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
9
+
10
+
**How to use**
11
+
1. Create a new **Lambda** function
12
+
2. Select **Python 3.8** as the runtime
13
+
3. Copy the source code into your function
14
+
4. Create execution role and assign permissions to your cloudfront distribution
15
+
5. Create an **Environment Variable** with a _key_ of DISTRIBUTION_ID and a _value_ of your CloudFront Distribution
16
+
6. Deploy function
17
+
18
+
19
+
**Note**
20
+
This function invalidates the entire cache. To select paths update the **items* sections within the function
0 commit comments