Skip to main content
A Cloud Storage bucket is billed for the data it holds whether or not anyone uses it. nOps finds buckets that have been billed for storage for at least 60 days with no operations, retrievals, downloads or egress at all in that time, and shows their storage cost as the saving from deleting them. If the data must be kept, moving it to the Archive class saves less but still saves.

Why it matters

Buckets left behind by old projects, tests and one-off exports are common and keep billing every month.

How nOps finds it

nOps reads Cloud Storage billing for each bucket over the last 60 complete days. A bucket is flagged when it was first billed for storage before that window started, was billed in the last 2 days, and had no operation, retrieval, download, egress, transfer, replication or early-deletion charges in the 60 days. The saving is the bucket’s storage cost over the last 7 days, scaled to a month, net of discounts and excluding credits, and must be at least $2 a month. Projects whose spend on the service is at least 90% paid by credits or promotions are left out.

Before you start

Confirm with the bucket owner that the data is not needed, or decide to keep it in the Archive class.

How to implement

  1. Check the bucket’s labels, owner and contents, and whether any application, backup or compliance rule refers to it.
  2. If the data must be kept, change the default storage class to Archive and rewrite existing objects, or add a lifecycle rule that moves objects to Archive.
  3. Otherwise delete the bucket and its contents: gcloud storage rm --recursive gs://BUCKET_NAME.
  4. Remove the bucket from Terraform so it is not recreated.

Risks and considerations

  • Deleting a bucket is permanent unless soft delete or object versioning keeps a copy for a while.
  • A bucket with a locked retention policy cannot be deleted until its objects reach the end of their retention.
  • Archive has a 365-day minimum storage charge and costs more to read, so only use it for data you do not expect to read.

FAQs

Billing shows that nobody used the bucket for 60 days, but not whether the data is still needed, for example as a backup.