All Tools View Categories About Contact Privacy

IAM Policy Example Library

Ready-to-use IAM policy JSON templates for common access patterns — edit the placeholders before use.

Starting-point templates, not exhaustive coverage. Runs entirely in your browser — nothing is uploaded.

About IAM Policy Example Library

Writing an IAM policy JSON document from a blank page for a common, well-understood access pattern — read-only S3 access, a Lambda execution role, deny-all — is unnecessary busywork you can skip. IAM Policy Example Library is a set of ready-to-use, structurally valid policy templates for frequently needed access patterns, each shown as pretty-printed JSON you can copy straight into the IAM console or your infrastructure-as-code.

Every template uses obvious placeholder values — <your-bucket-name>, <account-id>, <region>, <your-table-name> and similar — in angle brackets specifically so they cannot be mistaken for real values and are easy to find-and-replace before use. These are meant as a fast, correct starting point to edit, not a drop-in final policy: swap in your own resource identifiers, and narrow the action list further if a template grants more than a given role actually needs.

The two examples with the broadest reach — full S3 admin on a bucket, and full IAM admin — carry an explicit warning callout, since both are common sources of accidental over-permissioning when copied without a second look. Scope those down wherever possible; this site’s Least-Privilege Policy Generator and Overly-Permissive Policy Checker tools can help with that next step.

This is a curated set of common starting points, not exhaustive coverage of every access pattern you might need — for anything more specific, adjust the closest template here or build a policy from scratch with the IAM Policy Generator tool.

Features

  • 9 ready-to-use templates across S3, Compute, Database, IAM, and Messaging.
  • Pretty-printed, valid JSON for every example, checked against the same validator used elsewhere in this suite.
  • Category filter and live search.
  • One-click copy of any example’s JSON.
  • Explicit security warnings on the highest-privilege examples (IAM full admin, S3 full admin).
  • Clearly marked placeholders — every bucket/table/account value is in angle brackets, impossible to mistake for a real value.
  • 100% client-side — nothing you do here is uploaded.

How to Use

  1. Filter by category (S3 / Compute / Database / IAM / Messaging) or type a keyword to search.
  2. Read the one-line description to confirm it matches what you need.
  3. Copy the JSON with the copy button.
  4. Replace every <placeholder> with your real bucket name, table name, ARN, region, or account id.
  5. For the high-privilege examples, read the warning and consider narrowing the action list before attaching.

Examples

Example 1 — read-only S3 access. A role that only needs to list and read objects in one bucket copies the "S3 read-only access to a bucket" template, replacing <your-bucket-name> with the real bucket name.

Example 2 — a new Lambda function’s execution role. Attach the trust-policy example to the role so Lambda can assume it, then attach the permissions example (with the function name filled in) so it can write logs.

Example 3 — a guardrail deny. The deny-all statement is dropped into a larger SCP alongside a condition (e.g. aws:MultiFactorAuthPresent) to block all actions unless MFA is present.

Benefits

  • Faster than writing policy JSON from scratch for common access patterns.
  • Structurally correct by construction — every example is validated before publishing.
  • Placeholders that are impossible to miss, reducing the risk of accidentally shipping an unedited template.
  • Flags the riskiest templates so you don’t attach broad access without noticing.
  • Private — browsing and copying happen entirely client-side.

Frequently Asked Questions

Can I use these policies as-is?
No — every ARN, account id, bucket name and table name in these templates is a placeholder written in angle brackets, e.g. <code>&lt;your-bucket-name&gt;</code> or <code>&lt;account-id&gt;</code>. You must replace every placeholder with your own real values before attaching a policy. Pasting one of these templates unedited will either fail to attach (invalid ARN) or, worse, silently apply to the wrong resource.
Is this an exhaustive library covering every use case?
No. These are common starting-point templates for frequently needed access patterns — not a complete catalog of every possible IAM policy. For anything more specific, start from the closest template here and adjust the actions/resources, or build one from scratch with the IAM Policy Generator tool in this category.
Why do the IAM full-admin and S3 full-admin examples have a warning?
Both grant very broad access (all IAM actions account-wide, or all S3 actions on a bucket including delete/ACL changes) and are common sources of over-permissioning when copied without narrowing. They are included because they are genuinely common starting points, but you should scope the actions down to only what a role actually needs before using either in production — see the Overly-Permissive Policy Checker and Least-Privilege Policy Generator tools in this category.
What is the deny-all example actually useful for?
An explicit <code>Deny</code> on <code>*</code>/<code>*</code> is rarely a whole policy by itself. It is more commonly one statement inside a larger policy or service control policy (SCP) — for example, denying all actions unless a condition like MFA or a specific source IP is met, or as an emergency "break glass" guardrail. It is included here as a clean, minimal, structurally valid example of an explicit deny statement to build on.
How were these JSON documents built?
Each one is assembled deterministically with this site’s own <code>buildStatement</code>/<code>buildPolicyDocument</code> helpers (the same engine behind the IAM Policy Generator and Trust Policy Generator tools) and checked against <code>validatePolicyDocument</code> before shipping — there is no AI involved in generating or selecting these examples, and none of your data is sent anywhere; everything runs and copies entirely in your browser.
Does the Lambda example include the trust policy too?
Yes, as two separate cards: one is the trust (assume-role) policy that goes on the role itself so the Lambda service can assume it, and the other is the permissions (inline or attached) policy granting the CloudWatch Logs actions the function needs at runtime. Both are needed for a working Lambda execution role.