Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[20241010] retention policyでGCSの削除・編集をロックする #216

Open
linzhengen opened this issue Oct 10, 2024 · 0 comments
Open

Comments

@linzhengen
Copy link
Owner

Doc

https://cloud.google.com/storage/docs/using-bucket-lock?hl=ja#lock-bucket

cli

gcloud storage buckets update gs://BUCKET_NAME --lock-retention-period

tf

resource "google_storage_bucket" "my_locked_bucket" {
  name          = "my-gcs-locked-bucket"
  location      = "US"

  retention_policy {
    is_locked = true
    retention_period = 7776000 # 90日間で削除上書きできないようにする
  }

  lifecycle_rule {
    condition {
      age = 90
    }
    action {
      type = "Delete"
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant