Created
August 4, 2020 05:48
-
-
Save arcones/6374fc042533792854598c24606a8cd6 to your computer and use it in GitHub Desktop.
AWS assume role in one command by exporting the environment variables
This file contains hidden or 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
ROLE_ARN_TO_ASSUME="arn:aws:iam::123456789012:role/myRole" | |
eval $(aws sts assume-role --role-arn ${ROLE_ARN_TO_ASSUME} --role-session-name test | jq -r '.Credentials | "export AWS_ACCESS_KEY_ID=\(.AccessKeyId)\nexport AWS_SECRET_ACCESS_KEY=\(.SecretAccessKey)\nexport AWS_SESSION_TOKEN=\(.SessionToken)\n"') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment