How to Invalidate AWS CloudFront Objects with Python & Boto3

By Birtchum Thompson | March 15, 2020

This tutorial demonstrates how to invalidate AWS CloudFront objects by paths using Python and Boto3.

Organizations that use CloudFront as their CDN commonly need to programmatically invalidate a single object or and array of objects due to updates or other reasons. Boto3 makes this a simple task. The following example script will invalidate 3 objects within a CloudFront distribution. All fields are required to successfully invalidate the objects.

 Python
Share this Content

Join the Discussion

Also Read

Blue KDE Logo
Configure Screen Locking Shortcut in KDE

Learn to configure the screen locking shortcut in KDE.

Python logo and red trash can
Delete Files Older than X Days in Python

Create a Python script to delete files older than x days.

White Bash Logo
Check Exit Status of Bash Command in a Script

Check a Bash command exit status in a script.

UFW, Ubuntu, and firewall logos on dark grey background
Allow SMB in UFW

Allow SMB traffic in UFW on Ubuntu & Debian.