Skip to content

Instantly share code, notes, and snippets.

@Sedward
Last active June 3, 2022 20:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sedward/3fdb0e8d33d483826a7d52eb9a313320 to your computer and use it in GitHub Desktop.
Save Sedward/3fdb0e8d33d483826a7d52eb9a313320 to your computer and use it in GitHub Desktop.
resource "google_storage_bucket" "test-expiring-bucket" {
name = "test-expiring-bucket"
location = "US"
lifecycle_rule {
condition {
age = 30
}
action {
type = "Delete"
}
}
}
resource "google_storage_bucket" "test-retention-bucket" {
name = "test-retention-bucket-slayer"
location = "US"
retention_policy {
retention_period = 604800
}
}
resource "google_storage_bucket" "test-versioning-bucket007" {
name = "test-versioning-bucket007"
location = "US"
versioning {
enabled = true
}
}
resource "google_storage_bucket" "test-expiring-bucket2" {
name = "test-expiring-bucket2"
location = "US"
lifecycle_rule {
condition {
age = 7
}
action {
type = "SetStorageClass"
storage_class = "NEARLINE"
}
}
lifecycle_rule {
condition {
age = 30
}
action {
type = "Delete"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment