Created
July 3, 2019 20:13
-
-
Save radamant/aafbc2765dfd6b074731931b24d4c55e 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
echo "Enter MFA token:" | |
read varname | |
aws sts get-session-token --serial-number <arn from aws security credentials> --output text --token-code $varname | \ | |
awk '{printf("export AWS_ACCESS_KEY_ID=\"%s\"\nexport AWS_SECRET_ACCESS_KEY=\"%s\"\nexport AWS_SESSION_TOKEN=\"%s\"\n",$2,$4,$5)}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment