Created
November 7, 2023 15:20
-
-
Save ashishjullia/a301524098ec1eff39a1638a82b07503 to your computer and use it in GitHub Desktop.
auto_set_temporary_credentials_after_assuming_a_new_role_using_aws_cli
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 sts assume-role \ | |
--role-arn arn:aws:iam::<aws-account-id>:role/<role-name> \ | |
--role-session-name <Test-Session-Name> \ | |
--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