Skip to content

Commit

Permalink
specify the duration format for the Pub/Sub message retention duratio…
Browse files Browse the repository at this point in the history
…n (#9400) (#6599)

When passing a string that doesn't end with an `s`, get the error message

> Invalid value at 'topic.message_retention_duration' (type.googleapis.com/google.protobuf.Duration), Field 'messageRetentionDuration', Illegal duration format; duration must end with 's'

Made the wording similar to the [KMS key rotation period](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/kms_crypto_key#rotation_period) description.
[upstream:80ee4d4b7d0529189700b26aabb604e07e19198d]

Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Nov 3, 2023
1 parent 5ab0feb commit c991825
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .changelog/9400.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
pubsub: clarified the expected format for the `message_retention_duration`
```
3 changes: 2 additions & 1 deletion google-beta/services/pubsub/resource_pubsub_topic.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ 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 31 days or less than 10 minutes.`,
The rotation period has the format of a decimal number, followed by the
letter 's' (seconds). Cannot be more than 31 days or less than 10 minutes.`,
},
"message_storage_policy": {
Type: schema.TypeList,
Expand Down
3 changes: 2 additions & 1 deletion website/docs/r/pubsub_topic.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ The following arguments are supported:
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 31 days or less than 10 minutes.
The rotation period has the format of a decimal number, followed by the
letter `s` (seconds). Cannot be more than 31 days or less than 10 minutes.

* `project` - (Optional) The ID of the project in which the resource belongs.
If it is not provided, the provider project is used.
Expand Down

0 comments on commit c991825

Please sign in to comment.