Create Your AWS IAM Policy
To generate, add a service, at least one resource ARN (or choose all resources).
Generate a policy, then export it as Terraform, OpenTofu, CloudFormation, AWS CDK, or Pulumi.
Check an existing policy
Configure your policy settings and click "Generate Policy" to see the result here, or check the structure of an existing policy using one of the options below.
Already have a policy? Check it
Import or paste an existing policy to check its structure and get recommendations about wildcards, public principals and missing conditions.
This generator covers identity policies for every service in the catalogue except IAM and Amazon S3. For S3 permissions on a role use the Inline Policy Generator; for a bucket's own policy, the S3 Bucket Policy Generator; for IAM administration, the IAM Policy Generator. Not sure which tool fits? See which tool do I need.
Worked example: an order service that reads one DynamoDB table
A Lambda function looks up orders by ID and lists a customer's orders through a global secondary index. It never writes, scans or deletes. Here is how to build its policy with the generator above, and how to read the result.
- Choose Amazon DynamoDB and tick only
GetItem(lookup by ID) andQuery(the per-customer list).Scan,PutItemandDeleteItemstay unticked: the function does not need them. - Add the table ARN and the ARN of its indexes. A query on an index is authorized against
table/Orders/index/<name>, not the table, so the second ARN is what makes the customer list work. - Leave conditions empty for now and generate. The tool returns:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"dynamodb:GetItem",
"dynamodb:Query"
],
"Resource": [
"arn:aws:dynamodb:eu-west-1:111122223333:table/Orders",
"arn:aws:dynamodb:eu-west-1:111122223333:table/Orders/index/*"
]
}
]
}The checker reports no structural errors and one recommendation:
- Statement 1: No conditions. Where the request context allows, a condition can narrow this further (for example aws:PrincipalOrgID, aws:SourceVpce, aws:ResourceTag/<key> or aws:SecureTransport).
Here no request-context condition fits naturally, and the actions and resources are already narrow, so the policy is reasonable as it is. What the check cannot tell you is whether it is enough: if the function also needs BatchGetItem, it will fail with an AccessDenied error at runtime. Before attaching it, run IAM Access Analyzer policy validation, attach it to a test role, and exercise every code path once. The DynamoDB single-table example adds write access, per-user partitions and checks that change nothing.
Learn the policy language, then reuse what works
AWS Security Learning Center
10 guides on writing policies that hold up in production:
Policy example library
15 worked examples (identity, bucket, trust and SCP policies), each with deployment steps, checks that change nothing, and common mistakes. Open identity and bucket policies straight into a generator.
How policies are generated and what the checks cover: methodology. What changed recently: changelog.