gcp.pubsub.Topic
Explore with Pulumi AI
A named resource to which messages are sent by publishers.
To get more information about Topic, see:
- API documentation
- How-to Guides
Note: You can retrieve the email of the Google Managed Pub/Sub Service Account used for forwarding by using the
gcp.projects.ServiceIdentity
resource.
Example Usage
Pubsub Topic Basic
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const example = new gcp.pubsub.Topic("example", {
name: "example-topic",
labels: {
foo: "bar",
},
messageRetentionDuration: "86600s",
});
import pulumi
import pulumi_gcp as gcp
example = gcp.pubsub.Topic("example",
name="example-topic",
labels={
"foo": "bar",
},
message_retention_duration="86600s")
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/pubsub"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := pubsub.NewTopic(ctx, "example", &pubsub.TopicArgs{
Name: pulumi.String("example-topic"),
Labels: pulumi.StringMap{
"foo": pulumi.String("bar"),
},
MessageRetentionDuration: pulumi.String("86600s"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var example = new Gcp.PubSub.Topic("example", new()
{
Name = "example-topic",
Labels =
{
{ "foo", "bar" },
},
MessageRetentionDuration = "86600s",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.pubsub.Topic;
import com.pulumi.gcp.pubsub.TopicArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new Topic("example", TopicArgs.builder()
.name("example-topic")
.labels(Map.of("foo", "bar"))
.messageRetentionDuration("86600s")
.build());
}
}
resources:
example:
type: gcp:pubsub:Topic
properties:
name: example-topic
labels:
foo: bar
messageRetentionDuration: 86600s
Pubsub Topic Cmek
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const keyRing = new gcp.kms.KeyRing("key_ring", {
name: "example-keyring",
location: "global",
});
const cryptoKey = new gcp.kms.CryptoKey("crypto_key", {
name: "example-key",
keyRing: keyRing.id,
});
const example = new gcp.pubsub.Topic("example", {
name: "example-topic",
kmsKeyName: cryptoKey.id,
});
import pulumi
import pulumi_gcp as gcp
key_ring = gcp.kms.KeyRing("key_ring",
name="example-keyring",
location="global")
crypto_key = gcp.kms.CryptoKey("crypto_key",
name="example-key",
key_ring=key_ring.id)
example = gcp.pubsub.Topic("example",
name="example-topic",
kms_key_name=crypto_key.id)
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/kms"
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/pubsub"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
keyRing, err := kms.NewKeyRing(ctx, "key_ring", &kms.KeyRingArgs{
Name: pulumi.String("example-keyring"),
Location: pulumi.String("global"),
})
if err != nil {
return err
}
cryptoKey, err := kms.NewCryptoKey(ctx, "crypto_key", &kms.CryptoKeyArgs{
Name: pulumi.String("example-key"),
KeyRing: keyRing.ID(),
})
if err != nil {
return err
}
_, err = pubsub.NewTopic(ctx, "example", &pubsub.TopicArgs{
Name: pulumi.String("example-topic"),
KmsKeyName: cryptoKey.ID(),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var keyRing = new Gcp.Kms.KeyRing("key_ring", new()
{
Name = "example-keyring",
Location = "global",
});
var cryptoKey = new Gcp.Kms.CryptoKey("crypto_key", new()
{
Name = "example-key",
KeyRing = keyRing.Id,
});
var example = new Gcp.PubSub.Topic("example", new()
{
Name = "example-topic",
KmsKeyName = cryptoKey.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.kms.KeyRing;
import com.pulumi.gcp.kms.KeyRingArgs;
import com.pulumi.gcp.kms.CryptoKey;
import com.pulumi.gcp.kms.CryptoKeyArgs;
import com.pulumi.gcp.pubsub.Topic;
import com.pulumi.gcp.pubsub.TopicArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var keyRing = new KeyRing("keyRing", KeyRingArgs.builder()
.name("example-keyring")
.location("global")
.build());
var cryptoKey = new CryptoKey("cryptoKey", CryptoKeyArgs.builder()
.name("example-key")
.keyRing(keyRing.id())
.build());
var example = new Topic("example", TopicArgs.builder()
.name("example-topic")
.kmsKeyName(cryptoKey.id())
.build());
}
}
resources:
example:
type: gcp:pubsub:Topic
properties:
name: example-topic
kmsKeyName: ${cryptoKey.id}
cryptoKey:
type: gcp:kms:CryptoKey
name: crypto_key
properties:
name: example-key
keyRing: ${keyRing.id}
keyRing:
type: gcp:kms:KeyRing
name: key_ring
properties:
name: example-keyring
location: global
Pubsub Topic Geo Restricted
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const example = new gcp.pubsub.Topic("example", {
name: "example-topic",
messageStoragePolicy: {
allowedPersistenceRegions: ["europe-west3"],
},
});
import pulumi
import pulumi_gcp as gcp
example = gcp.pubsub.Topic("example",
name="example-topic",
message_storage_policy=gcp.pubsub.TopicMessageStoragePolicyArgs(
allowed_persistence_regions=["europe-west3"],
))
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/pubsub"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := pubsub.NewTopic(ctx, "example", &pubsub.TopicArgs{
Name: pulumi.String("example-topic"),
MessageStoragePolicy: &pubsub.TopicMessageStoragePolicyArgs{
AllowedPersistenceRegions: pulumi.StringArray{
pulumi.String("europe-west3"),
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var example = new Gcp.PubSub.Topic("example", new()
{
Name = "example-topic",
MessageStoragePolicy = new Gcp.PubSub.Inputs.TopicMessageStoragePolicyArgs
{
AllowedPersistenceRegions = new[]
{
"europe-west3",
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.pubsub.Topic;
import com.pulumi.gcp.pubsub.TopicArgs;
import com.pulumi.gcp.pubsub.inputs.TopicMessageStoragePolicyArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new Topic("example", TopicArgs.builder()
.name("example-topic")
.messageStoragePolicy(TopicMessageStoragePolicyArgs.builder()
.allowedPersistenceRegions("europe-west3")
.build())
.build());
}
}
resources:
example:
type: gcp:pubsub:Topic
properties:
name: example-topic
messageStoragePolicy:
allowedPersistenceRegions:
- europe-west3
Pubsub Topic Schema Settings
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const example = new gcp.pubsub.Schema("example", {
name: "example",
type: "AVRO",
definition: `{
"type" : "record",
"name" : "Avro",
"fields" : [
{
"name" : "StringField",
"type" : "string"
},
{
"name" : "IntField",
"type" : "int"
}
]
}
`,
});
const exampleTopic = new gcp.pubsub.Topic("example", {
name: "example-topic",
schemaSettings: {
schema: "projects/my-project-name/schemas/example",
encoding: "JSON",
},
}, {
dependsOn: [example],
});
import pulumi
import pulumi_gcp as gcp
example = gcp.pubsub.Schema("example",
name="example",
type="AVRO",
definition="""{
"type" : "record",
"name" : "Avro",
"fields" : [
{
"name" : "StringField",
"type" : "string"
},
{
"name" : "IntField",
"type" : "int"
}
]
}
""")
example_topic = gcp.pubsub.Topic("example",
name="example-topic",
schema_settings=gcp.pubsub.TopicSchemaSettingsArgs(
schema="projects/my-project-name/schemas/example",
encoding="JSON",
),
opts = pulumi.ResourceOptions(depends_on=[example]))
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/pubsub"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := pubsub.NewSchema(ctx, "example", &pubsub.SchemaArgs{
Name: pulumi.String("example"),
Type: pulumi.String("AVRO"),
Definition: pulumi.String(`{
"type" : "record",
"name" : "Avro",
"fields" : [
{
"name" : "StringField",
"type" : "string"
},
{
"name" : "IntField",
"type" : "int"
}
]
}
`),
})
if err != nil {
return err
}
_, err = pubsub.NewTopic(ctx, "example", &pubsub.TopicArgs{
Name: pulumi.String("example-topic"),
SchemaSettings: &pubsub.TopicSchemaSettingsArgs{
Schema: pulumi.String("projects/my-project-name/schemas/example"),
Encoding: pulumi.String("JSON"),
},
}, pulumi.DependsOn([]pulumi.Resource{
example,
}))
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var example = new Gcp.PubSub.Schema("example", new()
{
Name = "example",
Type = "AVRO",
Definition = @"{
""type"" : ""record"",
""name"" : ""Avro"",
""fields"" : [
{
""name"" : ""StringField"",
""type"" : ""string""
},
{
""name"" : ""IntField"",
""type"" : ""int""
}
]
}
",
});
var exampleTopic = new Gcp.PubSub.Topic("example", new()
{
Name = "example-topic",
SchemaSettings = new Gcp.PubSub.Inputs.TopicSchemaSettingsArgs
{
Schema = "projects/my-project-name/schemas/example",
Encoding = "JSON",
},
}, new CustomResourceOptions
{
DependsOn =
{
example,
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.pubsub.Schema;
import com.pulumi.gcp.pubsub.SchemaArgs;
import com.pulumi.gcp.pubsub.Topic;
import com.pulumi.gcp.pubsub.TopicArgs;
import com.pulumi.gcp.pubsub.inputs.TopicSchemaSettingsArgs;
import com.pulumi.resources.CustomResourceOptions;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new Schema("example", SchemaArgs.builder()
.name("example")
.type("AVRO")
.definition("""
{
"type" : "record",
"name" : "Avro",
"fields" : [
{
"name" : "StringField",
"type" : "string"
},
{
"name" : "IntField",
"type" : "int"
}
]
}
""")
.build());
var exampleTopic = new Topic("exampleTopic", TopicArgs.builder()
.name("example-topic")
.schemaSettings(TopicSchemaSettingsArgs.builder()
.schema("projects/my-project-name/schemas/example")
.encoding("JSON")
.build())
.build(), CustomResourceOptions.builder()
.dependsOn(example)
.build());
}
}
resources:
example:
type: gcp:pubsub:Schema
properties:
name: example
type: AVRO
definition: |
{
"type" : "record",
"name" : "Avro",
"fields" : [
{
"name" : "StringField",
"type" : "string"
},
{
"name" : "IntField",
"type" : "int"
}
]
}
exampleTopic:
type: gcp:pubsub:Topic
name: example
properties:
name: example-topic
schemaSettings:
schema: projects/my-project-name/schemas/example
encoding: JSON
options:
dependson:
- ${example}
Pubsub Topic Ingestion Kinesis
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const example = new gcp.pubsub.Topic("example", {
name: "example-topic",
ingestionDataSourceSettings: {
awsKinesis: {
streamArn: "arn:aws:kinesis:us-west-2:111111111111:stream/fake-stream-name",
consumerArn: "arn:aws:kinesis:us-west-2:111111111111:stream/fake-stream-name/consumer/consumer-1:1111111111",
awsRoleArn: "arn:aws:iam::111111111111:role/fake-role-name",
gcpServiceAccount: "fake-service-account@fake-gcp-project.iam.gserviceaccount.com",
},
},
});
import pulumi
import pulumi_gcp as gcp
example = gcp.pubsub.Topic("example",
name="example-topic",
ingestion_data_source_settings=gcp.pubsub.TopicIngestionDataSourceSettingsArgs(
aws_kinesis=gcp.pubsub.TopicIngestionDataSourceSettingsAwsKinesisArgs(
stream_arn="arn:aws:kinesis:us-west-2:111111111111:stream/fake-stream-name",
consumer_arn="arn:aws:kinesis:us-west-2:111111111111:stream/fake-stream-name/consumer/consumer-1:1111111111",
aws_role_arn="arn:aws:iam::111111111111:role/fake-role-name",
gcp_service_account="fake-service-account@fake-gcp-project.iam.gserviceaccount.com",
),
))
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/pubsub"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := pubsub.NewTopic(ctx, "example", &pubsub.TopicArgs{
Name: pulumi.String("example-topic"),
IngestionDataSourceSettings: &pubsub.TopicIngestionDataSourceSettingsArgs{
AwsKinesis: &pubsub.TopicIngestionDataSourceSettingsAwsKinesisArgs{
StreamArn: pulumi.String("arn:aws:kinesis:us-west-2:111111111111:stream/fake-stream-name"),
ConsumerArn: pulumi.String("arn:aws:kinesis:us-west-2:111111111111:stream/fake-stream-name/consumer/consumer-1:1111111111"),
AwsRoleArn: pulumi.String("arn:aws:iam::111111111111:role/fake-role-name"),
GcpServiceAccount: pulumi.String("fake-service-account@fake-gcp-project.iam.gserviceaccount.com"),
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var example = new Gcp.PubSub.Topic("example", new()
{
Name = "example-topic",
IngestionDataSourceSettings = new Gcp.PubSub.Inputs.TopicIngestionDataSourceSettingsArgs
{
AwsKinesis = new Gcp.PubSub.Inputs.TopicIngestionDataSourceSettingsAwsKinesisArgs
{
StreamArn = "arn:aws:kinesis:us-west-2:111111111111:stream/fake-stream-name",
ConsumerArn = "arn:aws:kinesis:us-west-2:111111111111:stream/fake-stream-name/consumer/consumer-1:1111111111",
AwsRoleArn = "arn:aws:iam::111111111111:role/fake-role-name",
GcpServiceAccount = "fake-service-account@fake-gcp-project.iam.gserviceaccount.com",
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.pubsub.Topic;
import com.pulumi.gcp.pubsub.TopicArgs;
import com.pulumi.gcp.pubsub.inputs.TopicIngestionDataSourceSettingsArgs;
import com.pulumi.gcp.pubsub.inputs.TopicIngestionDataSourceSettingsAwsKinesisArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new Topic("example", TopicArgs.builder()
.name("example-topic")
.ingestionDataSourceSettings(TopicIngestionDataSourceSettingsArgs.builder()
.awsKinesis(TopicIngestionDataSourceSettingsAwsKinesisArgs.builder()
.streamArn("arn:aws:kinesis:us-west-2:111111111111:stream/fake-stream-name")
.consumerArn("arn:aws:kinesis:us-west-2:111111111111:stream/fake-stream-name/consumer/consumer-1:1111111111")
.awsRoleArn("arn:aws:iam::111111111111:role/fake-role-name")
.gcpServiceAccount("fake-service-account@fake-gcp-project.iam.gserviceaccount.com")
.build())
.build())
.build());
}
}
resources:
example:
type: gcp:pubsub:Topic
properties:
name: example-topic
ingestionDataSourceSettings:
awsKinesis:
streamArn: arn:aws:kinesis:us-west-2:111111111111:stream/fake-stream-name
consumerArn: arn:aws:kinesis:us-west-2:111111111111:stream/fake-stream-name/consumer/consumer-1:1111111111
awsRoleArn: arn:aws:iam::111111111111:role/fake-role-name
gcpServiceAccount: fake-service-account@fake-gcp-project.iam.gserviceaccount.com
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)
type: gcp:pubsub:Topic
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args TopicArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args TopicArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args TopicArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args TopicArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args TopicArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var gcpTopicResource = new Gcp.PubSub.Topic("gcpTopicResource", new()
{
IngestionDataSourceSettings = new Gcp.PubSub.Inputs.TopicIngestionDataSourceSettingsArgs
{
AwsKinesis = new Gcp.PubSub.Inputs.TopicIngestionDataSourceSettingsAwsKinesisArgs
{
AwsRoleArn = "string",
ConsumerArn = "string",
GcpServiceAccount = "string",
StreamArn = "string",
},
},
KmsKeyName = "string",
Labels =
{
{ "string", "string" },
},
MessageRetentionDuration = "string",
MessageStoragePolicy = new Gcp.PubSub.Inputs.TopicMessageStoragePolicyArgs
{
AllowedPersistenceRegions = new[]
{
"string",
},
},
Name = "string",
Project = "string",
SchemaSettings = new Gcp.PubSub.Inputs.TopicSchemaSettingsArgs
{
Schema = "string",
Encoding = "string",
},
});
example, err := pubsub.NewTopic(ctx, "gcpTopicResource", &pubsub.TopicArgs{
IngestionDataSourceSettings: &pubsub.TopicIngestionDataSourceSettingsArgs{
AwsKinesis: &pubsub.TopicIngestionDataSourceSettingsAwsKinesisArgs{
AwsRoleArn: pulumi.String("string"),
ConsumerArn: pulumi.String("string"),
GcpServiceAccount: pulumi.String("string"),
StreamArn: pulumi.String("string"),
},
},
KmsKeyName: pulumi.String("string"),
Labels: pulumi.StringMap{
"string": pulumi.String("string"),
},
MessageRetentionDuration: pulumi.String("string"),
MessageStoragePolicy: &pubsub.TopicMessageStoragePolicyArgs{
AllowedPersistenceRegions: pulumi.StringArray{
pulumi.String("string"),
},
},
Name: pulumi.String("string"),
Project: pulumi.String("string"),
SchemaSettings: &pubsub.TopicSchemaSettingsArgs{
Schema: pulumi.String("string"),
Encoding: pulumi.String("string"),
},
})
var gcpTopicResource = new Topic("gcpTopicResource", TopicArgs.builder()
.ingestionDataSourceSettings(TopicIngestionDataSourceSettingsArgs.builder()
.awsKinesis(TopicIngestionDataSourceSettingsAwsKinesisArgs.builder()
.awsRoleArn("string")
.consumerArn("string")
.gcpServiceAccount("string")
.streamArn("string")
.build())
.build())
.kmsKeyName("string")
.labels(Map.of("string", "string"))
.messageRetentionDuration("string")
.messageStoragePolicy(TopicMessageStoragePolicyArgs.builder()
.allowedPersistenceRegions("string")
.build())
.name("string")
.project("string")
.schemaSettings(TopicSchemaSettingsArgs.builder()
.schema("string")
.encoding("string")
.build())
.build());
gcp_topic_resource = gcp.pubsub.Topic("gcpTopicResource",
ingestion_data_source_settings=gcp.pubsub.TopicIngestionDataSourceSettingsArgs(
aws_kinesis=gcp.pubsub.TopicIngestionDataSourceSettingsAwsKinesisArgs(
aws_role_arn="string",
consumer_arn="string",
gcp_service_account="string",
stream_arn="string",
),
),
kms_key_name="string",
labels={
"string": "string",
},
message_retention_duration="string",
message_storage_policy=gcp.pubsub.TopicMessageStoragePolicyArgs(
allowed_persistence_regions=["string"],
),
name="string",
project="string",
schema_settings=gcp.pubsub.TopicSchemaSettingsArgs(
schema="string",
encoding="string",
))
const gcpTopicResource = new gcp.pubsub.Topic("gcpTopicResource", {
ingestionDataSourceSettings: {
awsKinesis: {
awsRoleArn: "string",
consumerArn: "string",
gcpServiceAccount: "string",
streamArn: "string",
},
},
kmsKeyName: "string",
labels: {
string: "string",
},
messageRetentionDuration: "string",
messageStoragePolicy: {
allowedPersistenceRegions: ["string"],
},
name: "string",
project: "string",
schemaSettings: {
schema: "string",
encoding: "string",
},
});
type: gcp:pubsub:Topic
properties:
ingestionDataSourceSettings:
awsKinesis:
awsRoleArn: string
consumerArn: string
gcpServiceAccount: string
streamArn: string
kmsKeyName: string
labels:
string: string
messageRetentionDuration: string
messageStoragePolicy:
allowedPersistenceRegions:
- string
name: string
project: string
schemaSettings:
encoding: string
schema: string
Topic Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The Topic resource accepts the following input properties:
- Ingestion
Data TopicSource Settings Ingestion Data Source Settings - Settings for ingestion from a data source into this topic. Structure is documented below.
- Kms
Key stringName - 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 haveroles/cloudkms.cryptoKeyEncrypterDecrypter
to use this feature. The expected format isprojects/*/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.- Message
Retention stringDuration - 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 TopicPolicy Message Storage Policy - Policy constraining the set of Google Cloud Platform regions where messages published to the topic may be stored. If not present, then no constraints are in effect. Structure is documented below.
- Name string
- Name of the topic.
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Schema
Settings TopicSchema Settings - Settings for validating messages published against a schema. Structure is documented below.
- Ingestion
Data TopicSource Settings Ingestion Data Source Settings Args - Settings for ingestion from a data source into this topic. Structure is documented below.
- Kms
Key stringName - 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 haveroles/cloudkms.cryptoKeyEncrypterDecrypter
to use this feature. The expected format isprojects/*/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.- Message
Retention stringDuration - 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 TopicPolicy Message Storage Policy Args - Policy constraining the set of Google Cloud Platform regions where messages published to the topic may be stored. If not present, then no constraints are in effect. Structure is documented below.
- Name string
- Name of the topic.
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Schema
Settings TopicSchema Settings Args - Settings for validating messages published against a schema. Structure is documented below.
- ingestion
Data TopicSource Settings Ingestion Data Source Settings - Settings for ingestion from a data source into this topic. Structure is documented below.
- kms
Key StringName - 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 haveroles/cloudkms.cryptoKeyEncrypterDecrypter
to use this feature. The expected format isprojects/*/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.- message
Retention StringDuration - 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 TopicPolicy Message Storage Policy - Policy constraining the set of Google Cloud Platform regions where messages published to the topic may be stored. If not present, then no constraints are in effect. Structure is documented below.
- name String
- Name of the topic.
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- schema
Settings TopicSchema Settings - Settings for validating messages published against a schema. Structure is documented below.
- ingestion
Data TopicSource Settings Ingestion Data Source Settings - Settings for ingestion from a data source into this topic. Structure is documented below.
- kms
Key stringName - 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 haveroles/cloudkms.cryptoKeyEncrypterDecrypter
to use this feature. The expected format isprojects/*/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.- message
Retention stringDuration - 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 TopicPolicy Message Storage Policy - Policy constraining the set of Google Cloud Platform regions where messages published to the topic may be stored. If not present, then no constraints are in effect. Structure is documented below.
- name string
- Name of the topic.
- project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- schema
Settings TopicSchema Settings - Settings for validating messages published against a schema. Structure is documented below.
- ingestion_
data_ Topicsource_ settings Ingestion Data Source Settings Args - Settings for ingestion from a data source into this topic. Structure is documented below.
- kms_
key_ strname - 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 haveroles/cloudkms.cryptoKeyEncrypterDecrypter
to use this feature. The expected format isprojects/*/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_ strduration - 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_ Topicpolicy Message Storage Policy Args - Policy constraining the set of Google Cloud Platform regions where messages published to the topic may be stored. If not present, then no constraints are in effect. Structure is documented below.
- name str
- Name of the topic.
- project str
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- schema_
settings TopicSchema Settings Args - Settings for validating messages published against a schema. Structure is documented below.
- ingestion
Data Property MapSource Settings - Settings for ingestion from a data source into this topic. Structure is documented below.
- kms
Key StringName - 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 haveroles/cloudkms.cryptoKeyEncrypterDecrypter
to use this feature. The expected format isprojects/*/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.- message
Retention StringDuration - 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 Property MapPolicy - Policy constraining the set of Google Cloud Platform regions where messages published to the topic may be stored. If not present, then no constraints are in effect. Structure is documented below.
- name String
- Name of the topic.
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- schema
Settings 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:
- Effective
Labels 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.
- Pulumi
Labels Dictionary<string, string> - The combination of labels configured directly on the resource and default labels configured on the provider.
- Effective
Labels 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.
- Pulumi
Labels map[string]string - The combination of labels configured directly on the resource and default labels configured on the provider.
- effective
Labels 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.
- pulumi
Labels Map<String,String> - The combination of labels configured directly on the resource and default labels configured on the provider.
- effective
Labels {[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.
- pulumi
Labels {[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.
- effective
Labels 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.
- pulumi
Labels Map<String> - The combination of labels configured directly on the resource and default labels configured on the provider.
Look up Existing Topic Resource
Get an existing Topic resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: TopicState, opts?: CustomResourceOptions): Topic
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
effective_labels: Optional[Mapping[str, str]] = None,
ingestion_data_source_settings: Optional[TopicIngestionDataSourceSettingsArgs] = None,
kms_key_name: Optional[str] = None,
labels: Optional[Mapping[str, str]] = None,
message_retention_duration: Optional[str] = None,
message_storage_policy: Optional[TopicMessageStoragePolicyArgs] = None,
name: Optional[str] = None,
project: Optional[str] = None,
pulumi_labels: Optional[Mapping[str, str]] = None,
schema_settings: Optional[TopicSchemaSettingsArgs] = None) -> Topic
func GetTopic(ctx *Context, name string, id IDInput, state *TopicState, opts ...ResourceOption) (*Topic, error)
public static Topic Get(string name, Input<string> id, TopicState? state, CustomResourceOptions? opts = null)
public static Topic get(String name, Output<String> id, TopicState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Effective
Labels 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.
- Ingestion
Data TopicSource Settings Ingestion Data Source Settings - Settings for ingestion from a data source into this topic. Structure is documented below.
- Kms
Key stringName - 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 haveroles/cloudkms.cryptoKeyEncrypterDecrypter
to use this feature. The expected format isprojects/*/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.- Message
Retention stringDuration - 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 TopicPolicy Message Storage Policy - Policy constraining the set of Google Cloud Platform regions where messages published to the topic may be stored. If not present, then no constraints are in effect. Structure is documented below.
- Name string
- Name of the topic.
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Pulumi
Labels Dictionary<string, string> - The combination of labels configured directly on the resource and default labels configured on the provider.
- Schema
Settings TopicSchema Settings - Settings for validating messages published against a schema. Structure is documented below.
- Effective
Labels 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.
- Ingestion
Data TopicSource Settings Ingestion Data Source Settings Args - Settings for ingestion from a data source into this topic. Structure is documented below.
- Kms
Key stringName - 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 haveroles/cloudkms.cryptoKeyEncrypterDecrypter
to use this feature. The expected format isprojects/*/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.- Message
Retention stringDuration - 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 TopicPolicy Message Storage Policy Args - Policy constraining the set of Google Cloud Platform regions where messages published to the topic may be stored. If not present, then no constraints are in effect. Structure is documented below.
- Name string
- Name of the topic.
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Pulumi
Labels map[string]string - The combination of labels configured directly on the resource and default labels configured on the provider.
- Schema
Settings TopicSchema Settings Args - Settings for validating messages published against a schema. Structure is documented below.
- effective
Labels 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.
- ingestion
Data TopicSource Settings Ingestion Data Source Settings - Settings for ingestion from a data source into this topic. Structure is documented below.
- kms
Key StringName - 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 haveroles/cloudkms.cryptoKeyEncrypterDecrypter
to use this feature. The expected format isprojects/*/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.- message
Retention StringDuration - 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 TopicPolicy Message Storage Policy - Policy constraining the set of Google Cloud Platform regions where messages published to the topic may be stored. If not present, then no constraints are in effect. Structure is documented below.
- name String
- Name of the topic.
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- pulumi
Labels Map<String,String> - The combination of labels configured directly on the resource and default labels configured on the provider.
- schema
Settings TopicSchema Settings - Settings for validating messages published against a schema. Structure is documented below.
- effective
Labels {[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.
- ingestion
Data TopicSource Settings Ingestion Data Source Settings - Settings for ingestion from a data source into this topic. Structure is documented below.
- kms
Key stringName - 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 haveroles/cloudkms.cryptoKeyEncrypterDecrypter
to use this feature. The expected format isprojects/*/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.- message
Retention stringDuration - 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 TopicPolicy Message Storage Policy - Policy constraining the set of Google Cloud Platform regions where messages published to the topic may be stored. If not present, then no constraints are in effect. Structure is documented below.
- name string
- Name of the topic.
- project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- pulumi
Labels {[key: string]: string} - The combination of labels configured directly on the resource and default labels configured on the provider.
- schema
Settings TopicSchema Settings - 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_ Topicsource_ settings Ingestion Data Source Settings Args - Settings for ingestion from a data source into this topic. Structure is documented below.
- kms_
key_ strname - 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 haveroles/cloudkms.cryptoKeyEncrypterDecrypter
to use this feature. The expected format isprojects/*/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_ strduration - 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_ Topicpolicy Message Storage Policy Args - Policy constraining the set of Google Cloud Platform regions where messages published to the topic may be stored. If not present, then no constraints are in effect. Structure is documented below.
- name str
- Name of the topic.
- project str
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- pulumi_
labels Mapping[str, str] - The combination of labels configured directly on the resource and default labels configured on the provider.
- schema_
settings TopicSchema Settings Args - Settings for validating messages published against a schema. Structure is documented below.
- effective
Labels Map<String> - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- ingestion
Data Property MapSource Settings - Settings for ingestion from a data source into this topic. Structure is documented below.
- kms
Key StringName - 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 haveroles/cloudkms.cryptoKeyEncrypterDecrypter
to use this feature. The expected format isprojects/*/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.- message
Retention StringDuration - 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 Property MapPolicy - Policy constraining the set of Google Cloud Platform regions where messages published to the topic may be stored. If not present, then no constraints are in effect. Structure is documented below.
- name String
- Name of the topic.
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- pulumi
Labels Map<String> - The combination of labels configured directly on the resource and default labels configured on the provider.
- schema
Settings Property Map - Settings for validating messages published against a schema. Structure is documented below.
Supporting Types
TopicIngestionDataSourceSettings, TopicIngestionDataSourceSettingsArgs
- Aws
Kinesis TopicIngestion Data Source Settings Aws Kinesis - Settings for ingestion from Amazon Kinesis Data Streams. Structure is documented below.
- Aws
Kinesis TopicIngestion Data Source Settings Aws Kinesis - Settings for ingestion from Amazon Kinesis Data Streams. Structure is documented below.
- aws
Kinesis TopicIngestion Data Source Settings Aws Kinesis - Settings for ingestion from Amazon Kinesis Data Streams. Structure is documented below.
- aws
Kinesis TopicIngestion Data Source Settings Aws Kinesis - Settings for ingestion from Amazon Kinesis Data Streams. Structure is documented below.
- aws_
kinesis TopicIngestion Data Source Settings Aws Kinesis - Settings for ingestion from Amazon Kinesis Data Streams. Structure is documented below.
- aws
Kinesis Property Map - Settings for ingestion from Amazon Kinesis Data Streams. Structure is documented below.
TopicIngestionDataSourceSettingsAwsKinesis, TopicIngestionDataSourceSettingsAwsKinesisArgs
- Aws
Role stringArn - 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 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.
- Gcp
Service stringAccount - The GCP service account to be used for Federated Identity authentication
with Kinesis (via a
AssumeRoleWithWebIdentity
call for the provided role). TheawsRoleArn
must be set up withaccounts.google.com:sub
equals to this service account number. - Stream
Arn string - The Kinesis stream ARN to ingest data from.
- Aws
Role stringArn - 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 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.
- Gcp
Service stringAccount - The GCP service account to be used for Federated Identity authentication
with Kinesis (via a
AssumeRoleWithWebIdentity
call for the provided role). TheawsRoleArn
must be set up withaccounts.google.com:sub
equals to this service account number. - Stream
Arn string - The Kinesis stream ARN to ingest data from.
- aws
Role StringArn - 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 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.
- gcp
Service StringAccount - The GCP service account to be used for Federated Identity authentication
with Kinesis (via a
AssumeRoleWithWebIdentity
call for the provided role). TheawsRoleArn
must be set up withaccounts.google.com:sub
equals to this service account number. - stream
Arn String - The Kinesis stream ARN to ingest data from.
- aws
Role stringArn - 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 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.
- gcp
Service stringAccount - The GCP service account to be used for Federated Identity authentication
with Kinesis (via a
AssumeRoleWithWebIdentity
call for the provided role). TheawsRoleArn
must be set up withaccounts.google.com:sub
equals to this service account number. - stream
Arn string - The Kinesis stream ARN to ingest data from.
- aws_
role_ strarn - AWS role ARN to be used for Federated Identity authentication with Kinesis. Check the Pub/Sub docs for how to set up this role and the required permissions that need to be attached to it.
- consumer_
arn str - The Kinesis consumer ARN to used for ingestion in Enhanced Fan-Out mode. The consumer must be already created and ready to be used.
- gcp_
service_ straccount - The GCP service account to be used for Federated Identity authentication
with Kinesis (via a
AssumeRoleWithWebIdentity
call for the provided role). TheawsRoleArn
must be set up withaccounts.google.com:sub
equals to this service account number. - stream_
arn str - The Kinesis stream ARN to ingest data from.
- aws
Role StringArn - 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 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.
- gcp
Service StringAccount - The GCP service account to be used for Federated Identity authentication
with Kinesis (via a
AssumeRoleWithWebIdentity
call for the provided role). TheawsRoleArn
must be set up withaccounts.google.com:sub
equals to this service account number. - stream
Arn String - The Kinesis stream ARN to ingest data from.
TopicMessageStoragePolicy, TopicMessageStoragePolicyArgs
- Allowed
Persistence List<string>Regions - A list of IDs of GCP regions where messages that are published to the topic may be persisted in storage. Messages published by publishers running in non-allowed GCP regions (or running outside of GCP altogether) will be routed for storage in one of the allowed regions. An empty list means that no regions are allowed, and is not a valid configuration.
- Allowed
Persistence []stringRegions - A list of IDs of GCP regions where messages that are published to the topic may be persisted in storage. Messages published by publishers running in non-allowed GCP regions (or running outside of GCP altogether) will be routed for storage in one of the allowed regions. An empty list means that no regions are allowed, and is not a valid configuration.
- allowed
Persistence List<String>Regions - A list of IDs of GCP regions where messages that are published to the topic may be persisted in storage. Messages published by publishers running in non-allowed GCP regions (or running outside of GCP altogether) will be routed for storage in one of the allowed regions. An empty list means that no regions are allowed, and is not a valid configuration.
- allowed
Persistence string[]Regions - A list of IDs of GCP regions where messages that are published to the topic may be persisted in storage. Messages published by publishers running in non-allowed GCP regions (or running outside of GCP altogether) will be routed for storage in one of the allowed regions. An empty list means that no regions are allowed, and is not a valid configuration.
- allowed_
persistence_ Sequence[str]regions - A list of IDs of GCP regions where messages that are published to the topic may be persisted in storage. Messages published by publishers running in non-allowed GCP regions (or running outside of GCP altogether) will be routed for storage in one of the allowed regions. An empty list means that no regions are allowed, and is not a valid configuration.
- allowed
Persistence List<String>Regions - A list of IDs of GCP regions where messages that are published to the topic may be persisted in storage. Messages published by publishers running in non-allowed GCP regions (or running outside of GCP altogether) will be routed for storage in one of the allowed regions. An empty list means that no regions are allowed, and is not a valid configuration.
TopicSchemaSettings, TopicSchemaSettingsArgs
- Schema string
- The name of the schema that messages published should be validated against. Format is projects/{project}/schemas/{schema}. The value of this field will be deleted-schema if the schema has been deleted.
- Encoding string
- The encoding of messages validated against schema.
Default value is
ENCODING_UNSPECIFIED
. Possible values are:ENCODING_UNSPECIFIED
,JSON
,BINARY
.
- Schema string
- The name of the schema that messages published should be validated against. Format is projects/{project}/schemas/{schema}. The value of this field will be deleted-schema if the schema has been deleted.
- Encoding string
- The encoding of messages validated against schema.
Default value is
ENCODING_UNSPECIFIED
. Possible values are:ENCODING_UNSPECIFIED
,JSON
,BINARY
.
- schema String
- The name of the schema that messages published should be validated against. Format is projects/{project}/schemas/{schema}. The value of this field will be deleted-schema if the schema has been deleted.
- encoding String
- The encoding of messages validated against schema.
Default value is
ENCODING_UNSPECIFIED
. Possible values are:ENCODING_UNSPECIFIED
,JSON
,BINARY
.
- schema string
- The name of the schema that messages published should be validated against. Format is projects/{project}/schemas/{schema}. The value of this field will be deleted-schema if the schema has been deleted.
- encoding string
- The encoding of messages validated against schema.
Default value is
ENCODING_UNSPECIFIED
. Possible values are:ENCODING_UNSPECIFIED
,JSON
,BINARY
.
- schema str
- The name of the schema that messages published should be validated against. Format is projects/{project}/schemas/{schema}. The value of this field will be deleted-schema if the schema has been deleted.
- encoding str
- The encoding of messages validated against schema.
Default value is
ENCODING_UNSPECIFIED
. Possible values are:ENCODING_UNSPECIFIED
,JSON
,BINARY
.
- schema String
- The name of the schema that messages published should be validated against. Format is projects/{project}/schemas/{schema}. The value of this field will be deleted-schema if the schema has been deleted.
- encoding String
- The encoding of messages validated against schema.
Default value is
ENCODING_UNSPECIFIED
. Possible values are:ENCODING_UNSPECIFIED
,JSON
,BINARY
.
Import
Topic can be imported using any of these accepted formats:
projects/{{project}}/topics/{{name}}
{{project}}/{{name}}
{{name}}
When using the pulumi import
command, Topic can be imported using one of the formats above. For example:
$ pulumi import gcp:pubsub/topic:Topic default projects/{{project}}/topics/{{name}}
$ pulumi import gcp:pubsub/topic:Topic default {{project}}/{{name}}
$ pulumi import gcp:pubsub/topic:Topic default {{name}}
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Google Cloud (GCP) Classic pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
google-beta
Terraform Provider.