Skip to content

Instantly share code, notes, and snippets.

@advincze
Created Nov 6, 2018
Embed
What would you like to do?
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