Make objects public

Turn off Block public access on a bucket and add a bucket policy that lets anyone read its objects without a key.

Last updated 18 November 2026View as Markdown

Every bucket starts with Block public access on: nothing in it can be read without a key, and no policy can change that. Making objects public takes two steps: allow public access, then add a policy that grants the public what it may do. Replace example-site with your bucket's name.

Warning

Anyone on the internet can then read what the policy grants.

Prerequisites

  • Permission for s3:PutBucketPublicAccessBlock and s3:PutBucketPolicy on the bucket. Only your own organization can change them; a bucket policy cannot grant them to another.
  • In the console, also s3:GetBucketPolicy: without it the policy editor is not shown ("Reading the policy needs s3:GetBucketPolicy on this bucket.").
  • The bucket is not one the platform writes.

Step 1: Allow public access

  1. Open Object Storage, open the bucket, then choose Public access.
  2. Under Block public access, choose Allow public access….
  3. Enter the bucket's name to confirm, then choose Allow public access.

The console says "Public access is allowed. A policy decides what is published."

Over S3, aws s3api delete-public-access-block --bucket example-site turns all four flags off.

Step 2: Add a public-read policy

  1. Under Bucket policy, choose Public-read template. It fills in the policy below; it does not save it.
  2. Choose Save policy.

The bucket list then marks the bucket public.

The policy is the console's template:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "PublicRead",
      "Effect": "Allow",
      "Principal": "*",
      "Action": "s3:GetObject",
      "Resource": "arn:aws:s3:::example-site/*"
    }
  ]
}

Over S3: aws s3api put-bucket-policy --bucket example-site --policy file://policy.json.

Result

Anyone can fetch https://example-site.s3.<domain>/<key> without signing. Turning Block public access back on (the console's Block public access button, all four flags true) closes it at once, whatever the policy says.

A grant held to source addresses no wider than a /8 (IPv4) or a /32 (IPv6) does not count as public, so it is accepted while Block public access is on. The policy grammar is in Access control.

If it is refused

  • 403 This policy would make the bucket public, and Block Public Access is on for it. Turn off "Block public policies" first if you really mean to publish its objects.
  • 400 when the policy is longer than 20 KB, The policy is not valid JSON, or the statement that breaks the grammar.
  • 403 This bucket is managed by the platform; its access cannot be changed. In the console the buttons are unavailable and say "The platform manages this bucket; its access cannot be changed."
  • 403 Forbidden without the permission; in the console the button says Needs s3:PutBucketPublicAccessBlock on this bucket. or Needs s3:PutBucketPolicy on this bucket.
  • Uploads with a public ACL (--acl public-read, x-amz-acl: public-read) are refused with AccessControlListNotSupported "The bucket does not allow ACLs. Make objects public with a bucket policy instead.": a bucket policy is the only way to publish objects.
Did this page help you?