Ravi Sir's Cards › AWS
assume-role vs get-session-token
This comparison card contrasts assume-role and get-session-token. assume-role returns temporary keys for another role. get-session-token returns temporary keys for your own identity after MFA. The card pairs assume-role with switch to admin or other account, and get-session-token with MFA-protected actions.
Read card text
What this card says
Gives
assume-role
Keys for another role.
get-session-token
Keys for yourself with MFA.
Key points
Can cross accounts.
Same identity, MFA flag true.
Example
aws sts assume-role
Use when
Switch to admin or other account.
MFA-protected actions.