Deleting an Object Storage Bucket

Delete an Object Storage bucket.

The Console collects and provides a count of each resource that would prevent bucket deletion. Upon confirmation, the resources are deleted and the bucket is deleted in a single action. If you're deleting a bucket that contains one or more of these resources, consider using the Console to accomplish this task rather than one of the other methods.

Caution

You can't recover a deleted bucket. You can cancel a deletion in progress. However, resources deleted before the cancellation can’t be recovered. You can't delete a bucket that contains any of the following resources:

  • Objects and object versions

  • Pre-authenticated requests

  • Replication policy

  • Uncommitted multi-part uploads
    1. Open the navigation menu and click Storage. Under Object Storage & Archive Storage, click Buckets.
    2. Select the compartment from the list under List Scope. All buckets in that compartment are listed in tabular form.
    3. Select the bucket that you want to delete. The bucket's Details page appears.
    4. Enter the name of the bucket to confirm resource and bucket deletion and click Delete. The deletion stops if you navigate away from the page or you close the browser.

    The bucket is deleted and no longer appears in the list of buckets in the compartment.

  • Use the oci os bucket delete command and required parameters to delete a bucket:

    oci os bucket delete --name bucket_name [OPTIONS]

    For example:

    oci os bucket delete --name MyDeletedBucket
    Are you sure you want to delete this resource? [y/N]:

    Select y and press Enter. The bucket is deleted with no further prompting.

    For a complete list of parameters and values for CLI commands, see the CLI Command Reference.

  • Run the DeleteBucket operation to delete bucket.

    When accessing the Object Storage API, the bucket name is used with the Object Storage namespace name to form the request URL:

    n/object_storage_namespace/b/bucket