All Tools View Categories About Contact Privacy

Assume Role Policy Generator

Grant a user or role permission to call sts:AssumeRole against target roles — the identity-side counterpart to a trust policy.

Runs entirely in your browser — target ARNs and external IDs never leave this page.
0
target role(s)
-
action
0
conditions
-
structurally valid

  

About Assume Role Policy Generator

Role assumption in AWS IAM always has two separate, independently-configured halves, and mixing them up is one of the most common sources of "Access denied" confusion when setting up cross-account access. Assume Role Policy Generator builds the half that is easy to forget: the permissions statement attached to the calling user or role, granting it the ability to attempt an assume-role call against one or more specific target roles.

The other half — deciding who is allowed to assume a given role — is a trust policy attached to the target role itself, and this site has a separate, dedicated IAM Trust Policy Generator for exactly that. The two are not interchangeable and neither one alone is sufficient: a user can have this tool's permission statement attached and still be denied if the target role's trust policy does not name them, and a role's trust policy can name a caller perfectly and that caller will still be denied if it lacks permission to call sts:AssumeRole in the first place. This tool exists specifically to fill the gap most people forget: it is entirely possible to configure a role's trust relationship correctly and still get "not authorized to perform sts:AssumeRole" because the calling identity was never actually granted permission to call it.

Enter one or more target role ARNs, one per line — a common case is a single operator role needing access to the same-named role across several member accounts in an organization, so multiple targets in one statement is a first-class, expected use, not an edge case. Every line is trimmed, de-duplicated, and validated as a structurally well-formed ARN before a statement is built; an invalid line is rejected with a specific error rather than silently dropped or silently included.

The action defaults to the standard sts:AssumeRole, but two federated variants are available and must be chosen deliberately rather than guessed: sts:AssumeRoleWithSAML when the calling identity authenticates through a SAML identity provider before assuming the role, and sts:AssumeRoleWithWebIdentity when it authenticates through an OIDC provider. Which variant is correct depends entirely on how the calling identity itself authenticates, not on anything about the target role, so this tool leaves the choice explicit rather than trying to infer it.

An optional External ID field adds the standard sts:ExternalId condition, the same confused-deputy mitigation used in the Trust Policy Generator — but note it only does half the job here too: for the external ID to actually protect anything, the target role's trust policy on the other side needs the matching condition as well. This tool cannot see or verify that; it can only build its own side correctly.

As with the other tools in this category, validation is structural: the same policy-document validator checks Version, a non-empty Statement array, and the required Effect/Action/Resource fields. Nothing about whether the target roles actually exist, whether their trust policies actually permit this caller, or whether an external ID actually matches on both sides is something this tool — running entirely in your browser, with no AWS API access — can confirm. It builds one correct, well-formed half of the relationship; the target role's trust policy remains a separate, required piece of configuration.

Features

  • Builds the permission side of role assumption — explicitly distinguished from the resource-side Trust Policy Generator.
  • Multiple target role ARNs in one statement, one per line, deduplicated automatically.
  • Every target ARN validated before a statement is built.
  • Action variant selectorsts:AssumeRole, sts:AssumeRoleWithSAML, sts:AssumeRoleWithWebIdentity.
  • Optional External ID condition for confused-deputy mitigation.
  • Structural policy validation before you copy the result.
  • Sample statement preloads a realistic multi-account example.
  • Copy as JSON and Download .json.
  • One-click clear.
  • 100% client-side — nothing typed here is uploaded.

How to Use

  1. Enter one or more target role ARNs, one per line.
  2. Pick the action variant matching how this caller authenticates — standard, SAML, or OIDC.
  3. Optionally enter an External ID, matching what the target role's trust policy expects.
  4. Click Build statement.
  5. Review any ARN validation errors and fix the flagged lines.
  6. Copy or download the JSON.
  7. Attach it to the calling user or role as a permissions policy — not to the target role.
  8. Separately configure the target role's trust policy using the Trust Policy Generator, if you have not already.

Examples

Example 1 — single target role. Target ARN arn:aws:iam::444455556666:role/PartnerAccess, action sts:AssumeRole, no External ID — a minimal permission statement to assume one role.

Example 2 — multi-account operator access. Three target ARNs, one per line, for the same-named OpsRole in three different member accounts — one statement grants assume permission to all three.

Example 3 — cross-account with External ID. Target ARN arn:aws:iam::999999999999:role/VendorRole, External ID partner-42 — the resulting statement only satisfies the target's trust policy if that role's trust policy requires the same External ID.

Example 4 — SAML-federated caller. Target ARN arn:aws:iam::123456789012:role/AnalystRole, action sts:AssumeRoleWithSAML — used when the calling identity itself federates in via SAML before it can assume this role.

Example 5 — invalid ARN caught. Entering role/Ops instead of a full ARN produces a specific validation error naming that line, and no statement is built.

Benefits

  • Fills the gap most people forget — permission to call AssumeRole, distinct from the target role's trust policy.
  • Every target ARN validated before you copy anything.
  • Correct action variant for federated callers, chosen explicitly rather than guessed.
  • Multi-target statements for common multi-account operator patterns.
  • Structural validation before you attach the policy.
  • Private — target ARNs and external IDs never leave your browser.

Frequently Asked Questions

How is this different from the IAM Trust Policy Generator?
They build the two opposite halves of a role-assumption relationship. The Trust Policy Generator builds the statement attached to the TARGET role, controlling who is allowed to assume it (its <code>Principal</code>). This tool builds the statement attached to the USER OR ROLE that wants to assume something else — it grants that identity permission to call <code>sts:AssumeRole</code> (or a federated variant) against one or more target role ARNs (its <code>Resource</code>). A real cross-account or delegated-role setup needs both: the calling identity needs permission to attempt the assume-role call, and the target role's trust policy needs to allow that specific caller. This tool only builds the calling-identity side.
Where do I attach the JSON this tool produces?
As a permissions policy (inline or managed) on the IAM user or role that needs to be ABLE to assume other roles — not on the target role being assumed. If you also need to configure the target role to accept the assumption, use the separate IAM Trust Policy Generator for that role's trust relationship.
Can I list multiple target roles in one statement?
Yes — enter one ARN per line in the textarea. Blank lines are ignored and duplicate lines are automatically removed; the resulting statement's Resource is a single ARN if you entered one, or an array if you entered more than one.
What are the action variants for?
AWS uses a different STS API depending on how the caller ultimately authenticates before assuming the role. <code>sts:AssumeRole</code> is the standard case for an IAM user or role assuming another role directly. <code>sts:AssumeRoleWithSAML</code> is used when the calling identity federates in via a SAML provider, and <code>sts:AssumeRoleWithWebIdentity</code> when it federates in via an OIDC provider (Cognito, GitHub Actions OIDC, etc). Pick the variant that matches how the calling identity actually authenticates.
What does the External ID field do?
It adds <code>"Condition":{"StringEquals":{"sts:ExternalId":"<value>"}}</code> to the statement. This is the standard defense against the confused-deputy problem: if the target role's own trust policy also requires the same external ID, the assume-role call only succeeds when both sides present and require the same agreed-upon value.
Does every target role ARN get validated?
Yes — each line is checked with the same structural ARN validator used across this tool category before a statement is built. Any line that does not parse as a valid ARN is rejected with a specific error naming the bad line, rather than being silently included.
Does this tool check whether the target roles actually exist or actually trust this caller?
No — it only validates that each ARN is structurally well-formed. It does not call AWS, so it cannot confirm the role exists, that its trust policy actually allows this caller, or that the external ID (if any) matches what the target role requires.
Can I combine an External ID with an action variant other than sts:AssumeRole?
Yes — the External ID condition is independent of which action variant you pick; it is added to whichever statement is built.
Is anything I type sent anywhere?
No — ARN parsing, validation, condition building, and JSON assembly all run locally in your browser.
Can I export the result?
Yes, Copy as JSON and Download .json appear once the statement is built.