Created
June 3, 2023 21:59
-
-
Save Advantechnica/c873f320f8f73dfc767d8b019796b027 to your computer and use it in GitHub Desktop.
AWS sts assume role in one command
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
export $(printf "AWS_ACCESS_KEY_ID=%s AWS_SECRET_ACCESS_KEY=%s AWS_SESSION_TOKEN=%s" \ | |
$(aws sts assume-role \ | |
--role-arn arn:aws:iam::123456789012:role/MyAssumedRole \ | |
--role-session-name MySessionName \ | |
--query "Credentials.[AccessKeyId,SecretAccessKey,SessionToken]" \ | |
--output text)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment