sts:AssumeRole

Write

sts:AssumeRole is a Write access-level action in the sts service. Grants permission to obtain a set of temporary security credentials that you can use to access AWS resources that you might not normally have access to

Resource types

ARNs that sts:AssumeRole can be scoped to in an IAM policy.

arn:${Partition}:iam::${Account}:role/${RoleNameWithPath} required
role

Condition keys

Keys you can use in the Condition block of a policy that grants sts:AssumeRole.

accounts.google.com:aud String

Filters access by the Google application ID

accounts.google.com:sub String

Filters access by the subject of the claim (the Google user ID)

aws:RequestTag/${TagKey} String

Filters access by the tags that are passed in the request

aws:TagKeys ArrayOfString

Filters access by the tag keys that are passed in the request

cognito-identity.amazonaws.com:amr String

Filters access by the login information for Amazon Cognito

cognito-identity.amazonaws.com:aud String

Filters access by the Amazon Cognito identity pool ID

cognito-identity.amazonaws.com:sub String

Filters access by the subject of the claim (the Amazon Cognito user ID)

graph.facebook.com:app_id String

Filters access by the Facebook application ID

graph.facebook.com:id String

Filters access by the Facebook user ID

iam:ResourceTag/${TagKey} String

Filters access by the tags that are attached to the role that is being assumed

saml:namequalifier String

Filters access by the hash value of the issuer, account ID, and friendly name

saml:sub String

Filters access by the subject of the claim (the SAML user ID)

saml:sub_type String

Filters access by the value persistent, transient, or the full Format URI

sts:ExternalId String

Filters access by the unique identifier required when you assume a role in another account

sts:RoleSessionName String

Filters access by the role session name required when you assume a role

sts:SourceIdentity String

Filters access by the source identity that is passed in the request

sts:TransitiveTagKeys ArrayOfString

Filters access by the transitive tag keys that are passed in the request

www.amazon.com:app_id String

Filters access by the Login with Amazon application ID

www.amazon.com:user_id String

Filters access by the Login with Amazon user ID

aws:ResourceTag/${TagKey} String

Filters access by the tags associated with the resource

Example IAM policy

A minimal policy that allows sts:AssumeRole. Replace "Resource": "*" with a specific ARN to follow least privilege.

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "AllowStsAssumeRole",
      "Effect": "Allow",
      "Action": "sts:AssumeRole",
      "Resource": "*"
    }
  ]
}

Related actions in sts

View all sts actions →