terraform-google-modules / terraform-google-pubsub

Creates Pub/Sub topic and subscriptions associated with the topic
https://registry.terraform.io/modules/terraform-google-modules/pubsub/google
Apache License 2.0
83 stars 125 forks source link

Push Subscription is missing the NoWrapper feature available in the pubsub_subscription resource #193

Open onarres opened 1 month ago

onarres commented 1 month ago

Request

The Push Subscription's Push block is missing the NoWrapper feature. This should be added with the additional write metadata flag to support the NoWrapper feature completely.

Terraform Resources

https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/pubsub_subscription is where the no_wrapper feature is exposed.

This is the link to the no_wrapper field https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/pubsub_subscription#nested_no_wrapper

Detailed design

The Push Subscription is missing the no_wrapper (https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/pubsub_subscription#no_wrapper) flag/feature.

This no_wrapper and write_metadata fields should be added in the push subscription block https://github.com/terraform-google-modules/terraform-google-pubsub/blob/834f20481a6a634af91aed713e58b02ee6490dd9/main.tf#L221 

This should be optional fields to enable no_wrapper and no_wrapper_write_metadata both defaulting to false

Additional information

This supports use cases when publishing from GCP into another system not honoring the GCP Message Wrapper and when you add additional things into the HTTP Push Request to the Subscribed Endpoint.

onarres commented 4 weeks ago

I added the feature into this fork - https://github.com/onarres/terraform-google-pubsub-nowrap/pull/1

Opened this PR in this repo: https://github.com/terraform-google-modules/terraform-google-pubsub/pull/194