Created
November 6, 2018 21:12
-
-
Save advincze/decbb33d7838c694bb21bd69ff83e543 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
ROLE_NAME=arn:aws:iam::123456789123:role/my_role_to_assume | |
AWS=$(aws sts assume-role --role-arn $ROLE_NAME --role-session-name foo --query 'Credentials.[AccessKeyId,SecretAccessKey,SessionToken]' --output text | awk '{print "AWS_ACCESS_KEY_ID=" $1,"AWS_SECRET_ACCESS_KEY=" $2, "AWS_SESSION_TOKEN=" $3}') | |
env -S $AWS aws s3 ls |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment