1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. pubsub
  5. getTopic
Google Cloud Classic v7.20.0 published on Wednesday, Apr 24, 2024 by Pulumi

gcp.pubsub.getTopic

Explore with Pulumi AI

gcp logo
Google Cloud Classic v7.20.0 published on Wednesday, Apr 24, 2024 by Pulumi

    Get information about a Google Cloud Pub/Sub Topic. 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-topic = gcp.pubsub.getTopic({
        name: "my-pubsub-topic",
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    my_pubsub_topic = gcp.pubsub.get_topic(name="my-pubsub-topic")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/pubsub"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := pubsub.LookupTopic(ctx, &pubsub.LookupTopicArgs{
    			Name: "my-pubsub-topic",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var my_pubsub_topic = Gcp.PubSub.GetTopic.Invoke(new()
        {
            Name = "my-pubsub-topic",
        });
    
    });
    
    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.GetTopicArgs;
    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-topic = PubsubFunctions.getTopic(GetTopicArgs.builder()
                .name("my-pubsub-topic")
                .build());
    
        }
    }
    
    variables:
      my-pubsub-topic:
        fn::invoke:
          Function: gcp:pubsub:getTopic
          Arguments:
            name: my-pubsub-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>
    def get_topic(name: Optional[str] = None,
                  project: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetTopicResult
    def get_topic_output(name: Optional[pulumi.Input[str]] = None,
                  project: Optional[pulumi.Input[str]] = None,
                  opts: Optional[InvokeOptions] = None) -> Output[GetTopicResult]
    func LookupTopic(ctx *Context, args *LookupTopicArgs, opts ...InvokeOption) (*LookupTopicResult, error)
    func LookupTopicOutput(ctx *Context, args *LookupTopicOutputArgs, opts ...InvokeOption) LookupTopicResultOutput

    > 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)
    }
    public static CompletableFuture<GetTopicResult> getTopic(GetTopicArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: gcp:pubsub/getTopic:getTopic
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    The name of the Cloud Pub/Sub Topic.


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


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


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


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


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


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

    getTopic Result

    The following output properties are available:

    EffectiveLabels Dictionary<string, string>
    Id string
    The provider-assigned unique ID for this managed resource.
    IngestionDataSourceSettings List<GetTopicIngestionDataSourceSetting>
    KmsKeyName string
    Labels Dictionary<string, string>
    MessageRetentionDuration string
    MessageStoragePolicies List<GetTopicMessageStoragePolicy>
    Name string
    PulumiLabels Dictionary<string, string>
    SchemaSettings List<GetTopicSchemaSetting>
    Project string
    effectiveLabels {[key: string]: string}
    id string
    The provider-assigned unique ID for this managed resource.
    ingestionDataSourceSettings GetTopicIngestionDataSourceSetting[]
    kmsKeyName string
    labels {[key: string]: string}
    messageRetentionDuration string
    messageStoragePolicies GetTopicMessageStoragePolicy[]
    name string
    pulumiLabels {[key: string]: string}
    schemaSettings GetTopicSchemaSetting[]
    project string
    effectiveLabels Map<String>
    id String
    The provider-assigned unique ID for this managed resource.
    ingestionDataSourceSettings List<Property Map>
    kmsKeyName String
    labels Map<String>
    messageRetentionDuration String
    messageStoragePolicies List<Property Map>
    name String
    pulumiLabels Map<String>
    schemaSettings List<Property Map>
    project String

    Supporting Types

    GetTopicIngestionDataSourceSetting

    AwsKineses List<GetTopicIngestionDataSourceSettingAwsKinese>
    Settings for ingestion from Amazon Kinesis Data Streams.
    AwsKineses []GetTopicIngestionDataSourceSettingAwsKinese
    Settings for ingestion from Amazon Kinesis Data Streams.
    awsKineses List<GetTopicIngestionDataSourceSettingAwsKinese>
    Settings for ingestion from Amazon Kinesis Data Streams.
    awsKineses GetTopicIngestionDataSourceSettingAwsKinese[]
    Settings for ingestion from Amazon Kinesis Data Streams.
    aws_kineses Sequence[GetTopicIngestionDataSourceSettingAwsKinese]
    Settings for ingestion from Amazon Kinesis Data Streams.
    awsKineses List<Property Map>
    Settings for ingestion from Amazon Kinesis Data Streams.

    GetTopicIngestionDataSourceSettingAwsKinese

    AwsRoleArn string
    AWS role ARN to be used for Federated Identity authentication with Kinesis. Check the Pub/Sub docs for how to set up this role and the required permissions that need to be attached to it.
    ConsumerArn string
    The Kinesis consumer ARN to used for ingestion in Enhanced Fan-Out mode. The consumer must be already created and ready to be used.
    GcpServiceAccount string
    The GCP service account to be used for Federated Identity authentication with Kinesis (via a 'AssumeRoleWithWebIdentity' call for the provided role). The 'awsRoleArn' must be set up with 'accounts.google.com:sub' equals to this service account number.
    StreamArn string
    The Kinesis stream ARN to ingest data from.
    AwsRoleArn string
    AWS role ARN to be used for Federated Identity authentication with Kinesis. Check the Pub/Sub docs for how to set up this role and the required permissions that need to be attached to it.
    ConsumerArn string
    The Kinesis consumer ARN to used for ingestion in Enhanced Fan-Out mode. The consumer must be already created and ready to be used.
    GcpServiceAccount string
    The GCP service account to be used for Federated Identity authentication with Kinesis (via a 'AssumeRoleWithWebIdentity' call for the provided role). The 'awsRoleArn' must be set up with 'accounts.google.com:sub' equals to this service account number.
    StreamArn string
    The Kinesis stream ARN to ingest data from.
    awsRoleArn String
    AWS role ARN to be used for Federated Identity authentication with Kinesis. Check the Pub/Sub docs for how to set up this role and the required permissions that need to be attached to it.
    consumerArn String
    The Kinesis consumer ARN to used for ingestion in Enhanced Fan-Out mode. The consumer must be already created and ready to be used.
    gcpServiceAccount String
    The GCP service account to be used for Federated Identity authentication with Kinesis (via a 'AssumeRoleWithWebIdentity' call for the provided role). The 'awsRoleArn' must be set up with 'accounts.google.com:sub' equals to this service account number.
    streamArn String
    The Kinesis stream ARN to ingest data from.
    awsRoleArn string
    AWS role ARN to be used for Federated Identity authentication with Kinesis. Check the Pub/Sub docs for how to set up this role and the required permissions that need to be attached to it.
    consumerArn string
    The Kinesis consumer ARN to used for ingestion in Enhanced Fan-Out mode. The consumer must be already created and ready to be used.
    gcpServiceAccount string
    The GCP service account to be used for Federated Identity authentication with Kinesis (via a 'AssumeRoleWithWebIdentity' call for the provided role). The 'awsRoleArn' must be set up with 'accounts.google.com:sub' equals to this service account number.
    streamArn string
    The Kinesis stream ARN to ingest data from.
    aws_role_arn str
    AWS role ARN to be used for Federated Identity authentication with Kinesis. Check the Pub/Sub docs for how to set up this role and the required permissions that need to be attached to it.
    consumer_arn str
    The Kinesis consumer ARN to used for ingestion in Enhanced Fan-Out mode. The consumer must be already created and ready to be used.
    gcp_service_account str
    The GCP service account to be used for Federated Identity authentication with Kinesis (via a 'AssumeRoleWithWebIdentity' call for the provided role). The 'awsRoleArn' must be set up with 'accounts.google.com:sub' equals to this service account number.
    stream_arn str
    The Kinesis stream ARN to ingest data from.
    awsRoleArn String
    AWS role ARN to be used for Federated Identity authentication with Kinesis. Check the Pub/Sub docs for how to set up this role and the required permissions that need to be attached to it.
    consumerArn String
    The Kinesis consumer ARN to used for ingestion in Enhanced Fan-Out mode. The consumer must be already created and ready to be used.
    gcpServiceAccount String
    The GCP service account to be used for Federated Identity authentication with Kinesis (via a 'AssumeRoleWithWebIdentity' call for the provided role). The 'awsRoleArn' must be set up with 'accounts.google.com:sub' equals to this service account number.
    streamArn String
    The Kinesis stream ARN to ingest data from.

    GetTopicMessageStoragePolicy

    AllowedPersistenceRegions List<string>
    A list of IDs of GCP regions where messages that are published to the topic may be persisted in storage. Messages published by publishers running in non-allowed GCP regions (or running outside of GCP altogether) will be routed for storage in one of the allowed regions. An empty list means that no regions are allowed, and is not a valid configuration.
    AllowedPersistenceRegions []string
    A list of IDs of GCP regions where messages that are published to the topic may be persisted in storage. Messages published by publishers running in non-allowed GCP regions (or running outside of GCP altogether) will be routed for storage in one of the allowed regions. An empty list means that no regions are allowed, and is not a valid configuration.
    allowedPersistenceRegions List<String>
    A list of IDs of GCP regions where messages that are published to the topic may be persisted in storage. Messages published by publishers running in non-allowed GCP regions (or running outside of GCP altogether) will be routed for storage in one of the allowed regions. An empty list means that no regions are allowed, and is not a valid configuration.
    allowedPersistenceRegions string[]
    A list of IDs of GCP regions where messages that are published to the topic may be persisted in storage. Messages published by publishers running in non-allowed GCP regions (or running outside of GCP altogether) will be routed for storage in one of the allowed regions. An empty list means that no regions are allowed, and is not a valid configuration.
    allowed_persistence_regions Sequence[str]
    A list of IDs of GCP regions where messages that are published to the topic may be persisted in storage. Messages published by publishers running in non-allowed GCP regions (or running outside of GCP altogether) will be routed for storage in one of the allowed regions. An empty list means that no regions are allowed, and is not a valid configuration.
    allowedPersistenceRegions List<String>
    A list of IDs of GCP regions where messages that are published to the topic may be persisted in storage. Messages published by publishers running in non-allowed GCP regions (or running outside of GCP altogether) will be routed for storage in one of the allowed regions. An empty list means that no regions are allowed, and is not a valid configuration.

    GetTopicSchemaSetting

    Encoding string
    The encoding of messages validated against schema. Default value: "ENCODING_UNSPECIFIED" Possible values: ["ENCODING_UNSPECIFIED", "JSON", "BINARY"]
    Schema 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 string
    The encoding of messages validated against schema. Default value: "ENCODING_UNSPECIFIED" Possible values: ["ENCODING_UNSPECIFIED", "JSON", "BINARY"]
    Schema 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 String
    The encoding of messages validated against schema. Default value: "ENCODING_UNSPECIFIED" Possible values: ["ENCODING_UNSPECIFIED", "JSON", "BINARY"]
    schema 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 string
    The encoding of messages validated against schema. Default value: "ENCODING_UNSPECIFIED" Possible values: ["ENCODING_UNSPECIFIED", "JSON", "BINARY"]
    schema 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 str
    The encoding of messages validated against schema. Default value: "ENCODING_UNSPECIFIED" Possible values: ["ENCODING_UNSPECIFIED", "JSON", "BINARY"]
    schema 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 String
    The encoding of messages validated against schema. Default value: "ENCODING_UNSPECIFIED" Possible values: ["ENCODING_UNSPECIFIED", "JSON", "BINARY"]
    schema 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 (GCP) Classic pulumi/pulumi-gcp
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the google-beta Terraform Provider.
    gcp logo
    Google Cloud Classic v7.20.0 published on Wednesday, Apr 24, 2024 by Pulumi