diff --git a/README.md b/README.md index fc7eb08..fb1f8c2 100644 --- a/README.md +++ b/README.md @@ -63,14 +63,15 @@ module "pubsub" { ] cloud_storage_subscriptions = [ { - name = "cloud-storage" // required - bucket = "example-bucket" // required - filename_prefix = "log_events_" // optional - filename_suffix = ".avro" // optional - max_duration = "60s" // optional - max_bytes = "10000000" // optional - output_format = "avro" // optional - write_metadata = false // optional + name = "cloud-storage" // required + bucket = "example-bucket" // required + filename_prefix = "log_events_" // optional + filename_suffix = ".avro" // optional + filename_datetime_format = "YYYY-MM-DD/hh_mm_ssZ" // optional + max_duration = "60s" // optional + max_bytes = "10000000" // optional + output_format = "avro" // optional + write_metadata = false // optional } ] } diff --git a/examples/cloud_storage/main.tf b/examples/cloud_storage/main.tf index b2ab735..c65beeb 100644 --- a/examples/cloud_storage/main.tf +++ b/examples/cloud_storage/main.tf @@ -38,6 +38,9 @@ module "pubsub" { name = "example_bucket_subscription" bucket = google_storage_bucket.test.name + filename_prefix = "example_prefix_" + filename_suffix = "_example_suffix" + filename_datetime_format = "YYYY-MM-DD/hh_mm_ssZ" ack_deadline_seconds = 300 }, ] diff --git a/main.tf b/main.tf index 9d0659c..452030d 100644 --- a/main.tf +++ b/main.tf @@ -439,11 +439,12 @@ resource "google_pubsub_subscription" "cloud_storage_subscriptions" { } cloud_storage_config { - bucket = each.value["bucket"] - filename_prefix = lookup(each.value, "filename_prefix", null) - filename_suffix = lookup(each.value, "filename_suffix", null) - max_duration = lookup(each.value, "max_duration", null) - max_bytes = lookup(each.value, "max_bytes", null) + bucket = each.value["bucket"] + filename_prefix = lookup(each.value, "filename_prefix", null) + filename_suffix = lookup(each.value, "filename_suffix", null) + filename_datetime_format = lookup(each.value, "filename_datetime_format", null) + max_duration = lookup(each.value, "max_duration", null) + max_bytes = lookup(each.value, "max_bytes", null) dynamic "avro_config" { for_each = (lookup(each.value, "output_format", "") == "avro") ? [true] : [] content { diff --git a/test/setup/versions.tf b/test/setup/versions.tf index f106432..d1a102e 100644 --- a/test/setup/versions.tf +++ b/test/setup/versions.tf @@ -19,11 +19,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.78" + version = ">= 5.31" } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.78" + version = ">= 5.31" } null = { source = "hashicorp/null" diff --git a/versions.tf b/versions.tf index f601327..d8860e2 100644 --- a/versions.tf +++ b/versions.tf @@ -20,7 +20,7 @@ terraform { google = { source = "hashicorp/google" - version = ">= 4.78, < 6" + version = ">= 5.31, < 6" } }