Skip to content

Commit

Permalink
feat: add support for setting max_messages and use_topic_schema
Browse files Browse the repository at this point in the history
  • Loading branch information
lahuang4 committed Sep 11, 2024
1 parent b02fd35 commit 73224a9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ module "pubsub" {
filename_datetime_format = "YYYY-MM-DD/hh_mm_ssZ" // optional
max_duration = "60s" // optional
max_bytes = "10000000" // optional
max_messages = "10000" // optional
output_format = "avro" // optional
write_metadata = false // optional
use_topic_schema = false // optional
}
]
}
Expand Down
4 changes: 3 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -445,10 +445,12 @@ resource "google_pubsub_subscription" "cloud_storage_subscriptions" {
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)
max_messages = lookup(each.value, "max_messages", null)
dynamic "avro_config" {
for_each = (lookup(each.value, "output_format", "") == "avro") ? [true] : []
content {
write_metadata = lookup(each.value, "write_metadata", null)
write_metadata = lookup(each.value, "write_metadata", null)
use_topic_schema = lookup(each.value, "use_topic_schema", null)
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions test/setup/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 5.31"
version = ">= 6.2"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 5.31"
version = ">= 6.2"
}
null = {
source = "hashicorp/null"
Expand Down
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ terraform {

google = {
source = "hashicorp/google"
version = ">= 5.31, < 7"
version = ">= 6.2, < 7"
}
}

Expand Down

0 comments on commit 73224a9

Please sign in to comment.