diff --git a/mmv1/products/pubsub/Topic.yaml b/mmv1/products/pubsub/Topic.yaml index 8b539c7edd93..7468ffebb2bb 100644 --- a/mmv1/products/pubsub/Topic.yaml +++ b/mmv1/products/pubsub/Topic.yaml @@ -129,6 +129,14 @@ properties: required: true item_type: type: String + - name: "enforceInTransit" + type: Boolean + description: | + If true, `allowedPersistenceRegions` is also used to enforce in-transit + guarantees for messages. That is, Pub/Sub will fail topics.publish + operations on this topic and subscribe operations on any subscription + attached to this topic in any region that is not in `allowedPersistenceRegions`. + required: false - name: 'schemaSettings' type: NestedObject description: | diff --git a/mmv1/templates/terraform/examples/pubsub_topic_geo_restricted.tf.tmpl b/mmv1/templates/terraform/examples/pubsub_topic_geo_restricted.tf.tmpl index 48934419f82b..ba1a5e35b97a 100644 --- a/mmv1/templates/terraform/examples/pubsub_topic_geo_restricted.tf.tmpl +++ b/mmv1/templates/terraform/examples/pubsub_topic_geo_restricted.tf.tmpl @@ -5,5 +5,6 @@ resource "google_pubsub_topic" "{{$.PrimaryResourceId}}" { allowed_persistence_regions = [ "europe-west3", ] + enforce_in_transit = true } } diff --git a/mmv1/third_party/terraform/services/pubsub/resource_pubsub_topic_test.go b/mmv1/third_party/terraform/services/pubsub/resource_pubsub_topic_test.go index 38d02051d76e..543d89577f26 100644 --- a/mmv1/third_party/terraform/services/pubsub/resource_pubsub_topic_test.go +++ b/mmv1/third_party/terraform/services/pubsub/resource_pubsub_topic_test.go @@ -230,6 +230,7 @@ resource "google_pubsub_topic" "foo" { allowed_persistence_regions = [ "%s", ] + enforce_in_transit = false } } `, topic, key, value, region)