All Tools View Categories About Contact Privacy

IAM Role/User ARN Generator

Build an IAM role or user ARN, with an optional path.

IAM is global — there’s no region field. Runs entirely in your browser; your account id and names never leave this page.
Fill in account id and name to build an ARN.

About IAM Role/User ARN Generator

IAM role and user ARNs look deceptively simple next to something like a Lambda ARN — no region, and the resource segment is just a type keyword and a name. The part that actually trips people up is the optional path: AWS lets you nest roles and users under a path prefix the same way you’d nest files in folders, and getting that path segment positioned correctly (between the type keyword and the name, with exactly one slash on each side) is where hand-typed IAM ARNs most often go wrong. IAM Role/User ARN Generator builds the ARN from four fields — account id, a role-vs-user toggle, an optional path, and a name — so the path always lands in the right place regardless of how you type it.

IAM is a global AWS service, so unlike Lambda or EC2, its ARNs never carry a region — the field between the third and fourth colon is always empty: arn:aws:iam::123456789012:role/my-role. The account id is still required, though, since every role and user belongs to exactly one AWS account. The tool’s form reflects that reality directly: there’s an account id field, but no region field at all, with a short note explaining why rather than leaving you to wonder if something is missing.

The role-vs-user choice is a toggle rather than a free-text field on purpose. The resource type segment in a real IAM ARN has to be exactly role or exactly user, lowercase, with no room for a typo like Role or Roles silently producing a broken ARN — a toggle makes that mistake structurally impossible. The optional path field is the piece most generators skip: AWS itself creates plenty of roles under paths, most visibly service-linked roles under aws-service-role/... and console-created service roles under service-role/..., and organizations that use IAM paths to group roles by team or environment need that segment to show up correctly in every ARN they hand-build. Type the path with or without leading or trailing slashes — service-role, /service-role, or service-role/ all normalize to the same result — and the tool inserts exactly one slash on each side, so role/service-role/my-lambda-role comes out right whether you were careful about slashes or not.

Leave the path blank — the common case for most manually created roles and users — and you get the simple two-segment resource: role/my-role or user/jdoe. Nested paths work the same way: a path of org/team-a produces user/org/team-a/jdoe, preserving the full hierarchy.

After building, the ARN runs through the same structural validator shared across this entire tool family: partition, service, and — since IAM has no region — a check that the region field really is empty, plus the standard 12-digit account id format check. This is deliberately scoped to roles and users, which share an identical ARN shape; IAM groups use the same pattern with group/ in place of role/ or user/ but aren’t part of this form’s toggle, since conflating three resource types in one two-way switch would undercut the whole point of making the type field foolproof.

A Load sample button fills in a realistic account id, role type, path, and name so you can see the nested-path form immediately; Clear resets everything. As with every tool here, the account id and any role or user names you type never leave your browser — construction and validation both happen entirely client-side.

Features

  • Four-field form — account id, role/user toggle, optional path, name.
  • No region field — IAM is global, and the form reflects that directly.
  • Type toggle instead of free text — makes a role/user typo structurally impossible.
  • Path normalization — leading/trailing slashes are trimmed and reinserted correctly regardless of how you type them.
  • Nested path support for multi-segment paths like org/team-a.
  • Live preview that updates as you type.
  • Built on the shared buildARN engine, validated with the same validator used across every ARN tool here.
  • Sample account/type/path/name preloaded with one click.
  • One-click copy and clear.
  • 100% client-side — account ids and names never leave the page.

How to Use

  1. Enter a 12-digit account id.
  2. Toggle Role or User.
  3. Optionally enter a path — leave blank unless the role/user was created with one.
  4. Type the role or user name.
  5. Watch the live preview update as you fill in fields.
  6. Click Build to validate and reveal the copy action.
  7. Copy the ARN into your IAM policy or trust relationship.
  8. Clear and repeat for the next role or user.

Examples

Example 1 — Simple role, no path. Account 123456789012, type Role, no path, name my-role, gives arn:aws:iam::123456789012:role/my-role.

Example 2 — Role under service-role path. Same account, type Role, path service-role, name my-lambda-role, gives arn:aws:iam::123456789012:role/service-role/my-lambda-role — the pattern used by most console-created Lambda execution roles.

Example 3 — Simple user. Account 123456789012, type User, no path, name jdoe, gives arn:aws:iam::123456789012:user/jdoe.

Example 4 — Nested path. Type User, path org/team-a, name jdoe, gives arn:aws:iam::123456789012:user/org/team-a/jdoe.

Example 5 — Path typed with slashes. Path entered as /service-role/ normalizes the same as service-role, giving the identical role/service-role/my-role resource segment.

Benefits

  • Path segments always land in the right position — no more manually counting slashes.
  • Role/user typos are impossible thanks to the toggle.
  • Handles nested paths correctly, not just the simple single-segment case.
  • Correctly reflects that IAM has no region, unlike ARNs built by hand from a regional-service template.
  • Consistent with the shared ARN engine used across this entire tool family.
  • Private — account ids and names never leave your browser.

Frequently Asked Questions

Why is there no region field for IAM ARNs?
IAM is a global service — roles and users aren’t tied to a region, so IAM ARNs always leave that field empty: <code>arn:aws:iam::account:role/name</code>. The account id is still required, since roles and users are scoped to one AWS account.
What is the path for, and when do I need one?
IAM lets you organize roles and users under a path prefix, similar to a folder — AWS itself creates service-linked and console-managed roles under paths like <code>service-role/</code> or <code>aws-service-role/...</code>. If you didn’t explicitly set a path when creating the role or user, leave this blank; most roles created without extra options have no path.
Does it matter whether I type "Role" or "role" for the type?
The tool uses a toggle rather than free text specifically so you can’t typo this — the resource type segment in the ARN (<code>role/</code> vs <code>user/</code>) must be exactly lowercase, and the toggle guarantees that.
Can I add or strip leading and trailing slashes in the path field myself?
You can type it either way — with or without leading/trailing slashes — the tool trims them and reinserts exactly one slash between the path segment and the name, so <code>service-role</code>, <code>/service-role</code>, and <code>service-role/</code> all produce the same ARN.
What’s the difference between an IAM role ARN and an IAM user ARN in practice?
Structurally they’re identical apart from the <code>role/</code> vs <code>user/</code> segment. Functionally, roles are assumed temporarily (by services, federated identities, or other accounts) and carry no long-term credentials, while users represent a persistent identity with its own credentials — but the ARN format itself doesn’t encode that difference beyond the type keyword.
Can I build an ARN for an IAM group with this tool?
No — this generator is scoped to roles and users, which share the exact same ARN shape. Groups use the same pattern with <code>group/</code> instead, but aren’t included in this tool’s type toggle.
Is my account id or role name sent anywhere?
No. The ARN is assembled entirely client-side; nothing you type is transmitted anywhere.
What does the validation check catch here?
It confirms the partition and service look correct, that the account id is exactly 12 digits, and (since IAM has no region) that the region field really is empty as expected. It does not confirm the role or user actually exists in that account.