Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save diegofcornejo/477c05a19637906f953ad5fafa8dec8b to your computer and use it in GitHub Desktop.
Save diegofcornejo/477c05a19637906f953ad5fafa8dec8b to your computer and use it in GitHub Desktop.
Invalidate Multiple AWS Cloudfront Distributions
#!/bin/bash
distributions=( EVJDT**** E3UI4***** E*****0X1FHL E26R******* ******RIN9KGU)
for i in "${distributions[@]}"
do
aws cloudfront create-invalidation --distribution-id $i --paths "/*" --profile yourProfile
done
#Remember add permision for execute and use "./invalidate_distributions.sh" not "sh invalidate_distributions.sh" because sh doesn't support array
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment