Created
May 5, 2016 08:32
-
-
Save mafonso/d9d07f8f729455c63d80d1ce33fbfaa0 to your computer and use it in GitHub Desktop.
role credentials
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
instance_profile=`curl http://169.254.169.254/latest/meta-data/iam/security-credentials/` | |
aws_access_key_id=`curl http://169.254.169.254/latest/meta-data/iam/security-credentials/${instance_profile} | grep AccessKeyId | cut -d':' -f2 | sed 's/[^0-9A-Z]*//g'` | |
aws_secret_access_key=`curl http://169.254.169.254/latest/meta-data/iam/security-credentials/${instance_profile} | grep SecretAccessKey | cut -d':' -f2 | sed 's/[^0-9A-Za-z/+=]*//g'` | |
export AWS_ACCESS_KEY_ID=${aws_access_key_id} | |
export AWS_SECRET_ACCESS_KEY=${aws_secret_access_key} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment