DevTools Logo

IAM Policy Generator

IAM Policy Generator

Build AWS IAM policy JSON from a list of statements.

Statement 1

Generated policy

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "s3:GetObject",
        "s3:ListBucket"
      ],
      "Resource": "arn:aws:s3:::my-bucket/*",
      "Sid": "ReadOnlyAccess"
    }
  ]
}
client-side
JSON

Examples

Read-only S3 access

Input
Effect: Allow
Actions: s3:GetObject, s3:ListBucket
Resource: arn:aws:s3:::my-bucket/*
Output
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "s3:GetObject", "s3:ListBucket" ], "Resource": "arn:aws:s3:::my-bucket/*" } ] }

Two actions become an array, a single resource stays a string, and the policy uses the canonical version.

About this tool

The IAM Policy Generator turns a list of statements into a valid AWS IAM policy document. For each statement you choose Allow or Deny, list the actions (such as s3:GetObject or ec2:*), and list the resources they apply to (an ARN or *). An optional Sid names the statement.

The generator wraps everything in the standard { Version: 2012-10-17, Statement: [...] } shape, collapses a single action or resource to a string and keeps multiples as arrays, and warns when a statement is incomplete. Everything runs in your browser — nothing is uploaded.

How to use

  1. Add statements

    For each, pick the effect, enter actions and resources (one per line), and an optional Sid.

  2. Read the JSON

    The preview shows the assembled policy; warnings flag empty actions or resources.

  3. Copy into AWS

    Paste the JSON into the IAM console, a Terraform aws_iam_policy document, or a CloudFormation template.

Use cases

Least-privilege roles

Draft tight Allow statements per service instead of using broad managed policies.

Infrastructure as code

Generate the policy JSON to drop into Terraform or CloudFormation.

Common mistakes

Mistake:Using * for the resource.

Fix:Scope resources to specific ARNs where possible — a wildcard resource widens the blast radius.

Mistake:Mixing service namespaces.

Fix:Actions are namespaced (s3:, ec2:); keep each statement to one service for clarity.

Frequently asked questions

References & standards