AssumeRole
AssumeRole is an AWS Security Token Service (STS) API call that lets a user, service, or external identity temporarily take on the permissions of an IAM role. Instead of using long-lived credentials, the caller receives a set of temporary security credentials that expire after a defined period. This lets one entity act with a different, typically scoped-down or scoped-up, set of permissions for a limited time.
AssumeRole is an AWS STS API action (sts:AssumeRole) that returns a set of temporary security credentials, consisting of an access key ID, a secret access key, and a session token, associated with a specified IAM role. A principal (such as an IAM user, an AWS service, or an external identity) that is authorized to assume the role uses these temporary credentials to make subsequent AWS API calls under the assumed role's permissions. This is a runtime authorization and credential-issuance mechanism: the caller must already be authenticated as a principal, and the role's trust policy plus the caller's permissions determine whether the assumption is allowed. The returned credentials are short-lived and expire, in contrast to long-lived static credentials. Note that AssumeRole is distinct from PassRole; based on the evidence provided, exact credential lifetime bounds and other configuration-dependent limits are out of scope for this entry.
Why it matters
AssumeRole is central to how AWS environments avoid distributing long-lived static credentials. Because the call returns short-lived temporary credentials that expire, it limits the window in which leaked or misused credentials remain valid, which is a meaningful advantage over embedding permanent access keys in code, configuration, or CI/CD systems. In most deployments this makes AssumeRole a foundational building block for cross-account access, federated access from external identity providers, and workload-to-service access patterns.
The mechanism also enforces a clear separation between who a caller is and what they are permitted to become. A principal must already be authenticated before it can call sts:AssumeRole, and whether the assumption succeeds depends on both the target role's trust policy and the caller's own permissions. This dual-gate design means that misconfigurations, such as an overly broad trust policy that permits assumption from unintended principals, can create privilege escalation paths. For security architects, reasoning about who can assume which roles, and under what conditions, is often as important as reasoning about the permissions attached to the roles themselves.
Because AssumeRole issues credentials at runtime, it belongs to the enforcement side of an identity program rather than the governance side. It does not, on its own, provide access certification, periodic review, or segregation-of-duties analysis over which principals hold assumption rights. Organizations typically need separate governance processes to review and attest to role trust relationships over time, since a permissive trust policy will keep granting temporary credentials until it is changed.
Who it's relevant to
Inside AssumeRole
Common questions
Answers to the questions practitioners most commonly ask about AssumeRole.
