Skip to main content

Editing and deleting bucket policies

Edit a policy when access needs change, for example a new office IP range or an extra user. Delete it to return the bucket to the default, where only the owner has access.

Before you start: the bucket has a policy. See Creating bucket policies.

Edit a policy​

In the web panel

  1. Go to S3 > Buckets and click the line with the bucket.
  2. In the right pane, click Manage bucket policy.
  3. Add statements with Add, change them with the pencil icon, or remove them with the bin icon.
  4. Click Save.

With aws-cli: download the current policy, edit it, and upload the complete file again.

cd ~
aws s3api get-bucket-policy --bucket <bucket> --query Policy --output text --profile bamboozle > policy.json
# edit policy.json
aws s3api put-bucket-policy --bucket <bucket> --policy file://policy.json --profile bamboozle

Delete a policy​

In the web panel

  1. Go to S3 > Buckets and click the line with the bucket.
  2. Open the Bucket policy tab.
  3. Click the ellipsis (…) and select Delete.
  4. Confirm with Delete.

With aws-cli

cd ~
aws s3api delete-bucket-policy --bucket <bucket> --profile bamboozle

Without a policy, only the bucket owner can access the bucket.

Was this page helpful?