DevTools Logo

S3 Bucket Policy Generator

S3 Bucket Policy Generator

Generate an AWS S3 bucket policy JSON for a principal, actions, and prefix.

Policy inputs

Examples

Public read of objects under a prefix

Input
bucket: my-bucket
principal: *
action: s3:GetObject
prefix: public/
Output
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "AWS": "*" }, "Action": "s3:GetObject", "Resource": "arn:aws:s3:::my-bucket/public/*" } ] }

The principal is everyone, the action is scoped to objects under public/, and the resource reflects the prefix.

About this tool

The S3 Bucket Policy Generator writes a bucket policy that grants or denies a set of S3 actions to a principal. Enter the bucket name, choose the effect, set the principal (a 12-digit account id is expanded to its root ARN, or use * or any ARN), pick the actions, and optionally scope them to a key prefix.

You can also include the bucket ARN itself for ListBucket-style access. The output is valid JSON with the standard version and a single statement, ready to paste into the bucket's Permissions tab. Everything runs client-side — nothing is uploaded.

How to use this tool

  1. Set bucket and principal

    Enter the bucket name and the principal (account id, *, or ARN) the policy applies to.

  2. Choose actions and scope

    Pick the S3 actions and optionally narrow them to a key prefix like logs/.

  3. Copy the policy

    Copy the JSON and attach it to the bucket in the AWS console or via Terraform/CloudFormation.

Use cases

Cross-account access

Grant another AWS account read or write access to a bucket or prefix.

Static website public reads

Allow anonymous s3:GetObject on a prefix used for public assets.

Common mistakes

Mistake:Granting ListBucket on object ARNs.

Fix:ListBucket applies to the bucket ARN, not objects — tick the bucket-ARN option for that action.

Mistake:Forgetting the prefix trailing slash.

Fix:Use logs/ (not logs) so the wildcard covers the intended subtree.

Frequently asked questions

What is the Principal field?

It is who the policy grants access to. Enter a 12-digit AWS account id (expanded to its root ARN), an asterisk for everyone, or any IAM ARN.

What does the key prefix do?

It scopes the permission to objects under a path, for example `logs/` produces the resource `arn:aws:s3:::bucket/logs/*` so only that subtree is affected.

When should I include the bucket ARN?

Tick that option for ListBucket-style permissions, which apply to the bucket itself rather than its objects. It adds `arn:aws:s3:::bucket` alongside the object ARN.

References & standards

.env Secret Safety Linter

Validate .env syntax and spot likely leaked credentials or placeholder secrets.

.htaccess Generator

Build an Apache .htaccess — HTTPS redirects, rewrites, error pages, security headers, and basic auth

2D Fluid Dynamics & Particle Physics Sandbox

A physics playground with two engines sharing one canvas. The fluid mode runs a real Eulerian Navier-Stokes solver — semi-Lagrangian advection, explicit diffusion, Jacobi pressure projection and vorticity confinement — that you paint with dye and velocity using mouse or touch. The particle mode is a damped Verlet N-body engine with gravity wells, Coulomb attractors and repulsors, spring links, wall restitution and elastic circle collisions. Particle counts adapt to the device (100k target on WebGL2 desktop, 2k-5k on CPU fallback), and every configuration exports as runnable code: a Matter.js world, a PixiJS ticker setup, or a standalone vanilla Canvas engine.

AI Function Calling Schema Generator

Generate function calling JSON schemas from TypeScript interfaces

Algorithm Arena & Data Structure Visualizer

Interactive arena for algorithms and data structures: eight sorting algorithms racing on one seeded input, six pathfinding algorithms walking generated mazes, and BST, AVL, Red-Black, B-tree, heap and trie operations replayed step by step with rotations highlighted. Every run shows the Big-O table and the phase-highlighted reference implementation in four languages, and compared values can be played as pitch (sonification) through the shared audio engine. Everything runs client-side; inputs never leave the browser.

Ansible Playbook Generator

Build an Ansible playbook — hosts, vars, and tasks with modules — as YAML