🎉Black Friday deal: 40% off all lifetime licenses with code BF2026
Policy & Security

S3 IAM Policy Generator

Generate strict AWS IAM JSON policies with proper actions like s3:GetObject, s3:PutObject, and s3:ListBucket tailored for your security requirements.

S3 IAM Policy Builder

Generate minimal, secure JSON access policies for your AWS IAM users or Cloudflare API tokens.

Access Preset

Restricts policy scope to a specific subfolder inside the bucket.

AWS IAM Policy JSON
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "AllowBucketListing",
      "Effect": "Allow",
      "Action": [
        "s3:ListBucket",
        "s3:GetBucketLocation"
      ],
      "Resource": "arn:aws:s3:::my-company-bucket"
    },
    {
      "Sid": "AllowObjectOperations",
      "Effect": "Allow",
      "Action": [
        "s3:GetObject",
        "s3:GetObjectVersion"
      ],
      "Resource": "arn:aws:s3:::my-company-bucket/*"
    }
  ]
}

IAM policy vs bucket policy

An IAM policy is attached to a user, group, or role and says what that identity can do. A bucket policy is attached to the bucket and says who can access it. Both use the same JSON policy language with Effect, Action, and Resource. Use an IAM policy when you control the identity, such as an app user or CI role, and a bucket policy for cross-account or public access.

Bucket vs object ARNs

S3 actions target two different resources. s3:ListBucket applies to the bucket ARN, arn:aws:s3:::my-bucket. Object actions such as s3:GetObject, s3:PutObject, and s3:DeleteObject apply to object ARNs, arn:aws:s3:::my-bucket/*. A common mistake is granting s3:GetObject on the bucket ARN only, which fails with AccessDenied.

Common least-privilege presets

Read-only: s3:ListBucket on the bucket plus s3:GetObject on objects. Upload-only: s3:PutObject on a prefix such as arn:aws:s3:::my-bucket/uploads/*. Full bucket access for an app: list, get, put, and delete scoped to one bucket, never s3:* on *.

To restrict a user to one folder, add a Condition on s3:prefix for ListBucket and scope object actions to that prefix.

How to apply it

In the IAM console, open the user or role, choose Add permissions, then Create inline policy, switch to the JSON tab, and paste the output. With the AWS CLI, run aws iam put-user-policy --user-name app-user --policy-name s3-access --policy-document file://policy.json.

Frequently asked questions

Allow s3:ListBucket on arn:aws:s3:::my-bucket and s3:GetObject on arn:aws:s3:::my-bucket/*. Add s3:GetBucketLocation if your client needs to detect the bucket region.
The resource is probably the bucket ARN instead of the object ARN. Object actions need arn:aws:s3:::my-bucket/* with the trailing /*. Also check for an explicit Deny in a bucket policy, SCP, or permission boundary.
No. R2 does not use AWS IAM. R2 access is controlled by API tokens with Object Read, Object Read & Write, or Admin permissions, optionally scoped to specific buckets.

Need a faster way to browse & share S3 objects?