Created
November 17, 2022 14:21
-
-
Save Edison-Hsu/3dc918c6e2a60189ffa5c686a2b9776e to your computer and use it in GitHub Desktop.
assume a role in one line command
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
| export $(printf "AWS_ACCESS_KEY_ID=%s AWS_SECRET_ACCESS_KEY=%s AWS_SESSION_TOKEN=%s" \ $(aws_prompt_info) | |
| $(aws sts assume-role \ | |
| --role-arn arn:aws-cn:iam::xxxx:role/xxxx \ | |
| --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