google::subscription

Add a subscription.

Example

google::subscription subscription-pull-example
    name: "subscription-pull-example"
    topic: $(google::topic topic-example-for-subscription)

    ack-deadline-seconds: 15
    enable-message-ordering: false
    filter: ""
    retain-acked-messages: false

    expiration-policy
        ttl
            seconds: 2678400
            nanos: 0
        end
    end

    message-retention
        seconds: 525780
        nanos: 0
    end

    retry-policy
        maximum-backoff
            seconds: 600
            nanos: 0
        end

        minimum-backoff
            seconds: 600
            nanos: 0
        end
    end

    labels: {
        name: "subscription-pull-example"
    }
end

Attributes

Attribute Description
name The name of the subscription.
topic The topic from which this subscription is receiving messages. (Required)
ack-deadline-seconds The approximate amount of time (on a best-effort basis) Pub/Sub waits for the subscriber to acknowledge receipt before resending the message. Valid values are between 10 to 600.
dead-letter-policy subresource

The policy that specifies the conditions for dead lettering messages in this subscription.

dead-letter-topic
The topic to which dead letter messages should be published. (Required)
max-delivery-attempts
The maximum number of delivery attempts for any message. Valid values are between 5 to 100. (Required)
detached When set to true, the subscription is detached from its topic. Once detached cannot be re attached.
enable-message-ordering When set to true, messages published with the same ordering key in a message will be delivered to the subscribers in the order in which they are received by the Pub/Sub system.
expiration-policy subresource

The policy that specifies the conditions for this subscription’s expiration.

ttl subresource

The “time-to-live” duration for the subscription. (Required)

nanos
The nanosecond value of the duration.
seconds
The second value for of the duration.
filter The expression written in the Pub/Sub filter language.
labels map The set of labels for the subscription.
message-retention subresource

The configuration for how long to retain unacknowledged messages in the subscription’s backlog, from the moment a message is published.

nanos
The nanosecond value of the duration.
seconds
The second value for of the duration.
push-config subresource

The push delivery configuration for the subscription.

attributes map
The endpoint configuration attributes that can be used to control different aspects of the message delivery.
oidc-token subresource

The OIDC JWT token created by Pub/Sub as an authorization header in the HTTP request for every pushed message.

audience
The audience to be used when generating OIDC token. The audience claim identifies the recipients that the JWT is intended for.
service-account-email
The email of the service account to be used for generating the OIDC token.
push-endpoint
The URL locating the endpoint to which messages should be pushed. (Required)
retain-acked-messages When set to true, the acknowledged messages are retained.
retry-policy subresource

The policy that specifies how Pub/Sub retries message delivery for this subscription.

maximum-backoff subresource

The maximum delay between consecutive deliveries of a given message.

nanos
The nanosecond value of the duration.
seconds
The second value for of the duration.
minimum-backoff subresource

The minimum delay between consecutive deliveries of a given message.

nanos
The nanosecond value of the duration.
seconds
The second value for of the duration.

Outputs

Attribute Description
reference-name The full name of the subscription path including the project path.