Get Started →
AWS Cloud Tools

AWS
Policy Generator

Build production-ready AWS IAM policies, S3 bucket policies, SNS topic policies, SQS queue policies, and VPC endpoint policies visually — with live JSON output, validation, and analysis.

5 policy types: IAM, S3, SNS, SQS, VPC Endpoint Multiple statements with Allow / Deny effect Full service & action browser with search Principal, Resource, Condition builder Live JSON with syntax highlighting + line numbers Policy analysis, security warnings & one-click download
// Policy Summary
Step 1 — Select Policy Type
Step 2 — Add Statements

Quick Templates (Optional)
No statements yet. Click Add Statement to begin building your policy.
Step 3 — Generated Policy JSON
Policy JSON will appear here…
Add at least one statement then click Generate
IAM Policy Structure
ElementRequiredDescription
Version✓ RecommendedPolicy language version (2012-10-17)
IdOptionalOptional identifier for the policy
Statement✓ RequiredArray of individual permission statements
SidOptionalStatement identifier (alphanumeric + underscore)
Effect✓ RequiredAllow or Deny
PrincipalResource policiesWho the statement applies to
Action✓ RequiredList of AWS service actions (e.g. s3:GetObject)
Resource✓ RequiredARN(s) the statement applies to
ConditionOptionalWhen the policy takes effect
Common Condition Operators
OperatorUse case
StringEqualsExact string match
StringLikeWildcard string match (*, ?)
ArnEqualsExact ARN match
ArnLikeWildcard ARN match
IpAddressIPv4/CIDR range match
BoolBoolean (e.g. aws:MultiFactorAuthPresent)
DateLessThanDate/time comparison
NumericEqualsInteger comparison
StringNotEqualsNegated string match
NullKey presence check
Common Global Condition Keys
Condition KeyTypeDescription
aws:RequestedRegionStringRestrict API calls to specific AWS regions
aws:SourceIpIpAddressAllow / deny based on caller IP address or CIDR
aws:MultiFactorAuthPresentBoolRequire MFA authentication to be active
aws:PrincipalAccountStringMatch the AWS account of the principal making the request
aws:PrincipalOrgIDStringRestrict to principals within a specific AWS Organization
aws:CalledViaStringRestrict to calls made through specific AWS services
aws:SecureTransportBoolRequire HTTPS — deny unencrypted HTTP requests
aws:TagKeysStringRestrict based on tag key names in the request
aws:RequestTag/keyStringMatch specific tag values in create/tag requests
s3:prefixStringRestrict S3 ListBucket to specific key prefixes

What Is an AWS IAM Policy and How Do You Write One?

An AWS IAM policy is a JSON document that defines which AWS API actions a principal (user, role, or service) is allowed or denied to perform on which resources, and optionally under what conditions. Writing policies by hand is error-prone — this generator gives you a visual UI to build correct, production-safe policies in seconds.

Types of AWS Policies

  • Identity-based policies — Attached to IAM users, groups, or roles. Control what that identity can do.
  • Resource-based policies — Attached to a resource like an S3 bucket or SQS queue. Control who can access that resource.
  • Permissions boundaries — Set the maximum permissions an IAM entity can have, regardless of attached policies.
  • Service control policies (SCPs) — Applied at the AWS Organisation level to restrict maximum permissions across accounts.
  • Session policies — Passed inline when assuming a role to further restrict that session's permissions.

The Six Policy Elements Explained

Version: Always use 2012-10-17. This unlocks modern IAM features like policy variables (${aws:username}).

Effect: Either Allow or Deny. An explicit Deny always wins over any Allow — across all policies evaluated for a request.

Principal: Specifies who the statement applies to. Required for resource-based policies. Can be an AWS account (arn:aws:iam::123456789012:root), an IAM role, a service (e.g. lambda.amazonaws.com), or a wildcard (*).

Action: A list of AWS API actions in service:Action format, e.g. s3:GetObject, ec2:DescribeInstances. Use * to mean all actions. Use s3:* to mean all S3 actions.

Resource: The ARN(s) the statement applies to. Use * to match all resources. Use wildcards like arn:aws:s3:::my-bucket/* to match all objects inside a bucket.

Condition: Optional constraints using condition keys, operators, and values. Common patterns: require MFA, restrict by IP, require HTTPS, or limit to a specific AWS region.

IAM Policy Evaluation Logic

AWS evaluates all applicable policies in this order: (1) an explicit Deny in any policy immediately denies the request; (2) an explicit Allow grants access; (3) if no Allow is found, the request is implicitly denied. This means the default state is deny everything — permissions must be explicitly granted.

Security Best Practices

  • Apply least-privilege — grant only the specific actions and resources needed, never "Action": "*" with "Resource": "*".
  • Use conditions to add guardrails — require MFA, restrict to known IP ranges, or require HTTPS.
  • Prefer roles over users — attach policies to roles and assume them rather than creating long-lived access keys.
  • Use resource-level permissions — specify exact ARNs rather than wildcards wherever possible.
  • Add a Deny with aws:PrincipalOrgID condition in S3 bucket policies to prevent access from outside your AWS Organization.
  • Enable AWS IAM Access Analyzer to automatically detect over-permissive policies in your account.

Frequently Asked Questions

What is an AWS IAM policy?
An AWS IAM policy is a JSON document that defines permissions — which actions are allowed or denied for which principals on which resources, optionally with conditions. Policies are attached to users, groups, roles, or AWS resources.
What is the difference between IAM policy and S3 bucket policy?
An IAM identity policy is attached to the user or role and controls what that identity can do. An S3 bucket policy is attached to the bucket itself and controls who can access it. Both use the same JSON language. S3 bucket policies include a Principal element; IAM policies do not.
Does Deny always override Allow in IAM?
Yes. An explicit Deny in any evaluated policy always wins — even if another policy grants an explicit Allow for the same action. The only exception is root account actions which cannot be denied by SCPs.
What does Principal * mean?
Using "Principal": "*" means the policy applies to all AWS accounts and services — including unauthenticated public access. Always pair a wildcard Principal with restrictive conditions such as aws:PrincipalOrgID or aws:SourceIp.
What are IAM policy variables?
Policy variables like ${aws:username} and ${aws:userid} let you write dynamic policies that resolve to the caller's identity at evaluation time. They require policy version 2012-10-17.
Is my data safe in this tool?
Yes — completely. All policy generation runs in your browser. No ARNs, account IDs, or policy data are ever sent to any server. Safe for building policies with real account information.

More Free Online Tools

Simple tools. Surgical fixes. Zero friction.

Amazon Connect CCP Log Parser

Parse Amazon Connect CCP logs into structured, searchable diagnostics.

Open

Amazon Connect CTR Parser

Turn raw Amazon Connect CTR JSON into a rich visual breakdown.

Open

Amazon Connect Agent Workstation Validator

Pre-flight check for Amazon Connect softphone agents.

Open

CloudTrail Log Analyser

Security audit & threat detection for AWS environments.

Open

Amazon Connect Pricing Calculator

Instantly estimate monthly AWS Connect costs — voice, chat, email, campaigns, telephony & more.

Open

Connect CloudWatch Log Analyzer

Drop any Amazon Connect CloudWatch log and get a rich visual breakdown.

Open