common-fate / granted

The easiest way to access your cloud.
https://granted.dev
MIT License
957 stars 90 forks source link

assume with chained role sets AWS_PROFILE unexpectedly #555

Open bruecktech opened 7 months ago

bruecktech commented 7 months ago

I run the following command

❯ assume foobar --chain arn:aws:iam::123456789012:role/myrole
[i] If the browser does not open automatically, please open this link: https://device.sso.eu-central-1.amazonaws.com/?user_code=ABCD-EFGH
[i] Awaiting AWS authentication in the browser
[i] You will be prompted to authenticate with AWS in the browser, then you will be prompted to 'Allow'
[i] Code: ABCD-EFGH
[✔] [arn:aws:iam::123456789012:role/myrole](eu-central-1) session credentials will expire in 1 hour

but the following command then fails

❯ aws sts get-caller-identity

The config profile (arn:aws:iam::123456789012:role/myrole) could not be found

I think it's because AWS_PROFILE is set to arn:aws:iam::123456789012:role/myrole Running unset AWS_PROFILE fixes the issue.

mklemm2 commented 2 months ago

I'm facing the same problem.