Search code examples
google-cloud-platformterraform-provider-gcp

how to disable soft delete from a GCS bucket


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.


Solution

  • 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.