Last active
May 26, 2017 21:09
-
-
Save sjmcgrath/0ad55ae93138517964ff008ba9708921 to your computer and use it in GitHub Desktop.
Creates 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 | |
[[ $# -le 2 ]] || { | |
cat <<EOF >&2 | |
Usage: ${0##*/} environment application | |
Parameters: | |
environment - dev, staging, production, etc | |
application - name of application | |
Output: CloudFront Origin Access Identity Id | |
EOF | |
exit 1 | |
} | |
COMMENT=$2-$1-OAI | |
CALLER_REFERENCE=${COMMENT} | |
aws cloudfront create-cloud-front-origin-access-identity \ | |
--cloud-front-origin-access-identity-config "Comment=${COMMENT},CallerReference=${CALLER_REFERENCE}" \ | |
--query 'CloudFrontOriginAccessIdentity.Id' \ | |
| sed 's/"//g' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment