Created
April 5, 2024 21:24
-
-
Save astroanu/d16079463ff01053b7bc4635b8e00d5d to your computer and use it in GitHub Desktop.
Wait for cloudfront invalidation
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
# creates a new invalidation and waits until it's complete | |
DISTRIBUTION_ID=xxx | |
INVALIDATION_ID=$(aws cloudfront create-invalidation --distribution-id $DISTRIBUTION_ID --paths "/" | jq -r '.Invalidation.Id') | |
until [[ $(aws cloudfront get-invalidation --id $INVALIDATION_ID --distribution-id $DISTRIBUTION_ID | jq -r '.Invalidation.Status') = "Completed" ]] | |
do | |
echo "Waiting for the invalidation to complete" | |
sleep 3 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment