import * as pulumi from "@pulumi/pulumi"; import { input as inputs, output as outputs } from "./types"; /** * Manages a ClickHouse cluster within the Yandex.Cloud. For more information, see * [the official documentation](https://cloud.yandex.com/docs/managed-clickhouse/concepts). * * ## Example Usage * * Example of creating a Single Node ClickHouse. * * ```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 fooMdbClickhouseCluster = new yandex.MdbClickhouseCluster("foo", { * clickhouse: { * config: { * backgroundPoolSize: 16, * backgroundSchedulePoolSize: 16, * compressions: [ * { * method: "LZ4", * minPartSize: 1024, * minPartSizeRatio: 0.5, * }, * { * method: "ZSTD", * minPartSize: 2048, * minPartSizeRatio: 0.7, * }, * ], * geobaseUri: "", * graphiteRollups: [ * { * name: "rollup1", * patterns: [{ * function: "func1", * regexp: "abc", * retentions: [{ * age: 1000, * precision: 3, * }], * }], * }, * { * name: "rollup2", * patterns: [{ * function: "func2", * retentions: [{ * age: 2000, * precision: 5, * }], * }], * }, * ], * kafka: { * saslMechanism: "SASL_MECHANISM_GSSAPI", * saslPassword: "pass1", * saslUsername: "user1", * securityProtocol: "SECURITY_PROTOCOL_PLAINTEXT", * }, * kafkaTopics: [ * { * name: "topic1", * settings: { * saslMechanism: "SASL_MECHANISM_SCRAM_SHA_256", * saslPassword: "pass2", * saslUsername: "user2", * securityProtocol: "SECURITY_PROTOCOL_SSL", * }, * }, * { * name: "topic2", * settings: { * saslMechanism: "SASL_MECHANISM_PLAIN", * securityProtocol: "SECURITY_PROTOCOL_SASL_PLAINTEXT", * }, * }, * ], * keepAliveTimeout: 3000, * logLevel: "TRACE", * markCacheSize: 5368709120, * maxConcurrentQueries: 50, * maxConnections: 100, * maxPartitionSizeToDrop: 53687091200, * maxTableSizeToDrop: 53687091200, * mergeTree: { * maxBytesToMergeAtMinSpaceInPool: 1048576, * maxReplicatedMergesInQueue: 16, * numberOfFreeEntriesInPoolToLowerMaxSizeOfMerge: 8, * partsToDelayInsert: 150, * partsToThrowInsert: 300, * replicatedDeduplicationWindow: 100, * replicatedDeduplicationWindowSeconds: 604800, * }, * metricLogEnabled: true, * metricLogRetentionSize: 536870912, * metricLogRetentionTime: 2592000, * partLogRetentionSize: 536870912, * partLogRetentionTime: 2592000, * queryLogRetentionSize: 1073741824, * queryLogRetentionTime: 2592000, * queryThreadLogEnabled: true, * queryThreadLogRetentionSize: 536870912, * queryThreadLogRetentionTime: 2592000, * rabbitmq: { * password: "rabbit_pass", * username: "rabbit_user", * }, * textLogEnabled: true, * textLogLevel: "TRACE", * textLogRetentionSize: 536870912, * textLogRetentionTime: 2592000, * timezone: "UTC", * traceLogEnabled: true, * traceLogRetentionSize: 536870912, * traceLogRetentionTime: 2592000, * uncompressedCacheSize: 8589934592, * }, * resources: { * diskSize: 32, * diskTypeId: "network-ssd", * resourcePresetId: "s2.micro", * }, * }, * cloudStorage: { * enabled: false, * }, * databases: [{ * name: "db_name", * }], * environment: "PRESTABLE", * formatSchemas: [{ * name: "test_schema", * type: "FORMAT_SCHEMA_TYPE_CAPNPROTO", * uri: "https://storage.yandexcloud.net/ch-data/schema.proto", * }], * hosts: [{ * subnetId: fooVpcSubnet.id, * type: "CLICKHOUSE", * zone: "ru-central1-a", * }], * maintenanceWindow: { * type: "ANYTIME", * }, * mlModels: [{ * name: "test_model", * type: "ML_MODEL_TYPE_CATBOOST", * uri: "https://storage.yandexcloud.net/ch-data/train.csv", * }], * networkId: fooVpcNetwork.id, * serviceAccountId: "your_service_account_id", * users: [{ * name: "user", * password: "your_password", * permissions: [{ * databaseName: "db_name", * }], * quotas: [ * { * errors: 1000, * intervalDuration: 3600000, * queries: 10000, * }, * { * error: 5000, * intervalDuration: 79800000, * queries: 50000, * }, * ], * settings: { * maxMemoryUsageForUser: 1000000000, * outputFormatJsonQuote64bitIntegers: true, * readOverflowMode: "throw", * }, * }], * }); * ``` * * Example of creating a HA ClickHouse Cluster. * * ```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 fooMdbClickhouseCluster = new yandex.MdbClickhouseCluster("foo", { * clickhouse: { * resources: { * diskSize: 16, * diskTypeId: "network-ssd", * resourcePresetId: "s2.micro", * }, * }, * cloudStorage: { * enabled: false, * }, * databases: [{ * name: "db_name", * }], * environment: "PRESTABLE", * hosts: [ * { * subnetId: fooVpcSubnet.id, * type: "CLICKHOUSE", * zone: "ru-central1-a", * }, * { * subnetId: bar.id, * type: "CLICKHOUSE", * zone: "ru-central1-b", * }, * { * subnetId: fooVpcSubnet.id, * type: "ZOOKEEPER", * zone: "ru-central1-a", * }, * { * subnetId: bar.id, * type: "ZOOKEEPER", * zone: "ru-central1-b", * }, * { * subnetId: baz.id, * type: "ZOOKEEPER", * zone: "ru-central1-c", * }, * ], * networkId: fooVpcNetwork.id, * users: [{ * name: "user", * password: "password", * permissions: [{ * databaseName: "db_name", * }], * quotas: [ * { * errors: 1000, * intervalDuration: 3600000, * queries: 10000, * }, * { * error: 5000, * intervalDuration: 79800000, * queries: 50000, * }, * ], * settings: { * maxMemoryUsageForUser: 1000000000, * outputFormatJsonQuote64bitIntegers: true, * readOverflowMode: "throw", * }, * }], * zookeeper: { * resources: { * diskSize: 10, * diskTypeId: "network-ssd", * resourcePresetId: "s2.micro", * }, * }, * }); * ``` * * Example of creating a sharded ClickHouse Cluster. * * ```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 fooMdbClickhouseCluster = new yandex.MdbClickhouseCluster("foo", { * clickhouse: { * resources: { * diskSize: 16, * diskTypeId: "network-ssd", * resourcePresetId: "s2.micro", * }, * }, * cloudStorage: { * enabled: false, * }, * databases: [{ * name: "db_name", * }], * environment: "PRODUCTION", * hosts: [ * { * shardName: "shard1", * subnetId: fooVpcSubnet.id, * type: "CLICKHOUSE", * zone: "ru-central1-a", * }, * { * shardName: "shard1", * subnetId: bar.id, * type: "CLICKHOUSE", * zone: "ru-central1-b", * }, * { * shardName: "shard2", * subnetId: bar.id, * type: "CLICKHOUSE", * zone: "ru-central1-b", * }, * { * shardName: "shard2", * subnetId: baz.id, * type: "CLICKHOUSE", * zone: "ru-central1-c", * }, * ], * networkId: fooVpcNetwork.id, * shardGroups: [{ * description: "Cluster configuration that contain only shard1", * name: "single_shard_group", * shardNames: ["shard1"], * }], * users: [{ * name: "user", * password: "password", * permissions: [{ * databaseName: "db_name", * }], * quotas: [ * { * errors: 1000, * intervalDuration: 3600000, * queries: 10000, * }, * { * error: 5000, * intervalDuration: 79800000, * queries: 50000, * }, * ], * settings: { * maxMemoryUsageForUser: 1000000000, * outputFormatJsonQuote64bitIntegers: true, * readOverflowMode: "throw", * }, * }], * zookeeper: { * resources: { * diskSize: 10, * diskTypeId: "network-ssd", * resourcePresetId: "s2.micro", * }, * }, * }); * ``` * * ## Import * * A cluster can be imported using the `id` of the resource, e.g. * * ```sh * $ pulumi import yandex:index/mdbClickhouseCluster:MdbClickhouseCluster foo cluster_id * ``` */ export declare class MdbClickhouseCluster extends pulumi.CustomResource { /** * Get an existing MdbClickhouseCluster 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?: MdbClickhouseClusterState, opts?: pulumi.CustomResourceOptions): MdbClickhouseCluster; /** * Returns true if the given object is an instance of MdbClickhouseCluster. 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 MdbClickhouseCluster; /** * Access policy to the ClickHouse cluster. The structure is documented below. */ readonly access: pulumi.Output; /** * A password used to authorize as user `admin` when `sqlUserManagement` enabled. */ readonly adminPassword: pulumi.Output; /** * Time to start the daily backup, in the UTC timezone. The structure is documented below. */ readonly backupWindowStart: pulumi.Output; /** * Configuration of the ClickHouse subcluster. The structure is documented below. */ readonly clickhouse: pulumi.Output; readonly cloudStorage: pulumi.Output; /** * Whether to copy schema on new ClickHouse hosts. */ readonly copySchemaOnNewHosts: pulumi.Output; /** * Timestamp of cluster creation. */ readonly createdAt: pulumi.Output; /** * A database of the ClickHouse cluster. The structure is documented below. */ readonly databases: pulumi.Output; /** * Inhibits deletion of the cluster. Can be either `true` or `false`. */ readonly deletionProtection: pulumi.Output; /** * Description of the shard group. */ readonly description: pulumi.Output; /** * Deployment environment of the ClickHouse cluster. Can be either `PRESTABLE` or `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; /** * A set of protobuf or capnproto format schemas. The structure is documented below. */ readonly formatSchemas: pulumi.Output; /** * Aggregated health of the cluster. Can be `ALIVE`, `DEGRADED`, `DEAD` or `HEALTH_UNKNOWN`. * For more information see `health` field of JSON representation in [the official documentation](https://cloud.yandex.com/docs/managed-clickhouse/api-ref/Cluster/). */ readonly health: pulumi.Output; /** * A host of the ClickHouse cluster. The structure is documented below. */ readonly hosts: pulumi.Output; /** * A set of key/value label pairs to assign to the ClickHouse cluster. */ readonly labels: pulumi.Output<{ [key: string]: string; }>; readonly maintenanceWindow: pulumi.Output; /** * A group of machine learning models. The structure is documented below */ readonly mlModels: pulumi.Output; /** * Graphite rollup configuration name. */ readonly name: pulumi.Output; /** * ID of the network, to which the ClickHouse cluster belongs. */ readonly networkId: pulumi.Output; /** * A set of ids of security groups assigned to hosts of the cluster. */ readonly securityGroupIds: pulumi.Output; /** * ID of the service account used for access to Yandex Object Storage. */ readonly serviceAccountId: pulumi.Output; /** * A group of clickhouse shards. The structure is documented below. */ readonly shardGroups: pulumi.Output; /** * Grants `admin` user database management permission. */ readonly sqlDatabaseManagement: pulumi.Output; /** * Enables `admin` user with user management permission. */ readonly sqlUserManagement: pulumi.Output; /** * Status of the cluster. Can be `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-clickhouse/api-ref/Cluster/). */ readonly status: pulumi.Output; /** * A user of the ClickHouse cluster. The structure is documented below. */ readonly users: pulumi.Output; /** * Version of the ClickHouse server software. */ readonly version: pulumi.Output; /** * Configuration of the ZooKeeper subcluster. The structure is documented below. */ readonly zookeeper: pulumi.Output; /** * Create a MdbClickhouseCluster 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: MdbClickhouseClusterArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering MdbClickhouseCluster resources. */ export interface MdbClickhouseClusterState { /** * Access policy to the ClickHouse cluster. The structure is documented below. */ access?: pulumi.Input; /** * A password used to authorize as user `admin` when `sqlUserManagement` enabled. */ adminPassword?: pulumi.Input; /** * Time to start the daily backup, in the UTC timezone. The structure is documented below. */ backupWindowStart?: pulumi.Input; /** * Configuration of the ClickHouse subcluster. The structure is documented below. */ clickhouse?: pulumi.Input; cloudStorage?: pulumi.Input; /** * Whether to copy schema on new ClickHouse hosts. */ copySchemaOnNewHosts?: pulumi.Input; /** * Timestamp of cluster creation. */ createdAt?: pulumi.Input; /** * A database of the ClickHouse cluster. The structure is documented below. */ databases?: pulumi.Input[]>; /** * Inhibits deletion of the cluster. Can be either `true` or `false`. */ deletionProtection?: pulumi.Input; /** * Description of the shard group. */ description?: pulumi.Input; /** * Deployment environment of the ClickHouse cluster. Can be either `PRESTABLE` or `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 set of protobuf or capnproto format schemas. The structure is documented below. */ formatSchemas?: pulumi.Input[]>; /** * Aggregated health of the cluster. Can be `ALIVE`, `DEGRADED`, `DEAD` or `HEALTH_UNKNOWN`. * For more information see `health` field of JSON representation in [the official documentation](https://cloud.yandex.com/docs/managed-clickhouse/api-ref/Cluster/). */ health?: pulumi.Input; /** * A host of the ClickHouse cluster. The structure is documented below. */ hosts?: pulumi.Input[]>; /** * A set of key/value label pairs to assign to the ClickHouse cluster. */ labels?: pulumi.Input<{ [key: string]: pulumi.Input; }>; maintenanceWindow?: pulumi.Input; /** * A group of machine learning models. The structure is documented below */ mlModels?: pulumi.Input[]>; /** * Graphite rollup configuration name. */ name?: pulumi.Input; /** * ID of the network, to which the ClickHouse cluster belongs. */ networkId?: pulumi.Input; /** * A set of ids of security groups assigned to hosts of the cluster. */ securityGroupIds?: pulumi.Input[]>; /** * ID of the service account used for access to Yandex Object Storage. */ serviceAccountId?: pulumi.Input; /** * A group of clickhouse shards. The structure is documented below. */ shardGroups?: pulumi.Input[]>; /** * Grants `admin` user database management permission. */ sqlDatabaseManagement?: pulumi.Input; /** * Enables `admin` user with user management permission. */ sqlUserManagement?: pulumi.Input; /** * Status of the cluster. Can be `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-clickhouse/api-ref/Cluster/). */ status?: pulumi.Input; /** * A user of the ClickHouse cluster. The structure is documented below. */ users?: pulumi.Input[]>; /** * Version of the ClickHouse server software. */ version?: pulumi.Input; /** * Configuration of the ZooKeeper subcluster. The structure is documented below. */ zookeeper?: pulumi.Input; } /** * The set of arguments for constructing a MdbClickhouseCluster resource. */ export interface MdbClickhouseClusterArgs { /** * Access policy to the ClickHouse cluster. The structure is documented below. */ access?: pulumi.Input; /** * A password used to authorize as user `admin` when `sqlUserManagement` enabled. */ adminPassword?: pulumi.Input; /** * Time to start the daily backup, in the UTC timezone. The structure is documented below. */ backupWindowStart?: pulumi.Input; /** * Configuration of the ClickHouse subcluster. The structure is documented below. */ clickhouse: pulumi.Input; cloudStorage?: pulumi.Input; /** * Whether to copy schema on new ClickHouse hosts. */ copySchemaOnNewHosts?: pulumi.Input; /** * A database of the ClickHouse cluster. The structure is documented below. */ databases?: pulumi.Input[]>; /** * Inhibits deletion of the cluster. Can be either `true` or `false`. */ deletionProtection?: pulumi.Input; /** * Description of the shard group. */ description?: pulumi.Input; /** * Deployment environment of the ClickHouse cluster. Can be either `PRESTABLE` or `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 set of protobuf or capnproto format schemas. The structure is documented below. */ formatSchemas?: pulumi.Input[]>; /** * A host of the ClickHouse cluster. The structure is documented below. */ hosts: pulumi.Input[]>; /** * A set of key/value label pairs to assign to the ClickHouse cluster. */ labels?: pulumi.Input<{ [key: string]: pulumi.Input; }>; maintenanceWindow?: pulumi.Input; /** * A group of machine learning models. The structure is documented below */ mlModels?: pulumi.Input[]>; /** * Graphite rollup configuration name. */ name?: pulumi.Input; /** * ID of the network, to which the ClickHouse cluster belongs. */ networkId: pulumi.Input; /** * A set of ids of security groups assigned to hosts of the cluster. */ securityGroupIds?: pulumi.Input[]>; /** * ID of the service account used for access to Yandex Object Storage. */ serviceAccountId?: pulumi.Input; /** * A group of clickhouse shards. The structure is documented below. */ shardGroups?: pulumi.Input[]>; /** * Grants `admin` user database management permission. */ sqlDatabaseManagement?: pulumi.Input; /** * Enables `admin` user with user management permission. */ sqlUserManagement?: pulumi.Input; /** * A user of the ClickHouse cluster. The structure is documented below. */ users?: pulumi.Input[]>; /** * Version of the ClickHouse server software. */ version?: pulumi.Input; /** * Configuration of the ZooKeeper subcluster. The structure is documented below. */ zookeeper?: pulumi.Input; }