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
- Go to S3 > Buckets and click the line with the bucket.
- In the right pane, click Manage bucket policy.
- Add statements with Add, change them with the pencil icon, or remove them with the bin icon.
- 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
- Go to S3 > Buckets and click the line with the bucket.
- Open the Bucket policy tab.
- Click the ellipsis (…) and select Delete.
- 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.