Created
January 24, 2019 16:39
-
-
Save bitdivine/9abe667946b56f1e9e459a3939356527 to your computer and use it in GitHub Desktop.
Generate and export an AWS_SESSION_TOKEN
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
# Add this to your ~/.bashrc | |
alias aws_session_token_generate='export AWS_SESSION_TOKEN=$(aws sts get-session-token --serial-number "$(aws sts get-caller-identity --query Arn --output text | sed 's/user/mfa/g')" --token-code "$(read line ; echo $line)" --query Credentials.SessionToken --output text)' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment