Skip to content

Instantly share code, notes, and snippets.

View dineshcooper's full-sized avatar

Dinesh Copoosamy dineshcooper

View GitHub Profile
@dineshcooper
dineshcooper / README.markdown
Created March 1, 2024 11:26 — forked from NV/README.markdown
AWS script to sync files with Amazon s3 and invalidate CloudFront paths that have been synced. I can't believe the AWS CLI doesn't do that in one command!

AWS s3 sync and CloudFront invalidation script

This is a scrappy script I put together to invalidate AWS CloudFront paths that have been uploaded to AWS S3.

Problem

If you host a static website on Amazon S3 and CloudFront, you need to create a CloudFront cache invalidation every time you upload files to Amazon S3.