1. Packages
  2. Google Cloud Native
  3. API Docs
  4. pubsub
  5. pubsub/v1
  6. getTopic

Google Cloud Native is in preview. Google Cloud Classic is fully supported.

Google Cloud Native v0.32.0 published on Wednesday, Nov 29, 2023 by Pulumi

google-native.pubsub/v1.getTopic

Explore with Pulumi AI

Google Cloud Native is in preview. Google Cloud Classic is fully supported.

Google Cloud Native v0.32.0 published on Wednesday, Nov 29, 2023 by Pulumi

Gets the configuration of a topic.

Using getTopic

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 getTopic(args: GetTopicArgs, opts?: InvokeOptions): Promise<GetTopicResult>
function getTopicOutput(args: GetTopicOutputArgs, opts?: InvokeOptions): Output<GetTopicResult>
Copy
def get_topic(project: Optional[str] = None,
              topic_id: Optional[str] = None,
              opts: Optional[InvokeOptions] = None) -> GetTopicResult
def get_topic_output(project: Optional[pulumi.Input[str]] = None,
              topic_id: Optional[pulumi.Input[str]] = None,
              opts: Optional[InvokeOptions] = None) -> Output[GetTopicResult]
Copy
func LookupTopic(ctx *Context, args *LookupTopicArgs, opts ...InvokeOption) (*LookupTopicResult, error)
func LookupTopicOutput(ctx *Context, args *LookupTopicOutputArgs, opts ...InvokeOption) LookupTopicResultOutput
Copy

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

public static class GetTopic 
{
    public static Task<GetTopicResult> InvokeAsync(GetTopicArgs args, InvokeOptions? opts = null)
    public static Output<GetTopicResult> Invoke(GetTopicInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetTopicResult> getTopic(GetTopicArgs args, InvokeOptions options)
public static Output<GetTopicResult> getTopic(GetTopicArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: google-native:pubsub/v1:getTopic
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

TopicId This property is required. string
Project string
TopicId This property is required. string
Project string
topicId This property is required. String
project String
topicId This property is required. string
project string
topic_id This property is required. str
project str
topicId This property is required. String
project String

getTopic Result

The following output properties are available:

KmsKeyName string
Optional. The resource name of the Cloud KMS CryptoKey to be used to protect access to messages published on this topic. The expected format is projects/*/locations/*/keyRings/*/cryptoKeys/*.
Labels Dictionary<string, string>
Optional. See [Creating and managing labels] (https://cloud.google.com/pubsub/docs/labels).
MessageRetentionDuration string
Optional. 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 message_retention_duration are always available to subscribers. For instance, it allows any attached subscription to seek to a timestamp that is up to message_retention_duration 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.
MessageStoragePolicy Pulumi.GoogleNative.Pubsub.V1.Outputs.MessageStoragePolicyResponse
Optional. Policy constraining the set of Google Cloud Platform regions where messages published to the topic may be stored. If not present, then no constraints are in effect.
Name string
The name of the topic. It must have the format "projects/{project}/topics/{topic}". {topic} must start with a letter, and contain only letters ([A-Za-z]), numbers ([0-9]), dashes (-), underscores (_), periods (.), tildes (~), plus (+) or percent signs (%). It must be between 3 and 255 characters in length, and it must not start with "goog".
SatisfiesPzs bool
Optional. Reserved for future use. This field is set only in responses from the server; it is ignored if it is set in any requests.
SchemaSettings Pulumi.GoogleNative.Pubsub.V1.Outputs.SchemaSettingsResponse
Optional. Settings for validating messages published against a schema.
KmsKeyName string
Optional. The resource name of the Cloud KMS CryptoKey to be used to protect access to messages published on this topic. The expected format is projects/*/locations/*/keyRings/*/cryptoKeys/*.
Labels map[string]string
Optional. See [Creating and managing labels] (https://cloud.google.com/pubsub/docs/labels).
MessageRetentionDuration string
Optional. 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 message_retention_duration are always available to subscribers. For instance, it allows any attached subscription to seek to a timestamp that is up to message_retention_duration 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.
MessageStoragePolicy MessageStoragePolicyResponse
Optional. Policy constraining the set of Google Cloud Platform regions where messages published to the topic may be stored. If not present, then no constraints are in effect.
Name string
The name of the topic. It must have the format "projects/{project}/topics/{topic}". {topic} must start with a letter, and contain only letters ([A-Za-z]), numbers ([0-9]), dashes (-), underscores (_), periods (.), tildes (~), plus (+) or percent signs (%). It must be between 3 and 255 characters in length, and it must not start with "goog".
SatisfiesPzs bool
Optional. Reserved for future use. This field is set only in responses from the server; it is ignored if it is set in any requests.
SchemaSettings SchemaSettingsResponse
Optional. Settings for validating messages published against a schema.
kmsKeyName String
Optional. The resource name of the Cloud KMS CryptoKey to be used to protect access to messages published on this topic. The expected format is projects/*/locations/*/keyRings/*/cryptoKeys/*.
labels Map<String,String>
Optional. See [Creating and managing labels] (https://cloud.google.com/pubsub/docs/labels).
messageRetentionDuration String
Optional. 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 message_retention_duration are always available to subscribers. For instance, it allows any attached subscription to seek to a timestamp that is up to message_retention_duration 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.
messageStoragePolicy MessageStoragePolicyResponse
Optional. Policy constraining the set of Google Cloud Platform regions where messages published to the topic may be stored. If not present, then no constraints are in effect.
name String
The name of the topic. It must have the format "projects/{project}/topics/{topic}". {topic} must start with a letter, and contain only letters ([A-Za-z]), numbers ([0-9]), dashes (-), underscores (_), periods (.), tildes (~), plus (+) or percent signs (%). It must be between 3 and 255 characters in length, and it must not start with "goog".
satisfiesPzs Boolean
Optional. Reserved for future use. This field is set only in responses from the server; it is ignored if it is set in any requests.
schemaSettings SchemaSettingsResponse
Optional. Settings for validating messages published against a schema.
kmsKeyName string
Optional. The resource name of the Cloud KMS CryptoKey to be used to protect access to messages published on this topic. The expected format is projects/*/locations/*/keyRings/*/cryptoKeys/*.
labels {[key: string]: string}
Optional. See [Creating and managing labels] (https://cloud.google.com/pubsub/docs/labels).
messageRetentionDuration string
Optional. 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 message_retention_duration are always available to subscribers. For instance, it allows any attached subscription to seek to a timestamp that is up to message_retention_duration 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.
messageStoragePolicy MessageStoragePolicyResponse
Optional. Policy constraining the set of Google Cloud Platform regions where messages published to the topic may be stored. If not present, then no constraints are in effect.
name string
The name of the topic. It must have the format "projects/{project}/topics/{topic}". {topic} must start with a letter, and contain only letters ([A-Za-z]), numbers ([0-9]), dashes (-), underscores (_), periods (.), tildes (~), plus (+) or percent signs (%). It must be between 3 and 255 characters in length, and it must not start with "goog".
satisfiesPzs boolean
Optional. Reserved for future use. This field is set only in responses from the server; it is ignored if it is set in any requests.
schemaSettings SchemaSettingsResponse
Optional. Settings for validating messages published against a schema.
kms_key_name str
Optional. The resource name of the Cloud KMS CryptoKey to be used to protect access to messages published on this topic. The expected format is projects/*/locations/*/keyRings/*/cryptoKeys/*.
labels Mapping[str, str]
Optional. See [Creating and managing labels] (https://cloud.google.com/pubsub/docs/labels).
message_retention_duration str
Optional. 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 message_retention_duration are always available to subscribers. For instance, it allows any attached subscription to seek to a timestamp that is up to message_retention_duration 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.
message_storage_policy MessageStoragePolicyResponse
Optional. Policy constraining the set of Google Cloud Platform regions where messages published to the topic may be stored. If not present, then no constraints are in effect.
name str
The name of the topic. It must have the format "projects/{project}/topics/{topic}". {topic} must start with a letter, and contain only letters ([A-Za-z]), numbers ([0-9]), dashes (-), underscores (_), periods (.), tildes (~), plus (+) or percent signs (%). It must be between 3 and 255 characters in length, and it must not start with "goog".
satisfies_pzs bool
Optional. Reserved for future use. This field is set only in responses from the server; it is ignored if it is set in any requests.
schema_settings SchemaSettingsResponse
Optional. Settings for validating messages published against a schema.
kmsKeyName String
Optional. The resource name of the Cloud KMS CryptoKey to be used to protect access to messages published on this topic. The expected format is projects/*/locations/*/keyRings/*/cryptoKeys/*.
labels Map<String>
Optional. See [Creating and managing labels] (https://cloud.google.com/pubsub/docs/labels).
messageRetentionDuration String
Optional. 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 message_retention_duration are always available to subscribers. For instance, it allows any attached subscription to seek to a timestamp that is up to message_retention_duration 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.
messageStoragePolicy Property Map
Optional. Policy constraining the set of Google Cloud Platform regions where messages published to the topic may be stored. If not present, then no constraints are in effect.
name String
The name of the topic. It must have the format "projects/{project}/topics/{topic}". {topic} must start with a letter, and contain only letters ([A-Za-z]), numbers ([0-9]), dashes (-), underscores (_), periods (.), tildes (~), plus (+) or percent signs (%). It must be between 3 and 255 characters in length, and it must not start with "goog".
satisfiesPzs Boolean
Optional. Reserved for future use. This field is set only in responses from the server; it is ignored if it is set in any requests.
schemaSettings Property Map
Optional. Settings for validating messages published against a schema.

Supporting Types

MessageStoragePolicyResponse

AllowedPersistenceRegions This property is required. List<string>
Optional. A list of IDs of Google Cloud regions where messages that are published to the topic may be persisted in storage. Messages published by publishers running in non-allowed Google Cloud regions (or running outside of Google Cloud altogether) are routed for storage in one of the allowed regions. An empty list means that no regions are allowed, and is not a valid configuration.
EnforceInTransit This property is required. bool
Optional. If true, allowed_persistence_regions is also used to enforce in-transit guarantees for messages. That is, Pub/Sub will fail Publish operations on this topic and subscribe operations on any subscription attached to this topic in any region that is not in allowed_persistence_regions.
AllowedPersistenceRegions This property is required. []string
Optional. A list of IDs of Google Cloud regions where messages that are published to the topic may be persisted in storage. Messages published by publishers running in non-allowed Google Cloud regions (or running outside of Google Cloud altogether) are routed for storage in one of the allowed regions. An empty list means that no regions are allowed, and is not a valid configuration.
EnforceInTransit This property is required. bool
Optional. If true, allowed_persistence_regions is also used to enforce in-transit guarantees for messages. That is, Pub/Sub will fail Publish operations on this topic and subscribe operations on any subscription attached to this topic in any region that is not in allowed_persistence_regions.
allowedPersistenceRegions This property is required. List<String>
Optional. A list of IDs of Google Cloud regions where messages that are published to the topic may be persisted in storage. Messages published by publishers running in non-allowed Google Cloud regions (or running outside of Google Cloud altogether) are routed for storage in one of the allowed regions. An empty list means that no regions are allowed, and is not a valid configuration.
enforceInTransit This property is required. Boolean
Optional. If true, allowed_persistence_regions is also used to enforce in-transit guarantees for messages. That is, Pub/Sub will fail Publish operations on this topic and subscribe operations on any subscription attached to this topic in any region that is not in allowed_persistence_regions.
allowedPersistenceRegions This property is required. string[]
Optional. A list of IDs of Google Cloud regions where messages that are published to the topic may be persisted in storage. Messages published by publishers running in non-allowed Google Cloud regions (or running outside of Google Cloud altogether) are routed for storage in one of the allowed regions. An empty list means that no regions are allowed, and is not a valid configuration.
enforceInTransit This property is required. boolean
Optional. If true, allowed_persistence_regions is also used to enforce in-transit guarantees for messages. That is, Pub/Sub will fail Publish operations on this topic and subscribe operations on any subscription attached to this topic in any region that is not in allowed_persistence_regions.
allowed_persistence_regions This property is required. Sequence[str]
Optional. A list of IDs of Google Cloud regions where messages that are published to the topic may be persisted in storage. Messages published by publishers running in non-allowed Google Cloud regions (or running outside of Google Cloud altogether) are routed for storage in one of the allowed regions. An empty list means that no regions are allowed, and is not a valid configuration.
enforce_in_transit This property is required. bool
Optional. If true, allowed_persistence_regions is also used to enforce in-transit guarantees for messages. That is, Pub/Sub will fail Publish operations on this topic and subscribe operations on any subscription attached to this topic in any region that is not in allowed_persistence_regions.
allowedPersistenceRegions This property is required. List<String>
Optional. A list of IDs of Google Cloud regions where messages that are published to the topic may be persisted in storage. Messages published by publishers running in non-allowed Google Cloud regions (or running outside of Google Cloud altogether) are routed for storage in one of the allowed regions. An empty list means that no regions are allowed, and is not a valid configuration.
enforceInTransit This property is required. Boolean
Optional. If true, allowed_persistence_regions is also used to enforce in-transit guarantees for messages. That is, Pub/Sub will fail Publish operations on this topic and subscribe operations on any subscription attached to this topic in any region that is not in allowed_persistence_regions.

SchemaSettingsResponse

Encoding This property is required. string
Optional. The encoding of messages validated against schema.
FirstRevisionId This property is required. string
Optional. The minimum (inclusive) revision allowed for validating messages. If empty or not present, allow any revision to be validated against last_revision or any revision created before.
LastRevisionId This property is required. string
Optional. The maximum (inclusive) revision allowed for validating messages. If empty or not present, allow any revision to be validated against first_revision or any revision created after.
Schema This property is required. string
The name of the schema that messages published should be validated against. Format is projects/{project}/schemas/{schema}. The value of this field will be _deleted-schema_ if the schema has been deleted.
Encoding This property is required. string
Optional. The encoding of messages validated against schema.
FirstRevisionId This property is required. string
Optional. The minimum (inclusive) revision allowed for validating messages. If empty or not present, allow any revision to be validated against last_revision or any revision created before.
LastRevisionId This property is required. string
Optional. The maximum (inclusive) revision allowed for validating messages. If empty or not present, allow any revision to be validated against first_revision or any revision created after.
Schema This property is required. string
The name of the schema that messages published should be validated against. Format is projects/{project}/schemas/{schema}. The value of this field will be _deleted-schema_ if the schema has been deleted.
encoding This property is required. String
Optional. The encoding of messages validated against schema.
firstRevisionId This property is required. String
Optional. The minimum (inclusive) revision allowed for validating messages. If empty or not present, allow any revision to be validated against last_revision or any revision created before.
lastRevisionId This property is required. String
Optional. The maximum (inclusive) revision allowed for validating messages. If empty or not present, allow any revision to be validated against first_revision or any revision created after.
schema This property is required. String
The name of the schema that messages published should be validated against. Format is projects/{project}/schemas/{schema}. The value of this field will be _deleted-schema_ if the schema has been deleted.
encoding This property is required. string
Optional. The encoding of messages validated against schema.
firstRevisionId This property is required. string
Optional. The minimum (inclusive) revision allowed for validating messages. If empty or not present, allow any revision to be validated against last_revision or any revision created before.
lastRevisionId This property is required. string
Optional. The maximum (inclusive) revision allowed for validating messages. If empty or not present, allow any revision to be validated against first_revision or any revision created after.
schema This property is required. string
The name of the schema that messages published should be validated against. Format is projects/{project}/schemas/{schema}. The value of this field will be _deleted-schema_ if the schema has been deleted.
encoding This property is required. str
Optional. The encoding of messages validated against schema.
first_revision_id This property is required. str
Optional. The minimum (inclusive) revision allowed for validating messages. If empty or not present, allow any revision to be validated against last_revision or any revision created before.
last_revision_id This property is required. str
Optional. The maximum (inclusive) revision allowed for validating messages. If empty or not present, allow any revision to be validated against first_revision or any revision created after.
schema This property is required. str
The name of the schema that messages published should be validated against. Format is projects/{project}/schemas/{schema}. The value of this field will be _deleted-schema_ if the schema has been deleted.
encoding This property is required. String
Optional. The encoding of messages validated against schema.
firstRevisionId This property is required. String
Optional. The minimum (inclusive) revision allowed for validating messages. If empty or not present, allow any revision to be validated against last_revision or any revision created before.
lastRevisionId This property is required. String
Optional. The maximum (inclusive) revision allowed for validating messages. If empty or not present, allow any revision to be validated against first_revision or any revision created after.
schema This property is required. String
The name of the schema that messages published should be validated against. Format is projects/{project}/schemas/{schema}. The value of this field will be _deleted-schema_ if the schema has been deleted.

Package Details

Repository
Google Cloud Native pulumi/pulumi-google-native
License
Apache-2.0

Google Cloud Native is in preview. Google Cloud Classic is fully supported.

Google Cloud Native v0.32.0 published on Wednesday, Nov 29, 2023 by Pulumi