Created
January 31, 2018 07:22
-
-
Save jenseickmeyer/d1d7145b005618477680db3a39953eda to your computer and use it in GitHub Desktop.
Script for invalidation a CloudFront Distribution
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DISTRIBUTION_ID= | |
#Invalidate the CloudFront Distribution | |
invalidation_id=$(aws cloudfront create-invalidation --distribution-id $DISTRIBUTION_ID --paths "/*" --query Invalidation.Id) | |
length=${#invalidation_id} | |
# Wait for invalidation to finish | |
aws cloudfront wait invalidation-completed --distribution-id $DISTRIBUTION_ID --id ${invalidation_id:1:$length-2} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment