iam:PassRole Is Checked by the Service - What the Resource, PassedToService, the Trust Policy, and Service-Linked Roles Each Decide

First Published:
Last Updated:

Many AWS services are configured to receive an IAM role. The service later assumes that role and performs actions on behalf of the user. The individual passing the role to the service must possess the iam:PassRole permission. iam:PassRole is a permission name, not an API name, and the service receiving the role checks this permission.

This article outlines how the PassRole check works, breaking down who, when, and what factors are considered. It details what the Resource element, the two condition keys (iam:PassedToService and iam:AssociatedResourceArn), the role's trust policy, and service-linked roles each determine. It also covers ways of writing a policy that do not work and what is not recorded.

To state the conclusion first, the service that receives a role's ARN makes the PassRole check when it creates a resource with the role attached and when it changes a resource to a new role. The Resource element defines the set of roles that can be passed, while the two condition keys can narrow the service the role is passed to and the resource it is associated with. Independently of these factors, the role's trust policy determines whether the service is authorized to assume the role. The IAM User Guide states that narrowing the roles that can be passed by the roles' tags does not have reliable results. Because PassRole is not an API, no PassRole events are logged in CloudTrail.

This article was reviewed based on available documentation as of November 25, 2026 (Japan Standard Time). It has not been tested on actual AWS resources. Pricing information is not included. This article was written prior to AWS re:Invent 2026 (November 30 – December 4, 2026) and does not include any information that will be presented at that event.

Related articles on this site:

Table of Contents

  1. 1. Scope and Assumptions
  2. 2. PassRole Is a Permission, Not an API
  3. 3. Who Checks PassRole and When
  4. 4. What Narrows PassRole
  5. 5. How the Work Is Divided With the Trust Policy
  6. 6. Passing a Service-Linked Role
  7. 7. What Changes After the Check
  8. 8. Reading Records and Errors
  9. 9. Where the Sources Disagree, and What They Do Not Say
  10. 10. Frequently Asked Questions About iam:PassRole
  11. 11. Summary
  12. 12. References

1. Scope and Assumptions

This chapter first defines the intended audience, the scope of this article, the relevant materials, and the terminology used. The following eight points represent the key conclusions:

  • iam:PassRole is a permission that is used exclusively within policies, and not as part of API operations. The Service Authorization Reference (Chapter 2) also lists PassRole as an action that cannot be directly called from an API.
  • The service that receives the role's ARN is the one that checks PassRole. It checks when a resource is created with the role attached and when a resource is changed to a new role (Chapter 3).
  • PassRole can only be used to pass roles within the same AWS account (Section 3.3).
  • The set of roles that can be passed is determined by the Resource element. Using Resource: "*" would allow any role in the account to be passed, which can lead to unintended privilege escalation (Section 4.2).
  • iam:PassedToService narrows the service to which the role is being passed, while iam:AssociatedResourceArn narrows the resource being associated with the role. Narrowing with the role's tags and the ResourceTag condition keys does not have reliable results (Sections 4.3 through 4.5).
  • The trust policy determines whether a service is authorized to assume the role. This is a check separate from the PassRole check (Chapter 5).
  • Even for a service-linked role, PassRole is required when the role is explicitly specified (Chapter 6).
  • PassRole events are not logged in CloudTrail. You see the passed role in the events that created or modified the resource that received the role (Chapter 8).

1.1 Intended Audience

This article is intended for:

  • Platform and security engineers who are designing permissions to pass roles to services such as Lambda, ECS, EC2, Step Functions, and CloudFormation.
  • Individuals who are currently allowing iam:PassRole with Resource: "*" and want to determine how to narrow the scope.
  • Users who receive AccessDenied errors for lack of iam:PassRole and want to know what to fix.

1.2 Scope: What This Article Covers, and What It Does Not

This article addresses the following topics:

  • Who checks PassRole and when, and the same-account limit.
  • The Resource element and two condition keys, the fact that tags do not narrow it, and denials by other policies.
  • How the work is divided with the trust policy, and service-linked roles.
  • As an example of what can change after the check, the version of an Amazon EC2 Auto Scaling launch template.
  • Information retained in CloudTrail, how to interpret errors, IAM Access Analyzer checks, and Access Troubleshooter.

This article does not cover:

  • The complete evaluation logic for IAM policies. This is detailed in this site's IAM Policy Evaluation Logic Step-by-Step.
  • Amazon EKS Pod Identity and IRSA. This is covered in this site's Amazon EKS Pod Identity and IRSA Decision Guide.
  • Step-by-step instructions for creating roles for each service.
  • General interpretation of AccessDenied errors. This is documented in this site's AWS IAM AccessDenied Reference.
  • Designing trust policies with added conditions that restrict on whose behalf a service can assume a role (protection against the confused deputy problem).
  • Specific techniques for escalating privileges with PassRole. This article goes only as far as the design caution that an overly broad Resource element can lead to escalation.

1.3 Check Date and Sources Read

This article was written after reviewing the following materials on November 25, 2026 (Japan Standard Time). In the text, this article refers to them by the English names in parentheses.

  • The "Grant a user permissions to pass a role to an AWS service" page of the IAM User Guide (PassRole page). The HTTP Last-Modified date was November 24, 2026, 18:58:44 GMT.
  • The "IAM and AWS STS condition context keys" page of the same guide (condition keys page). The Last-Modified date was November 24, 2026, 18:58:41 GMT.
  • The "IAM: Pass an IAM role to a specific AWS service" page of the same guide (PassRole example page).
  • The "Troubleshoot IAM roles" page of the same guide (roles troubleshooting page). The Last-Modified date was November 24, 2026, 18:58:44 GMT.
  • The "Troubleshoot access denied error messages" page (access denied page) and the "Troubleshoot access denied error messages with authorization ID" page (authorization ID page) of the same guide.
  • The "IAM policy validation check reference" page of the same guide (policy checks page).
  • The "IAM JSON policy elements: Condition" page (Condition element page) and the terms section of the "IAM roles" page (roles terms) of the same guide.
  • The "AWS Identity and Access Management (IAM)" page of the Service Authorization Reference (SAR). The Last-Modified date was November 24, 2026, 23:59:04 GMT.
  • "How to use the PassRole permission with IAM roles" on the AWS Security Blog (PassRole blog post). It was published on November 24, 2023.
  • The "Service-linked roles for Amazon EC2 Auto Scaling" page (Auto Scaling service-linked role page) and the "Control Amazon EC2 launch template usage in Auto Scaling groups" page (launch template permissions page) of the Amazon EC2 Auto Scaling User Guide.
  • "AWS IAM announces Access Troubleshooter to debug access denied errors" on AWS What's New (What's New). It was posted on November 17, 2026.

This article read every source both as the original text retrieved with curl and through a search of the AWS documentation.

1.4 Terminology

This article uses the following terms consistently:

  • Pass: To provide a role's ARN as a parameter to a service's API and attach the role to a resource.
  • Assume: For a service to obtain temporary credentials for a role.
  • Use: For a service to perform actions using the permissions associated with the role it has assumed.
  • Caller: The IAM user or role that invokes the API to pass a role.
  • Receiving service: The service that receives the role's ARN and subsequently assumes that role.
  • Service role: An IAM role that a service assumes to perform actions on behalf of a user. This is the term used in roles terms.
  • Service-linked role: A service role that is linked to a service and owned by the service. IAM administrators cannot edit its permissions. This is the term used in roles terms.
  • Service principal: The name of a service that can be specified in the Principal element of a policy, such as ec2.amazonaws.com.

This article uses "PassRole" to refer to the act of providing a role, and does not use phrasing such as "assign a role." "PassRole" specifically refers to the act of providing a role; it does not refer to the caller assuming that role.

1.5 Words for Source Status, and the Check Date

This article uses four terms to describe the status of sources. In the tables, this article will consistently use these English spellings.

  • Stated: A source contains a statement regarding the matter.
  • No statement found: Despite searching for the information using various search terms and types of sources (as described in Section 1.3), no relevant statement could be found. This does not indicate that the matter is nonexistent or did not occur.
  • Sources disagree: The statements from two sources regarding the same matter are inconsistent. This article will present both statements, along with their sources, without designating either as incorrect.
  • Inference: This represents an inference made by this article, and is not a statement found in any of the sources. This article marks an inference in the same sentence.

The check date for this article is November 25, 2026 (Japan Standard Time). The definitions of condition keys, error messages, check names, and supported services are accurate as of the check date. These elements may be subject to change after the check date. This article will consistently use the full year when referencing dates.

2. PassRole Is a Permission, Not an API

This chapter explains what PassRole is and what counts as passing a role.

2.1 What Two Sources Say

The PassRole page describes PassRole as follows:

PassRole is not an API call. PassRole is a permission, meaning no CloudTrail logs are generated for IAM PassRole.

PassRole is a permission, not an API call (Stated).

SAR lists PassRole in the table for "Permission-only actions for AWS Identity and Access Management (IAM)." The preceding sentence in the table reads:

The following actions are defined by AWS Identity and Access Management (IAM) but are not directly invocable through any API operation. They can only be used in IAM policy statements to grant or deny permissions.

PassRole cannot be directly invoked from any API operation; it is used only in policy statements to allow or deny it (Stated). The row for PassRole in SAR describes it as "Grants permission to pass a role to a service," specifies the resource type as role (required), and sets the access level to Write (Stated). The condition keys column lists four entries: aws:ResourceTag/${TagKey}, iam:AssociatedResourceArn, iam:PassedToService, and iam:ResourceTag/${TagKey} (Stated). As described in Section 4.5, the PassRole page and the PassRole blog post advise against narrowing the roles that can be passed with the two tag keys among them.

2.2 What Counts as Passing a Role

The PassRole page describes the "pass" operation as follows:

A user can pass a role ARN as a parameter in any API operation that uses the role to assign permissions to the service. The service then checks whether that user has the iam:PassRole permission.

To pass a role means to use an API operation that grants permissions to a service by providing the role's ARN as a parameter (Stated). The PassRole blog post, using the Lambda CreateFunction as an example, states that the role's ARN is passed as a parameter, but there is no "PassRole" parameter itself (Stated).

In most cases, passing a role occurs only once, during the initial configuration. The PassRole page states:

For most services, you only have to pass the role to the service once during setup, and not every time that the service assumes the role.

For many services, passing a role typically happens only once, during configuration, and not every time the service assumes the role (Stated).

3. Who Checks PassRole and When

This chapter outlines who checks PassRole, when the check happens, the same-account limit, and the flow of the check.

3.1 The Receiving Service Does the Check

As stated in the PassRole page in Section 2.2, the service that receives the role ARN checks whether the caller possesses the iam:PassRole permission (Stated). Because PassRole is not an API, the caller cannot directly invoke PassRole. The check occurs in the API call of the service that receives the role ARN (Stated).

Therefore, the name of the operation in the error message will be that of the receiving service's API, rather than PassRole. In the example provided in Section 8.3, the call to Auto Scaling's PutLifecycleHook is denied for lack of PassRole (Stated).

3.2 When It Is Checked

The PassRole blog post describes when the check happens as follows:

The iam:PassRole permission is checked whenever a resource is created with an IAM service role or is updated with a new IAM service role.

PassRole is checked in two cases: when creating resources with a service role attached, and when changing a resource to a new service role (Stated).

The PassRole blog post, using the example of creating a Lambda function, states that both CreateFunction and iam:PassRole permissions are required, and that requests will be rejected if either is missing (Stated). After the function is created, the Lambda service principal assumes the passed role each time the function is invoked (Stated).

Therefore, this article reads that it is Lambda that assumes the role each time the function is called, and the caller's PassRole is not checked again with each invocation (Inference). This aligns with the PassRole page's statement in Section 2.2, which specifies that a role is passed only once, during the initial configuration. This distinction in timing is relevant to the discussion in Chapter 7.

3.3 Within the Same Account

The PassRole page includes the following warning:

You can only use the PassRole permission to pass an IAM role to a service that shares the same AWS account. To pass a role in Account A to a service in Account B, you must first create an IAM role in Account B that can assume the role from Account A, and then the role in Account B can be passed to the service.

PassRole can pass only roles in the same AWS account as the service (Stated). To use a role in another account, A, create a role in account B that can assume the role in account A, and then pass the role in account B (Stated). The PassRole blog post also lists, as one of its three prerequisites, that the role being passed and the principal passing it must be in the same AWS account (Stated).

This site's Amazon EKS Pod Identity and IRSA Decision Guide provides an example where the role for EKS Pod Identity is placed in the cluster's account to meet the PassRole requirements.

3.4 The Flow of the Check

The PassRole blog post lists three prerequisites for passing a role to a service so that the service can use the role (Stated).

  • The principal passing the role must be allowed iam:PassRole in an identity-based policy, with the role being passed in the Resource element. All IAM conditions must be met, and no other policies (such as SCPs, VPC endpoint policies, session policies, or permissions boundaries) should contain either implicit or explicit denials.
  • The trust policy of the role being passed trusts the service principal of the service it is passed to.
  • The role being passed and the principal passing it are in the same AWS account.

Figure 1 arranges these three prerequisites by who makes the check and when, as this article reads them (Inference). The receiving service checks the first and third points in the API call. The second point, concerning the trust policy, takes effect when the service assumes the role (see Chapter 5).

Where iam:PassRole Is Checked - The Receiving Service, the Caller's Policy, and the Trust Policy
Where iam:PassRole Is Checked - The Receiving Service, the Caller's Policy, and the Trust Policy

4. What Narrows PassRole

This chapter describes what a policy that allows PassRole can narrow.

4.1 Four Components and What Not to Use

The components involved in PassRole differ in where they go and what they narrow. This article organized the table below from the sources in Section 1.3.

ComponentWhere It GoesWhat It NarrowsSource
Resource elementThe statement in the caller's identity-based policy that allows iam:PassRole.The set of roles that can be passed.Stated (PassRole page, PassRole blog post)
iam:PassedToServiceThe Condition element in the same statement.The service (service principal) to which the role is being passed.Stated (condition keys page)
iam:AssociatedResourceArnThe Condition element in the same statement.The ARN of the resource to which the role is being associated.Stated (condition keys page)
Trust policyOn the side of the role being passed.The principal that can assume the role. A check separate from the PassRole check.Stated (roles terms, PassRole blog post)
Role tags and ResourceTagNot used.Cannot narrow the roles that can be passed in a reliable way.Stated (PassRole page, PassRole blog post)

Figure 2 shows which part of the passing flow each of the top four components in this table narrows.

What Each Part of a PassRole Policy Narrows
What Each Part of a PassRole Policy Narrows

4.2 Narrowing the Roles That Can Be Passed With the Resource Element

The PassRole page states that the roles that can be passed can be restricted using the Resource element to limit the scope of iam:PassRole (Stated).

The PassRole page explains the reason for restricting passable roles as follows:

When setting the PassRole permission, you should make sure that a user doesn’t pass a role where the role has more permissions than you want the user to have. For example, Alice might not be allowed to perform any Amazon S3 actions. If Alice could pass a role to a service that allows Amazon S3 actions, the service could perform Amazon S3 actions on behalf of Alice when executing the job.

Individuals who can pass roles can grant the service permission to use the authority associated with those roles (Stated). Therefore, if the authority of the roles being passed exceeds the authority of the individual passing them, the individual could potentially cause the service to perform actions that are not permitted to them (Stated). The PassRole blog post includes the following note regarding Resource: "*":

Note: We recommend that you avoid using resource ”*” with the iam:PassRole action in most cases, because this could grant someone the permission to pass any role, opening the possibility of unintended privilege escalation.

Resource: "*" would allow the caller to pass any role in the account, potentially opening the possibility of unintended privilege escalation (Stated). The PassRole blog post also states that if the Resource element is limited to only a wildcard, the principal could pass any role in the account, potentially escalating privileges beyond the intended scope (Stated).

The PassRole page provides an example of restricting the ability to pass only roles whose names begin with EC2-roles-for-XYZ-. The PassRole page also states that you usually add iam:GetRole to iam:PassRole so that the user can get the details of the role being passed (Stated).

{
 "Version":"2012-10-17",
 "Statement": [
 {
 "Effect": "Allow",
 "Action": [
 "iam:GetRole",
 "iam:PassRole"
 ],
 "Resource": "arn:aws:iam::111122223333:role/EC2-roles-for-XYZ-*"
 }
 ]
}

The PassRole blog post recommends the following four ways of writing the Resource element (Stated):

  • Place iam:PassRole in a separate statement from other permissions. This allows for more granular specification of the Resource element.
  • Use a wildcard only as the last characters, when matching a role-name pattern.
  • Organize roles using IAM path or naming conventions, and then restrict the ability to pass only those roles within a specific path. If developers create roles, attach permissions boundaries to the roles and have them created in a defined path.
  • Use the caller's tags as variables in the Resource element.

The PassRole blog post provides an example of using paths, restricting the ability to pass only roles within the /application_role/ path.

{
 "Version": "2012-10-17",
 "Statement": [
 {
 "Effect": "Allow",
 "Action": "iam:PassRole",
 "Resource": [
 "arn:aws:iam::111122223333:role/application_role/*"
 ]
 }
 ]
}

The PassRole blog post provides an example of using the caller's tags, constructing the path to the passable roles based on the value of the caller's AllowedRolePath tag.

{
 "Version": "2012-10-17",
 "Statement": [
 {
 "Effect": "Allow",
 "Action": "iam:PassRole",
 "Resource": [
"arn:aws:iam::111122223333:role/${aws:PrincipalTag/AllowedRolePath}/*"
 ]
 }
 ]
}

The PassRole blog post states that if the AllowedRolePath tag does not have a value, the Resource element will not match the ARN of any role, and no iam:PassRole permissions will be granted (Stated). This refers to the tags of the caller, not the tags of the role being passed. Narrowing by role tags is described in Section 4.5.

Misusing wildcards is a type of design mistake that is not limited to PassRole. This site's IAM Anti-Patterns describes types of IAM design mistakes.

4.3 Narrowing the Service With iam:PassedToService

The condition keys page describes the iam:PassedToService key as specifying the service principal that a role can be passed to (Stated). The value is compared using a string operator and is written in the format of the service principal (Stated).

This condition key applies to only the PassRole action in a policy. It can't be used to limit any other action.

This key applies only to the PassRole action; it cannot narrow other actions (Stated).

Sometimes you pass a role to a service that then passes the role to a different service. iam:PassedToService includes only the final service that assumes the role, not the intermediate service that passes the role.

Sometimes, a service receives a role and then passes it on to another service. In that case, this key contains only the final service that assumes the role; it does not include the intermediate services (Stated). Therefore, this article reads that specifying the service principal of an intermediate service as the value may not allow the intended passing of the role (Inference).

Some services do not support this condition key.

Some services do not support this key (Stated). This article found no list of the services that do not support it in the sources in Section 1.3 (No statement found). The sources also do not say how this key is evaluated when it is written in an Allow condition for a service that does not support it (No statement found).

The example in the PassRole blog post allows ExampleRole to be passed only to Amazon EC2.

{
 "Version": "2012-10-17",
 "Statement": [
 {
 "Effect": "Allow",
 "Action": "iam:PassRole",
 "Resource": "arn:aws:iam::*:role/ExampleRole",
 "Condition": {
 "StringEquals": {
 "iam:PassedToService": "ec2.amazonaws.com"
 }
 }
 }
 ]
}

The PassRole blog post recommends including only one service in the trust policy for a single role, stating that this reduces the need to use this key in the caller's policy (Stated). This key is useful when you want to restrict a role that can be assumed by multiple services to be passed only to a specific service (Stated).

The example on the PassRole example page uses Resource as "*" and iam:PassedToService to allow the role to be passed only to Amazon CloudWatch (Stated). This configuration allows any role in the account to be passed to CloudWatch (Inference). Based on the reasoning in Section 4.2, this article recommends restricting the role using the Resource element as well (Inference). This site's AWS DevOps Agent article provides an example of registering a role that uses this key.

4.4 Narrowing the Associated Resource With iam:AssociatedResourceArn

The condition keys page describes iam:AssociatedResourceArn as follows:

Specifies the ARN of the resource to which this role will be associated at the destination service. The resource usually belongs to the service to which the principal is passing the role. Sometimes, the resource might belong to a third service. For example, you might pass a role to Amazon EC2 Auto Scaling that they use on an Amazon EC2 instance. In this case, the condition would match the ARN of the Amazon EC2 instance.

This key identifies the resource to which the role is being associated—the ARN of the resource within the service receiving the role (Stated). While this resource is often within the service to which the role is being passed, it can also be a resource of a third service (Stated). For example, if the role is passed to Auto Scaling to be used on an EC2 instance, this key matches the ARN of the EC2 instance (Stated). The value is compared using ARN operators (Stated). This key also only applies to the PassRole action (Stated).

About which services support it, the condition keys page says the following:

AWS services that support iam:PassedToService also support this condition key.

Services that support iam:PassedToService also support this key (Stated).

When defining policies that govern access for the AddRoleToInstanceProfile action, special attention is required. The condition keys page says the following (Stated).

In this case, you cannot specify a Region or instance ID in the EC2 instance ARN. The ARN value must be arn:aws:ec2:*:CallerAccountId:instance/*. Using any other ARN value might lead to unexpected evaluation results.

An example on the condition keys page combines two condition keys to restrict a role used with EC2 instances within an account, allowing it to be passed only to EC2.

{
 "Effect": "Allow",
 "Action": "iam:PassRole",
 "Resource": "*",
 "Condition": {
 "StringEquals": {
 "iam:PassedToService": "ec2.amazonaws.com"
 },
 "ArnLike": {
 "iam:AssociatedResourceARN": [
 "arn:aws:ec2:*:111122223333:instance/*"
 ]
 }
 }
}

In this example, the JSON uses the key name iam:AssociatedResourceARN. The heading on the condition keys page is iam:AssociatedResourceArn (Stated). The Condition element page states that the name of the condition key is case-insensitive (Stated).

Context key names are not case-sensitive.

Therefore, this article reads that both spellings refer to the same key (Inference). The body of this article uses the heading spelling iam:AssociatedResourceArn.

The PassRole blog post describes two cautions for this key (Stated). First, some resources, such as EC2 instance IDs, have portions of their ARN that are not known in advance. Deleting and recreating a resource may necessitate updating the ARN in the policy. Second, many organizations choose to restrict the principals that can delete or modify resources rather than restricting the resources to which the role is associated. As an example, the post notes that passing a role to Lambda requires permission to modify the function itself, so organizations restrict who can modify the function.

4.5 Role Tags Do Not Narrow PassRole

The PassRole page warns against tagging roles and narrowing the roles that can be passed with the ResourceTag condition key:

Do not try to control who can pass a role by tagging the role and then using the ResourceTag condition key in a policy with the iam:PassRole action. This approach does not have reliable results.

This approach does not have reliable results (Stated). The PassRole blog post further explains:

iam:PassRole does not support using the iam:ResourceTag or aws:ResourceTag condition keys to specify which roles can be passed.

iam:PassRole does not support specifying the roles that can be passed with iam:ResourceTag or aws:ResourceTag (Stated).

However, as described in Section 2.1, the PassRole row in the SAR table lists both aws:ResourceTag/${TagKey} and iam:ResourceTag/${TagKey} in the condition key column (Stated). This article identifies this as a discrepancy between the sources (Sources disagree). This article reads that the presence of a key in the SAR table does not necessarily indicate that roles can be narrowed using that key (Inference). This article does not design PassRole to narrow roles based on their tags. Instead, as described in Section 4.2, it narrows roles by their name or path in the Resource element, and if necessary, uses the caller's tags as variables in the Resource element.

4.6 Other Policies Can Also Deny PassRole

The PassRole blog post describes the relationship between PassRole and other policies as follows:

The iam:PassRole action can only grant permissions when used in an identity-based policy attached to an IAM role or user, and it is governed by all relevant AWS policy types, such as service control policies (SCPs) and VPC endpoint policies.

PassRole can only be permitted by identity-based policies attached to IAM roles or users (Stated). Furthermore, PassRole is subject to all relevant policy types, including SCPs and VPC endpoint policies (Stated). As stated in Section 3.4, both permissions boundaries and session policies may also deny PassRole (Stated).

The PassRole blog post provides an example of using an SCP to protect roles for specific paths. The example demonstrates that if the caller does not have the team tag with the value security, it will not be allowed to pass roles within the /security_app_roles/ path (Stated).

{
 "Version": "2012-10-17",
 "Statement": [
 {
 "Effect": "Deny",
 "Action": "iam:PassRole",
 "Resource": "arn:aws:iam::*:role/security_app_roles/*",
 "Condition": {
 "StringNotEquals": {
 "aws:PrincipalTag/team": "security"
 }
 }
 }
 ]
}

This site's IAM Policy Evaluation Logic Step-by-Step details the order in which different policy types are evaluated, as well as the distinction between explicit and implicit denials. Specific considerations for requests passing through VPC endpoints are discussed in Section 8.4.

5. How the Work Is Divided With the Trust Policy

This chapter separates the PassRole check from the trust policy check.

5.1 Two Checks

The roles terms define the trust policy as follows:

A JSON policy document in which you define the principals that you trust to assume the role. A role trust policy is a required resource-based policy that is attached to a role in IAM.

A trust policy is a resource-based policy attached to a role that defines the principals that can assume that role (Stated). In the example on the PassRole page, the trust policy for the role being passed to EC2 allows the ec2.amazonaws.com service principal to perform the sts:AssumeRole action (Stated).

{
 "Version":"2012-10-17",
 "Statement": {
 "Sid": "TrustPolicyStatementThatAllowsEC2ServiceToAssumeTheAttachedRole",
 "Effect": "Allow",
 "Principal": { "Service": "ec2.amazonaws.com" },
 "Action": "sts:AssumeRole"
 }
}

The example on the PassRole page breaks down what is required to pass a role into three parts: the permissions policy attached to the role, which defines what the role can do; the trust policy for the role, which allows a service to assume that role; and the user permissions policy, which restricts the ability to pass only approved roles (Stated).

Therefore, the two checks involve different policies and different principals. The PassRole check examines the caller's identity-based policy to determine whether the caller is authorized to pass that role. The trust policy check examines the role's trust policy to determine whether a service is authorized to assume that role. When passing a role to a service, the Principal in the trust policy specifies the service, not the caller passing the role. Therefore, this article reads that the trust policy cannot narrow who can pass the role (Inference).

5.2 A Resource May Be Created Even Without Trust

The PassRole blog post says the following about the trust policy prerequisite:

In certain scenarios, the resource may end up being created or modified even if a passed IAM role doesn’t trust the required service principal, but the AWS service won’t be able to use the role to perform actions.

In some cases, resources may be created or modified even if the passed role does not trust the required service principal. However, the service cannot perform any actions using that role (Stated). The sources do not specify which services or operations are affected (No statement found).

Therefore, this article reads that a successful response from the API that passes the role does not necessarily mean the service can use that role (Inference). It is necessary to verify, through the service's own operations, whether the service is actually able to use the role after the resource has been created (Inference).

5.3 One Role, One Use Case

The PassRole blog post recommends using a single IAM role for each specific use case and avoiding using the same role across multiple services (Stated). It also recommends creating separate roles for workloads, even those in the same service (Stated). As mentioned in Section 4.3, by limiting trust policies to a single service, the need to narrow using iam:PassedToService is also reduced (Stated).

6. Passing a Service-Linked Role

This chapter describes PassRole when passing a service-linked role.

6.1 Required Only When Explicitly Specified

The PassRole page says the following:

When you specify a service-linked role, you must also have permission to pass that role to the service.

Even when specifying a service-linked role, the permission to pass that role to the service is required (Stated). The PassRole page, using Amazon EC2 Auto Scaling as an example, describes the case where a role is not specified:

If you don't explicitly specify the role, the iam:PassRole permission is not required, and the default is to use AWSServiceRoleForAutoScaling role for all operations that are performed on that group.

If a role is not explicitly specified, the iam:PassRole permission is not required. Instead, the default AWSServiceRoleForAutoScaling role is used for operations in that group (Stated). The Auto Scaling service-linked role page also states that specifying the role without permission to pass it results in an error (Stated).

If users try to specify a service-linked role without permission to pass that role to the service, they receive an error.

Therefore, whether or not a service-linked role requires PassRole depends on whether the role is explicitly specified. It cannot be definitively stated that a service-linked role does not require PassRole.

6.2 Services That Create Multiple Roles and Pass Them

The PassRole blog post notes that in services that use service-linked roles, PassRole is often unnecessary (Stated). This is because the service creates and manages roles on behalf of the user, and the user does not pass roles through the service configuration, so the PassRole check is not performed (Stated).

However, there are services that create multiple service-linked roles and can pass them when creating or modifying resources. In these cases, PassRole is required, as with service roles (Stated). The PassRole blog post gives the example of Auto Scaling, which can create multiple roles with suffixes, and of passing the role's ARN in the request that creates an Auto Scaling group (Stated).

Service-linked roles are created under the /aws-service-role/ path (Stated). The PassRole blog post recommends organizing roles by team using suffixes and separating the roles that can be passed through IAM policies. The following example allows only roles with the suffix _BlueTeamSuffix to be passed (Stated).

{
 "Version": "2012-10-17",
 "Statement": [
 {
 "Effect": "Allow",
 "Action": "iam:PassRole",
 "Resource": [
 "arn:aws:iam::*:role/aws-service-role/*_BlueTeamSuffix"
 ]
 }
 ]
}

6.3 How the Roles Troubleshooting Page Puts It

The section "I'm not authorized to perform: iam:PassRole" of the roles troubleshooting page states that when creating a service-linked role, you need the permission to pass the role. It states that attempting to create an Auto Scaling group without the PassRole permission will result in the error described in Section 8.3 (Stated).

This section does not differentiate between explicitly specifying the role and using a default. The PassRole page in Section 6.1 and the Auto Scaling service-linked role page both state that the permission is required when the role is explicitly specified. This article treats this as a place where the sources disagree (Sources disagree). This article will state the required condition as when the role is explicitly specified, a condition that both sources agree upon. The error described in the roles troubleshooting page is referenced as an example of the error format in Section 8.3.

7. What Changes After the Check

This chapter illustrates, through examples from the sources, how the timing of the check from Section 3.2 impacts the design.

7.1 Auto Scaling Launch Template Versions

The launch template permissions page states that launching instances from a launch template that contains an instance profile (a container for an IAM role) also requires the iam:PassRole permission (Stated). Furthermore, regarding the version of the launch template used by an Auto Scaling group, it states:

When a user calls the CreateAutoScalingGroup, UpdateAutoScalingGroup, or StartInstanceRefresh APIs, Amazon EC2 Auto Scaling checks their permissions against the version of the launch template that is the latest or default version at that time before proceeding with the request.

When CreateAutoScalingGroup, UpdateAutoScalingGroup, or StartInstanceRefresh are called, Auto Scaling checks the caller's permissions against the most recent version or the default version of the launch template at that time (Stated). This check includes permissions required to launch instances, such as ec2:RunInstances and iam:PassRole. Auto Scaling performs this check using a dry run of the EC2 RunInstances operation (Stated).

After the initial verification and request are complete, whenever instances launch, Amazon EC2 Auto Scaling launches them with the latest or default version, even if it has changed, using the permissions of its service-linked role. This means that a user who is using the launch template could potentially update it to pass an IAM role to an instance even if they don't have the iam:PassRole permission.

After the initial verification and request, Auto Scaling uses the most recent or default version, even if it has changed, and launches instances using the permissions associated with the service-linked role (Stated). Consequently, even if the user does not possess the iam:PassRole permission, they may be able to update the launch template and pass an IAM role to the instance (Stated).

7.2 Mitigations the Sources Describe

The launch template permissions page describes two mitigations (Stated).

  • To restrict who can configure groups to use the $Latest or $Default version, use the condition key autoscaling:LaunchTemplateVersionSpecified. Groups will then only accept versions specified by number in CreateAutoScalingGroup and UpdateAutoScalingGroup calls.
  • For groups that use either $Latest or $Default, restrict who can create and manage launch template versions. This also includes the ec2:ModifyLaunchTemplate action, which allows specifying a default version.

7.3 What This Example Shows, and What It Does Not

Based on the example in Section 7.1, this article reads the following (Inference). The PassRole check is made at the time an API call receives the role's ARN, based on the configuration in effect at that moment. If, after this check, there is a path by which the service can change the role it uses without going through the API that receives the role's ARN, that path will not be subject to the PassRole check. Therefore, when narrowing PassRole, narrow not only the API that passes the role but also who can change the configuration that the service will subsequently read (in this example, the version of the launch template).

The sources for this article do not say whether other services have the same path (No statement found). This article specifically focuses on the description in Section 7.1 regarding Auto Scaling launch templates and does not extend this to other services.

The sources in Section 1.3 do not say whether, after the caller's PassRole is removed, the service of a resource that already has the role attached can no longer use the role (No statement found). This article does not state that it would stop. This site's What Stays Valid After You Revoke on AWS - Role Sessions, Presigned URLs, Portal Sessions, Tokens, and Open Connections covers what stays valid after you revoke.

8. Reading Records and Errors

This chapter explains what PassRole leaves in records and what to look at when a request is denied.

8.1 CloudTrail Has No PassRole Event

The PassRole page describes CloudTrail's handling as follows:

To review what roles are passed to which AWS services in CloudTrail, you must review the CloudTrail log that created or modified the AWS resource receiving the role. For example, a role is passed to an AWS Lambda function when it's created. The log for the CreateFunction action shows a record of role that was passed to the function.

As stated in Section 2.1, PassRole is not an API, so CloudTrail does not generate logs for PassRole events (Stated). The PassRole blog post also states that since iam:PassRole is not an API call, no records of it are stored in CloudTrail (Stated). To determine which role was passed to which service, you should examine the events that created or modified the resource that received the role (Stated). For example, with Lambda, the role passed to the function will be visible in the CreateFunction event (Stated).

Therefore, this article reads that to investigate who passed which role, you will need to search for events related to the API calls that receive the role's ARN for each service (Inference). The specific field in the event where the role's ARN is included varies depending on the service and API. However, no list of these was found in the sources in Section 1.3 (No statement found).

8.2 Not in Last Accessed Information Either

IAM last accessed information also does not show PassRole. This point, and why last accessed information alone cannot decide that a role can be deleted, are explained on this site in Where the Logs Come From on AWS.

8.3 The Shape of the Error

The roles troubleshooting page shows the following example of an error when PassRole is missing:

ClientError: An error occurred (AccessDenied) when calling the PutLifecycleHook
 operation: User: arn:aws:sts::111122223333:assumed-role/Testrole/Diego is not authorized
 to perform: iam:PassRole on resource:
 arn:aws:iam::111122223333:role/aws-service-role/autoscaling.amazonaws.com/AWSServiceRoleForAutoScaling

The access denied page states that many denial messages are structured to indicate who, what action, and which resource was affected, followed by the context of the denial (Stated). In cases of implicit denials, a phrase of the following form is included (Stated).

because no type policy allows the action action

An explicit denial includes a phrase of the following form (Stated).

with an explicit deny in a type policy

In both, type is replaced by the policy type and action by the action (Stated). Some services do not support this format (Stated).

From this example, this article reads the following (Inference):

  • The operation name following when calling the is the API of the receiving service. It is not PassRole itself (Section 3.1).
  • The ARN following on resource: is the ARN of the role being passed. The resource type in the PassRole row of the SAR is role (Section 2.1).

When fixing it, check the following in order (Inference):

  1. Verify that the caller's identity-based policy includes an iam:PassRole permission with a Resource element that includes the ARN of the role. Ensure the ARN is correct, including the role path (e.g., /service-role/ or /aws-service-role/) (Section 4.2).
  2. Confirm that the value of iam:PassedToService matches the service principal of the service ultimately assuming the role (Section 4.3).
  3. If using iam:AssociatedResourceArn, verify that the ARN of the resource being associated is correct (Section 4.4).
  4. If the message has an explicit deny phrase, determine which of an SCP, a VPC endpoint policy, a permissions boundary, or a session policy denied it (Section 4.6).
  5. Confirm that the role does not belong to a different account (Section 3.3).

This site's AWS IAM AccessDenied Reference describes the general procedure for locating the statement that denied the request from the error message.

8.4 Requests Passing Through VPC Endpoints

The PassRole blog post states the following regarding VPC endpoints:

If a request that requires the iam:PassRole permission is made over a VPC endpoint with a custom VPC endpoint policy configured, iam:PassRole should be allowed through the Action element of that VPC endpoint policy, or the request will be denied.

If a request requiring iam:PassRole is sent through a VPC endpoint with its own VPC endpoint policy, that policy must also allow iam:PassRole in its Action element. Otherwise, the request is denied (Stated).

8.5 IAM Access Analyzer Checks

The policy checks page lists six checks about PassRole in IAM Access Analyzer policy validation (Stated).

  • Pass role with NotResource
  • Pass role with star in action and NotResource
  • Pass role with NotAction and NotResource
  • Pass role with star in resource
  • Pass role with star in action and resource
  • Pass role with star in resource and NotAction

All of them have the finding type SECURITY_WARNING (Stated). Among them, the Pass role with star in resource check has the issue code PASS_ROLE_WITH_STAR_IN_RESOURCE and returns the following message (Stated):

Pass role with star in resource: Using the iam:PassRole action with wildcards (*) in the resource can be overly permissive because it allows iam:PassRole permissions on multiple resources. We recommend that you specify resource ARNs or add the iam:PassedToService condition key to your statement.

Regarding this check, the policy checks page notes that it may not detect certain ARNs, considering that some services include their namespace in the role name. For example, it may not detect ARNs like arn:aws:iam::*:role/Service* (Stated). Therefore, this article reads that the absence of this finding does not necessarily indicate that the Resource element is sufficiently restrictive (Inference). This site's IAM Policy Least Privilege Analyzer also detects any iam:PassRole permission to arbitrary resources.

8.6 Access Troubleshooter

What's New announced IAM Access Troubleshooter on November 17, 2026 (Stated). For supported services and APIs, denial messages now include a unique identifier (authorization ID), allowing users to retrieve detailed authorization information based on that identifier (Stated).

The authorization ID page states that users can either pass the identifier to the GetRequestAuthorizationDetails API or open a link in the message, revealing the evaluated policy, the context of the request, and the evaluation result (Stated). An authorization ID is not guaranteed to always be present, and the details are retained for at least 24 hours after a denial (Stated).

As of the check date, the authorization ID page lists nine services with support in some of their APIs: AWS CodeDeploy, AWS Identity and Access Management, AWS Key Management Service, AWS Security Token Service, AWS Step Functions, Amazon Elastic Compute Cloud, Amazon Elastic Container Registry, Amazon Kinesis Data Streams, and Amazon Simple Queue Service (Stated). Support is being rolled out gradually to additional services and regions (Stated). Requests that a service makes on your behalf are among the request types not yet supported (Stated).

The sources do not state whether denials due to insufficient PassRole permissions will include an authorization ID (No statement found). However, if an authorization ID is present, it can be used to review the specific PassRole denial and the associated policy (Inference).

9. Where the Sources Disagree, and What They Do Not Say

This chapter collects the places the body marks Sources disagree or No statement found.

ItemStatusTreatment in this Article
Can role tags narrow the roles that can be passed?Sources disagree (The SAR row lists tag keys. The PassRole page and the PassRole blog post say not to use them.)Do not use them (Section 4.5)
When does a service-linked role need PassRole?Sources disagree (The roles troubleshooting page does not distinguish whether the role is explicitly specified.)State that it is required when explicitly specified (Section 6.3)
What is the list of services that do not support iam:PassedToService?No statement foundSimply state that there are services that do not support it (Section 4.3)
Which services and operations allow resources to be created even without trust?No statement foundDo not treat a successful API call that passes the role as evidence that the service can use the role (Section 5.2)
Do other services have a path equivalent to that used for Auto Scaling launch templates?No statement foundLimit the description to examples involving Auto Scaling (Section 7.3)
If PassRole is removed after a role is passed, can the service no longer use the role?No statement foundDo not state that the service will no longer be able to use the role (Section 7.3)
In which fields of CloudTrail events does the role ARN appear?No statement foundCheck service by service and API by API (Section 8.1)
Does a denial for missing PassRole include an authorization ID?No statement foundIf present, refer to the details (Section 8.6)

10. Frequently Asked Questions About iam:PassRole

This chapter answers the readers in Section 1.1 with the text of Chapters 2 through 9.

Q1. What is the problem with allowing iam:PassRole with Resource: "*"?

Any role in the account can be passed. If the permissions of the role being passed are broader than the caller's permissions, the caller could potentially cause the service to perform actions that the caller themselves are not authorized to do. The PassRole blog post notes that this opens the possibility of unintended privilege escalation. Narrow the role name or path in the Resource element (see Section 4.2).

Q2. If the trust policy specifies the service, can PassRole be left unrestricted?

No. The trust policy determines whether a service is capable of assuming a role, but it does not determine who can pass that role. The identity-based policy, specifically the PassRole setting (as described in Section 5.1), dictates who is authorized to pass the role.

Q3. Can tagging roles and using iam:ResourceTag narrow the roles that can be passed?

No. The PassRole page states that this approach does not have reliable results, and the PassRole blog post indicates that PassRole does not support this specification. Even though the SAR table lists the keys, this article does not use them. While there is a mechanism to use the caller's tags as variables in the Resource element (see Sections 4.2 and 4.5), it is a different approach.

Q4. Is PassRole unnecessary for a service-linked role?

If you explicitly specify a role, then it is necessary. If you allow the service to use its default role, then it is not necessary. For services that can be provided with multiple roles, it is required, just like with service roles (Chapter 6).

Q5. Can a role in another account be passed?

No. PassRole can only pass roles within the same account as the service. If you want the service to use a role in a different account, create a role on the service's account that can assume the other account's role, and then pass that role (as described in Section 3.3).

Q6. Can CloudTrail show who passed which role?

Not through PassRole events. Since PassRole is not an API, PassRole events are not recorded in CloudTrail. To see which role was passed, examine the events that created or modified the resource that received the role (see Section 8.1).

Q7. Can iam:PassedToService be used with every service?

No. The condition keys page states that there are some services that do not support this key. A list of those services was not found in the sources (Section 4.3).

Q8. If PassRole is removed, does the service stop using a role already passed?

The sources do not say. For many services, the PassRole check is performed at the time the API call to pass the role is made, and it is not re-evaluated each time the service assumes the role. This article does not state that removing the PassRole will cause previously passed roles to become unusable. In the Auto Scaling example, instances continue to launch with the service-linked role permissions after the check (see Section 3.2 and Chapter 7).

11. Summary

Before creating a policy that allows iam:PassRole, ensure the following:

  • You understand that the service receiving the role checks PassRole, and that it checks when a resource is created with the role attached and when it is changed to a new role (Chapter 3).
  • The role being passed is within the same account as the service (Section 3.3).
  • The iam:PassRole permission is included in a separate statement and is restricted by the Resource element, specifying either the name or path of the role. Resource: "*" is not used (Section 4.2).
  • If multiple services can assume the role, iam:PassedToService restricts the policy to the service that ultimately assumes the role (Section 4.3).
  • If you use iam:AssociatedResourceArn, you have allowed for ARNs with parts that are not known in advance and for the caution about AddRoleToInstanceProfile (Section 4.4).
  • The policy does not narrow the roles that can be passed with role tags and the ResourceTag condition keys (Section 4.5).
  • You have allowed for SCPs, VPC endpoint policies, permissions boundaries, and session policies that may deny PassRole (Sections 4.6 and 8.4).
  • The trust policy specifies only one service, and the success of role-passing API calls is not used as proof that the service can use the role (Chapter 5).
  • The policy allows iam:PassRole for automation that explicitly specifies service-linked roles (Chapter 6).
  • If using a $Latest or $Default launch template with Auto Scaling, who can create and change its versions is restricted (Chapter 7).
  • The passed role can be tracked in the creation and modification events of the resources that receive it (Section 8.1).
  • The policy has been validated using IAM Access Analyzer, including checks for iam:PassRole (Section 8.5).
  • You have revisited the relevant pages to confirm that the definitions of the condition keys and the supported services have not changed since the check date of November 25, 2026 (Section 1.5).

12. References



References:
Tech Blog with curated related content

Written by Hidekazu Konishi