1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. pubsub
  5. Topic
Google Cloud v8.25.1 published on Wednesday, Apr 9, 2025 by Pulumi

gcp.pubsub.Topic

Explore with Pulumi AI

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",
});
Copy
import pulumi
import pulumi_gcp as gcp

example = gcp.pubsub.Topic("example",
    name="example-topic",
    labels={
        "foo": "bar",
    },
    message_retention_duration="86600s")
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := pubsub.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
	})
}
Copy
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",
    });

});
Copy
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());

    }
}
Copy
resources:
  example:
    type: gcp:pubsub:Topic
    properties:
      name: example-topic
      labels:
        foo: bar
      messageRetentionDuration: 86600s
Copy

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,
});
Copy
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)
Copy
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
	})
}
Copy
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,
    });

});
Copy
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());

    }
}
Copy
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
Copy

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"],
        enforceInTransit: true,
    },
});
Copy
import pulumi
import pulumi_gcp as gcp

example = gcp.pubsub.Topic("example",
    name="example-topic",
    message_storage_policy={
        "allowed_persistence_regions": ["europe-west3"],
        "enforce_in_transit": True,
    })
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := pubsub.NewTopic(ctx, "example", &pubsub.TopicArgs{
			Name: pulumi.String("example-topic"),
			MessageStoragePolicy: &pubsub.TopicMessageStoragePolicyArgs{
				AllowedPersistenceRegions: pulumi.StringArray{
					pulumi.String("europe-west3"),
				},
				EnforceInTransit: pulumi.Bool(true),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var example = new Gcp.PubSub.Topic("example", new()
    {
        Name = "example-topic",
        MessageStoragePolicy = new Gcp.PubSub.Inputs.TopicMessageStoragePolicyArgs
        {
            AllowedPersistenceRegions = new[]
            {
                "europe-west3",
            },
            EnforceInTransit = true,
        },
    });

});
Copy
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")
                .enforceInTransit(true)
                .build())
            .build());

    }
}
Copy
resources:
  example:
    type: gcp:pubsub:Topic
    properties:
      name: example-topic
      messageStoragePolicy:
        allowedPersistenceRegions:
          - europe-west3
        enforceInTransit: true
Copy

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],
});
Copy
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]))
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		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
	})
}
Copy
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,
        },
    });

});
Copy
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());

    }
}
Copy
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}
Copy

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",
        },
    },
});
Copy
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",
        },
    })
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := pubsub.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
	})
}
Copy
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",
            },
        },
    });

});
Copy
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());

    }
}
Copy
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
Copy

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",
        },
    },
});
Copy
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",
        },
    })
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := pubsub.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
	})
}
Copy
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",
            },
        },
    });

});
Copy
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());

    }
}
Copy
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
Copy

Pubsub Topic Ingestion Azure Event Hubs

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

const example = new gcp.pubsub.Topic("example", {
    name: "example-topic",
    ingestionDataSourceSettings: {
        azureEventHubs: {
            resourceGroup: "azure-ingestion-resource-group",
            namespace: "azure-ingestion-namespace",
            eventHub: "azure-ingestion-event-hub",
            clientId: "aZZZZZZZ-YYYY-HHHH-GGGG-abcdef569123",
            tenantId: "0XXXXXXX-YYYY-HHHH-GGGG-123456789123",
            subscriptionId: "bXXXXXXX-YYYY-HHHH-GGGG-123456789123",
            gcpServiceAccount: "fake-service-account@fake-gcp-project.iam.gserviceaccount.com",
        },
    },
});
Copy
import pulumi
import pulumi_gcp as gcp

example = gcp.pubsub.Topic("example",
    name="example-topic",
    ingestion_data_source_settings={
        "azure_event_hubs": {
            "resource_group": "azure-ingestion-resource-group",
            "namespace": "azure-ingestion-namespace",
            "event_hub": "azure-ingestion-event-hub",
            "client_id": "aZZZZZZZ-YYYY-HHHH-GGGG-abcdef569123",
            "tenant_id": "0XXXXXXX-YYYY-HHHH-GGGG-123456789123",
            "subscription_id": "bXXXXXXX-YYYY-HHHH-GGGG-123456789123",
            "gcp_service_account": "fake-service-account@fake-gcp-project.iam.gserviceaccount.com",
        },
    })
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := pubsub.NewTopic(ctx, "example", &pubsub.TopicArgs{
			Name: pulumi.String("example-topic"),
			IngestionDataSourceSettings: &pubsub.TopicIngestionDataSourceSettingsArgs{
				AzureEventHubs: &pubsub.TopicIngestionDataSourceSettingsAzureEventHubsArgs{
					ResourceGroup:     pulumi.String("azure-ingestion-resource-group"),
					Namespace:         pulumi.String("azure-ingestion-namespace"),
					EventHub:          pulumi.String("azure-ingestion-event-hub"),
					ClientId:          pulumi.String("aZZZZZZZ-YYYY-HHHH-GGGG-abcdef569123"),
					TenantId:          pulumi.String("0XXXXXXX-YYYY-HHHH-GGGG-123456789123"),
					SubscriptionId:    pulumi.String("bXXXXXXX-YYYY-HHHH-GGGG-123456789123"),
					GcpServiceAccount: pulumi.String("fake-service-account@fake-gcp-project.iam.gserviceaccount.com"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var example = new Gcp.PubSub.Topic("example", new()
    {
        Name = "example-topic",
        IngestionDataSourceSettings = new Gcp.PubSub.Inputs.TopicIngestionDataSourceSettingsArgs
        {
            AzureEventHubs = new Gcp.PubSub.Inputs.TopicIngestionDataSourceSettingsAzureEventHubsArgs
            {
                ResourceGroup = "azure-ingestion-resource-group",
                Namespace = "azure-ingestion-namespace",
                EventHub = "azure-ingestion-event-hub",
                ClientId = "aZZZZZZZ-YYYY-HHHH-GGGG-abcdef569123",
                TenantId = "0XXXXXXX-YYYY-HHHH-GGGG-123456789123",
                SubscriptionId = "bXXXXXXX-YYYY-HHHH-GGGG-123456789123",
                GcpServiceAccount = "fake-service-account@fake-gcp-project.iam.gserviceaccount.com",
            },
        },
    });

});
Copy
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.TopicIngestionDataSourceSettingsAzureEventHubsArgs;
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()
                .azureEventHubs(TopicIngestionDataSourceSettingsAzureEventHubsArgs.builder()
                    .resourceGroup("azure-ingestion-resource-group")
                    .namespace("azure-ingestion-namespace")
                    .eventHub("azure-ingestion-event-hub")
                    .clientId("aZZZZZZZ-YYYY-HHHH-GGGG-abcdef569123")
                    .tenantId("0XXXXXXX-YYYY-HHHH-GGGG-123456789123")
                    .subscriptionId("bXXXXXXX-YYYY-HHHH-GGGG-123456789123")
                    .gcpServiceAccount("fake-service-account@fake-gcp-project.iam.gserviceaccount.com")
                    .build())
                .build())
            .build());

    }
}
Copy
resources:
  example:
    type: gcp:pubsub:Topic
    properties:
      name: example-topic
      ingestionDataSourceSettings:
        azureEventHubs:
          resourceGroup: azure-ingestion-resource-group
          namespace: azure-ingestion-namespace
          eventHub: azure-ingestion-event-hub
          clientId: aZZZZZZZ-YYYY-HHHH-GGGG-abcdef569123
          tenantId: 0XXXXXXX-YYYY-HHHH-GGGG-123456789123
          subscriptionId: bXXXXXXX-YYYY-HHHH-GGGG-123456789123
          gcpServiceAccount: fake-service-account@fake-gcp-project.iam.gserviceaccount.com
Copy

Pubsub Topic Ingestion Aws Msk

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

const example = new gcp.pubsub.Topic("example", {
    name: "example-topic",
    ingestionDataSourceSettings: {
        awsMsk: {
            clusterArn: "arn:aws:kinesis:us-west-2:111111111111:stream/fake-stream-name",
            topic: "test-topic",
            awsRoleArn: "arn:aws:iam::111111111111:role/fake-role-name",
            gcpServiceAccount: "fake-service-account@fake-gcp-project.iam.gserviceaccount.com",
        },
    },
});
Copy
import pulumi
import pulumi_gcp as gcp

example = gcp.pubsub.Topic("example",
    name="example-topic",
    ingestion_data_source_settings={
        "aws_msk": {
            "cluster_arn": "arn:aws:kinesis:us-west-2:111111111111:stream/fake-stream-name",
            "topic": "test-topic",
            "aws_role_arn": "arn:aws:iam::111111111111:role/fake-role-name",
            "gcp_service_account": "fake-service-account@fake-gcp-project.iam.gserviceaccount.com",
        },
    })
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := pubsub.NewTopic(ctx, "example", &pubsub.TopicArgs{
			Name: pulumi.String("example-topic"),
			IngestionDataSourceSettings: &pubsub.TopicIngestionDataSourceSettingsArgs{
				AwsMsk: &pubsub.TopicIngestionDataSourceSettingsAwsMskArgs{
					ClusterArn:        pulumi.String("arn:aws:kinesis:us-west-2:111111111111:stream/fake-stream-name"),
					Topic:             pulumi.String("test-topic"),
					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
	})
}
Copy
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
        {
            AwsMsk = new Gcp.PubSub.Inputs.TopicIngestionDataSourceSettingsAwsMskArgs
            {
                ClusterArn = "arn:aws:kinesis:us-west-2:111111111111:stream/fake-stream-name",
                Topic = "test-topic",
                AwsRoleArn = "arn:aws:iam::111111111111:role/fake-role-name",
                GcpServiceAccount = "fake-service-account@fake-gcp-project.iam.gserviceaccount.com",
            },
        },
    });

});
Copy
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.TopicIngestionDataSourceSettingsAwsMskArgs;
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()
                .awsMsk(TopicIngestionDataSourceSettingsAwsMskArgs.builder()
                    .clusterArn("arn:aws:kinesis:us-west-2:111111111111:stream/fake-stream-name")
                    .topic("test-topic")
                    .awsRoleArn("arn:aws:iam::111111111111:role/fake-role-name")
                    .gcpServiceAccount("fake-service-account@fake-gcp-project.iam.gserviceaccount.com")
                    .build())
                .build())
            .build());

    }
}
Copy
resources:
  example:
    type: gcp:pubsub:Topic
    properties:
      name: example-topic
      ingestionDataSourceSettings:
        awsMsk:
          clusterArn: arn:aws:kinesis:us-west-2:111111111111:stream/fake-stream-name
          topic: test-topic
          awsRoleArn: arn:aws:iam::111111111111:role/fake-role-name
          gcpServiceAccount: fake-service-account@fake-gcp-project.iam.gserviceaccount.com
Copy

Pubsub Topic Ingestion Confluent Cloud

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

const example = new gcp.pubsub.Topic("example", {
    name: "example-topic",
    ingestionDataSourceSettings: {
        confluentCloud: {
            bootstrapServer: "test.us-west2.gcp.confluent.cloud:1111",
            clusterId: "1234",
            topic: "test-topic",
            identityPoolId: "test-identity-pool-id",
            gcpServiceAccount: "fake-service-account@fake-gcp-project.iam.gserviceaccount.com",
        },
    },
});
Copy
import pulumi
import pulumi_gcp as gcp

example = gcp.pubsub.Topic("example",
    name="example-topic",
    ingestion_data_source_settings={
        "confluent_cloud": {
            "bootstrap_server": "test.us-west2.gcp.confluent.cloud:1111",
            "cluster_id": "1234",
            "topic": "test-topic",
            "identity_pool_id": "test-identity-pool-id",
            "gcp_service_account": "fake-service-account@fake-gcp-project.iam.gserviceaccount.com",
        },
    })
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := pubsub.NewTopic(ctx, "example", &pubsub.TopicArgs{
			Name: pulumi.String("example-topic"),
			IngestionDataSourceSettings: &pubsub.TopicIngestionDataSourceSettingsArgs{
				ConfluentCloud: &pubsub.TopicIngestionDataSourceSettingsConfluentCloudArgs{
					BootstrapServer:   pulumi.String("test.us-west2.gcp.confluent.cloud:1111"),
					ClusterId:         pulumi.String("1234"),
					Topic:             pulumi.String("test-topic"),
					IdentityPoolId:    pulumi.String("test-identity-pool-id"),
					GcpServiceAccount: pulumi.String("fake-service-account@fake-gcp-project.iam.gserviceaccount.com"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var example = new Gcp.PubSub.Topic("example", new()
    {
        Name = "example-topic",
        IngestionDataSourceSettings = new Gcp.PubSub.Inputs.TopicIngestionDataSourceSettingsArgs
        {
            ConfluentCloud = new Gcp.PubSub.Inputs.TopicIngestionDataSourceSettingsConfluentCloudArgs
            {
                BootstrapServer = "test.us-west2.gcp.confluent.cloud:1111",
                ClusterId = "1234",
                Topic = "test-topic",
                IdentityPoolId = "test-identity-pool-id",
                GcpServiceAccount = "fake-service-account@fake-gcp-project.iam.gserviceaccount.com",
            },
        },
    });

});
Copy
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.TopicIngestionDataSourceSettingsConfluentCloudArgs;
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()
                .confluentCloud(TopicIngestionDataSourceSettingsConfluentCloudArgs.builder()
                    .bootstrapServer("test.us-west2.gcp.confluent.cloud:1111")
                    .clusterId("1234")
                    .topic("test-topic")
                    .identityPoolId("test-identity-pool-id")
                    .gcpServiceAccount("fake-service-account@fake-gcp-project.iam.gserviceaccount.com")
                    .build())
                .build())
            .build());

    }
}
Copy
resources:
  example:
    type: gcp:pubsub:Topic
    properties:
      name: example-topic
      ingestionDataSourceSettings:
        confluentCloud:
          bootstrapServer: test.us-west2.gcp.confluent.cloud:1111
          clusterId: '1234'
          topic: test-topic
          identityPoolId: test-identity-pool-id
          gcpServiceAccount: fake-service-account@fake-gcp-project.iam.gserviceaccount.com
Copy

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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. String
The unique name of the resource.
args This property is required. 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",
        },
        AwsMsk = new Gcp.PubSub.Inputs.TopicIngestionDataSourceSettingsAwsMskArgs
        {
            AwsRoleArn = "string",
            ClusterArn = "string",
            GcpServiceAccount = "string",
            Topic = "string",
        },
        AzureEventHubs = new Gcp.PubSub.Inputs.TopicIngestionDataSourceSettingsAzureEventHubsArgs
        {
            ClientId = "string",
            EventHub = "string",
            GcpServiceAccount = "string",
            Namespace = "string",
            ResourceGroup = "string",
            SubscriptionId = "string",
            TenantId = "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",
            },
        },
        ConfluentCloud = new Gcp.PubSub.Inputs.TopicIngestionDataSourceSettingsConfluentCloudArgs
        {
            BootstrapServer = "string",
            GcpServiceAccount = "string",
            IdentityPoolId = "string",
            Topic = "string",
            ClusterId = "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",
        },
        EnforceInTransit = false,
    },
    Name = "string",
    Project = "string",
    SchemaSettings = new Gcp.PubSub.Inputs.TopicSchemaSettingsArgs
    {
        Schema = "string",
        Encoding = "string",
    },
});
Copy
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"),
		},
		AwsMsk: &pubsub.TopicIngestionDataSourceSettingsAwsMskArgs{
			AwsRoleArn:        pulumi.String("string"),
			ClusterArn:        pulumi.String("string"),
			GcpServiceAccount: pulumi.String("string"),
			Topic:             pulumi.String("string"),
		},
		AzureEventHubs: &pubsub.TopicIngestionDataSourceSettingsAzureEventHubsArgs{
			ClientId:          pulumi.String("string"),
			EventHub:          pulumi.String("string"),
			GcpServiceAccount: pulumi.String("string"),
			Namespace:         pulumi.String("string"),
			ResourceGroup:     pulumi.String("string"),
			SubscriptionId:    pulumi.String("string"),
			TenantId:          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"),
			},
		},
		ConfluentCloud: &pubsub.TopicIngestionDataSourceSettingsConfluentCloudArgs{
			BootstrapServer:   pulumi.String("string"),
			GcpServiceAccount: pulumi.String("string"),
			IdentityPoolId:    pulumi.String("string"),
			Topic:             pulumi.String("string"),
			ClusterId:         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"),
		},
		EnforceInTransit: pulumi.Bool(false),
	},
	Name:    pulumi.String("string"),
	Project: pulumi.String("string"),
	SchemaSettings: &pubsub.TopicSchemaSettingsArgs{
		Schema:   pulumi.String("string"),
		Encoding: pulumi.String("string"),
	},
})
Copy
var gcpTopicResource = new Topic("gcpTopicResource", TopicArgs.builder()
    .ingestionDataSourceSettings(TopicIngestionDataSourceSettingsArgs.builder()
        .awsKinesis(TopicIngestionDataSourceSettingsAwsKinesisArgs.builder()
            .awsRoleArn("string")
            .consumerArn("string")
            .gcpServiceAccount("string")
            .streamArn("string")
            .build())
        .awsMsk(TopicIngestionDataSourceSettingsAwsMskArgs.builder()
            .awsRoleArn("string")
            .clusterArn("string")
            .gcpServiceAccount("string")
            .topic("string")
            .build())
        .azureEventHubs(TopicIngestionDataSourceSettingsAzureEventHubsArgs.builder()
            .clientId("string")
            .eventHub("string")
            .gcpServiceAccount("string")
            .namespace("string")
            .resourceGroup("string")
            .subscriptionId("string")
            .tenantId("string")
            .build())
        .cloudStorage(TopicIngestionDataSourceSettingsCloudStorageArgs.builder()
            .bucket("string")
            .avroFormat()
            .matchGlob("string")
            .minimumObjectCreateTime("string")
            .pubsubAvroFormat()
            .textFormat(TopicIngestionDataSourceSettingsCloudStorageTextFormatArgs.builder()
                .delimiter("string")
                .build())
            .build())
        .confluentCloud(TopicIngestionDataSourceSettingsConfluentCloudArgs.builder()
            .bootstrapServer("string")
            .gcpServiceAccount("string")
            .identityPoolId("string")
            .topic("string")
            .clusterId("string")
            .build())
        .platformLogsSettings(TopicIngestionDataSourceSettingsPlatformLogsSettingsArgs.builder()
            .severity("string")
            .build())
        .build())
    .kmsKeyName("string")
    .labels(Map.of("string", "string"))
    .messageRetentionDuration("string")
    .messageStoragePolicy(TopicMessageStoragePolicyArgs.builder()
        .allowedPersistenceRegions("string")
        .enforceInTransit(false)
        .build())
    .name("string")
    .project("string")
    .schemaSettings(TopicSchemaSettingsArgs.builder()
        .schema("string")
        .encoding("string")
        .build())
    .build());
Copy
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",
        },
        "aws_msk": {
            "aws_role_arn": "string",
            "cluster_arn": "string",
            "gcp_service_account": "string",
            "topic": "string",
        },
        "azure_event_hubs": {
            "client_id": "string",
            "event_hub": "string",
            "gcp_service_account": "string",
            "namespace": "string",
            "resource_group": "string",
            "subscription_id": "string",
            "tenant_id": "string",
        },
        "cloud_storage": {
            "bucket": "string",
            "avro_format": {},
            "match_glob": "string",
            "minimum_object_create_time": "string",
            "pubsub_avro_format": {},
            "text_format": {
                "delimiter": "string",
            },
        },
        "confluent_cloud": {
            "bootstrap_server": "string",
            "gcp_service_account": "string",
            "identity_pool_id": "string",
            "topic": "string",
            "cluster_id": "string",
        },
        "platform_logs_settings": {
            "severity": "string",
        },
    },
    kms_key_name="string",
    labels={
        "string": "string",
    },
    message_retention_duration="string",
    message_storage_policy={
        "allowed_persistence_regions": ["string"],
        "enforce_in_transit": False,
    },
    name="string",
    project="string",
    schema_settings={
        "schema": "string",
        "encoding": "string",
    })
Copy
const gcpTopicResource = new gcp.pubsub.Topic("gcpTopicResource", {
    ingestionDataSourceSettings: {
        awsKinesis: {
            awsRoleArn: "string",
            consumerArn: "string",
            gcpServiceAccount: "string",
            streamArn: "string",
        },
        awsMsk: {
            awsRoleArn: "string",
            clusterArn: "string",
            gcpServiceAccount: "string",
            topic: "string",
        },
        azureEventHubs: {
            clientId: "string",
            eventHub: "string",
            gcpServiceAccount: "string",
            namespace: "string",
            resourceGroup: "string",
            subscriptionId: "string",
            tenantId: "string",
        },
        cloudStorage: {
            bucket: "string",
            avroFormat: {},
            matchGlob: "string",
            minimumObjectCreateTime: "string",
            pubsubAvroFormat: {},
            textFormat: {
                delimiter: "string",
            },
        },
        confluentCloud: {
            bootstrapServer: "string",
            gcpServiceAccount: "string",
            identityPoolId: "string",
            topic: "string",
            clusterId: "string",
        },
        platformLogsSettings: {
            severity: "string",
        },
    },
    kmsKeyName: "string",
    labels: {
        string: "string",
    },
    messageRetentionDuration: "string",
    messageStoragePolicy: {
        allowedPersistenceRegions: ["string"],
        enforceInTransit: false,
    },
    name: "string",
    project: "string",
    schemaSettings: {
        schema: "string",
        encoding: "string",
    },
});
Copy
type: gcp:pubsub:Topic
properties:
    ingestionDataSourceSettings:
        awsKinesis:
            awsRoleArn: string
            consumerArn: string
            gcpServiceAccount: string
            streamArn: string
        awsMsk:
            awsRoleArn: string
            clusterArn: string
            gcpServiceAccount: string
            topic: string
        azureEventHubs:
            clientId: string
            eventHub: string
            gcpServiceAccount: string
            namespace: string
            resourceGroup: string
            subscriptionId: string
            tenantId: string
        cloudStorage:
            avroFormat: {}
            bucket: string
            matchGlob: string
            minimumObjectCreateTime: string
            pubsubAvroFormat: {}
            textFormat:
                delimiter: string
        confluentCloud:
            bootstrapServer: string
            clusterId: string
            gcpServiceAccount: string
            identityPoolId: string
            topic: string
        platformLogsSettings:
            severity: string
    kmsKeyName: string
    labels:
        string: string
    messageRetentionDuration: string
    messageStoragePolicy:
        allowedPersistenceRegions:
            - string
        enforceInTransit: false
    name: string
    project: string
    schemaSettings:
        encoding: string
        schema: string
Copy

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 Changes to this property will trigger replacement. string
Name of the topic.


Project Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string
Name of the topic.


Project Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. String
Name of the topic.


project Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string
Name of the topic.


project Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. str
Name of the topic.


project Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. String
Name of the topic.


project Changes to this property will trigger replacement. 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)
resources:  _:    type: gcp:pubsub:Topic    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 Changes to this property will trigger replacement. string
Name of the topic.


Project Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string
Name of the topic.


Project Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. String
Name of the topic.


project Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string
Name of the topic.


project Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. str
Name of the topic.


project Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. String
Name of the topic.


project Changes to this property will trigger replacement. 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.
AwsMsk TopicIngestionDataSourceSettingsAwsMsk
Settings for ingestion from Amazon Managed Streaming for Apache Kafka. Structure is documented below.
AzureEventHubs TopicIngestionDataSourceSettingsAzureEventHubs
Settings for ingestion from Azure Event Hubs. Structure is documented below.
CloudStorage TopicIngestionDataSourceSettingsCloudStorage
Settings for ingestion from Cloud Storage. Structure is documented below.
ConfluentCloud TopicIngestionDataSourceSettingsConfluentCloud
Settings for ingestion from Confluent Cloud. 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.
AwsMsk TopicIngestionDataSourceSettingsAwsMsk
Settings for ingestion from Amazon Managed Streaming for Apache Kafka. Structure is documented below.
AzureEventHubs TopicIngestionDataSourceSettingsAzureEventHubs
Settings for ingestion from Azure Event Hubs. Structure is documented below.
CloudStorage TopicIngestionDataSourceSettingsCloudStorage
Settings for ingestion from Cloud Storage. Structure is documented below.
ConfluentCloud TopicIngestionDataSourceSettingsConfluentCloud
Settings for ingestion from Confluent Cloud. 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.
awsMsk TopicIngestionDataSourceSettingsAwsMsk
Settings for ingestion from Amazon Managed Streaming for Apache Kafka. Structure is documented below.
azureEventHubs TopicIngestionDataSourceSettingsAzureEventHubs
Settings for ingestion from Azure Event Hubs. Structure is documented below.
cloudStorage TopicIngestionDataSourceSettingsCloudStorage
Settings for ingestion from Cloud Storage. Structure is documented below.
confluentCloud TopicIngestionDataSourceSettingsConfluentCloud
Settings for ingestion from Confluent Cloud. 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.
awsMsk TopicIngestionDataSourceSettingsAwsMsk
Settings for ingestion from Amazon Managed Streaming for Apache Kafka. Structure is documented below.
azureEventHubs TopicIngestionDataSourceSettingsAzureEventHubs
Settings for ingestion from Azure Event Hubs. Structure is documented below.
cloudStorage TopicIngestionDataSourceSettingsCloudStorage
Settings for ingestion from Cloud Storage. Structure is documented below.
confluentCloud TopicIngestionDataSourceSettingsConfluentCloud
Settings for ingestion from Confluent Cloud. 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.
aws_msk TopicIngestionDataSourceSettingsAwsMsk
Settings for ingestion from Amazon Managed Streaming for Apache Kafka. Structure is documented below.
azure_event_hubs TopicIngestionDataSourceSettingsAzureEventHubs
Settings for ingestion from Azure Event Hubs. Structure is documented below.
cloud_storage TopicIngestionDataSourceSettingsCloudStorage
Settings for ingestion from Cloud Storage. Structure is documented below.
confluent_cloud TopicIngestionDataSourceSettingsConfluentCloud
Settings for ingestion from Confluent Cloud. 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.
awsMsk Property Map
Settings for ingestion from Amazon Managed Streaming for Apache Kafka. Structure is documented below.
azureEventHubs Property Map
Settings for ingestion from Azure Event Hubs. Structure is documented below.
cloudStorage Property Map
Settings for ingestion from Cloud Storage. Structure is documented below.
confluentCloud Property Map
Settings for ingestion from Confluent Cloud. 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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. string
The Kinesis stream ARN to ingest data from.
AwsRoleArn This property is required. 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 This property is required. 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 This property is required. 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 This property is required. string
The Kinesis stream ARN to ingest data from.
awsRoleArn This property is required. 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 This property is required. 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 This property is required. 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 This property is required. String
The Kinesis stream ARN to ingest data from.
awsRoleArn This property is required. 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 This property is required. 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 This property is required. 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 This property is required. string
The Kinesis stream ARN to ingest data from.
aws_role_arn This property is required. 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 This property is required. 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 This property is required. 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 This property is required. str
The Kinesis stream ARN to ingest data from.
awsRoleArn This property is required. 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 This property is required. 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 This property is required. 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 This property is required. String
The Kinesis stream ARN to ingest data from.

TopicIngestionDataSourceSettingsAwsMsk
, TopicIngestionDataSourceSettingsAwsMskArgs

AwsRoleArn This property is required. string
AWS role ARN to be used for Federated Identity authentication with MSK. Check the Pub/Sub docs for how to set up this role and the required permissions that need to be attached to it.
ClusterArn This property is required. string
ARN that uniquely identifies the MSK cluster.
GcpServiceAccount This property is required. string
The GCP service account to be used for Federated Identity authentication with MSK (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.
Topic This property is required. string
The name of the MSK topic that Pub/Sub will import from.
AwsRoleArn This property is required. string
AWS role ARN to be used for Federated Identity authentication with MSK. Check the Pub/Sub docs for how to set up this role and the required permissions that need to be attached to it.
ClusterArn This property is required. string
ARN that uniquely identifies the MSK cluster.
GcpServiceAccount This property is required. string
The GCP service account to be used for Federated Identity authentication with MSK (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.
Topic This property is required. string
The name of the MSK topic that Pub/Sub will import from.
awsRoleArn This property is required. String
AWS role ARN to be used for Federated Identity authentication with MSK. Check the Pub/Sub docs for how to set up this role and the required permissions that need to be attached to it.
clusterArn This property is required. String
ARN that uniquely identifies the MSK cluster.
gcpServiceAccount This property is required. String
The GCP service account to be used for Federated Identity authentication with MSK (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.
topic This property is required. String
The name of the MSK topic that Pub/Sub will import from.
awsRoleArn This property is required. string
AWS role ARN to be used for Federated Identity authentication with MSK. Check the Pub/Sub docs for how to set up this role and the required permissions that need to be attached to it.
clusterArn This property is required. string
ARN that uniquely identifies the MSK cluster.
gcpServiceAccount This property is required. string
The GCP service account to be used for Federated Identity authentication with MSK (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.
topic This property is required. string
The name of the MSK topic that Pub/Sub will import from.
aws_role_arn This property is required. str
AWS role ARN to be used for Federated Identity authentication with MSK. Check the Pub/Sub docs for how to set up this role and the required permissions that need to be attached to it.
cluster_arn This property is required. str
ARN that uniquely identifies the MSK cluster.
gcp_service_account This property is required. str
The GCP service account to be used for Federated Identity authentication with MSK (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.
topic This property is required. str
The name of the MSK topic that Pub/Sub will import from.
awsRoleArn This property is required. String
AWS role ARN to be used for Federated Identity authentication with MSK. Check the Pub/Sub docs for how to set up this role and the required permissions that need to be attached to it.
clusterArn This property is required. String
ARN that uniquely identifies the MSK cluster.
gcpServiceAccount This property is required. String
The GCP service account to be used for Federated Identity authentication with MSK (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.
topic This property is required. String
The name of the MSK topic that Pub/Sub will import from.

TopicIngestionDataSourceSettingsAzureEventHubs
, TopicIngestionDataSourceSettingsAzureEventHubsArgs

ClientId string
The Azure event hub client ID to use for ingestion.
EventHub string
The Azure event hub to ingest data from.
GcpServiceAccount string
The GCP service account to be used for Federated Identity authentication with Azure (via a AssumeRoleWithWebIdentity call for the provided role).
Namespace string
The Azure event hub namespace to ingest data from.
ResourceGroup string
The name of the resource group within an Azure subscription.
SubscriptionId string
The Azure event hub subscription ID to use for ingestion.
TenantId string
The Azure event hub tenant ID to use for ingestion.
ClientId string
The Azure event hub client ID to use for ingestion.
EventHub string
The Azure event hub to ingest data from.
GcpServiceAccount string
The GCP service account to be used for Federated Identity authentication with Azure (via a AssumeRoleWithWebIdentity call for the provided role).
Namespace string
The Azure event hub namespace to ingest data from.
ResourceGroup string
The name of the resource group within an Azure subscription.
SubscriptionId string
The Azure event hub subscription ID to use for ingestion.
TenantId string
The Azure event hub tenant ID to use for ingestion.
clientId String
The Azure event hub client ID to use for ingestion.
eventHub String
The Azure event hub to ingest data from.
gcpServiceAccount String
The GCP service account to be used for Federated Identity authentication with Azure (via a AssumeRoleWithWebIdentity call for the provided role).
namespace String
The Azure event hub namespace to ingest data from.
resourceGroup String
The name of the resource group within an Azure subscription.
subscriptionId String
The Azure event hub subscription ID to use for ingestion.
tenantId String
The Azure event hub tenant ID to use for ingestion.
clientId string
The Azure event hub client ID to use for ingestion.
eventHub string
The Azure event hub to ingest data from.
gcpServiceAccount string
The GCP service account to be used for Federated Identity authentication with Azure (via a AssumeRoleWithWebIdentity call for the provided role).
namespace string
The Azure event hub namespace to ingest data from.
resourceGroup string
The name of the resource group within an Azure subscription.
subscriptionId string
The Azure event hub subscription ID to use for ingestion.
tenantId string
The Azure event hub tenant ID to use for ingestion.
client_id str
The Azure event hub client ID to use for ingestion.
event_hub str
The Azure event hub to ingest data from.
gcp_service_account str
The GCP service account to be used for Federated Identity authentication with Azure (via a AssumeRoleWithWebIdentity call for the provided role).
namespace str
The Azure event hub namespace to ingest data from.
resource_group str
The name of the resource group within an Azure subscription.
subscription_id str
The Azure event hub subscription ID to use for ingestion.
tenant_id str
The Azure event hub tenant ID to use for ingestion.
clientId String
The Azure event hub client ID to use for ingestion.
eventHub String
The Azure event hub to ingest data from.
gcpServiceAccount String
The GCP service account to be used for Federated Identity authentication with Azure (via a AssumeRoleWithWebIdentity call for the provided role).
namespace String
The Azure event hub namespace to ingest data from.
resourceGroup String
The name of the resource group within an Azure subscription.
subscriptionId String
The Azure event hub subscription ID to use for ingestion.
tenantId String
The Azure event hub tenant ID to use for ingestion.

TopicIngestionDataSourceSettingsCloudStorage
, TopicIngestionDataSourceSettingsCloudStorageArgs

Bucket This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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.

TopicIngestionDataSourceSettingsConfluentCloud
, TopicIngestionDataSourceSettingsConfluentCloudArgs

BootstrapServer This property is required. string
The Confluent Cloud bootstrap server. The format is url:port.
GcpServiceAccount This property is required. string
The GCP service account to be used for Federated Identity authentication with Confluent Cloud.
IdentityPoolId This property is required. string
Identity pool ID to be used for Federated Identity authentication with Confluent Cloud.
Topic This property is required. string
Name of the Confluent Cloud topic that Pub/Sub will import from.
ClusterId string
The Confluent Cloud cluster ID.
BootstrapServer This property is required. string
The Confluent Cloud bootstrap server. The format is url:port.
GcpServiceAccount This property is required. string
The GCP service account to be used for Federated Identity authentication with Confluent Cloud.
IdentityPoolId This property is required. string
Identity pool ID to be used for Federated Identity authentication with Confluent Cloud.
Topic This property is required. string
Name of the Confluent Cloud topic that Pub/Sub will import from.
ClusterId string
The Confluent Cloud cluster ID.
bootstrapServer This property is required. String
The Confluent Cloud bootstrap server. The format is url:port.
gcpServiceAccount This property is required. String
The GCP service account to be used for Federated Identity authentication with Confluent Cloud.
identityPoolId This property is required. String
Identity pool ID to be used for Federated Identity authentication with Confluent Cloud.
topic This property is required. String
Name of the Confluent Cloud topic that Pub/Sub will import from.
clusterId String
The Confluent Cloud cluster ID.
bootstrapServer This property is required. string
The Confluent Cloud bootstrap server. The format is url:port.
gcpServiceAccount This property is required. string
The GCP service account to be used for Federated Identity authentication with Confluent Cloud.
identityPoolId This property is required. string
Identity pool ID to be used for Federated Identity authentication with Confluent Cloud.
topic This property is required. string
Name of the Confluent Cloud topic that Pub/Sub will import from.
clusterId string
The Confluent Cloud cluster ID.
bootstrap_server This property is required. str
The Confluent Cloud bootstrap server. The format is url:port.
gcp_service_account This property is required. str
The GCP service account to be used for Federated Identity authentication with Confluent Cloud.
identity_pool_id This property is required. str
Identity pool ID to be used for Federated Identity authentication with Confluent Cloud.
topic This property is required. str
Name of the Confluent Cloud topic that Pub/Sub will import from.
cluster_id str
The Confluent Cloud cluster ID.
bootstrapServer This property is required. String
The Confluent Cloud bootstrap server. The format is url:port.
gcpServiceAccount This property is required. String
The GCP service account to be used for Federated Identity authentication with Confluent Cloud.
identityPoolId This property is required. String
Identity pool ID to be used for Federated Identity authentication with Confluent Cloud.
topic This property is required. String
Name of the Confluent Cloud topic that Pub/Sub will import from.
clusterId String
The Confluent Cloud cluster ID.

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 This property is required. 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.
EnforceInTransit bool
If true, allowedPersistenceRegions is also used to enforce in-transit guarantees for messages. That is, Pub/Sub will fail topics.publish operations on this topic and subscribe operations on any subscription attached to this topic in any region that is not in allowedPersistenceRegions.
AllowedPersistenceRegions This property is required. []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.
EnforceInTransit bool
If true, allowedPersistenceRegions is also used to enforce in-transit guarantees for messages. That is, Pub/Sub will fail topics.publish operations on this topic and subscribe operations on any subscription attached to this topic in any region that is not in allowedPersistenceRegions.
allowedPersistenceRegions This property is required. 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.
enforceInTransit Boolean
If true, allowedPersistenceRegions is also used to enforce in-transit guarantees for messages. That is, Pub/Sub will fail topics.publish operations on this topic and subscribe operations on any subscription attached to this topic in any region that is not in allowedPersistenceRegions.
allowedPersistenceRegions This property is required. 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.
enforceInTransit boolean
If true, allowedPersistenceRegions is also used to enforce in-transit guarantees for messages. That is, Pub/Sub will fail topics.publish operations on this topic and subscribe operations on any subscription attached to this topic in any region that is not in allowedPersistenceRegions.
allowed_persistence_regions This property is required. 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.
enforce_in_transit bool
If true, allowedPersistenceRegions is also used to enforce in-transit guarantees for messages. That is, Pub/Sub will fail topics.publish operations on this topic and subscribe operations on any subscription attached to this topic in any region that is not in allowedPersistenceRegions.
allowedPersistenceRegions This property is required. 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.
enforceInTransit Boolean
If true, allowedPersistenceRegions is also used to enforce in-transit guarantees for messages. That is, Pub/Sub will fail topics.publish operations on this topic and subscribe operations on any subscription attached to this topic in any region that is not in allowedPersistenceRegions.

TopicSchemaSettings
, TopicSchemaSettingsArgs

Schema This property is required. string
The name of the schema that messages published should be validated against. Format is projects/{project}/schemas/{schema}. The value of this field will be deleted-schema if the schema has been deleted.
Encoding string
The encoding of messages validated against schema. Default value is ENCODING_UNSPECIFIED. Possible values are: ENCODING_UNSPECIFIED, JSON, BINARY.
Schema This property is required. string
The name of the schema that messages published should be validated against. Format is projects/{project}/schemas/{schema}. The value of this field will be deleted-schema if the schema has been deleted.
Encoding string
The encoding of messages validated against schema. Default value is ENCODING_UNSPECIFIED. Possible values are: ENCODING_UNSPECIFIED, JSON, BINARY.
schema This property is required. String
The name of the schema that messages published should be validated against. Format is projects/{project}/schemas/{schema}. The value of this field will be deleted-schema if the schema has been deleted.
encoding String
The encoding of messages validated against schema. Default value is ENCODING_UNSPECIFIED. Possible values are: ENCODING_UNSPECIFIED, JSON, BINARY.
schema This property is required. string
The name of the schema that messages published should be validated against. Format is projects/{project}/schemas/{schema}. The value of this field will be deleted-schema if the schema has been deleted.
encoding string
The encoding of messages validated against schema. Default value is ENCODING_UNSPECIFIED. Possible values are: ENCODING_UNSPECIFIED, JSON, BINARY.
schema This property is required. str
The name of the schema that messages published should be validated against. Format is projects/{project}/schemas/{schema}. The value of this field will be deleted-schema if the schema has been deleted.
encoding str
The encoding of messages validated against schema. Default value is ENCODING_UNSPECIFIED. Possible values are: ENCODING_UNSPECIFIED, JSON, BINARY.
schema This property is required. String
The name of the schema that messages published should be validated against. Format is projects/{project}/schemas/{schema}. The value of this field will be deleted-schema if the schema has been deleted.
encoding 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}}
Copy
$ pulumi import gcp:pubsub/topic:Topic default {{project}}/{{name}}
Copy
$ pulumi import gcp:pubsub/topic:Topic default {{name}}
Copy

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.