1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. pubsub
  5. getSubscription
Google Cloud v8.26.0 published on Thursday, Apr 10, 2025 by Pulumi

gcp.pubsub.getSubscription

Explore with Pulumi AI

Google Cloud v8.26.0 published on Thursday, Apr 10, 2025 by Pulumi

Get information about a Google Cloud Pub/Sub Subscription. For more information see the official documentation and API.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const my_pubsub_subscription = gcp.pubsub.getSubscription({
    name: "my-pubsub-subscription",
});
Copy
import pulumi
import pulumi_gcp as gcp

my_pubsub_subscription = gcp.pubsub.get_subscription(name="my-pubsub-subscription")
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/pubsub"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := pubsub.LookupSubscription(ctx, &pubsub.LookupSubscriptionArgs{
			Name: "my-pubsub-subscription",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var my_pubsub_subscription = Gcp.PubSub.GetSubscription.Invoke(new()
    {
        Name = "my-pubsub-subscription",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.pubsub.PubsubFunctions;
import com.pulumi.gcp.pubsub.inputs.GetSubscriptionArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var my-pubsub-subscription = PubsubFunctions.getSubscription(GetSubscriptionArgs.builder()
            .name("my-pubsub-subscription")
            .build());

    }
}
Copy
variables:
  my-pubsub-subscription:
    fn::invoke:
      function: gcp:pubsub:getSubscription
      arguments:
        name: my-pubsub-subscription
Copy

Using getSubscription

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getSubscription(args: GetSubscriptionArgs, opts?: InvokeOptions): Promise<GetSubscriptionResult>
function getSubscriptionOutput(args: GetSubscriptionOutputArgs, opts?: InvokeOptions): Output<GetSubscriptionResult>
Copy
def get_subscription(name: Optional[str] = None,
                     project: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetSubscriptionResult
def get_subscription_output(name: Optional[pulumi.Input[str]] = None,
                     project: Optional[pulumi.Input[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetSubscriptionResult]
Copy
func LookupSubscription(ctx *Context, args *LookupSubscriptionArgs, opts ...InvokeOption) (*LookupSubscriptionResult, error)
func LookupSubscriptionOutput(ctx *Context, args *LookupSubscriptionOutputArgs, opts ...InvokeOption) LookupSubscriptionResultOutput
Copy

> Note: This function is named LookupSubscription in the Go SDK.

public static class GetSubscription 
{
    public static Task<GetSubscriptionResult> InvokeAsync(GetSubscriptionArgs args, InvokeOptions? opts = null)
    public static Output<GetSubscriptionResult> Invoke(GetSubscriptionInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetSubscriptionResult> getSubscription(GetSubscriptionArgs args, InvokeOptions options)
public static Output<GetSubscriptionResult> getSubscription(GetSubscriptionArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: gcp:pubsub/getSubscription:getSubscription
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Name This property is required. string
The name of the Cloud Pub/Sub Subscription.


Project string
The project in which the resource belongs. If it is not provided, the provider project is used.
Name This property is required. string
The name of the Cloud Pub/Sub Subscription.


Project string
The project in which the resource belongs. If it is not provided, the provider project is used.
name This property is required. String
The name of the Cloud Pub/Sub Subscription.


project String
The project in which the resource belongs. If it is not provided, the provider project is used.
name This property is required. string
The name of the Cloud Pub/Sub Subscription.


project string
The project in which the resource belongs. If it is not provided, the provider project is used.
name This property is required. str
The name of the Cloud Pub/Sub Subscription.


project str
The project in which the resource belongs. If it is not provided, the provider project is used.
name This property is required. String
The name of the Cloud Pub/Sub Subscription.


project String
The project in which the resource belongs. If it is not provided, the provider project is used.

getSubscription Result

The following output properties are available:

Supporting Types

GetSubscriptionBigqueryConfig

DropUnknownFields This property is required. bool
When true and use_topic_schema or use_table_schema is true, any fields that are a part of the topic schema or message schema that are not part of the BigQuery table schema are dropped when writing to BigQuery. Otherwise, the schemas must be kept in sync and any messages with extra fields are not written and remain in the subscription's backlog.
ServiceAccountEmail This property is required. string
The service account to use to write to BigQuery. If not specified, the Pub/Sub service agent, service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used.
Table This property is required. string
The name of the table to which to write data, of the form {projectId}.{datasetId}.{tableId}
UseTableSchema This property is required. bool
When true, use the BigQuery table's schema as the columns to write to in BigQuery. Messages must be published in JSON format. Only one of use_topic_schema and use_table_schema can be set.
UseTopicSchema This property is required. bool
When true, use the topic's schema as the columns to write to in BigQuery, if it exists. Only one of use_topic_schema and use_table_schema can be set.
WriteMetadata This property is required. bool
When true, write the subscription name, messageId, publishTime, attributes, and orderingKey to additional columns in the table. The subscription name, messageId, and publishTime fields are put in their own columns while all other message properties (other than data) are written to a JSON object in the attributes column.
DropUnknownFields This property is required. bool
When true and use_topic_schema or use_table_schema is true, any fields that are a part of the topic schema or message schema that are not part of the BigQuery table schema are dropped when writing to BigQuery. Otherwise, the schemas must be kept in sync and any messages with extra fields are not written and remain in the subscription's backlog.
ServiceAccountEmail This property is required. string
The service account to use to write to BigQuery. If not specified, the Pub/Sub service agent, service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used.
Table This property is required. string
The name of the table to which to write data, of the form {projectId}.{datasetId}.{tableId}
UseTableSchema This property is required. bool
When true, use the BigQuery table's schema as the columns to write to in BigQuery. Messages must be published in JSON format. Only one of use_topic_schema and use_table_schema can be set.
UseTopicSchema This property is required. bool
When true, use the topic's schema as the columns to write to in BigQuery, if it exists. Only one of use_topic_schema and use_table_schema can be set.
WriteMetadata This property is required. bool
When true, write the subscription name, messageId, publishTime, attributes, and orderingKey to additional columns in the table. The subscription name, messageId, and publishTime fields are put in their own columns while all other message properties (other than data) are written to a JSON object in the attributes column.
dropUnknownFields This property is required. Boolean
When true and use_topic_schema or use_table_schema is true, any fields that are a part of the topic schema or message schema that are not part of the BigQuery table schema are dropped when writing to BigQuery. Otherwise, the schemas must be kept in sync and any messages with extra fields are not written and remain in the subscription's backlog.
serviceAccountEmail This property is required. String
The service account to use to write to BigQuery. If not specified, the Pub/Sub service agent, service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used.
table This property is required. String
The name of the table to which to write data, of the form {projectId}.{datasetId}.{tableId}
useTableSchema This property is required. Boolean
When true, use the BigQuery table's schema as the columns to write to in BigQuery. Messages must be published in JSON format. Only one of use_topic_schema and use_table_schema can be set.
useTopicSchema This property is required. Boolean
When true, use the topic's schema as the columns to write to in BigQuery, if it exists. Only one of use_topic_schema and use_table_schema can be set.
writeMetadata This property is required. Boolean
When true, write the subscription name, messageId, publishTime, attributes, and orderingKey to additional columns in the table. The subscription name, messageId, and publishTime fields are put in their own columns while all other message properties (other than data) are written to a JSON object in the attributes column.
dropUnknownFields This property is required. boolean
When true and use_topic_schema or use_table_schema is true, any fields that are a part of the topic schema or message schema that are not part of the BigQuery table schema are dropped when writing to BigQuery. Otherwise, the schemas must be kept in sync and any messages with extra fields are not written and remain in the subscription's backlog.
serviceAccountEmail This property is required. string
The service account to use to write to BigQuery. If not specified, the Pub/Sub service agent, service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used.
table This property is required. string
The name of the table to which to write data, of the form {projectId}.{datasetId}.{tableId}
useTableSchema This property is required. boolean
When true, use the BigQuery table's schema as the columns to write to in BigQuery. Messages must be published in JSON format. Only one of use_topic_schema and use_table_schema can be set.
useTopicSchema This property is required. boolean
When true, use the topic's schema as the columns to write to in BigQuery, if it exists. Only one of use_topic_schema and use_table_schema can be set.
writeMetadata This property is required. boolean
When true, write the subscription name, messageId, publishTime, attributes, and orderingKey to additional columns in the table. The subscription name, messageId, and publishTime fields are put in their own columns while all other message properties (other than data) are written to a JSON object in the attributes column.
drop_unknown_fields This property is required. bool
When true and use_topic_schema or use_table_schema is true, any fields that are a part of the topic schema or message schema that are not part of the BigQuery table schema are dropped when writing to BigQuery. Otherwise, the schemas must be kept in sync and any messages with extra fields are not written and remain in the subscription's backlog.
service_account_email This property is required. str
The service account to use to write to BigQuery. If not specified, the Pub/Sub service agent, service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used.
table This property is required. str
The name of the table to which to write data, of the form {projectId}.{datasetId}.{tableId}
use_table_schema This property is required. bool
When true, use the BigQuery table's schema as the columns to write to in BigQuery. Messages must be published in JSON format. Only one of use_topic_schema and use_table_schema can be set.
use_topic_schema This property is required. bool
When true, use the topic's schema as the columns to write to in BigQuery, if it exists. Only one of use_topic_schema and use_table_schema can be set.
write_metadata This property is required. bool
When true, write the subscription name, messageId, publishTime, attributes, and orderingKey to additional columns in the table. The subscription name, messageId, and publishTime fields are put in their own columns while all other message properties (other than data) are written to a JSON object in the attributes column.
dropUnknownFields This property is required. Boolean
When true and use_topic_schema or use_table_schema is true, any fields that are a part of the topic schema or message schema that are not part of the BigQuery table schema are dropped when writing to BigQuery. Otherwise, the schemas must be kept in sync and any messages with extra fields are not written and remain in the subscription's backlog.
serviceAccountEmail This property is required. String
The service account to use to write to BigQuery. If not specified, the Pub/Sub service agent, service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used.
table This property is required. String
The name of the table to which to write data, of the form {projectId}.{datasetId}.{tableId}
useTableSchema This property is required. Boolean
When true, use the BigQuery table's schema as the columns to write to in BigQuery. Messages must be published in JSON format. Only one of use_topic_schema and use_table_schema can be set.
useTopicSchema This property is required. Boolean
When true, use the topic's schema as the columns to write to in BigQuery, if it exists. Only one of use_topic_schema and use_table_schema can be set.
writeMetadata This property is required. Boolean
When true, write the subscription name, messageId, publishTime, attributes, and orderingKey to additional columns in the table. The subscription name, messageId, and publishTime fields are put in their own columns while all other message properties (other than data) are written to a JSON object in the attributes column.

GetSubscriptionCloudStorageConfig

AvroConfigs This property is required. List<GetSubscriptionCloudStorageConfigAvroConfig>
If set, message data will be written to Cloud Storage in Avro format.
Bucket This property is required. string
User-provided name for the Cloud Storage bucket. The bucket must be created by the user. The bucket name must be without any prefix like "gs://".
FilenameDatetimeFormat This property is required. string
User-provided format string specifying how to represent datetimes in Cloud Storage filenames.
FilenamePrefix This property is required. string
User-provided prefix for Cloud Storage filename.
FilenameSuffix This property is required. string
User-provided suffix for Cloud Storage filename. Must not end in "/".
MaxBytes This property is required. int
The maximum bytes that can be written to a Cloud Storage file before a new file is created. Min 1 KB, max 10 GiB. The maxBytes limit may be exceeded in cases where messages are larger than the limit.
MaxDuration This property is required. string
The maximum duration that can elapse before a new Cloud Storage file is created. Min 1 minute, max 10 minutes, default 5 minutes. May not exceed the subscription's acknowledgement deadline. A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".
MaxMessages This property is required. int
The maximum messages that can be written to a Cloud Storage file before a new file is created. Min 1000 messages.
ServiceAccountEmail This property is required. string
The service account to use to write to Cloud Storage. If not specified, the Pub/Sub service agent, service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used.
State This property is required. string
An output-only field that indicates whether or not the subscription can receive messages.
AvroConfigs This property is required. []GetSubscriptionCloudStorageConfigAvroConfig
If set, message data will be written to Cloud Storage in Avro format.
Bucket This property is required. string
User-provided name for the Cloud Storage bucket. The bucket must be created by the user. The bucket name must be without any prefix like "gs://".
FilenameDatetimeFormat This property is required. string
User-provided format string specifying how to represent datetimes in Cloud Storage filenames.
FilenamePrefix This property is required. string
User-provided prefix for Cloud Storage filename.
FilenameSuffix This property is required. string
User-provided suffix for Cloud Storage filename. Must not end in "/".
MaxBytes This property is required. int
The maximum bytes that can be written to a Cloud Storage file before a new file is created. Min 1 KB, max 10 GiB. The maxBytes limit may be exceeded in cases where messages are larger than the limit.
MaxDuration This property is required. string
The maximum duration that can elapse before a new Cloud Storage file is created. Min 1 minute, max 10 minutes, default 5 minutes. May not exceed the subscription's acknowledgement deadline. A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".
MaxMessages This property is required. int
The maximum messages that can be written to a Cloud Storage file before a new file is created. Min 1000 messages.
ServiceAccountEmail This property is required. string
The service account to use to write to Cloud Storage. If not specified, the Pub/Sub service agent, service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used.
State This property is required. string
An output-only field that indicates whether or not the subscription can receive messages.
avroConfigs This property is required. List<GetSubscriptionCloudStorageConfigAvroConfig>
If set, message data will be written to Cloud Storage in Avro format.
bucket This property is required. String
User-provided name for the Cloud Storage bucket. The bucket must be created by the user. The bucket name must be without any prefix like "gs://".
filenameDatetimeFormat This property is required. String
User-provided format string specifying how to represent datetimes in Cloud Storage filenames.
filenamePrefix This property is required. String
User-provided prefix for Cloud Storage filename.
filenameSuffix This property is required. String
User-provided suffix for Cloud Storage filename. Must not end in "/".
maxBytes This property is required. Integer
The maximum bytes that can be written to a Cloud Storage file before a new file is created. Min 1 KB, max 10 GiB. The maxBytes limit may be exceeded in cases where messages are larger than the limit.
maxDuration This property is required. String
The maximum duration that can elapse before a new Cloud Storage file is created. Min 1 minute, max 10 minutes, default 5 minutes. May not exceed the subscription's acknowledgement deadline. A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".
maxMessages This property is required. Integer
The maximum messages that can be written to a Cloud Storage file before a new file is created. Min 1000 messages.
serviceAccountEmail This property is required. String
The service account to use to write to Cloud Storage. If not specified, the Pub/Sub service agent, service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used.
state This property is required. String
An output-only field that indicates whether or not the subscription can receive messages.
avroConfigs This property is required. GetSubscriptionCloudStorageConfigAvroConfig[]
If set, message data will be written to Cloud Storage in Avro format.
bucket This property is required. string
User-provided name for the Cloud Storage bucket. The bucket must be created by the user. The bucket name must be without any prefix like "gs://".
filenameDatetimeFormat This property is required. string
User-provided format string specifying how to represent datetimes in Cloud Storage filenames.
filenamePrefix This property is required. string
User-provided prefix for Cloud Storage filename.
filenameSuffix This property is required. string
User-provided suffix for Cloud Storage filename. Must not end in "/".
maxBytes This property is required. number
The maximum bytes that can be written to a Cloud Storage file before a new file is created. Min 1 KB, max 10 GiB. The maxBytes limit may be exceeded in cases where messages are larger than the limit.
maxDuration This property is required. string
The maximum duration that can elapse before a new Cloud Storage file is created. Min 1 minute, max 10 minutes, default 5 minutes. May not exceed the subscription's acknowledgement deadline. A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".
maxMessages This property is required. number
The maximum messages that can be written to a Cloud Storage file before a new file is created. Min 1000 messages.
serviceAccountEmail This property is required. string
The service account to use to write to Cloud Storage. If not specified, the Pub/Sub service agent, service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used.
state This property is required. string
An output-only field that indicates whether or not the subscription can receive messages.
avro_configs This property is required. Sequence[GetSubscriptionCloudStorageConfigAvroConfig]
If set, message data will be written to Cloud Storage in Avro format.
bucket This property is required. str
User-provided name for the Cloud Storage bucket. The bucket must be created by the user. The bucket name must be without any prefix like "gs://".
filename_datetime_format This property is required. str
User-provided format string specifying how to represent datetimes in Cloud Storage filenames.
filename_prefix This property is required. str
User-provided prefix for Cloud Storage filename.
filename_suffix This property is required. str
User-provided suffix for Cloud Storage filename. Must not end in "/".
max_bytes This property is required. int
The maximum bytes that can be written to a Cloud Storage file before a new file is created. Min 1 KB, max 10 GiB. The maxBytes limit may be exceeded in cases where messages are larger than the limit.
max_duration This property is required. str
The maximum duration that can elapse before a new Cloud Storage file is created. Min 1 minute, max 10 minutes, default 5 minutes. May not exceed the subscription's acknowledgement deadline. A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".
max_messages This property is required. int
The maximum messages that can be written to a Cloud Storage file before a new file is created. Min 1000 messages.
service_account_email This property is required. str
The service account to use to write to Cloud Storage. If not specified, the Pub/Sub service agent, service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used.
state This property is required. str
An output-only field that indicates whether or not the subscription can receive messages.
avroConfigs This property is required. List<Property Map>
If set, message data will be written to Cloud Storage in Avro format.
bucket This property is required. String
User-provided name for the Cloud Storage bucket. The bucket must be created by the user. The bucket name must be without any prefix like "gs://".
filenameDatetimeFormat This property is required. String
User-provided format string specifying how to represent datetimes in Cloud Storage filenames.
filenamePrefix This property is required. String
User-provided prefix for Cloud Storage filename.
filenameSuffix This property is required. String
User-provided suffix for Cloud Storage filename. Must not end in "/".
maxBytes This property is required. Number
The maximum bytes that can be written to a Cloud Storage file before a new file is created. Min 1 KB, max 10 GiB. The maxBytes limit may be exceeded in cases where messages are larger than the limit.
maxDuration This property is required. String
The maximum duration that can elapse before a new Cloud Storage file is created. Min 1 minute, max 10 minutes, default 5 minutes. May not exceed the subscription's acknowledgement deadline. A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".
maxMessages This property is required. Number
The maximum messages that can be written to a Cloud Storage file before a new file is created. Min 1000 messages.
serviceAccountEmail This property is required. String
The service account to use to write to Cloud Storage. If not specified, the Pub/Sub service agent, service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used.
state This property is required. String
An output-only field that indicates whether or not the subscription can receive messages.

GetSubscriptionCloudStorageConfigAvroConfig

UseTopicSchema This property is required. bool
When true, the output Cloud Storage file will be serialized using the topic schema, if it exists.
WriteMetadata This property is required. bool
When true, write the subscription name, messageId, publishTime, attributes, and orderingKey as additional fields in the output.
UseTopicSchema This property is required. bool
When true, the output Cloud Storage file will be serialized using the topic schema, if it exists.
WriteMetadata This property is required. bool
When true, write the subscription name, messageId, publishTime, attributes, and orderingKey as additional fields in the output.
useTopicSchema This property is required. Boolean
When true, the output Cloud Storage file will be serialized using the topic schema, if it exists.
writeMetadata This property is required. Boolean
When true, write the subscription name, messageId, publishTime, attributes, and orderingKey as additional fields in the output.
useTopicSchema This property is required. boolean
When true, the output Cloud Storage file will be serialized using the topic schema, if it exists.
writeMetadata This property is required. boolean
When true, write the subscription name, messageId, publishTime, attributes, and orderingKey as additional fields in the output.
use_topic_schema This property is required. bool
When true, the output Cloud Storage file will be serialized using the topic schema, if it exists.
write_metadata This property is required. bool
When true, write the subscription name, messageId, publishTime, attributes, and orderingKey as additional fields in the output.
useTopicSchema This property is required. Boolean
When true, the output Cloud Storage file will be serialized using the topic schema, if it exists.
writeMetadata This property is required. Boolean
When true, write the subscription name, messageId, publishTime, attributes, and orderingKey as additional fields in the output.

GetSubscriptionDeadLetterPolicy

DeadLetterTopic This property is required. string

The name of the topic to which dead letter messages should be published. Format is 'projects/{project}/topics/{topic}'.

The Cloud Pub/Sub service account 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.

MaxDeliveryAttempts This property is required. int

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.

DeadLetterTopic This property is required. string

The name of the topic to which dead letter messages should be published. Format is 'projects/{project}/topics/{topic}'.

The Cloud Pub/Sub service account 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.

MaxDeliveryAttempts This property is required. int

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.

deadLetterTopic This property is required. String

The name of the topic to which dead letter messages should be published. Format is 'projects/{project}/topics/{topic}'.

The Cloud Pub/Sub service account 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.

maxDeliveryAttempts This property is required. Integer

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.

deadLetterTopic This property is required. string

The name of the topic to which dead letter messages should be published. Format is 'projects/{project}/topics/{topic}'.

The Cloud Pub/Sub service account 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.

maxDeliveryAttempts This property is required. number

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.

dead_letter_topic This property is required. str

The name of the topic to which dead letter messages should be published. Format is 'projects/{project}/topics/{topic}'.

The Cloud Pub/Sub service account 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.

max_delivery_attempts This property is required. int

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.

deadLetterTopic This property is required. String

The name of the topic to which dead letter messages should be published. Format is 'projects/{project}/topics/{topic}'.

The Cloud Pub/Sub service account 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.

maxDeliveryAttempts This property is required. Number

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.

GetSubscriptionExpirationPolicy

Ttl This property is required. string
Specifies the "time-to-live" duration for an associated resource. The resource expires if it is not active for a period of ttl. If ttl is set to "", the associated resource never expires. A duration in seconds with up to nine fractional digits, terminated by 's'. Example - "3.5s".
Ttl This property is required. string
Specifies the "time-to-live" duration for an associated resource. The resource expires if it is not active for a period of ttl. If ttl is set to "", the associated resource never expires. A duration in seconds with up to nine fractional digits, terminated by 's'. Example - "3.5s".
ttl This property is required. String
Specifies the "time-to-live" duration for an associated resource. The resource expires if it is not active for a period of ttl. If ttl is set to "", the associated resource never expires. A duration in seconds with up to nine fractional digits, terminated by 's'. Example - "3.5s".
ttl This property is required. string
Specifies the "time-to-live" duration for an associated resource. The resource expires if it is not active for a period of ttl. If ttl is set to "", the associated resource never expires. A duration in seconds with up to nine fractional digits, terminated by 's'. Example - "3.5s".
ttl This property is required. str
Specifies the "time-to-live" duration for an associated resource. The resource expires if it is not active for a period of ttl. If ttl is set to "", the associated resource never expires. A duration in seconds with up to nine fractional digits, terminated by 's'. Example - "3.5s".
ttl This property is required. String
Specifies the "time-to-live" duration for an associated resource. The resource expires if it is not active for a period of ttl. If ttl is set to "", the associated resource never expires. A duration in seconds with up to nine fractional digits, terminated by 's'. Example - "3.5s".

GetSubscriptionPushConfig

Attributes This property is required. Dictionary<string, string>

Endpoint configuration attributes.

Every endpoint has a set of API supported attributes that can be used to control different aspects of the message delivery.

The currently supported attribute is x-goog-version, which you can use to change the format of the pushed message. This attribute indicates the version of the data expected by the endpoint. This controls the shape of the pushed message (i.e., its fields and metadata). The endpoint version is based on the version of the Pub/Sub API.

If not present during the subscriptions.create call, it will default to the version of the API used to make such call. If not present during a subscriptions.modifyPushConfig call, its value will not be changed. subscriptions.get calls will always return a valid version, even if the subscription was created without this attribute.

The possible values for this attribute are:

  • v1beta1: uses the push format defined in the v1beta1 Pub/Sub API.
  • v1 or v1beta2: uses the push format defined in the v1 Pub/Sub API.
NoWrappers This property is required. List<GetSubscriptionPushConfigNoWrapper>
When set, the payload to the push endpoint is not wrapped.Sets the 'data' field as the HTTP body for delivery.
OidcTokens This property is required. List<GetSubscriptionPushConfigOidcToken>
If specified, Pub/Sub will generate and attach an OIDC JWT token as an Authorization header in the HTTP request for every pushed message.
PushEndpoint This property is required. string
A URL locating the endpoint to which messages should be pushed. For example, a Webhook endpoint might use "https://example.com/push".
Attributes This property is required. map[string]string

Endpoint configuration attributes.

Every endpoint has a set of API supported attributes that can be used to control different aspects of the message delivery.

The currently supported attribute is x-goog-version, which you can use to change the format of the pushed message. This attribute indicates the version of the data expected by the endpoint. This controls the shape of the pushed message (i.e., its fields and metadata). The endpoint version is based on the version of the Pub/Sub API.

If not present during the subscriptions.create call, it will default to the version of the API used to make such call. If not present during a subscriptions.modifyPushConfig call, its value will not be changed. subscriptions.get calls will always return a valid version, even if the subscription was created without this attribute.

The possible values for this attribute are:

  • v1beta1: uses the push format defined in the v1beta1 Pub/Sub API.
  • v1 or v1beta2: uses the push format defined in the v1 Pub/Sub API.
NoWrappers This property is required. []GetSubscriptionPushConfigNoWrapper
When set, the payload to the push endpoint is not wrapped.Sets the 'data' field as the HTTP body for delivery.
OidcTokens This property is required. []GetSubscriptionPushConfigOidcToken
If specified, Pub/Sub will generate and attach an OIDC JWT token as an Authorization header in the HTTP request for every pushed message.
PushEndpoint This property is required. string
A URL locating the endpoint to which messages should be pushed. For example, a Webhook endpoint might use "https://example.com/push".
attributes This property is required. Map<String,String>

Endpoint configuration attributes.

Every endpoint has a set of API supported attributes that can be used to control different aspects of the message delivery.

The currently supported attribute is x-goog-version, which you can use to change the format of the pushed message. This attribute indicates the version of the data expected by the endpoint. This controls the shape of the pushed message (i.e., its fields and metadata). The endpoint version is based on the version of the Pub/Sub API.

If not present during the subscriptions.create call, it will default to the version of the API used to make such call. If not present during a subscriptions.modifyPushConfig call, its value will not be changed. subscriptions.get calls will always return a valid version, even if the subscription was created without this attribute.

The possible values for this attribute are:

  • v1beta1: uses the push format defined in the v1beta1 Pub/Sub API.
  • v1 or v1beta2: uses the push format defined in the v1 Pub/Sub API.
noWrappers This property is required. List<GetSubscriptionPushConfigNoWrapper>
When set, the payload to the push endpoint is not wrapped.Sets the 'data' field as the HTTP body for delivery.
oidcTokens This property is required. List<GetSubscriptionPushConfigOidcToken>
If specified, Pub/Sub will generate and attach an OIDC JWT token as an Authorization header in the HTTP request for every pushed message.
pushEndpoint This property is required. String
A URL locating the endpoint to which messages should be pushed. For example, a Webhook endpoint might use "https://example.com/push".
attributes This property is required. {[key: string]: string}

Endpoint configuration attributes.

Every endpoint has a set of API supported attributes that can be used to control different aspects of the message delivery.

The currently supported attribute is x-goog-version, which you can use to change the format of the pushed message. This attribute indicates the version of the data expected by the endpoint. This controls the shape of the pushed message (i.e., its fields and metadata). The endpoint version is based on the version of the Pub/Sub API.

If not present during the subscriptions.create call, it will default to the version of the API used to make such call. If not present during a subscriptions.modifyPushConfig call, its value will not be changed. subscriptions.get calls will always return a valid version, even if the subscription was created without this attribute.

The possible values for this attribute are:

  • v1beta1: uses the push format defined in the v1beta1 Pub/Sub API.
  • v1 or v1beta2: uses the push format defined in the v1 Pub/Sub API.
noWrappers This property is required. GetSubscriptionPushConfigNoWrapper[]
When set, the payload to the push endpoint is not wrapped.Sets the 'data' field as the HTTP body for delivery.
oidcTokens This property is required. GetSubscriptionPushConfigOidcToken[]
If specified, Pub/Sub will generate and attach an OIDC JWT token as an Authorization header in the HTTP request for every pushed message.
pushEndpoint This property is required. string
A URL locating the endpoint to which messages should be pushed. For example, a Webhook endpoint might use "https://example.com/push".
attributes This property is required. Mapping[str, str]

Endpoint configuration attributes.

Every endpoint has a set of API supported attributes that can be used to control different aspects of the message delivery.

The currently supported attribute is x-goog-version, which you can use to change the format of the pushed message. This attribute indicates the version of the data expected by the endpoint. This controls the shape of the pushed message (i.e., its fields and metadata). The endpoint version is based on the version of the Pub/Sub API.

If not present during the subscriptions.create call, it will default to the version of the API used to make such call. If not present during a subscriptions.modifyPushConfig call, its value will not be changed. subscriptions.get calls will always return a valid version, even if the subscription was created without this attribute.

The possible values for this attribute are:

  • v1beta1: uses the push format defined in the v1beta1 Pub/Sub API.
  • v1 or v1beta2: uses the push format defined in the v1 Pub/Sub API.
no_wrappers This property is required. Sequence[GetSubscriptionPushConfigNoWrapper]
When set, the payload to the push endpoint is not wrapped.Sets the 'data' field as the HTTP body for delivery.
oidc_tokens This property is required. Sequence[GetSubscriptionPushConfigOidcToken]
If specified, Pub/Sub will generate and attach an OIDC JWT token as an Authorization header in the HTTP request for every pushed message.
push_endpoint This property is required. str
A URL locating the endpoint to which messages should be pushed. For example, a Webhook endpoint might use "https://example.com/push".
attributes This property is required. Map<String>

Endpoint configuration attributes.

Every endpoint has a set of API supported attributes that can be used to control different aspects of the message delivery.

The currently supported attribute is x-goog-version, which you can use to change the format of the pushed message. This attribute indicates the version of the data expected by the endpoint. This controls the shape of the pushed message (i.e., its fields and metadata). The endpoint version is based on the version of the Pub/Sub API.

If not present during the subscriptions.create call, it will default to the version of the API used to make such call. If not present during a subscriptions.modifyPushConfig call, its value will not be changed. subscriptions.get calls will always return a valid version, even if the subscription was created without this attribute.

The possible values for this attribute are:

  • v1beta1: uses the push format defined in the v1beta1 Pub/Sub API.
  • v1 or v1beta2: uses the push format defined in the v1 Pub/Sub API.
noWrappers This property is required. List<Property Map>
When set, the payload to the push endpoint is not wrapped.Sets the 'data' field as the HTTP body for delivery.
oidcTokens This property is required. List<Property Map>
If specified, Pub/Sub will generate and attach an OIDC JWT token as an Authorization header in the HTTP request for every pushed message.
pushEndpoint This property is required. String
A URL locating the endpoint to which messages should be pushed. For example, a Webhook endpoint might use "https://example.com/push".

GetSubscriptionPushConfigNoWrapper

WriteMetadata This property is required. bool
When true, writes the Pub/Sub message metadata to 'x-goog-pubsub-:' headers of the HTTP request. Writes the Pub/Sub message attributes to ':' headers of the HTTP request.
WriteMetadata This property is required. bool
When true, writes the Pub/Sub message metadata to 'x-goog-pubsub-:' headers of the HTTP request. Writes the Pub/Sub message attributes to ':' headers of the HTTP request.
writeMetadata This property is required. Boolean
When true, writes the Pub/Sub message metadata to 'x-goog-pubsub-:' headers of the HTTP request. Writes the Pub/Sub message attributes to ':' headers of the HTTP request.
writeMetadata This property is required. boolean
When true, writes the Pub/Sub message metadata to 'x-goog-pubsub-:' headers of the HTTP request. Writes the Pub/Sub message attributes to ':' headers of the HTTP request.
write_metadata This property is required. bool
When true, writes the Pub/Sub message metadata to 'x-goog-pubsub-:' headers of the HTTP request. Writes the Pub/Sub message attributes to ':' headers of the HTTP request.
writeMetadata This property is required. Boolean
When true, writes the Pub/Sub message metadata to 'x-goog-pubsub-:' headers of the HTTP request. Writes the Pub/Sub message attributes to ':' headers of the HTTP request.

GetSubscriptionPushConfigOidcToken

Audience This property is required. string
Audience to be used when generating OIDC token. The audience claim identifies the recipients that the JWT is intended for. The audience value is a single case-sensitive string. Having multiple values (array) for the audience field is not supported. More info about the OIDC JWT token audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3 Note: if not specified, the Push endpoint URL will be used.
ServiceAccountEmail This property is required. string
Service account email to be used for generating the OIDC token. The caller (for subscriptions.create, subscriptions.patch, and subscriptions.modifyPushConfig RPCs) must have the iam.serviceAccounts.actAs permission for the service account.
Audience This property is required. string
Audience to be used when generating OIDC token. The audience claim identifies the recipients that the JWT is intended for. The audience value is a single case-sensitive string. Having multiple values (array) for the audience field is not supported. More info about the OIDC JWT token audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3 Note: if not specified, the Push endpoint URL will be used.
ServiceAccountEmail This property is required. string
Service account email to be used for generating the OIDC token. The caller (for subscriptions.create, subscriptions.patch, and subscriptions.modifyPushConfig RPCs) must have the iam.serviceAccounts.actAs permission for the service account.
audience This property is required. String
Audience to be used when generating OIDC token. The audience claim identifies the recipients that the JWT is intended for. The audience value is a single case-sensitive string. Having multiple values (array) for the audience field is not supported. More info about the OIDC JWT token audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3 Note: if not specified, the Push endpoint URL will be used.
serviceAccountEmail This property is required. String
Service account email to be used for generating the OIDC token. The caller (for subscriptions.create, subscriptions.patch, and subscriptions.modifyPushConfig RPCs) must have the iam.serviceAccounts.actAs permission for the service account.
audience This property is required. string
Audience to be used when generating OIDC token. The audience claim identifies the recipients that the JWT is intended for. The audience value is a single case-sensitive string. Having multiple values (array) for the audience field is not supported. More info about the OIDC JWT token audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3 Note: if not specified, the Push endpoint URL will be used.
serviceAccountEmail This property is required. string
Service account email to be used for generating the OIDC token. The caller (for subscriptions.create, subscriptions.patch, and subscriptions.modifyPushConfig RPCs) must have the iam.serviceAccounts.actAs permission for the service account.
audience This property is required. str
Audience to be used when generating OIDC token. The audience claim identifies the recipients that the JWT is intended for. The audience value is a single case-sensitive string. Having multiple values (array) for the audience field is not supported. More info about the OIDC JWT token audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3 Note: if not specified, the Push endpoint URL will be used.
service_account_email This property is required. str
Service account email to be used for generating the OIDC token. The caller (for subscriptions.create, subscriptions.patch, and subscriptions.modifyPushConfig RPCs) must have the iam.serviceAccounts.actAs permission for the service account.
audience This property is required. String
Audience to be used when generating OIDC token. The audience claim identifies the recipients that the JWT is intended for. The audience value is a single case-sensitive string. Having multiple values (array) for the audience field is not supported. More info about the OIDC JWT token audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3 Note: if not specified, the Push endpoint URL will be used.
serviceAccountEmail This property is required. String
Service account email to be used for generating the OIDC token. The caller (for subscriptions.create, subscriptions.patch, and subscriptions.modifyPushConfig RPCs) must have the iam.serviceAccounts.actAs permission for the service account.

GetSubscriptionRetryPolicy

MaximumBackoff This property is required. string
The maximum delay between consecutive deliveries of a given message. Value should be between 0 and 600 seconds. Defaults to 600 seconds. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".
MinimumBackoff This property is required. string
The minimum delay between consecutive deliveries of a given message. Value should be between 0 and 600 seconds. Defaults to 10 seconds. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".
MaximumBackoff This property is required. string
The maximum delay between consecutive deliveries of a given message. Value should be between 0 and 600 seconds. Defaults to 600 seconds. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".
MinimumBackoff This property is required. string
The minimum delay between consecutive deliveries of a given message. Value should be between 0 and 600 seconds. Defaults to 10 seconds. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".
maximumBackoff This property is required. String
The maximum delay between consecutive deliveries of a given message. Value should be between 0 and 600 seconds. Defaults to 600 seconds. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".
minimumBackoff This property is required. String
The minimum delay between consecutive deliveries of a given message. Value should be between 0 and 600 seconds. Defaults to 10 seconds. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".
maximumBackoff This property is required. string
The maximum delay between consecutive deliveries of a given message. Value should be between 0 and 600 seconds. Defaults to 600 seconds. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".
minimumBackoff This property is required. string
The minimum delay between consecutive deliveries of a given message. Value should be between 0 and 600 seconds. Defaults to 10 seconds. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".
maximum_backoff This property is required. str
The maximum delay between consecutive deliveries of a given message. Value should be between 0 and 600 seconds. Defaults to 600 seconds. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".
minimum_backoff This property is required. str
The minimum delay between consecutive deliveries of a given message. Value should be between 0 and 600 seconds. Defaults to 10 seconds. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".
maximumBackoff This property is required. String
The maximum delay between consecutive deliveries of a given message. Value should be between 0 and 600 seconds. Defaults to 600 seconds. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".
minimumBackoff This property is required. String
The minimum delay between consecutive deliveries of a given message. Value should be between 0 and 600 seconds. Defaults to 10 seconds. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".

Package Details

Repository
Google Cloud (GCP) Classic pulumi/pulumi-gcp
License
Apache-2.0
Notes
This Pulumi package is based on the google-beta Terraform Provider.
Google Cloud v8.26.0 published on Thursday, Apr 10, 2025 by Pulumi