Some odds and ends...

Invalidate CloudFront and wait 

1
2
3
4
5
6
invalidate-cf-and-wait() {   id=$(aws cloudfront create-invalidation \
--distribution-id $1 --path '/*' --profile $2 | egrep Id | awk -F'"' '{ print $4}' ); \
echo "Waiting for invalidation $id";\
aws cloudfront wait invalidation-completed --id $id \
--distribution-id $1 --profile $2 && \
osascript -e "display notification 'Invalidation $id completed' with title 'CF Invalidation'" ; }