Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Yes, it is possible to assume an AWS STS role with a single command using the AWS CLI. The command to assume a role is as follows:

aws sts assume-role --role-arn [ROLE ARN] --role-session-name [SESSION NAME]

You will need to replace [ROLE ARN] with the ARN of the role you want to assume and [SESSION NAME] with a descriptive name for the session. The command will return temporary security credentials that you can use to access AWS resources with the permissions granted by the assumed role.