Automating the invalidation of cloudfront assets

Hi

I’m using cloudfront as my cdn, and when i deploy my stack i’d like to invalidate those assets because they’ll be updated. Is there a good way to automate this?

Thanks for getting in touch with us. The following deploy hook automates the invalidation of cloudfront assets: http://pastebin.com/raw.php?i=8EnNiH5J

You will need 3 environment variables to be set before running the hook. These are: S3_ACCESS_KEY, S3_SECRET_KEY, CLOUDFRONT_DISTRIBUTION_ID. An optional environment variable is AWS_PATH, to set a specific path to invalidate.

Please let me know if you have any questions about this.

You must be logged in to answer this question