hashicorp / terraform-provider-google

Terraform Provider for Google Cloud Platform
https://registry.terraform.io/providers/hashicorp/google/latest/docs
Mozilla Public License 2.0
2.36k stars 1.75k forks source link

Add support for enforceInTransit field in `google_pubsub_topic` #19448

Open sk0928 opened 2 months ago

sk0928 commented 2 months ago

Community Note

Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request. If you are interested in working on this issue or have submitted a pull request, please leave a comment. If an issue is assigned to a user, that user is claiming responsibility for the issue. Customers working with a Google Technical Account Manager or Customer Engineer can ask them to reach out internally to expedite investigation and resolution of this issue.

Description

This resource (pubsub topic) is missing an important parameter i.e. enableInTransit that restricts the messages to flow via non-allowed regions

Ref: https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics#messagestoragepolicy

It's set to false by default but since there is not option to set it via tf resources which is very unhelpful for automation task.

https://github.com/hashicorp/terraform-provider-google/blob/0e2f5eade7138de880b0814b54f20be00ba99049/google/services/pubsub/resource_pubsub_topic.go#L144

New or Affected Resource(s)

Potential Terraform Configuration

resource "google_pubsub_topic" "example" {
  name = "example-topic"

  message_storage_policy {
    allowed_persistence_regions = [
      "europe-west3",
    ]
    enforce_in_transit = true
  }
}

References

b/372207550

SarahFrench commented 1 month ago

Note from triage: this is requesting that we add coverage for the enforce_in_transit field : https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics#MessageStoragePolicy.FIELDS.enforce_in_transit