import * as pulumi from "@pulumi/pulumi"; /** * A Managed Service for Apache Kafka topic. Apache Kafka is a trademark owned by the Apache Software Foundation. * * ## Example Usage * * ### Managedkafka Topic Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const project = gcp.organizations.getProject({}); * const cluster = new gcp.managedkafka.Cluster("cluster", { * clusterId: "my-cluster", * location: "us-central1", * capacityConfig: { * vcpuCount: "3", * memoryBytes: "3221225472", * }, * gcpConfig: { * accessConfig: { * networkConfigs: [{ * subnet: project.then(project => `projects/${project.number}/regions/us-central1/subnetworks/default`), * }], * }, * }, * }); * const example = new gcp.managedkafka.Topic("example", { * topicId: "my-topic", * cluster: cluster.clusterId, * location: "us-central1", * partitionCount: 2, * replicationFactor: 3, * configs: { * "cleanup.policy": "compact", * }, * }); * ``` * * ## Import * * Topic can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/clusters/{{cluster}}/topics/{{topic_id}}` * * `{{project}}/{{location}}/{{cluster}}/{{topic_id}}` * * `{{location}}/{{cluster}}/{{topic_id}}` * * When using the `pulumi import` command, Topic can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:managedkafka/topic:Topic default projects/{{project}}/locations/{{location}}/clusters/{{cluster}}/topics/{{topic_id}} * $ pulumi import gcp:managedkafka/topic:Topic default {{project}}/{{location}}/{{cluster}}/{{topic_id}} * $ pulumi import gcp:managedkafka/topic:Topic default {{location}}/{{cluster}}/{{topic_id}} * ``` */ export declare class Topic extends pulumi.CustomResource { /** * Get an existing Topic resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: TopicState, opts?: pulumi.CustomResourceOptions): Topic; /** * Returns true if the given object is an instance of Topic. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is Topic; /** * The cluster name. */ readonly cluster: pulumi.Output; /** * Configuration for the topic that are overridden from the cluster defaults. The key of the map is a Kafka topic property name, for example: `cleanup.policy=compact`, `compression.type=producer`. */ readonly configs: pulumi.Output<{ [key: string]: string; } | undefined>; /** * ID of the location of the Kafka resource. See https://cloud.google.com/managed-kafka/docs/locations for a list of supported locations. */ readonly location: pulumi.Output; /** * The name of the topic. The `topic` segment is used when connecting directly to the cluster. Must be in the format `projects/PROJECT_ID/locations/LOCATION/clusters/CLUSTER_ID/topics/TOPIC_ID`. */ readonly name: pulumi.Output; /** * The number of partitions in a topic. You can increase the partition count for a topic, but you cannot decrease it. Increasing partitions for a topic that uses a key might change how messages are distributed. */ readonly partitionCount: pulumi.Output; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ readonly project: pulumi.Output; /** * The number of replicas of each partition. A replication factor of 3 is recommended for high availability. */ readonly replicationFactor: pulumi.Output; /** * The ID to use for the topic, which will become the final component of the topic's name. This value is structured like: `my-topic-name`. */ readonly topicId: pulumi.Output; /** * Create a Topic resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: TopicArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Topic resources. */ export interface TopicState { /** * The cluster name. */ cluster?: pulumi.Input; /** * Configuration for the topic that are overridden from the cluster defaults. The key of the map is a Kafka topic property name, for example: `cleanup.policy=compact`, `compression.type=producer`. */ configs?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * ID of the location of the Kafka resource. See https://cloud.google.com/managed-kafka/docs/locations for a list of supported locations. */ location?: pulumi.Input; /** * The name of the topic. The `topic` segment is used when connecting directly to the cluster. Must be in the format `projects/PROJECT_ID/locations/LOCATION/clusters/CLUSTER_ID/topics/TOPIC_ID`. */ name?: pulumi.Input; /** * The number of partitions in a topic. You can increase the partition count for a topic, but you cannot decrease it. Increasing partitions for a topic that uses a key might change how messages are distributed. */ partitionCount?: pulumi.Input; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input; /** * The number of replicas of each partition. A replication factor of 3 is recommended for high availability. */ replicationFactor?: pulumi.Input; /** * The ID to use for the topic, which will become the final component of the topic's name. This value is structured like: `my-topic-name`. */ topicId?: pulumi.Input; } /** * The set of arguments for constructing a Topic resource. */ export interface TopicArgs { /** * The cluster name. */ cluster: pulumi.Input; /** * Configuration for the topic that are overridden from the cluster defaults. The key of the map is a Kafka topic property name, for example: `cleanup.policy=compact`, `compression.type=producer`. */ configs?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * ID of the location of the Kafka resource. See https://cloud.google.com/managed-kafka/docs/locations for a list of supported locations. */ location: pulumi.Input; /** * The number of partitions in a topic. You can increase the partition count for a topic, but you cannot decrease it. Increasing partitions for a topic that uses a key might change how messages are distributed. */ partitionCount?: pulumi.Input; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input; /** * The number of replicas of each partition. A replication factor of 3 is recommended for high availability. */ replicationFactor: pulumi.Input; /** * The ID to use for the topic, which will become the final component of the topic's name. This value is structured like: `my-topic-name`. */ topicId: pulumi.Input; }