1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. pubsub
  5. Topic
Google Cloud Classic v8.9.3 published on Monday, Nov 18, 2024 by Pulumi

gcp.pubsub.Topic

Explore with Pulumi AI

gcp logo
Google Cloud Classic v8.9.3 published on Monday, Nov 18, 2024 by Pulumi

    A named resource to which messages are sent by publishers.

    To get more information about Topic, see:

    Note: You can retrieve the email of the Google Managed Pub/Sub Service Account used for forwarding by using the gcp.projects.ServiceIdentity resource.

    Example Usage

    Pubsub Topic Basic

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const example = new gcp.pubsub.Topic("example", {
        name: "example-topic",
        labels: {
            foo: "bar",
        },
        messageRetentionDuration: "86600s",
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    example = gcp.pubsub.Topic("example",
        name="example-topic",
        labels={
            "foo": "bar",
        },
        message_retention_duration="86600s")
    
    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.NewTopic(ctx, "example", &pubsub.TopicArgs{
    			Name: pulumi.String("example-topic"),
    			Labels: pulumi.StringMap{
    				"foo": pulumi.String("bar"),
    			},
    			MessageRetentionDuration: pulumi.String("86600s"),
    		})
    		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 example = new Gcp.PubSub.Topic("example", new()
        {
            Name = "example-topic",
            Labels = 
            {
                { "foo", "bar" },
            },
            MessageRetentionDuration = "86600s",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.pubsub.Topic;
    import com.pulumi.gcp.pubsub.TopicArgs;
    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) {
            var example = new Topic("example", TopicArgs.builder()
                .name("example-topic")
                .labels(Map.of("foo", "bar"))
                .messageRetentionDuration("86600s")
                .build());
    
        }
    }
    
    resources:
      example:
        type: gcp:pubsub:Topic
        properties:
          name: example-topic
          labels:
            foo: bar
          messageRetentionDuration: 86600s
    

    Pubsub Topic Cmek

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const keyRing = new gcp.kms.KeyRing("key_ring", {
        name: "example-keyring",
        location: "global",
    });
    const cryptoKey = new gcp.kms.CryptoKey("crypto_key", {
        name: "example-key",
        keyRing: keyRing.id,
    });
    const example = new gcp.pubsub.Topic("example", {
        name: "example-topic",
        kmsKeyName: cryptoKey.id,
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    key_ring = gcp.kms.KeyRing("key_ring",
        name="example-keyring",
        location="global")
    crypto_key = gcp.kms.CryptoKey("crypto_key",
        name="example-key",
        key_ring=key_ring.id)
    example = gcp.pubsub.Topic("example",
        name="example-topic",
        kms_key_name=crypto_key.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/kms"
    	"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 {
    		keyRing, err := kms.NewKeyRing(ctx, "key_ring", &kms.KeyRingArgs{
    			Name:     pulumi.String("example-keyring"),
    			Location: pulumi.String("global"),
    		})
    		if err != nil {
    			return err
    		}
    		cryptoKey, err := kms.NewCryptoKey(ctx, "crypto_key", &kms.CryptoKeyArgs{
    			Name:    pulumi.String("example-key"),
    			KeyRing: keyRing.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = pubsub.NewTopic(ctx, "example", &pubsub.TopicArgs{
    			Name:       pulumi.String("example-topic"),
    			KmsKeyName: cryptoKey.ID(),
    		})
    		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 keyRing = new Gcp.Kms.KeyRing("key_ring", new()
        {
            Name = "example-keyring",
            Location = "global",
        });
    
        var cryptoKey = new Gcp.Kms.CryptoKey("crypto_key", new()
        {
            Name = "example-key",
            KeyRing = keyRing.Id,
        });
    
        var example = new Gcp.PubSub.Topic("example", new()
        {
            Name = "example-topic",
            KmsKeyName = cryptoKey.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.kms.KeyRing;
    import com.pulumi.gcp.kms.KeyRingArgs;
    import com.pulumi.gcp.kms.CryptoKey;
    import com.pulumi.gcp.kms.CryptoKeyArgs;
    import com.pulumi.gcp.pubsub.Topic;
    import com.pulumi.gcp.pubsub.TopicArgs;
    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) {
            var keyRing = new KeyRing("keyRing", KeyRingArgs.builder()
                .name("example-keyring")
                .location("global")
                .build());
    
            var cryptoKey = new CryptoKey("cryptoKey", CryptoKeyArgs.builder()
                .name("example-key")
                .keyRing(keyRing.id())
                .build());
    
            var example = new Topic("example", TopicArgs.builder()
                .name("example-topic")
                .kmsKeyName(cryptoKey.id())
                .build());
    
        }
    }
    
    resources:
      example:
        type: gcp:pubsub:Topic
        properties:
          name: example-topic
          kmsKeyName: ${cryptoKey.id}
      cryptoKey:
        type: gcp:kms:CryptoKey
        name: crypto_key
        properties:
          name: example-key
          keyRing: ${keyRing.id}
      keyRing:
        type: gcp:kms:KeyRing
        name: key_ring
        properties:
          name: example-keyring
          location: global
    

    Pubsub Topic Geo Restricted

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const example = new gcp.pubsub.Topic("example", {
        name: "example-topic",
        messageStoragePolicy: {
            allowedPersistenceRegions: ["europe-west3"],
        },
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    example = gcp.pubsub.Topic("example",
        name="example-topic",
        message_storage_policy={
            "allowed_persistence_regions": ["europe-west3"],
        })
    
    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.NewTopic(ctx, "example", &pubsub.TopicArgs{
    			Name: pulumi.String("example-topic"),
    			MessageStoragePolicy: &pubsub.TopicMessageStoragePolicyArgs{
    				AllowedPersistenceRegions: pulumi.StringArray{
    					pulumi.String("europe-west3"),
    				},
    			},
    		})
    		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 example = new Gcp.PubSub.Topic("example", new()
        {
            Name = "example-topic",
            MessageStoragePolicy = new Gcp.PubSub.Inputs.TopicMessageStoragePolicyArgs
            {
                AllowedPersistenceRegions = new[]
                {
                    "europe-west3",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.pubsub.Topic;
    import com.pulumi.gcp.pubsub.TopicArgs;
    import com.pulumi.gcp.pubsub.inputs.TopicMessageStoragePolicyArgs;
    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) {
            var example = new Topic("example", TopicArgs.builder()
                .name("example-topic")
                .messageStoragePolicy(TopicMessageStoragePolicyArgs.builder()
                    .allowedPersistenceRegions("europe-west3")
                    .build())
                .build());
    
        }
    }
    
    resources:
      example:
        type: gcp:pubsub:Topic
        properties:
          name: example-topic
          messageStoragePolicy:
            allowedPersistenceRegions:
              - europe-west3
    

    Pubsub Topic Schema Settings

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const example = new gcp.pubsub.Schema("example", {
        name: "example",
        type: "AVRO",
        definition: `{
      "type" : "record",
      "name" : "Avro",
      "fields" : [
        {
          "name" : "StringField",
          "type" : "string"
        },
        {
          "name" : "IntField",
          "type" : "int"
        }
      ]
    }
    `,
    });
    const exampleTopic = new gcp.pubsub.Topic("example", {
        name: "example-topic",
        schemaSettings: {
            schema: "projects/my-project-name/schemas/example",
            encoding: "JSON",
        },
    }, {
        dependsOn: [example],
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    example = gcp.pubsub.Schema("example",
        name="example",
        type="AVRO",
        definition="""{
      "type" : "record",
      "name" : "Avro",
      "fields" : [
        {
          "name" : "StringField",
          "type" : "string"
        },
        {
          "name" : "IntField",
          "type" : "int"
        }
      ]
    }
    """)
    example_topic = gcp.pubsub.Topic("example",
        name="example-topic",
        schema_settings={
            "schema": "projects/my-project-name/schemas/example",
            "encoding": "JSON",
        },
        opts = pulumi.ResourceOptions(depends_on=[example]))
    
    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 {
    		example, err := pubsub.NewSchema(ctx, "example", &pubsub.SchemaArgs{
    			Name: pulumi.String("example"),
    			Type: pulumi.String("AVRO"),
    			Definition: pulumi.String(`{
      "type" : "record",
      "name" : "Avro",
      "fields" : [
        {
          "name" : "StringField",
          "type" : "string"
        },
        {
          "name" : "IntField",
          "type" : "int"
        }
      ]
    }
    `),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = pubsub.NewTopic(ctx, "example", &pubsub.TopicArgs{
    			Name: pulumi.String("example-topic"),
    			SchemaSettings: &pubsub.TopicSchemaSettingsArgs{
    				Schema:   pulumi.String("projects/my-project-name/schemas/example"),
    				Encoding: pulumi.String("JSON"),
    			},
    		}, pulumi.DependsOn([]pulumi.Resource{
    			example,
    		}))
    		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 example = new Gcp.PubSub.Schema("example", new()
        {
            Name = "example",
            Type = "AVRO",
            Definition = @"{
      ""type"" : ""record"",
      ""name"" : ""Avro"",
      ""fields"" : [
        {
          ""name"" : ""StringField"",
          ""type"" : ""string""
        },
        {
          ""name"" : ""IntField"",
          ""type"" : ""int""
        }
      ]
    }
    ",
        });
    
        var exampleTopic = new Gcp.PubSub.Topic("example", new()
        {
            Name = "example-topic",
            SchemaSettings = new Gcp.PubSub.Inputs.TopicSchemaSettingsArgs
            {
                Schema = "projects/my-project-name/schemas/example",
                Encoding = "JSON",
            },
        }, new CustomResourceOptions
        {
            DependsOn =
            {
                example,
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.pubsub.Schema;
    import com.pulumi.gcp.pubsub.SchemaArgs;
    import com.pulumi.gcp.pubsub.Topic;
    import com.pulumi.gcp.pubsub.TopicArgs;
    import com.pulumi.gcp.pubsub.inputs.TopicSchemaSettingsArgs;
    import com.pulumi.resources.CustomResourceOptions;
    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) {
            var example = new Schema("example", SchemaArgs.builder()
                .name("example")
                .type("AVRO")
                .definition("""
    {
      "type" : "record",
      "name" : "Avro",
      "fields" : [
        {
          "name" : "StringField",
          "type" : "string"
        },
        {
          "name" : "IntField",
          "type" : "int"
        }
      ]
    }
                """)
                .build());
    
            var exampleTopic = new Topic("exampleTopic", TopicArgs.builder()
                .name("example-topic")
                .schemaSettings(TopicSchemaSettingsArgs.builder()
                    .schema("projects/my-project-name/schemas/example")
                    .encoding("JSON")
                    .build())
                .build(), CustomResourceOptions.builder()
                    .dependsOn(example)
                    .build());
    
        }
    }
    
    resources:
      example:
        type: gcp:pubsub:Schema
        properties:
          name: example
          type: AVRO
          definition: |
            {
              "type" : "record",
              "name" : "Avro",
              "fields" : [
                {
                  "name" : "StringField",
                  "type" : "string"
                },
                {
                  "name" : "IntField",
                  "type" : "int"
                }
              ]
            }        
      exampleTopic:
        type: gcp:pubsub:Topic
        name: example
        properties:
          name: example-topic
          schemaSettings:
            schema: projects/my-project-name/schemas/example
            encoding: JSON
        options:
          dependson:
            - ${example}
    

    Pubsub Topic Ingestion Kinesis

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const example = new gcp.pubsub.Topic("example", {
        name: "example-topic",
        ingestionDataSourceSettings: {
            awsKinesis: {
                streamArn: "arn:aws:kinesis:us-west-2:111111111111:stream/fake-stream-name",
                consumerArn: "arn:aws:kinesis:us-west-2:111111111111:stream/fake-stream-name/consumer/consumer-1:1111111111",
                awsRoleArn: "arn:aws:iam::111111111111:role/fake-role-name",
                gcpServiceAccount: "fake-service-account@fake-gcp-project.iam.gserviceaccount.com",
            },
        },
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    example = gcp.pubsub.Topic("example",
        name="example-topic",
        ingestion_data_source_settings={
            "aws_kinesis": {
                "stream_arn": "arn:aws:kinesis:us-west-2:111111111111:stream/fake-stream-name",
                "consumer_arn": "arn:aws:kinesis:us-west-2:111111111111:stream/fake-stream-name/consumer/consumer-1:1111111111",
                "aws_role_arn": "arn:aws:iam::111111111111:role/fake-role-name",
                "gcp_service_account": "fake-service-account@fake-gcp-project.iam.gserviceaccount.com",
            },
        })
    
    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.NewTopic(ctx, "example", &pubsub.TopicArgs{
    			Name: pulumi.String("example-topic"),
    			IngestionDataSourceSettings: &pubsub.TopicIngestionDataSourceSettingsArgs{
    				AwsKinesis: &pubsub.TopicIngestionDataSourceSettingsAwsKinesisArgs{
    					StreamArn:         pulumi.String("arn:aws:kinesis:us-west-2:111111111111:stream/fake-stream-name"),
    					ConsumerArn:       pulumi.String("arn:aws:kinesis:us-west-2:111111111111:stream/fake-stream-name/consumer/consumer-1:1111111111"),
    					AwsRoleArn:        pulumi.String("arn:aws:iam::111111111111:role/fake-role-name"),
    					GcpServiceAccount: pulumi.String("fake-service-account@fake-gcp-project.iam.gserviceaccount.com"),
    				},
    			},
    		})
    		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 example = new Gcp.PubSub.Topic("example", new()
        {
            Name = "example-topic",
            IngestionDataSourceSettings = new Gcp.PubSub.Inputs.TopicIngestionDataSourceSettingsArgs
            {
                AwsKinesis = new Gcp.PubSub.Inputs.TopicIngestionDataSourceSettingsAwsKinesisArgs
                {
                    StreamArn = "arn:aws:kinesis:us-west-2:111111111111:stream/fake-stream-name",
                    ConsumerArn = "arn:aws:kinesis:us-west-2:111111111111:stream/fake-stream-name/consumer/consumer-1:1111111111",
                    AwsRoleArn = "arn:aws:iam::111111111111:role/fake-role-name",
                    GcpServiceAccount = "fake-service-account@fake-gcp-project.iam.gserviceaccount.com",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.pubsub.Topic;
    import com.pulumi.gcp.pubsub.TopicArgs;
    import com.pulumi.gcp.pubsub.inputs.TopicIngestionDataSourceSettingsArgs;
    import com.pulumi.gcp.pubsub.inputs.TopicIngestionDataSourceSettingsAwsKinesisArgs;
    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) {
            var example = new Topic("example", TopicArgs.builder()
                .name("example-topic")
                .ingestionDataSourceSettings(TopicIngestionDataSourceSettingsArgs.builder()
                    .awsKinesis(TopicIngestionDataSourceSettingsAwsKinesisArgs.builder()
                        .streamArn("arn:aws:kinesis:us-west-2:111111111111:stream/fake-stream-name")
                        .consumerArn("arn:aws:kinesis:us-west-2:111111111111:stream/fake-stream-name/consumer/consumer-1:1111111111")
                        .awsRoleArn("arn:aws:iam::111111111111:role/fake-role-name")
                        .gcpServiceAccount("fake-service-account@fake-gcp-project.iam.gserviceaccount.com")
                        .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      example:
        type: gcp:pubsub:Topic
        properties:
          name: example-topic
          ingestionDataSourceSettings:
            awsKinesis:
              streamArn: arn:aws:kinesis:us-west-2:111111111111:stream/fake-stream-name
              consumerArn: arn:aws:kinesis:us-west-2:111111111111:stream/fake-stream-name/consumer/consumer-1:1111111111
              awsRoleArn: arn:aws:iam::111111111111:role/fake-role-name
              gcpServiceAccount: fake-service-account@fake-gcp-project.iam.gserviceaccount.com
    

    Pubsub Topic Ingestion Cloud Storage

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const example = new gcp.pubsub.Topic("example", {
        name: "example-topic",
        ingestionDataSourceSettings: {
            cloudStorage: {
                bucket: "test-bucket",
                textFormat: {
                    delimiter: " ",
                },
                minimumObjectCreateTime: "2024-01-01T00:00:00Z",
                matchGlob: "foo/**",
            },
            platformLogsSettings: {
                severity: "WARNING",
            },
        },
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    example = gcp.pubsub.Topic("example",
        name="example-topic",
        ingestion_data_source_settings={
            "cloud_storage": {
                "bucket": "test-bucket",
                "text_format": {
                    "delimiter": " ",
                },
                "minimum_object_create_time": "2024-01-01T00:00:00Z",
                "match_glob": "foo/**",
            },
            "platform_logs_settings": {
                "severity": "WARNING",
            },
        })
    
    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.NewTopic(ctx, "example", &pubsub.TopicArgs{
    			Name: pulumi.String("example-topic"),
    			IngestionDataSourceSettings: &pubsub.TopicIngestionDataSourceSettingsArgs{
    				CloudStorage: &pubsub.TopicIngestionDataSourceSettingsCloudStorageArgs{
    					Bucket: pulumi.String("test-bucket"),
    					TextFormat: &pubsub.TopicIngestionDataSourceSettingsCloudStorageTextFormatArgs{
    						Delimiter: pulumi.String(" "),
    					},
    					MinimumObjectCreateTime: pulumi.String("2024-01-01T00:00:00Z"),
    					MatchGlob:               pulumi.String("foo/**"),
    				},
    				PlatformLogsSettings: &pubsub.TopicIngestionDataSourceSettingsPlatformLogsSettingsArgs{
    					Severity: pulumi.String("WARNING"),
    				},
    			},
    		})
    		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 example = new Gcp.PubSub.Topic("example", new()
        {
            Name = "example-topic",
            IngestionDataSourceSettings = new Gcp.PubSub.Inputs.TopicIngestionDataSourceSettingsArgs
            {
                CloudStorage = new Gcp.PubSub.Inputs.TopicIngestionDataSourceSettingsCloudStorageArgs
                {
                    Bucket = "test-bucket",
                    TextFormat = new Gcp.PubSub.Inputs.TopicIngestionDataSourceSettingsCloudStorageTextFormatArgs
                    {
                        Delimiter = " ",
                    },
                    MinimumObjectCreateTime = "2024-01-01T00:00:00Z",
                    MatchGlob = "foo/**",
                },
                PlatformLogsSettings = new Gcp.PubSub.Inputs.TopicIngestionDataSourceSettingsPlatformLogsSettingsArgs
                {
                    Severity = "WARNING",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.pubsub.Topic;
    import com.pulumi.gcp.pubsub.TopicArgs;
    import com.pulumi.gcp.pubsub.inputs.TopicIngestionDataSourceSettingsArgs;
    import com.pulumi.gcp.pubsub.inputs.TopicIngestionDataSourceSettingsCloudStorageArgs;
    import com.pulumi.gcp.pubsub.inputs.TopicIngestionDataSourceSettingsCloudStorageTextFormatArgs;
    import com.pulumi.gcp.pubsub.inputs.TopicIngestionDataSourceSettingsPlatformLogsSettingsArgs;
    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) {
            var example = new Topic("example", TopicArgs.builder()
                .name("example-topic")
                .ingestionDataSourceSettings(TopicIngestionDataSourceSettingsArgs.builder()
                    .cloudStorage(TopicIngestionDataSourceSettingsCloudStorageArgs.builder()
                        .bucket("test-bucket")
                        .textFormat(TopicIngestionDataSourceSettingsCloudStorageTextFormatArgs.builder()
                            .delimiter(" ")
                            .build())
                        .minimumObjectCreateTime("2024-01-01T00:00:00Z")
                        .matchGlob("foo/**")
                        .build())
                    .platformLogsSettings(TopicIngestionDataSourceSettingsPlatformLogsSettingsArgs.builder()
                        .severity("WARNING")
                        .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      example:
        type: gcp:pubsub:Topic
        properties:
          name: example-topic
          ingestionDataSourceSettings:
            cloudStorage:
              bucket: test-bucket
              textFormat:
                delimiter: ' '
              minimumObjectCreateTime: 2024-01-01T00:00:00Z
              matchGlob: foo/**
            platformLogsSettings:
              severity: WARNING
    

    Create Topic Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Topic(name: string, args?: TopicArgs, opts?: CustomResourceOptions);
    @overload
    def Topic(resource_name: str,
              args: Optional[TopicArgs] = None,
              opts: Optional[ResourceOptions] = None)
    
    @overload
    def Topic(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              ingestion_data_source_settings: Optional[TopicIngestionDataSourceSettingsArgs] = None,
              kms_key_name: Optional[str] = None,
              labels: Optional[Mapping[str, str]] = None,
              message_retention_duration: Optional[str] = None,
              message_storage_policy: Optional[TopicMessageStoragePolicyArgs] = None,
              name: Optional[str] = None,
              project: Optional[str] = None,
              schema_settings: Optional[TopicSchemaSettingsArgs] = None)
    func NewTopic(ctx *Context, name string, args *TopicArgs, opts ...ResourceOption) (*Topic, error)
    public Topic(string name, TopicArgs? args = null, CustomResourceOptions? opts = null)
    public Topic(String name, TopicArgs args)
    public Topic(String name, TopicArgs args, CustomResourceOptions options)
    
    type: gcp:pubsub:Topic
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args TopicArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args TopicArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args TopicArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args TopicArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args TopicArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var gcpTopicResource = new Gcp.PubSub.Topic("gcpTopicResource", new()
    {
        IngestionDataSourceSettings = new Gcp.PubSub.Inputs.TopicIngestionDataSourceSettingsArgs
        {
            AwsKinesis = new Gcp.PubSub.Inputs.TopicIngestionDataSourceSettingsAwsKinesisArgs
            {
                AwsRoleArn = "string",
                ConsumerArn = "string",
                GcpServiceAccount = "string",
                StreamArn = "string",
            },
            CloudStorage = new Gcp.PubSub.Inputs.TopicIngestionDataSourceSettingsCloudStorageArgs
            {
                Bucket = "string",
                AvroFormat = null,
                MatchGlob = "string",
                MinimumObjectCreateTime = "string",
                PubsubAvroFormat = null,
                TextFormat = new Gcp.PubSub.Inputs.TopicIngestionDataSourceSettingsCloudStorageTextFormatArgs
                {
                    Delimiter = "string",
                },
            },
            PlatformLogsSettings = new Gcp.PubSub.Inputs.TopicIngestionDataSourceSettingsPlatformLogsSettingsArgs
            {
                Severity = "string",
            },
        },
        KmsKeyName = "string",
        Labels = 
        {
            { "string", "string" },
        },
        MessageRetentionDuration = "string",
        MessageStoragePolicy = new Gcp.PubSub.Inputs.TopicMessageStoragePolicyArgs
        {
            AllowedPersistenceRegions = new[]
            {
                "string",
            },
        },
        Name = "string",
        Project = "string",
        SchemaSettings = new Gcp.PubSub.Inputs.TopicSchemaSettingsArgs
        {
            Schema = "string",
            Encoding = "string",
        },
    });
    
    example, err := pubsub.NewTopic(ctx, "gcpTopicResource", &pubsub.TopicArgs{
    	IngestionDataSourceSettings: &pubsub.TopicIngestionDataSourceSettingsArgs{
    		AwsKinesis: &pubsub.TopicIngestionDataSourceSettingsAwsKinesisArgs{
    			AwsRoleArn:        pulumi.String("string"),
    			ConsumerArn:       pulumi.String("string"),
    			GcpServiceAccount: pulumi.String("string"),
    			StreamArn:         pulumi.String("string"),
    		},
    		CloudStorage: &pubsub.TopicIngestionDataSourceSettingsCloudStorageArgs{
    			Bucket:                  pulumi.String("string"),
    			AvroFormat:              &pubsub.TopicIngestionDataSourceSettingsCloudStorageAvroFormatArgs{},
    			MatchGlob:               pulumi.String("string"),
    			MinimumObjectCreateTime: pulumi.String("string"),
    			PubsubAvroFormat:        &pubsub.TopicIngestionDataSourceSettingsCloudStoragePubsubAvroFormatArgs{},
    			TextFormat: &pubsub.TopicIngestionDataSourceSettingsCloudStorageTextFormatArgs{
    				Delimiter: pulumi.String("string"),
    			},
    		},
    		PlatformLogsSettings: &pubsub.TopicIngestionDataSourceSettingsPlatformLogsSettingsArgs{
    			Severity: pulumi.String("string"),
    		},
    	},
    	KmsKeyName: pulumi.String("string"),
    	Labels: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	MessageRetentionDuration: pulumi.String("string"),
    	MessageStoragePolicy: &pubsub.TopicMessageStoragePolicyArgs{
    		AllowedPersistenceRegions: pulumi.StringArray{
    			pulumi.String("string"),
    		},
    	},
    	Name:    pulumi.String("string"),
    	Project: pulumi.String("string"),
    	SchemaSettings: &pubsub.TopicSchemaSettingsArgs{
    		Schema:   pulumi.String("string"),
    		Encoding: pulumi.String("string"),
    	},
    })
    
    var gcpTopicResource = new Topic("gcpTopicResource", TopicArgs.builder()
        .ingestionDataSourceSettings(TopicIngestionDataSourceSettingsArgs.builder()
            .awsKinesis(TopicIngestionDataSourceSettingsAwsKinesisArgs.builder()
                .awsRoleArn("string")
                .consumerArn("string")
                .gcpServiceAccount("string")
                .streamArn("string")
                .build())
            .cloudStorage(TopicIngestionDataSourceSettingsCloudStorageArgs.builder()
                .bucket("string")
                .avroFormat()
                .matchGlob("string")
                .minimumObjectCreateTime("string")
                .pubsubAvroFormat()
                .textFormat(TopicIngestionDataSourceSettingsCloudStorageTextFormatArgs.builder()
                    .delimiter("string")
                    .build())
                .build())
            .platformLogsSettings(TopicIngestionDataSourceSettingsPlatformLogsSettingsArgs.builder()
                .severity("string")
                .build())
            .build())
        .kmsKeyName("string")
        .labels(Map.of("string", "string"))
        .messageRetentionDuration("string")
        .messageStoragePolicy(TopicMessageStoragePolicyArgs.builder()
            .allowedPersistenceRegions("string")
            .build())
        .name("string")
        .project("string")
        .schemaSettings(TopicSchemaSettingsArgs.builder()
            .schema("string")
            .encoding("string")
            .build())
        .build());
    
    gcp_topic_resource = gcp.pubsub.Topic("gcpTopicResource",
        ingestion_data_source_settings={
            "aws_kinesis": {
                "aws_role_arn": "string",
                "consumer_arn": "string",
                "gcp_service_account": "string",
                "stream_arn": "string",
            },
            "cloud_storage": {
                "bucket": "string",
                "avro_format": {},
                "match_glob": "string",
                "minimum_object_create_time": "string",
                "pubsub_avro_format": {},
                "text_format": {
                    "delimiter": "string",
                },
            },
            "platform_logs_settings": {
                "severity": "string",
            },
        },
        kms_key_name="string",
        labels={
            "string": "string",
        },
        message_retention_duration="string",
        message_storage_policy={
            "allowed_persistence_regions": ["string"],
        },
        name="string",
        project="string",
        schema_settings={
            "schema": "string",
            "encoding": "string",
        })
    
    const gcpTopicResource = new gcp.pubsub.Topic("gcpTopicResource", {
        ingestionDataSourceSettings: {
            awsKinesis: {
                awsRoleArn: "string",
                consumerArn: "string",
                gcpServiceAccount: "string",
                streamArn: "string",
            },
            cloudStorage: {
                bucket: "string",
                avroFormat: {},
                matchGlob: "string",
                minimumObjectCreateTime: "string",
                pubsubAvroFormat: {},
                textFormat: {
                    delimiter: "string",
                },
            },
            platformLogsSettings: {
                severity: "string",
            },
        },
        kmsKeyName: "string",
        labels: {
            string: "string",
        },
        messageRetentionDuration: "string",
        messageStoragePolicy: {
            allowedPersistenceRegions: ["string"],
        },
        name: "string",
        project: "string",
        schemaSettings: {
            schema: "string",
            encoding: "string",
        },
    });
    
    type: gcp:pubsub:Topic
    properties:
        ingestionDataSourceSettings:
            awsKinesis:
                awsRoleArn: string
                consumerArn: string
                gcpServiceAccount: string
                streamArn: string
            cloudStorage:
                avroFormat: {}
                bucket: string
                matchGlob: string
                minimumObjectCreateTime: string
                pubsubAvroFormat: {}
                textFormat:
                    delimiter: string
            platformLogsSettings:
                severity: string
        kmsKeyName: string
        labels:
            string: string
        messageRetentionDuration: string
        messageStoragePolicy:
            allowedPersistenceRegions:
                - string
        name: string
        project: string
        schemaSettings:
            encoding: string
            schema: string
    

    Topic Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The Topic resource accepts the following input properties:

    IngestionDataSourceSettings TopicIngestionDataSourceSettings
    Settings for ingestion from a data source into this topic. Structure is documented below.
    KmsKeyName string
    The resource name of the Cloud KMS CryptoKey to be used to protect access to messages published on this topic. Your project's PubSub service account (service-{{PROJECT_NUMBER}}@gcp-sa-pubsub.iam.gserviceaccount.com) must have roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. The expected format is projects/*/locations/*/keyRings/*/cryptoKeys/*
    Labels Dictionary<string, string>

    A set of key/value label pairs to assign to this Topic.

    Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

    MessageRetentionDuration string
    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 messageRetentionDuration are always available to subscribers. For instance, it allows any attached subscription to seek to a timestamp that is up to messageRetentionDuration in the past. If this field is not set, message retention is controlled by settings on individual subscriptions. The rotation period has the format of a decimal number, followed by the letter s (seconds). Cannot be more than 31 days or less than 10 minutes.
    MessageStoragePolicy TopicMessageStoragePolicy
    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. Structure is documented below.
    Name string
    Name of the topic.


    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    SchemaSettings TopicSchemaSettings
    Settings for validating messages published against a schema. Structure is documented below.
    IngestionDataSourceSettings TopicIngestionDataSourceSettingsArgs
    Settings for ingestion from a data source into this topic. Structure is documented below.
    KmsKeyName string
    The resource name of the Cloud KMS CryptoKey to be used to protect access to messages published on this topic. Your project's PubSub service account (service-{{PROJECT_NUMBER}}@gcp-sa-pubsub.iam.gserviceaccount.com) must have roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. The expected format is projects/*/locations/*/keyRings/*/cryptoKeys/*
    Labels map[string]string

    A set of key/value label pairs to assign to this Topic.

    Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

    MessageRetentionDuration string
    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 messageRetentionDuration are always available to subscribers. For instance, it allows any attached subscription to seek to a timestamp that is up to messageRetentionDuration in the past. If this field is not set, message retention is controlled by settings on individual subscriptions. The rotation period has the format of a decimal number, followed by the letter s (seconds). Cannot be more than 31 days or less than 10 minutes.
    MessageStoragePolicy TopicMessageStoragePolicyArgs
    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. Structure is documented below.
    Name string
    Name of the topic.


    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    SchemaSettings TopicSchemaSettingsArgs
    Settings for validating messages published against a schema. Structure is documented below.
    ingestionDataSourceSettings TopicIngestionDataSourceSettings
    Settings for ingestion from a data source into this topic. Structure is documented below.
    kmsKeyName String
    The resource name of the Cloud KMS CryptoKey to be used to protect access to messages published on this topic. Your project's PubSub service account (service-{{PROJECT_NUMBER}}@gcp-sa-pubsub.iam.gserviceaccount.com) must have roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. The expected format is projects/*/locations/*/keyRings/*/cryptoKeys/*
    labels Map<String,String>

    A set of key/value label pairs to assign to this Topic.

    Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

    messageRetentionDuration String
    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 messageRetentionDuration are always available to subscribers. For instance, it allows any attached subscription to seek to a timestamp that is up to messageRetentionDuration in the past. If this field is not set, message retention is controlled by settings on individual subscriptions. The rotation period has the format of a decimal number, followed by the letter s (seconds). Cannot be more than 31 days or less than 10 minutes.
    messageStoragePolicy TopicMessageStoragePolicy
    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. Structure is documented below.
    name String
    Name of the topic.


    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    schemaSettings TopicSchemaSettings
    Settings for validating messages published against a schema. Structure is documented below.
    ingestionDataSourceSettings TopicIngestionDataSourceSettings
    Settings for ingestion from a data source into this topic. Structure is documented below.
    kmsKeyName string
    The resource name of the Cloud KMS CryptoKey to be used to protect access to messages published on this topic. Your project's PubSub service account (service-{{PROJECT_NUMBER}}@gcp-sa-pubsub.iam.gserviceaccount.com) must have roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. The expected format is projects/*/locations/*/keyRings/*/cryptoKeys/*
    labels {[key: string]: string}

    A set of key/value label pairs to assign to this Topic.

    Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

    messageRetentionDuration string
    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 messageRetentionDuration are always available to subscribers. For instance, it allows any attached subscription to seek to a timestamp that is up to messageRetentionDuration in the past. If this field is not set, message retention is controlled by settings on individual subscriptions. The rotation period has the format of a decimal number, followed by the letter s (seconds). Cannot be more than 31 days or less than 10 minutes.
    messageStoragePolicy TopicMessageStoragePolicy
    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. Structure is documented below.
    name string
    Name of the topic.


    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    schemaSettings TopicSchemaSettings
    Settings for validating messages published against a schema. Structure is documented below.
    ingestion_data_source_settings TopicIngestionDataSourceSettingsArgs
    Settings for ingestion from a data source into this topic. Structure is documented below.
    kms_key_name str
    The resource name of the Cloud KMS CryptoKey to be used to protect access to messages published on this topic. Your project's PubSub service account (service-{{PROJECT_NUMBER}}@gcp-sa-pubsub.iam.gserviceaccount.com) must have roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. The expected format is projects/*/locations/*/keyRings/*/cryptoKeys/*
    labels Mapping[str, str]

    A set of key/value label pairs to assign to this Topic.

    Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

    message_retention_duration str
    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 messageRetentionDuration are always available to subscribers. For instance, it allows any attached subscription to seek to a timestamp that is up to messageRetentionDuration in the past. If this field is not set, message retention is controlled by settings on individual subscriptions. The rotation period has the format of a decimal number, followed by the letter s (seconds). Cannot be more than 31 days or less than 10 minutes.
    message_storage_policy TopicMessageStoragePolicyArgs
    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. Structure is documented below.
    name str
    Name of the topic.


    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    schema_settings TopicSchemaSettingsArgs
    Settings for validating messages published against a schema. Structure is documented below.
    ingestionDataSourceSettings Property Map
    Settings for ingestion from a data source into this topic. Structure is documented below.
    kmsKeyName String
    The resource name of the Cloud KMS CryptoKey to be used to protect access to messages published on this topic. Your project's PubSub service account (service-{{PROJECT_NUMBER}}@gcp-sa-pubsub.iam.gserviceaccount.com) must have roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. The expected format is projects/*/locations/*/keyRings/*/cryptoKeys/*
    labels Map<String>

    A set of key/value label pairs to assign to this Topic.

    Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

    messageRetentionDuration String
    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 messageRetentionDuration are always available to subscribers. For instance, it allows any attached subscription to seek to a timestamp that is up to messageRetentionDuration in the past. If this field is not set, message retention is controlled by settings on individual subscriptions. The rotation period has the format of a decimal number, followed by the letter s (seconds). Cannot be more than 31 days or less than 10 minutes.
    messageStoragePolicy Property Map
    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. Structure is documented below.
    name String
    Name of the topic.


    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    schemaSettings Property Map
    Settings for validating messages published against a schema. Structure is documented below.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Topic resource produces the following output properties:

    EffectiveLabels Dictionary<string, string>
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    Id string
    The provider-assigned unique ID for this managed resource.
    PulumiLabels Dictionary<string, string>
    The combination of labels configured directly on the resource and default labels configured on the provider.
    EffectiveLabels map[string]string
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    Id string
    The provider-assigned unique ID for this managed resource.
    PulumiLabels map[string]string
    The combination of labels configured directly on the resource and default labels configured on the provider.
    effectiveLabels Map<String,String>
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    id String
    The provider-assigned unique ID for this managed resource.
    pulumiLabels Map<String,String>
    The combination of labels configured directly on the resource and default labels configured on the provider.
    effectiveLabels {[key: string]: string}
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    id string
    The provider-assigned unique ID for this managed resource.
    pulumiLabels {[key: string]: string}
    The combination of labels configured directly on the resource and default labels configured on the provider.
    effective_labels Mapping[str, str]
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    id str
    The provider-assigned unique ID for this managed resource.
    pulumi_labels Mapping[str, str]
    The combination of labels configured directly on the resource and default labels configured on the provider.
    effectiveLabels Map<String>
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    id String
    The provider-assigned unique ID for this managed resource.
    pulumiLabels Map<String>
    The combination of labels configured directly on the resource and default labels configured on the provider.

    Look up Existing Topic Resource

    Get an existing Topic resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: TopicState, opts?: CustomResourceOptions): Topic
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            effective_labels: Optional[Mapping[str, str]] = None,
            ingestion_data_source_settings: Optional[TopicIngestionDataSourceSettingsArgs] = None,
            kms_key_name: Optional[str] = None,
            labels: Optional[Mapping[str, str]] = None,
            message_retention_duration: Optional[str] = None,
            message_storage_policy: Optional[TopicMessageStoragePolicyArgs] = None,
            name: Optional[str] = None,
            project: Optional[str] = None,
            pulumi_labels: Optional[Mapping[str, str]] = None,
            schema_settings: Optional[TopicSchemaSettingsArgs] = None) -> Topic
    func GetTopic(ctx *Context, name string, id IDInput, state *TopicState, opts ...ResourceOption) (*Topic, error)
    public static Topic Get(string name, Input<string> id, TopicState? state, CustomResourceOptions? opts = null)
    public static Topic get(String name, Output<String> id, TopicState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    EffectiveLabels Dictionary<string, string>
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    IngestionDataSourceSettings TopicIngestionDataSourceSettings
    Settings for ingestion from a data source into this topic. Structure is documented below.
    KmsKeyName string
    The resource name of the Cloud KMS CryptoKey to be used to protect access to messages published on this topic. Your project's PubSub service account (service-{{PROJECT_NUMBER}}@gcp-sa-pubsub.iam.gserviceaccount.com) must have roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. The expected format is projects/*/locations/*/keyRings/*/cryptoKeys/*
    Labels Dictionary<string, string>

    A set of key/value label pairs to assign to this Topic.

    Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

    MessageRetentionDuration string
    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 messageRetentionDuration are always available to subscribers. For instance, it allows any attached subscription to seek to a timestamp that is up to messageRetentionDuration in the past. If this field is not set, message retention is controlled by settings on individual subscriptions. The rotation period has the format of a decimal number, followed by the letter s (seconds). Cannot be more than 31 days or less than 10 minutes.
    MessageStoragePolicy TopicMessageStoragePolicy
    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. Structure is documented below.
    Name string
    Name of the topic.


    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    PulumiLabels Dictionary<string, string>
    The combination of labels configured directly on the resource and default labels configured on the provider.
    SchemaSettings TopicSchemaSettings
    Settings for validating messages published against a schema. Structure is documented below.
    EffectiveLabels map[string]string
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    IngestionDataSourceSettings TopicIngestionDataSourceSettingsArgs
    Settings for ingestion from a data source into this topic. Structure is documented below.
    KmsKeyName string
    The resource name of the Cloud KMS CryptoKey to be used to protect access to messages published on this topic. Your project's PubSub service account (service-{{PROJECT_NUMBER}}@gcp-sa-pubsub.iam.gserviceaccount.com) must have roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. The expected format is projects/*/locations/*/keyRings/*/cryptoKeys/*
    Labels map[string]string

    A set of key/value label pairs to assign to this Topic.

    Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

    MessageRetentionDuration string
    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 messageRetentionDuration are always available to subscribers. For instance, it allows any attached subscription to seek to a timestamp that is up to messageRetentionDuration in the past. If this field is not set, message retention is controlled by settings on individual subscriptions. The rotation period has the format of a decimal number, followed by the letter s (seconds). Cannot be more than 31 days or less than 10 minutes.
    MessageStoragePolicy TopicMessageStoragePolicyArgs
    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. Structure is documented below.
    Name string
    Name of the topic.


    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    PulumiLabels map[string]string
    The combination of labels configured directly on the resource and default labels configured on the provider.
    SchemaSettings TopicSchemaSettingsArgs
    Settings for validating messages published against a schema. Structure is documented below.
    effectiveLabels Map<String,String>
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    ingestionDataSourceSettings TopicIngestionDataSourceSettings
    Settings for ingestion from a data source into this topic. Structure is documented below.
    kmsKeyName String
    The resource name of the Cloud KMS CryptoKey to be used to protect access to messages published on this topic. Your project's PubSub service account (service-{{PROJECT_NUMBER}}@gcp-sa-pubsub.iam.gserviceaccount.com) must have roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. The expected format is projects/*/locations/*/keyRings/*/cryptoKeys/*
    labels Map<String,String>

    A set of key/value label pairs to assign to this Topic.

    Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

    messageRetentionDuration String
    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 messageRetentionDuration are always available to subscribers. For instance, it allows any attached subscription to seek to a timestamp that is up to messageRetentionDuration in the past. If this field is not set, message retention is controlled by settings on individual subscriptions. The rotation period has the format of a decimal number, followed by the letter s (seconds). Cannot be more than 31 days or less than 10 minutes.
    messageStoragePolicy TopicMessageStoragePolicy
    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. Structure is documented below.
    name String
    Name of the topic.


    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    pulumiLabels Map<String,String>
    The combination of labels configured directly on the resource and default labels configured on the provider.
    schemaSettings TopicSchemaSettings
    Settings for validating messages published against a schema. Structure is documented below.
    effectiveLabels {[key: string]: string}
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    ingestionDataSourceSettings TopicIngestionDataSourceSettings
    Settings for ingestion from a data source into this topic. Structure is documented below.
    kmsKeyName string
    The resource name of the Cloud KMS CryptoKey to be used to protect access to messages published on this topic. Your project's PubSub service account (service-{{PROJECT_NUMBER}}@gcp-sa-pubsub.iam.gserviceaccount.com) must have roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. The expected format is projects/*/locations/*/keyRings/*/cryptoKeys/*
    labels {[key: string]: string}

    A set of key/value label pairs to assign to this Topic.

    Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

    messageRetentionDuration string
    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 messageRetentionDuration are always available to subscribers. For instance, it allows any attached subscription to seek to a timestamp that is up to messageRetentionDuration in the past. If this field is not set, message retention is controlled by settings on individual subscriptions. The rotation period has the format of a decimal number, followed by the letter s (seconds). Cannot be more than 31 days or less than 10 minutes.
    messageStoragePolicy TopicMessageStoragePolicy
    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. Structure is documented below.
    name string
    Name of the topic.


    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    pulumiLabels {[key: string]: string}
    The combination of labels configured directly on the resource and default labels configured on the provider.
    schemaSettings TopicSchemaSettings
    Settings for validating messages published against a schema. Structure is documented below.
    effective_labels Mapping[str, str]
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    ingestion_data_source_settings TopicIngestionDataSourceSettingsArgs
    Settings for ingestion from a data source into this topic. Structure is documented below.
    kms_key_name str
    The resource name of the Cloud KMS CryptoKey to be used to protect access to messages published on this topic. Your project's PubSub service account (service-{{PROJECT_NUMBER}}@gcp-sa-pubsub.iam.gserviceaccount.com) must have roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. The expected format is projects/*/locations/*/keyRings/*/cryptoKeys/*
    labels Mapping[str, str]

    A set of key/value label pairs to assign to this Topic.

    Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

    message_retention_duration str
    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 messageRetentionDuration are always available to subscribers. For instance, it allows any attached subscription to seek to a timestamp that is up to messageRetentionDuration in the past. If this field is not set, message retention is controlled by settings on individual subscriptions. The rotation period has the format of a decimal number, followed by the letter s (seconds). Cannot be more than 31 days or less than 10 minutes.
    message_storage_policy TopicMessageStoragePolicyArgs
    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. Structure is documented below.
    name str
    Name of the topic.


    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    pulumi_labels Mapping[str, str]
    The combination of labels configured directly on the resource and default labels configured on the provider.
    schema_settings TopicSchemaSettingsArgs
    Settings for validating messages published against a schema. Structure is documented below.
    effectiveLabels Map<String>
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    ingestionDataSourceSettings Property Map
    Settings for ingestion from a data source into this topic. Structure is documented below.
    kmsKeyName String
    The resource name of the Cloud KMS CryptoKey to be used to protect access to messages published on this topic. Your project's PubSub service account (service-{{PROJECT_NUMBER}}@gcp-sa-pubsub.iam.gserviceaccount.com) must have roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. The expected format is projects/*/locations/*/keyRings/*/cryptoKeys/*
    labels Map<String>

    A set of key/value label pairs to assign to this Topic.

    Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

    messageRetentionDuration String
    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 messageRetentionDuration are always available to subscribers. For instance, it allows any attached subscription to seek to a timestamp that is up to messageRetentionDuration in the past. If this field is not set, message retention is controlled by settings on individual subscriptions. The rotation period has the format of a decimal number, followed by the letter s (seconds). Cannot be more than 31 days or less than 10 minutes.
    messageStoragePolicy Property Map
    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. Structure is documented below.
    name String
    Name of the topic.


    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    pulumiLabels Map<String>
    The combination of labels configured directly on the resource and default labels configured on the provider.
    schemaSettings Property Map
    Settings for validating messages published against a schema. Structure is documented below.

    Supporting Types

    TopicIngestionDataSourceSettings, TopicIngestionDataSourceSettingsArgs

    AwsKinesis TopicIngestionDataSourceSettingsAwsKinesis
    Settings for ingestion from Amazon Kinesis Data Streams. Structure is documented below.
    CloudStorage TopicIngestionDataSourceSettingsCloudStorage
    Settings for ingestion from Cloud Storage. Structure is documented below.
    PlatformLogsSettings TopicIngestionDataSourceSettingsPlatformLogsSettings
    Settings for Platform Logs regarding ingestion to Pub/Sub. If unset, no Platform Logs will be generated.' Structure is documented below.
    AwsKinesis TopicIngestionDataSourceSettingsAwsKinesis
    Settings for ingestion from Amazon Kinesis Data Streams. Structure is documented below.
    CloudStorage TopicIngestionDataSourceSettingsCloudStorage
    Settings for ingestion from Cloud Storage. Structure is documented below.
    PlatformLogsSettings TopicIngestionDataSourceSettingsPlatformLogsSettings
    Settings for Platform Logs regarding ingestion to Pub/Sub. If unset, no Platform Logs will be generated.' Structure is documented below.
    awsKinesis TopicIngestionDataSourceSettingsAwsKinesis
    Settings for ingestion from Amazon Kinesis Data Streams. Structure is documented below.
    cloudStorage TopicIngestionDataSourceSettingsCloudStorage
    Settings for ingestion from Cloud Storage. Structure is documented below.
    platformLogsSettings TopicIngestionDataSourceSettingsPlatformLogsSettings
    Settings for Platform Logs regarding ingestion to Pub/Sub. If unset, no Platform Logs will be generated.' Structure is documented below.
    awsKinesis TopicIngestionDataSourceSettingsAwsKinesis
    Settings for ingestion from Amazon Kinesis Data Streams. Structure is documented below.
    cloudStorage TopicIngestionDataSourceSettingsCloudStorage
    Settings for ingestion from Cloud Storage. Structure is documented below.
    platformLogsSettings TopicIngestionDataSourceSettingsPlatformLogsSettings
    Settings for Platform Logs regarding ingestion to Pub/Sub. If unset, no Platform Logs will be generated.' Structure is documented below.
    aws_kinesis TopicIngestionDataSourceSettingsAwsKinesis
    Settings for ingestion from Amazon Kinesis Data Streams. Structure is documented below.
    cloud_storage TopicIngestionDataSourceSettingsCloudStorage
    Settings for ingestion from Cloud Storage. Structure is documented below.
    platform_logs_settings TopicIngestionDataSourceSettingsPlatformLogsSettings
    Settings for Platform Logs regarding ingestion to Pub/Sub. If unset, no Platform Logs will be generated.' Structure is documented below.
    awsKinesis Property Map
    Settings for ingestion from Amazon Kinesis Data Streams. Structure is documented below.
    cloudStorage Property Map
    Settings for ingestion from Cloud Storage. Structure is documented below.
    platformLogsSettings Property Map
    Settings for Platform Logs regarding ingestion to Pub/Sub. If unset, no Platform Logs will be generated.' Structure is documented below.

    TopicIngestionDataSourceSettingsAwsKinesis, TopicIngestionDataSourceSettingsAwsKinesisArgs

    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.

    TopicIngestionDataSourceSettingsCloudStorage, TopicIngestionDataSourceSettingsCloudStorageArgs

    Bucket string
    Cloud Storage bucket. The bucket name must be without any prefix like "gs://". See the bucket naming requirements: https://cloud.google.com/storage/docs/buckets#naming.
    AvroFormat TopicIngestionDataSourceSettingsCloudStorageAvroFormat
    Configuration for reading Cloud Storage data in Avro binary format. The bytes of each object will be set to the data field of a Pub/Sub message.
    MatchGlob string
    Glob pattern used to match objects that will be ingested. If unset, all objects will be ingested. See the supported patterns: https://cloud.google.com/storage/docs/json_api/v1/objects/list#list-objects-and-prefixes-using-glob
    MinimumObjectCreateTime string
    The timestamp set in RFC3339 text format. If set, only objects with a larger or equal timestamp will be ingested. Unset by default, meaning all objects will be ingested.
    PubsubAvroFormat TopicIngestionDataSourceSettingsCloudStoragePubsubAvroFormat
    Configuration for reading Cloud Storage data written via Cloud Storage subscriptions(See https://cloud.google.com/pubsub/docs/cloudstorage). The data and attributes fields of the originally exported Pub/Sub message will be restored when publishing.
    TextFormat TopicIngestionDataSourceSettingsCloudStorageTextFormat
    Configuration for reading Cloud Storage data in text format. Each line of text as specified by the delimiter will be set to the data field of a Pub/Sub message. Structure is documented below.
    Bucket string
    Cloud Storage bucket. The bucket name must be without any prefix like "gs://". See the bucket naming requirements: https://cloud.google.com/storage/docs/buckets#naming.
    AvroFormat TopicIngestionDataSourceSettingsCloudStorageAvroFormat
    Configuration for reading Cloud Storage data in Avro binary format. The bytes of each object will be set to the data field of a Pub/Sub message.
    MatchGlob string
    Glob pattern used to match objects that will be ingested. If unset, all objects will be ingested. See the supported patterns: https://cloud.google.com/storage/docs/json_api/v1/objects/list#list-objects-and-prefixes-using-glob
    MinimumObjectCreateTime string
    The timestamp set in RFC3339 text format. If set, only objects with a larger or equal timestamp will be ingested. Unset by default, meaning all objects will be ingested.
    PubsubAvroFormat TopicIngestionDataSourceSettingsCloudStoragePubsubAvroFormat
    Configuration for reading Cloud Storage data written via Cloud Storage subscriptions(See https://cloud.google.com/pubsub/docs/cloudstorage). The data and attributes fields of the originally exported Pub/Sub message will be restored when publishing.
    TextFormat TopicIngestionDataSourceSettingsCloudStorageTextFormat
    Configuration for reading Cloud Storage data in text format. Each line of text as specified by the delimiter will be set to the data field of a Pub/Sub message. Structure is documented below.
    bucket String
    Cloud Storage bucket. The bucket name must be without any prefix like "gs://". See the bucket naming requirements: https://cloud.google.com/storage/docs/buckets#naming.
    avroFormat TopicIngestionDataSourceSettingsCloudStorageAvroFormat
    Configuration for reading Cloud Storage data in Avro binary format. The bytes of each object will be set to the data field of a Pub/Sub message.
    matchGlob String
    Glob pattern used to match objects that will be ingested. If unset, all objects will be ingested. See the supported patterns: https://cloud.google.com/storage/docs/json_api/v1/objects/list#list-objects-and-prefixes-using-glob
    minimumObjectCreateTime String
    The timestamp set in RFC3339 text format. If set, only objects with a larger or equal timestamp will be ingested. Unset by default, meaning all objects will be ingested.
    pubsubAvroFormat TopicIngestionDataSourceSettingsCloudStoragePubsubAvroFormat
    Configuration for reading Cloud Storage data written via Cloud Storage subscriptions(See https://cloud.google.com/pubsub/docs/cloudstorage). The data and attributes fields of the originally exported Pub/Sub message will be restored when publishing.
    textFormat TopicIngestionDataSourceSettingsCloudStorageTextFormat
    Configuration for reading Cloud Storage data in text format. Each line of text as specified by the delimiter will be set to the data field of a Pub/Sub message. Structure is documented below.
    bucket string
    Cloud Storage bucket. The bucket name must be without any prefix like "gs://". See the bucket naming requirements: https://cloud.google.com/storage/docs/buckets#naming.
    avroFormat TopicIngestionDataSourceSettingsCloudStorageAvroFormat
    Configuration for reading Cloud Storage data in Avro binary format. The bytes of each object will be set to the data field of a Pub/Sub message.
    matchGlob string
    Glob pattern used to match objects that will be ingested. If unset, all objects will be ingested. See the supported patterns: https://cloud.google.com/storage/docs/json_api/v1/objects/list#list-objects-and-prefixes-using-glob
    minimumObjectCreateTime string
    The timestamp set in RFC3339 text format. If set, only objects with a larger or equal timestamp will be ingested. Unset by default, meaning all objects will be ingested.
    pubsubAvroFormat TopicIngestionDataSourceSettingsCloudStoragePubsubAvroFormat
    Configuration for reading Cloud Storage data written via Cloud Storage subscriptions(See https://cloud.google.com/pubsub/docs/cloudstorage). The data and attributes fields of the originally exported Pub/Sub message will be restored when publishing.
    textFormat TopicIngestionDataSourceSettingsCloudStorageTextFormat
    Configuration for reading Cloud Storage data in text format. Each line of text as specified by the delimiter will be set to the data field of a Pub/Sub message. Structure is documented below.
    bucket str
    Cloud Storage bucket. The bucket name must be without any prefix like "gs://". See the bucket naming requirements: https://cloud.google.com/storage/docs/buckets#naming.
    avro_format TopicIngestionDataSourceSettingsCloudStorageAvroFormat
    Configuration for reading Cloud Storage data in Avro binary format. The bytes of each object will be set to the data field of a Pub/Sub message.
    match_glob str
    Glob pattern used to match objects that will be ingested. If unset, all objects will be ingested. See the supported patterns: https://cloud.google.com/storage/docs/json_api/v1/objects/list#list-objects-and-prefixes-using-glob
    minimum_object_create_time str
    The timestamp set in RFC3339 text format. If set, only objects with a larger or equal timestamp will be ingested. Unset by default, meaning all objects will be ingested.
    pubsub_avro_format TopicIngestionDataSourceSettingsCloudStoragePubsubAvroFormat
    Configuration for reading Cloud Storage data written via Cloud Storage subscriptions(See https://cloud.google.com/pubsub/docs/cloudstorage). The data and attributes fields of the originally exported Pub/Sub message will be restored when publishing.
    text_format TopicIngestionDataSourceSettingsCloudStorageTextFormat
    Configuration for reading Cloud Storage data in text format. Each line of text as specified by the delimiter will be set to the data field of a Pub/Sub message. Structure is documented below.
    bucket String
    Cloud Storage bucket. The bucket name must be without any prefix like "gs://". See the bucket naming requirements: https://cloud.google.com/storage/docs/buckets#naming.
    avroFormat Property Map
    Configuration for reading Cloud Storage data in Avro binary format. The bytes of each object will be set to the data field of a Pub/Sub message.
    matchGlob String
    Glob pattern used to match objects that will be ingested. If unset, all objects will be ingested. See the supported patterns: https://cloud.google.com/storage/docs/json_api/v1/objects/list#list-objects-and-prefixes-using-glob
    minimumObjectCreateTime String
    The timestamp set in RFC3339 text format. If set, only objects with a larger or equal timestamp will be ingested. Unset by default, meaning all objects will be ingested.
    pubsubAvroFormat Property Map
    Configuration for reading Cloud Storage data written via Cloud Storage subscriptions(See https://cloud.google.com/pubsub/docs/cloudstorage). The data and attributes fields of the originally exported Pub/Sub message will be restored when publishing.
    textFormat Property Map
    Configuration for reading Cloud Storage data in text format. Each line of text as specified by the delimiter will be set to the data field of a Pub/Sub message. Structure is documented below.

    TopicIngestionDataSourceSettingsCloudStorageTextFormat, TopicIngestionDataSourceSettingsCloudStorageTextFormatArgs

    Delimiter string
    The delimiter to use when using the 'text' format. Each line of text as specified by the delimiter will be set to the 'data' field of a Pub/Sub message. When unset, '\n' is used.
    Delimiter string
    The delimiter to use when using the 'text' format. Each line of text as specified by the delimiter will be set to the 'data' field of a Pub/Sub message. When unset, '\n' is used.
    delimiter String
    The delimiter to use when using the 'text' format. Each line of text as specified by the delimiter will be set to the 'data' field of a Pub/Sub message. When unset, '\n' is used.
    delimiter string
    The delimiter to use when using the 'text' format. Each line of text as specified by the delimiter will be set to the 'data' field of a Pub/Sub message. When unset, '\n' is used.
    delimiter str
    The delimiter to use when using the 'text' format. Each line of text as specified by the delimiter will be set to the 'data' field of a Pub/Sub message. When unset, '\n' is used.
    delimiter String
    The delimiter to use when using the 'text' format. Each line of text as specified by the delimiter will be set to the 'data' field of a Pub/Sub message. When unset, '\n' is used.

    TopicIngestionDataSourceSettingsPlatformLogsSettings, TopicIngestionDataSourceSettingsPlatformLogsSettingsArgs

    Severity string
    The minimum severity level of Platform Logs that will be written. If unspecified, no Platform Logs will be written. Default value is SEVERITY_UNSPECIFIED. Possible values are: SEVERITY_UNSPECIFIED, DISABLED, DEBUG, INFO, WARNING, ERROR.
    Severity string
    The minimum severity level of Platform Logs that will be written. If unspecified, no Platform Logs will be written. Default value is SEVERITY_UNSPECIFIED. Possible values are: SEVERITY_UNSPECIFIED, DISABLED, DEBUG, INFO, WARNING, ERROR.
    severity String
    The minimum severity level of Platform Logs that will be written. If unspecified, no Platform Logs will be written. Default value is SEVERITY_UNSPECIFIED. Possible values are: SEVERITY_UNSPECIFIED, DISABLED, DEBUG, INFO, WARNING, ERROR.
    severity string
    The minimum severity level of Platform Logs that will be written. If unspecified, no Platform Logs will be written. Default value is SEVERITY_UNSPECIFIED. Possible values are: SEVERITY_UNSPECIFIED, DISABLED, DEBUG, INFO, WARNING, ERROR.
    severity str
    The minimum severity level of Platform Logs that will be written. If unspecified, no Platform Logs will be written. Default value is SEVERITY_UNSPECIFIED. Possible values are: SEVERITY_UNSPECIFIED, DISABLED, DEBUG, INFO, WARNING, ERROR.
    severity String
    The minimum severity level of Platform Logs that will be written. If unspecified, no Platform Logs will be written. Default value is SEVERITY_UNSPECIFIED. Possible values are: SEVERITY_UNSPECIFIED, DISABLED, DEBUG, INFO, WARNING, ERROR.

    TopicMessageStoragePolicy, TopicMessageStoragePolicyArgs

    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.

    TopicSchemaSettings, TopicSchemaSettingsArgs

    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 is ENCODING_UNSPECIFIED. Possible values are: 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 is ENCODING_UNSPECIFIED. Possible values are: 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 is ENCODING_UNSPECIFIED. Possible values are: 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 is ENCODING_UNSPECIFIED. Possible values are: 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 str
    The encoding of messages validated against schema. Default value is ENCODING_UNSPECIFIED. Possible values are: 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 is ENCODING_UNSPECIFIED. Possible values are: ENCODING_UNSPECIFIED, JSON, BINARY.

    Import

    Topic can be imported using any of these accepted formats:

    • projects/{{project}}/topics/{{name}}

    • {{project}}/{{name}}

    • {{name}}

    When using the pulumi import command, Topic can be imported using one of the formats above. For example:

    $ pulumi import gcp:pubsub/topic:Topic default projects/{{project}}/topics/{{name}}
    
    $ pulumi import gcp:pubsub/topic:Topic default {{project}}/{{name}}
    
    $ pulumi import gcp:pubsub/topic:Topic default {{name}}
    

    To learn more about importing existing cloud resources, see Importing resources.

    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 v8.9.3 published on Monday, Nov 18, 2024 by Pulumi