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

feat(push): Add Pub/Sub Subscription support for push payload unwrapping (no wrapper) #141

Closed
wants to merge 11 commits into from
Prev Previous commit
Modify no_wrapper definition
ORabbit committed Jan 29, 2024
commit eb85854275d210025edaa2c221d4b2d531aabec5
5 changes: 4 additions & 1 deletion examples/subscriptions_only/main.tf
Original file line number Diff line number Diff line change
@@ -51,10 +51,13 @@ module "pubsub" {
{
name = "push_payload_unwrapping"
push_endpoint = "https://${var.project_id}.appspot.com/"
no_wrapper = { write_metadata = true }
no_wrapper = no_wrapper.test.name
ack_deadline_seconds = 20
expiration_policy = "1209600s" // two weeks
},
]
}

resource "no_wrapper" "test" {
write_metadata = true
}
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
@@ -228,9 +228,9 @@ resource "google_pubsub_subscription" "push_subscriptions" {
}

dynamic "no_wrapper" {
for_each = lookup(each.value, "no_wrapper", "") ? [true] : []
for_each = (lookup(each.value, "write_metadata", "") != "") ? [each.value.write_metadata] : []
content {
write_metadata = lookup(each.value, "no_wrapper_write_metadata", null)
write_metadata = lookup(each.value, "write_metadata", null)
}
}
}