Get temporary credentials for a role from the CLI. Returns an AKID, secret, AND a session token — export all three.
⚠ Gotcha: Forgetting AWS_SESSION_TOKEN is the #1 assume-role failure. Default session is 1h; role chaining caps at 1h regardless of --duration-seconds.
Organization-level guardrails. An SCP can only RESTRICT — it never grants. If the SCP does not allow it, no IAM policy can either.
⚠ Gotcha: SCPs do not apply to the management account or to service-linked roles — a frequent "why isn’t my SCP working" surprise.
Examples
SCP denies region eu-west-1 → every account in the OU is blocked there
Permissions boundary
A managed policy set as a ceiling on a user/role. The effective permission is the INTERSECTION of the identity policy and the boundary.
Examples
Identity allows s3:* + ec2:*; boundary allows s3:* → only s3:* is effective
Identity vs resource policy union
Within ONE account, access is granted if the identity policy OR the resource policy allows it (and nothing denies). Either side can authorize.
Examples
No identity Allow, but bucket policy allows the user → access granted
Cross-account needs both sides
Across accounts, BOTH the resource policy (or trust) in the target account AND an IAM policy in the caller’s account must allow it.
⚠ Gotcha: This asymmetry vs same-account union is the most common cross-account AccessDenied cause.
Examples
Bucket policy allows acct B, but B’s IAM has no Allow → denied
Pitfalls (10)
iam:PassRole is the silent escalation
Launching an EC2/Lambda/ECS task with a role requires iam:PassRole on that role. Granting PassRole on "*" lets a user attach an admin role to compute they control — full takeover.
⚠ Gotcha: Always scope PassRole to specific role ARNs and add a Condition on iam:PassedToService.
A statement with Allow on Action "*" and Resource "*" is AdministratorAccess no matter what it is named. Wildcards hide the blast radius.
Examples
"Effect": "Allow", "Action": "*", "Resource": "*"
Inline vs managed policies
Managed policies are reusable, versioned, and listed via list-attached-*. Inline policies are 1:1 with the principal, unlisted there, and easy to lose.
⚠ Gotcha: A "missing permission" you cannot find is often hiding in an inline policy. Check list-role-policies / list-user-policies.
Examples
aws iam list-role-policies --role-name MyAppRole
Policy size limits
Managed policy doc ≤ 6,144 chars; inline policy per user/role/group ≤ 2,048/10,240 chars depending on type. Whitespace counts.
⚠ Gotcha: Hitting the limit means splitting into multiple managed policies (up to 10 attachable per principal) or compacting whitespace.
Examples
Managed policy max: 6144 characters
IAM changes are eventually consistent
A new key, role, or policy edit can take a few seconds to propagate globally. A create-then-use script may briefly 403.
⚠ Gotcha: Add a retry-with-backoff after create-role before assume-role, rather than assuming the change is instant.
Examples
create-role → (wait/retry) → assume-role
Access key leaked to git
A committed AKID is scraped by bots within minutes and abused for crypto mining across regions. Delete the key FIRST; history rewrite alone does not help.
⚠ Gotcha: iam delete-access-key immediately, audit CloudTrail for the last 24h, then rotate every secret in that account.
Examples
aws iam update-access-key --access-key-id AKIA... --status Inactive --user-name lilei
aws iam delete-access-key --access-key-id AKIA... --user-name lilei
NotAction with Allow over-grants
Allow + NotAction grants everything you did NOT list. People reach for it to "block one thing" and accidentally open the rest.
⚠ Gotcha: To block specific actions use an explicit Deny + Action, never Allow + NotAction.
If a condition value contains * or ?, you must use StringLike. StringEquals treats them as literal characters and the condition silently never matches.
Use IAM Access Analyzer "last accessed" / generate-service-last-accessed-details to right-size a policy from real usage instead of guessing.
Examples
aws iam generate-service-last-accessed-details --arn arn:aws:iam::123:role/MyAppRole
What this tool does
A dense browser-only AWS IAM cheatsheet for cloud engineers, SREs, and
developers who need the right policy term while working. Search policy
JSON fields, ARN shapes, condition operators, IAM CLI commands, AWS
managed policy ARNs, trust-policy patterns, evaluation rules, and common
IAM pitfalls such as iam:PassRole escalation, Allow with NotAction,
missing S3 object ARNs, role-session ARN matching, access-key leaks, and
eventual consistency. Paste an IAM policy JSON document into the local
inspector to count statements, allow/deny rules, wildcard actions,
wildcard resources, PassRole exposure, S3 object ARN mistakes, Principal
usage, and malformed JSON. Nothing is uploaded and long pasted policy
text is never stored in the URL.
Tool details
Input
Text
The page exposes text boxes, numeric controls, file pickers, or structured inputs depending on the tool.
Output
Live result + Copy
The result area focuses on usable output, with copy, download, or preview actions when supported.
Privacy
Browser-side processing
The main tool logic does not call an external API, so inputs normally stay in the current tab.
Save / share
Shareable URL state
Key settings are encoded in the URL so another person can reopen the same setup.
Performance budget
Initial JS <= 32 KB
No WASM budget is declared, keeping the tool quick to open on mobile.
Best fit
Developer & DevOps · Developer
Category and role tags drive related tools, internal links, and quick fit checks.
How to use
1
1. Input
Paste or drop your content into the tool panel.
2
2. Process
Click the button. All processing is local in your browser.
3
3. Copy / Download
Copy the result or download to disk in one click.
How AWS IAM Cheatsheet fits into your work
Use it in the small gaps between coding, reviewing, debugging, and shipping.
Developer jobs
Formatting, validating, shrinking, or inspecting code-adjacent text.
Preparing snippets for documentation, tickets, commits, or handoff.
Checking a small payload quickly without switching tools.
Developer checks
Run irreversible transforms like minify or obfuscate on a copy.
Keep secrets out of pasted snippets unless the tool explicitly stays local.
Use your normal tests or linter before shipping transformed code.
Good next steps
These links move the current task into a more complete workflow.
Search for the condition key, ARN format, or evaluation concept that
appears in the error, then paste the policy to catch obvious shape
mistakes before widening access. This keeps the workflow grounded in
the actual action/resource pair instead of adding AdministratorAccess
as a panic fix.
Review a role before deployment
Paste the planned policy and look for wildcard actions, wildcard
resources, PassRole scope, NotAction with Allow, and S3 object ARN
mistakes. The copied report is short enough to drop into a pull
request or change-control note.
Write trust policies faster
Filter to trust and assume-role entries to compare service principals,
cross-account trust, ExternalId, MFA conditions, and OIDC CI patterns.
The examples are copy-ready but still annotated with the gotchas that
usually cause AssumeRole failures.
Common pitfalls
Granting `iam:PassRole` on `*`, which can let a deployer attach an admin role to compute they control.
Using a bucket ARN for object actions such as `s3:GetObject`; object actions need the `/*` ARN.
Treating `arn:aws:iam::account:root` in a Principal as only the root user instead of the whole account delegation.
Privacy
Search query and group filter are safe URL state for sharing. Pasted IAM
policies are kept only in React state in the current tab and are never
written to the URL, localStorage, or any external service.
FAQ
Related tools
Hand-picked utilities that pair well with this one.