Skip to content

Instantly share code, notes, and snippets.

@lucasjhall
lucasjhall / cf-invalidate.php
Last active November 21, 2018 01:53 — forked from claylo/cf-invalidate.php
How to invalidate items in AWS CloudFront
<?php
/**
* Super-simple AWS CloudFront Invalidation Script
*
* Steps:
* 1. Set your AWS access_key in gitlab CI/CD
* 2. Set your AWS secret_key in gitlab CI/CD
* 3. Set your CloudFront DISTRIBUTION_ID in gitlab CI/CD
* 4. Define the batch of paths to invalidate
* 5. Run it on the command-line with: php invalidate-cloudfront.php $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY $DISTRIBUTION_ID