diff --git a/README.md b/README.md index cae87926..d6aa354c 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,8 @@ module "pubsub" { minimum_backoff = "300s" // optional filter = "attributes.domain = \"com\"" // optional enable_message_ordering = true // optional + no_wrapper = false // optional + write_metadata = false // optional } ] pull_subscriptions = [ diff --git a/examples/subscriptions_only/main.tf b/examples/subscriptions_only/main.tf index 5d5632b8..58dd1917 100644 --- a/examples/subscriptions_only/main.tf +++ b/examples/subscriptions_only/main.tf @@ -47,6 +47,8 @@ module "pubsub" { x-goog-version = "v1beta1" ack_deadline_seconds = 20 expiration_policy = "1209600s" // two weeks + no_wrapper = false + write_metadata = false }, ] diff --git a/main.tf b/main.tf index b20ca74b..c56209a5 100644 --- a/main.tf +++ b/main.tf @@ -212,6 +212,13 @@ resource "google_pubsub_subscription" "push_subscriptions" { x-goog-version = each.value.minimum_backoff != null ? "x-goog-version" : "v1" } + dynamic "no_wrapper" { + for_each = (lookup(each.value, "no_wrapper", null) != null ? [true] : []) + content { + write_metadata = lookup(each.value, "write_metadata", null) + } + } + dynamic "oidc_token" { for_each = each.value.oidc_service_account_email != null ? [true] : [] content {