Skip to main content

PutBucketPolicy

PutBucketPolicy - Amazon Simple Storage Service :::warning Only verified users can update bucket policy. To request KYC on your account, go to Portal Account Verifications :::

Example PutBucketPolicy request

Create a bucket where the objects stored in there can be read publicly without authentication Create a JSON file locally, e.g. public_read_policy.json

Prepare a JSON file like this

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "PublicReadGetObject",
      "Effect": "Allow",
      "Principal": "*",
      "Action": "s3:GetObject",
      "Resource": "arn:aws:s3:::<your-bucket-name>/*"
    }
  ]
}

Then apply that to an existing bucket

user@host % aws s3api put-bucket-policy --bucket pubreadbuc --policy file://public_read_policy.json