Created
July 6, 2017 09:10
-
-
Save dougneal/0806d732821bcf1d3c85830526d3735c to your computer and use it in GitHub Desktop.
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
URL="http://169.254.169.254/latest/meta-data/iam/security-credentials/$1" | |
echo "export AWS_DEFAULT_REGION=\"eu-west-1\"" | |
echo "export AWS_ACCESS_KEY_ID=\"$(curl $URL 2>/dev/null | jq -r '.AccessKeyId')\"" | |
echo "export AWS_SECRET_ACCESS_KEY=\"$(curl $URL 2>/dev/null | jq -r '.SecretAccessKey')\"" | |
echo "export AWS_SESSION_TOKEN=\"$(curl $URL 2>/dev/null | jq -r '.Token')\"" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment