Skill 2.1.5

Assume an IAM role

Key Concepts

A principal calls sts:AssumeRole with the role ARN and a session name, and receives an access key, secret key and session token that expire after the session duration (one hour by default). Two policies must agree: the role's trust policy must allow the principal to assume it, and the principal's own permissions must allow sts:AssumeRole on that role.

For third parties assuming a role in your account, an external ID in the trust policy condition prevents the "confused deputy" problem. The CLI can assume roles automatically through a profile with role_arn and source_profile, and services assume their roles for you, such as Lambda with its execution role.