Created
August 20, 2021 15:51
-
-
Save tsaito-cyber/23fed27403da120058871ff845817232 to your computer and use it in GitHub Desktop.
assume_role.sh
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
#!/bin/bash -xe | |
role_arn="$1" | |
eval $(aws sts assume-role --role-arn "$role_arn" --role-session-name $RANDOM | 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