Add deadLetterPolicy to Pub/Sub Subscription resource (#3305) (#184)

* Add deadLetterPolicy to Pub/Sub subscription resource

* fix: disable allow_empty_objects, fix docstring, add example

* fix: set max_delivery_attempts

* fix: block and topic name

Signed-off-by: Modular Magician <magic-modules@google.com>
This commit is contained in:
The Magician 2020-03-30 11:44:47 -07:00 committed by GitHub
commit c41f599aee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 130 additions and 0 deletions

View file

@ -236,6 +236,41 @@ resources:
- Example - "3.5s".
returned: success
type: str
deadLetterPolicy:
description:
- A policy that specifies the conditions for dead lettering messages in this
subscription. If dead_letter_policy is not set, dead lettering is disabled.
- The Cloud Pub/Sub service account associated with this subscriptions's parent
project (i.e., service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com)
must have permission to Acknowledge() messages on this subscription.
returned: success
type: complex
contains:
deadLetterTopic:
description:
- The name of the topic to which dead letter messages should be published.
- Format is `projects/{project}/topics/{topic}`.
- The Cloud Pub/Sub service\naccount associated with the enclosing subscription's
parent project (i.e., service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com)
must have permission to Publish() to this topic.
- The operation will fail if the topic does not exist.
- Users should ensure that there is a subscription attached to this topic
since messages published to a topic with no subscriptions are lost.
returned: success
type: str
maxDeliveryAttempts:
description:
- The maximum number of delivery attempts for any message. The value must
be between 5 and 100.
- The number of delivery attempts is defined as 1 + (the sum of number of
NACKs and number of times the acknowledgement deadline has been exceeded
for the message).
- A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that client
libraries may automatically extend ack_deadlines.
- This field will be honored on a best effort basis.
- If this parameter is 0, a default value of 5 is used.
returned: success
type: int
'''
################################################################################