import * as pulumi from "@pulumi/pulumi"; import { input as inputs, output as outputs } from "./types"; /** * Manages a Kafka cluster within the Yandex.Cloud. For more information, see * [the official documentation](https://cloud.yandex.com/docs/managed-kafka/concepts). * * ## Example Usage * * Example of creating a Single Node Kafka. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as yandex from "@pulumi/yandex"; * * const fooVpcNetwork = new yandex.VpcNetwork("foo", {}); * const fooVpcSubnet = new yandex.VpcSubnet("foo", { * networkId: fooVpcNetwork.id, * v4CidrBlocks: ["10.5.0.0/24"], * zone: "ru-central1-a", * }); * const fooMdbKafkaCluster = new yandex.MdbKafkaCluster("foo", { * config: { * assignPublicIp: false, * brokersCount: 1, * kafka: { * kafkaConfig: { * compressionType: "COMPRESSION_TYPE_ZSTD", * defaultReplicationFactor: "1", * logFlushIntervalMessages: "1024", * logFlushIntervalMs: "1000", * logFlushSchedulerIntervalMs: "1000", * logPreallocate: true, * logRetentionBytes: "1.073741824e+09", * logRetentionHours: "168", * logRetentionMinutes: "10080", * logRetentionMs: "8.64e+07", * logSegmentBytes: "1.34217728e+08", * numPartitions: "10", * }, * resources: { * diskSize: 32, * diskTypeId: "network-ssd", * resourcePresetId: "s2.micro", * }, * }, * schemaRegistry: false, * unmanagedTopics: false, * version: "2.8", * zones: ["ru-central1-a"], * }, * environment: "PRESTABLE", * networkId: fooVpcNetwork.id, * subnetIds: [fooVpcSubnet.id], * users: [ * { * name: "producer-application", * password: "password", * permissions: [{ * role: "ACCESS_ROLE_PRODUCER", * topicName: "input", * }], * }, * { * name: "worker", * password: "password", * permissions: [ * { * role: "ACCESS_ROLE_CONSUMER", * topicName: "input", * }, * { * role: "ACCESS_ROLE_PRODUCER", * topicName: "output", * }, * ], * }, * ], * }); * ``` * * Example of creating a HA Kafka Cluster with two brokers per AZ (6 brokers + 3 zk) * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as yandex from "@pulumi/yandex"; * * const fooVpcNetwork = new yandex.VpcNetwork("foo", {}); * const fooVpcSubnet = new yandex.VpcSubnet("foo", { * networkId: fooVpcNetwork.id, * v4CidrBlocks: ["10.1.0.0/24"], * zone: "ru-central1-a", * }); * const bar = new yandex.VpcSubnet("bar", { * networkId: fooVpcNetwork.id, * v4CidrBlocks: ["10.2.0.0/24"], * zone: "ru-central1-b", * }); * const baz = new yandex.VpcSubnet("baz", { * networkId: fooVpcNetwork.id, * v4CidrBlocks: ["10.3.0.0/24"], * zone: "ru-central1-c", * }); * const fooMdbKafkaCluster = new yandex.MdbKafkaCluster("foo", { * config: { * assignPublicIp: true, * brokersCount: 2, * kafka: { * kafkaConfig: { * compressionType: "COMPRESSION_TYPE_ZSTD", * defaultReplicationFactor: "6", * logFlushIntervalMessages: "1024", * logFlushIntervalMs: "1000", * logFlushSchedulerIntervalMs: "1000", * logPreallocate: true, * logRetentionBytes: "1.073741824e+09", * logRetentionHours: "168", * logRetentionMinutes: "10080", * logRetentionMs: "8.64e+07", * logSegmentBytes: "1.34217728e+08", * numPartitions: "10", * }, * resources: { * diskSize: 128, * diskTypeId: "network-ssd", * resourcePresetId: "s2.medium", * }, * }, * schemaRegistry: false, * unmanagedTopics: false, * version: "2.8", * zones: [ * "ru-central1-a", * "ru-central1-b", * "ru-central1-c", * ], * zookeeper: { * resources: { * diskSize: 20, * diskTypeId: "network-ssd", * resourcePresetId: "s2.micro", * }, * }, * }, * environment: "PRESTABLE", * networkId: fooVpcNetwork.id, * subnetIds: [ * fooVpcSubnet.id, * bar.id, * baz.id, * ], * users: [ * { * name: "producer-application", * password: "password", * permissions: [{ * role: "ACCESS_ROLE_PRODUCER", * topicName: "input", * }], * }, * { * name: "worker", * password: "password", * permissions: [ * { * role: "ACCESS_ROLE_CONSUMER", * topicName: "input", * }, * { * role: "ACCESS_ROLE_PRODUCER", * topicName: "output", * }, * ], * }, * ], * }); * ``` * * ## Import * * A cluster can be imported using the `id` of the resource, e.g. * * ```sh * $ pulumi import yandex:index/mdbKafkaCluster:MdbKafkaCluster foo cluster_id * ``` */ export declare class MdbKafkaCluster extends pulumi.CustomResource { /** * Get an existing MdbKafkaCluster 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?: MdbKafkaClusterState, opts?: pulumi.CustomResourceOptions): MdbKafkaCluster; /** * Returns true if the given object is an instance of MdbKafkaCluster. 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 MdbKafkaCluster; /** * Configuration of the Kafka cluster. The structure is documented below. */ readonly config: pulumi.Output; /** * Timestamp of cluster creation. */ readonly createdAt: pulumi.Output; /** * Inhibits deletion of the cluster. Can be either `true` or `false`. */ readonly deletionProtection: pulumi.Output; /** * Description of the Kafka cluster. */ readonly description: pulumi.Output; /** * Deployment environment of the Kafka cluster. Can be either `PRESTABLE` or `PRODUCTION`. * The default is `PRODUCTION`. */ readonly environment: pulumi.Output; /** * The ID of the folder that the resource belongs to. If it is not provided, the default provider folder is used. */ readonly folderId: pulumi.Output; /** * Health of the host. */ readonly health: pulumi.Output; /** * A list of IDs of the host groups to place VMs of the cluster on. */ readonly hostGroupIds: pulumi.Output; /** * A host of the Kafka cluster. The structure is documented below. */ readonly hosts: pulumi.Output; /** * A set of key/value label pairs to assign to the Kafka cluster. */ readonly labels: pulumi.Output<{ [key: string]: string; }>; /** * Maintenance policy of the Kafka cluster. The structure is documented below. */ readonly maintenanceWindow: pulumi.Output; /** * The name of the topic. */ readonly name: pulumi.Output; /** * ID of the network, to which the Kafka cluster belongs. */ readonly networkId: pulumi.Output; /** * Security group ids, to which the Kafka cluster belongs. */ readonly securityGroupIds: pulumi.Output; /** * Status of the cluster. Can be either `CREATING`, `STARTING`, `RUNNING`, `UPDATING`, `STOPPING`, `STOPPED`, `ERROR` or `STATUS_UNKNOWN`. * For more information see `status` field of JSON representation in [the official documentation](https://cloud.yandex.com/docs/managed-kafka/api-ref/Cluster/). */ readonly status: pulumi.Output; /** * IDs of the subnets, to which the Kafka cluster belongs. */ readonly subnetIds: pulumi.Output; /** * To manage topics, please switch to using a separate resource type `yandex.MdbKafkaTopic`. * * @deprecated to manage topics, please switch to using a separate resource type yandex_mdb_kafka_topic */ readonly topics: pulumi.Output; /** * A user of the Kafka cluster. The structure is documented below. */ readonly users: pulumi.Output; /** * Create a MdbKafkaCluster 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: MdbKafkaClusterArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering MdbKafkaCluster resources. */ export interface MdbKafkaClusterState { /** * Configuration of the Kafka cluster. The structure is documented below. */ config?: pulumi.Input; /** * Timestamp of cluster creation. */ createdAt?: pulumi.Input; /** * Inhibits deletion of the cluster. Can be either `true` or `false`. */ deletionProtection?: pulumi.Input; /** * Description of the Kafka cluster. */ description?: pulumi.Input; /** * Deployment environment of the Kafka cluster. Can be either `PRESTABLE` or `PRODUCTION`. * The default is `PRODUCTION`. */ environment?: pulumi.Input; /** * The ID of the folder that the resource belongs to. If it is not provided, the default provider folder is used. */ folderId?: pulumi.Input; /** * Health of the host. */ health?: pulumi.Input; /** * A list of IDs of the host groups to place VMs of the cluster on. */ hostGroupIds?: pulumi.Input[]>; /** * A host of the Kafka cluster. The structure is documented below. */ hosts?: pulumi.Input[]>; /** * A set of key/value label pairs to assign to the Kafka cluster. */ labels?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * Maintenance policy of the Kafka cluster. The structure is documented below. */ maintenanceWindow?: pulumi.Input; /** * The name of the topic. */ name?: pulumi.Input; /** * ID of the network, to which the Kafka cluster belongs. */ networkId?: pulumi.Input; /** * Security group ids, to which the Kafka cluster belongs. */ securityGroupIds?: pulumi.Input[]>; /** * Status of the cluster. Can be either `CREATING`, `STARTING`, `RUNNING`, `UPDATING`, `STOPPING`, `STOPPED`, `ERROR` or `STATUS_UNKNOWN`. * For more information see `status` field of JSON representation in [the official documentation](https://cloud.yandex.com/docs/managed-kafka/api-ref/Cluster/). */ status?: pulumi.Input; /** * IDs of the subnets, to which the Kafka cluster belongs. */ subnetIds?: pulumi.Input[]>; /** * To manage topics, please switch to using a separate resource type `yandex.MdbKafkaTopic`. * * @deprecated to manage topics, please switch to using a separate resource type yandex_mdb_kafka_topic */ topics?: pulumi.Input[]>; /** * A user of the Kafka cluster. The structure is documented below. */ users?: pulumi.Input[]>; } /** * The set of arguments for constructing a MdbKafkaCluster resource. */ export interface MdbKafkaClusterArgs { /** * Configuration of the Kafka cluster. The structure is documented below. */ config: pulumi.Input; /** * Inhibits deletion of the cluster. Can be either `true` or `false`. */ deletionProtection?: pulumi.Input; /** * Description of the Kafka cluster. */ description?: pulumi.Input; /** * Deployment environment of the Kafka cluster. Can be either `PRESTABLE` or `PRODUCTION`. * The default is `PRODUCTION`. */ environment?: pulumi.Input; /** * The ID of the folder that the resource belongs to. If it is not provided, the default provider folder is used. */ folderId?: pulumi.Input; /** * A list of IDs of the host groups to place VMs of the cluster on. */ hostGroupIds?: pulumi.Input[]>; /** * A set of key/value label pairs to assign to the Kafka cluster. */ labels?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * Maintenance policy of the Kafka cluster. The structure is documented below. */ maintenanceWindow?: pulumi.Input; /** * The name of the topic. */ name?: pulumi.Input; /** * ID of the network, to which the Kafka cluster belongs. */ networkId: pulumi.Input; /** * Security group ids, to which the Kafka cluster belongs. */ securityGroupIds?: pulumi.Input[]>; /** * IDs of the subnets, to which the Kafka cluster belongs. */ subnetIds?: pulumi.Input[]>; /** * To manage topics, please switch to using a separate resource type `yandex.MdbKafkaTopic`. * * @deprecated to manage topics, please switch to using a separate resource type yandex_mdb_kafka_topic */ topics?: pulumi.Input[]>; /** * A user of the Kafka cluster. The structure is documented below. */ users?: pulumi.Input[]>; }