how to disable soft delete from a GCS bucket

352 views Asked by At

as mentioned in the GCP announcement the gcs soft delete feature should have been activated by GCP. I can already see an increase on the total number of bytes present in the bucket (that match the 7 day default retention). However, I am not able to find any way to disable the feature in the UI or the terraform provider.

Do you know how to disable this feature for a bucket?

I tried looking into the terraform provider as well as the CLI docuementation. Googling also yielded no result.

2

There are 2 answers

1
Antoine Redier On BEST ANSWER

To disable the soft-delete feature on a given bucket you can use the gcloud cli:

gcloud storage buckets update --clear-soft-delete gs://<bucket-name>

In order to check if the feature is activated on your bucket and what is the soft-delete retention policy, you can use the alpha gcloud command:

gcloud storage buckets describe gs://<bucket-name>

and look for the soft_delete_policy block.

1
Jerther On

Found how to disable the feature through the UI in this article.

Here's a recap:

  1. In the Google Cloud console, go to the Cloud Storage Buckets page. Go to Buckets (direct link)
  2. In the list of buckets, click the name of the bucket you want to remove the soft delete policy from.
  3. Click the Protection tab.
  4. In the Soft delete policy section, click Delete.
  5. Click Confirm.