Created
May 26, 2017 21:09
-
-
Save sjmcgrath/6a83b4f0d909d0a31baaffe648a04560 to your computer and use it in GitHub Desktop.
Deletes a CloudFront Origin Access Identity
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 -e | |
[[ $# -eq 1 ]] || { | |
cat <<EOF >&2 | |
Usage. ${0##*/} OAI-Id | |
EOF | |
exit 1 | |
} | |
ETAG=$( aws cloudfront get-cloud-front-origin-access-identity --id "$1" --query 'ETag' | sed 's/"//g') | |
aws cloudfront delete-cloud-front-origin-access-identity --id "$1" --if-match "$ETAG" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment