Table Of Contents

Feedback

User Guide

First time using the AWS CLI? See the User Guide for help getting started.

[ aws . s3api ]

delete-bucket-policy

Description

This implementation of the DELETE operation uses the policy subresource to delete the policy of a specified bucket. If you are using an identity other than the root user of the AWS account that owns the bucket, the calling identity must have the DeleteBucketPolicy permissions on the specified bucket and belong to the bucket owner's account to use this operation.

If you don't have DeleteBucketPolicy permissions, Amazon S3 returns a 403 Access Denied error. If you have the correct permissions, but you're not using an identity that belongs to the bucket owner's account, Amazon S3 returns a 405 Method Not Allowed error.

Warning

As a security precaution, the root user of the AWS account that owns a bucket can always use this operation, even if the policy explicitly denies the root user the ability to perform this action.

For more information about bucket policies, see `Using Bucket Policies and UserPolicies < https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html>`__ .

The following operations are related to DeleteBucketPolicy

  • CreateBucket
  • DeleteObject

See also: AWS API Documentation

See 'aws help' for descriptions of global parameters.

Synopsis

  delete-bucket-policy
--bucket <value>
[--cli-input-json <value>]
[--generate-cli-skeleton <value>]

Options

--bucket (string)

The bucket name.

--cli-input-json (string) Performs service operation based on the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, the CLI values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally.

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

See 'aws help' for descriptions of global parameters.

Examples

The following command deletes a bucket policy from a bucket named my-bucket:

aws s3api delete-bucket-policy --bucket my-bucket

Output

None