Ensure Versioning Enabled For a new bucket in Google cloud storage service (GCS)

Ensure that versioning is enabled for new buckets in Google Cloud Storage (GCS) to facilitate recovering objects in the event of accidental deletions or overwrites. Enabling versioning helps maintain a history of object changes, providing a safeguard against data loss and ensuring data integrity.

Risk Level: high
Cloud Entity: Cloud Storage
Spectral Rule ID: TFGCP060
Category: Storage

REMEDIATION

in google_storage_bucket set versioning

resource "google_storage_bucket" "example_bucket" {
  name     = "example-bucket"
  location = "US"

+  versioning {
+    enabled = true
+  }
}

Cloud Storage

Cloud Storage is a managed service for storing unstructured data. Store any amount of data and retrieve it as often as you like.

Read more: