
com.pulumi.gcp.pubsub.kotlin.TopicArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-gcp-kotlin Show documentation
Show all versions of pulumi-gcp-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.gcp.pubsub.kotlin
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.pubsub.TopicArgs.builder
import com.pulumi.gcp.pubsub.kotlin.inputs.TopicIngestionDataSourceSettingsArgs
import com.pulumi.gcp.pubsub.kotlin.inputs.TopicIngestionDataSourceSettingsArgsBuilder
import com.pulumi.gcp.pubsub.kotlin.inputs.TopicMessageStoragePolicyArgs
import com.pulumi.gcp.pubsub.kotlin.inputs.TopicMessageStoragePolicyArgsBuilder
import com.pulumi.gcp.pubsub.kotlin.inputs.TopicSchemaSettingsArgs
import com.pulumi.gcp.pubsub.kotlin.inputs.TopicSchemaSettingsArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.jvm.JvmName
/**
* A named resource to which messages are sent by publishers.
* To get more information about Topic, see:
* * [API documentation](https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics)
* * How-to Guides
* * [Managing Topics](https://cloud.google.com/pubsub/docs/admin#managing_topics)
* > **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
*
* ```typescript
* 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",
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* example = gcp.pubsub.Topic("example",
* name="example-topic",
* labels={
* "foo": "bar",
* },
* message_retention_duration="86600s")
* ```
* ```csharp
* 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",
* });
* });
* ```
* ```go
* 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
* })
* }
* ```
* ```java
* 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());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: gcp:pubsub:Topic
* properties:
* name: example-topic
* labels:
* foo: bar
* messageRetentionDuration: 86600s
* ```
*
* ### Pubsub Topic Cmek
*
* ```typescript
* 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,
* });
* ```
* ```python
* 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)
* ```
* ```csharp
* 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,
* });
* });
* ```
* ```go
* 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
* })
* }
* ```
* ```java
* 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());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: gcp:pubsub:Topic
* properties:
* name: example-topic
* kmsKeyName: ${cryptoKey.id}
* cryptoKey:
* type: gcp:kms:CryptoKey
* name: crypto_key
* properties:
* name: example-key
* keyRing: ${keyRing.id}
* keyRing:
* type: gcp:kms:KeyRing
* name: key_ring
* properties:
* name: example-keyring
* location: global
* ```
*
* ### Pubsub Topic Geo Restricted
*
* ```typescript
* 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"],
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* example = gcp.pubsub.Topic("example",
* name="example-topic",
* message_storage_policy={
* "allowed_persistence_regions": ["europe-west3"],
* })
* ```
* ```csharp
* 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",
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/pubsub"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := pubsub.NewTopic(ctx, "example", &pubsub.TopicArgs{
* Name: pulumi.String("example-topic"),
* MessageStoragePolicy: &pubsub.TopicMessageStoragePolicyArgs{
* AllowedPersistenceRegions: pulumi.StringArray{
* pulumi.String("europe-west3"),
* },
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.pubsub.Topic;
* import com.pulumi.gcp.pubsub.TopicArgs;
* import com.pulumi.gcp.pubsub.inputs.TopicMessageStoragePolicyArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* var example = new Topic("example", TopicArgs.builder()
* .name("example-topic")
* .messageStoragePolicy(TopicMessageStoragePolicyArgs.builder()
* .allowedPersistenceRegions("europe-west3")
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: gcp:pubsub:Topic
* properties:
* name: example-topic
* messageStoragePolicy:
* allowedPersistenceRegions:
* - europe-west3
* ```
*
* ### Pubsub Topic Schema Settings
*
* ```typescript
* 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],
* });
* ```
* ```python
* 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]))
* ```
* ```csharp
* 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,
* },
* });
* });
* ```
* ```go
* 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
* })
* }
* ```
* ```java
* 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());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: gcp:pubsub:Schema
* properties:
* name: example
* type: AVRO
* definition: |
* {
* "type" : "record",
* "name" : "Avro",
* "fields" : [
* {
* "name" : "StringField",
* "type" : "string"
* },
* {
* "name" : "IntField",
* "type" : "int"
* }
* ]
* }
* exampleTopic:
* type: gcp:pubsub:Topic
* name: example
* properties:
* name: example-topic
* schemaSettings:
* schema: projects/my-project-name/schemas/example
* encoding: JSON
* options:
* dependsOn:
* - ${example}
* ```
*
* ### Pubsub Topic Ingestion Kinesis
*
* ```typescript
* 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: "[email protected]",
* },
* },
* });
* ```
* ```python
* 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": "[email protected]",
* },
* })
* ```
* ```csharp
* 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 = "[email protected]",
* },
* },
* });
* });
* ```
* ```go
* 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("[email protected]"),
* },
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* 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("[email protected]")
* .build())
* .build())
* .build());
* }
* }
* ```
* ```yaml
* 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: [email protected]
* ```
*
* ### Pubsub Topic Ingestion Cloud Storage
*
* ```typescript
* 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",
* },
* },
* });
* ```
* ```python
* 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",
* },
* })
* ```
* ```csharp
* 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",
* },
* },
* });
* });
* ```
* ```go
* 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
* })
* }
* ```
* ```java
* 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());
* }
* }
* ```
* ```yaml
* 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
* ```
*
* ## 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:
* ```sh
* $ pulumi import gcp:pubsub/topic:Topic default projects/{{project}}/topics/{{name}}
* ```
* ```sh
* $ pulumi import gcp:pubsub/topic:Topic default {{project}}/{{name}}
* ```
* ```sh
* $ pulumi import gcp:pubsub/topic:Topic default {{name}}
* ```
* @property ingestionDataSourceSettings Settings for ingestion from a data source into this topic.
* Structure is documented below.
* @property kmsKeyName 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/*`
* @property labels 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.
* @property messageRetentionDuration 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.
* @property messageStoragePolicy 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.
* @property name Name of the topic.
* - - -
* @property project The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
* @property schemaSettings Settings for validating messages published against a schema.
* Structure is documented below.
* */*/*/*/*/*/*/*/*/*/
*/
public data class TopicArgs(
public val ingestionDataSourceSettings: Output? = null,
public val kmsKeyName: Output? = null,
public val labels: Output
© 2015 - 2025 Weber Informatics LLC | Privacy Policy