From 6d1239324585a2a6cf6e56e9c39d12de22a09134 Mon Sep 17 00:00:00 2001 From: Mahamed Date: Thu, 4 Nov 2021 17:22:39 +0000 Subject: [PATCH] Add Retention Duration to `google_pubsub_topic` (#5347) Co-authored-by: upodroid --- mmv1/products/pubsub/api.yaml | 10 ++++++++++ .../terraform/examples/pubsub_topic_basic.tf.erb | 2 ++ 2 files changed, 12 insertions(+) diff --git a/mmv1/products/pubsub/api.yaml b/mmv1/products/pubsub/api.yaml index 349d6b668586..aff0d7e7144a 100644 --- a/mmv1/products/pubsub/api.yaml +++ b/mmv1/products/pubsub/api.yaml @@ -100,6 +100,16 @@ objects: - :ENCODING_UNSPECIFIED - :JSON - :BINARY + - !ruby/object:Api::Type::String + name: 'messageRetentionDuration' + description: | + Indicates the minimum duration to retain a message after it is published + to the topic. If this field is set, messages published to the topic in + the last messageRetentionDuration are always available to subscribers. + For instance, it allows any attached subscription to seek to a timestamp + that is up to messageRetentionDuration in the past. If this field is not + set, message retention is controlled by settings on individual subscriptions. + Cannot be more than 7 days or less than 10 minutes. - !ruby/object:Api::Resource name: 'Subscription' description: | diff --git a/mmv1/templates/terraform/examples/pubsub_topic_basic.tf.erb b/mmv1/templates/terraform/examples/pubsub_topic_basic.tf.erb index 6cc7abb210a6..32bf56e82c1d 100644 --- a/mmv1/templates/terraform/examples/pubsub_topic_basic.tf.erb +++ b/mmv1/templates/terraform/examples/pubsub_topic_basic.tf.erb @@ -4,4 +4,6 @@ resource "google_pubsub_topic" "<%= ctx[:primary_resource_id] %>" { labels = { foo = "bar" } + + message_retention_duration = "86600s" }