This page shows you how to delete Google Distributed Cloud (GDC) air-gapped storage buckets.

## Before you begin

Storage buckets are resources scoped to a specific [project](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/platform/pa-user/project-management.md.txt). The project acts as a container, grouping your buckets and enabling their management through the Management API server. Before you can perform the operations on this page, you must either create a new project or select an existing one where you have sufficient permissions.

### Required IAM roles

Contact your IAM Project Admin to request the following roles in your project
namespace:

- **Bucket Project Admin** (`project-bucket-admin`): create, update, and delete storage buckets.
- **Bucket Object Project Viewer** (`project-bucket-object-viewer`): view and check details of storage buckets and objects.

For more information, see [Grant bucket access](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/application/ao-user/grant-obtain-storage-access.md.txt#grant_bucket_access).

### Prepare your environment

To run commands against the management API server or the global API server, do the following:

1. [Sign in and generate](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/application/ao-user/iam/sign-in.md.txt#zonal-resources-kubeconfig) the kubeconfig file for the zonal management API server if you don't have one.
2. For dual-zone buckets, do the following:
   - Verify with your Infrastructure Operator (IO) that the `BucketLocationConfig` custom resource has been created for your paired zones.
   - [Generate the kubeconfig file](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/application/ao-user/iam/sign-in.md.txt#global-resources-kubeconfig) for the global API server.

## Delete storage buckets

> [!WARNING]
> **Warning:** Buckets with an [active retention policy](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/platform/pa-user/set-bucket-retention-periods.md.txt) are blocked from deletion until the lock date expires. If you need to destroy the data before that date, you must [crypto-shred the bucket](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/platform/pa-user/delete-storage-buckets.md.txt#crypto_shred_bucket).

### Console

1. In the navigation menu, click **Object Storage**.
2. Click delete **Delete** at the end of the row of the bucket to be deleted.
3. Wait a few minutes and refresh the page to check that the bucket is deleted.

### CLI

You can delete storage buckets by using the CLI. **Buckets must be empty before
you can delete them.**

1. Use the `GET` or `DESCRIBE` command from the [View bucket configuration](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/platform/pa-user/list-view-storage-buckets.md.txt#view_bucket_configurations) section to get the fully qualified bucket name.

2. If the bucket is *not empty*, delete files within the bucket:

   ```bash
   gdcloud storage rm --recursive --all-versions s3://FULLY_QUALIFIED_BUCKET_NAME/**
   ```
3. Delete the empty bucket:

   > [!NOTE]
   > **Note:** Make sure the bucket is empty before using the following kubectl command to trigger the bucket deletion.

   ```bash
   kubectl delete buckets/FULLY_QUALIFIED_BUCKET_NAME --namespace PROJECT_NAMESPACE
   ```

## Crypto shred bucket

To crypto-shred a bucket is to permanently destroy access to its data by deleting the encryption keys, rendering the stored data unreadable. In comparison to deleting individual buckets when cleaning up storage, which can take minutes to days for very large buckets, crypto-shredding provides instant and irreversible data destruction at scale.

> [!NOTE]
> **Note:** Only `v1` encryption bucket can be crypto shred, for `v2` encryption bucket, use [Crypto shred objects in buckets with encryption v2](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/platform/pa-user/delete-storage-objects.md.txt#crypto_shred_objects_in_buckets_with_encryption_v2)

> [!WARNING]
> **Warning:** This step is not recoverable and you will lose all data encrypted in the bucket.

### Crypto shred buckets

Retrieve information about the `AEADKey` based on [Verify bucket resource creation](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/platform/pa-user/create-storage-buckets.md.txt#verify_bucket_and_related_resource_creation) and follow [Delete a key](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/application/ao-user/kms/create-delete-keys.md.txt#delete) to delete the `AEADKey`, then the entire bucket would be crypto shredded.

After crypto shredding the bucket, proceed to [verify](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/platform/pa-user/delete-storage-buckets.md.txt#verify_crypto_shred_success).

### Verify crypto shred success

You can run the following command to verify the bucket has been successfully crypto shredded. The `BucketReady` should be `False` and `Reason` to be `BucketCryptoShredded`.

```bash
kubectl get buckets FULLY_QUALIFIED_BUCKET_NAME -n PROJECT_NAMESPACE
```