yandex_mdb_clickhouse_cluster_v2 (Data Source)
Written by
Updated at January 26, 2026
- Example usage
- Schema
- Optional
- Read-Only
- Nested Schema for timeouts
- Nested Schema for access
- Nested Schema for backup_window_start
- Nested Schema for clickhouse
- Nested Schema for clickhouse.config
- Nested Schema for clickhouse.config.access_control_improvements
- Nested Schema for clickhouse.config.compression
- Nested Schema for clickhouse.config.custom_macros
- Nested Schema for clickhouse.config.graphite_rollup
- Nested Schema for clickhouse.config.graphite_rollup.patterns
- Nested Schema for clickhouse.config.graphite_rollup.version_column_name.retention
- Nested Schema for clickhouse.config.jdbc_bridge
- Nested Schema for clickhouse.config.kafka
- Nested Schema for clickhouse.config.merge_tree
- Nested Schema for clickhouse.config.query_cache
- Nested Schema for clickhouse.config.query_masking_rules
- Nested Schema for clickhouse.config.rabbitmq
- Nested Schema for clickhouse.resources
- Nested Schema for cloud_storage
- Nested Schema for format_schema
- Nested Schema for hosts
- Nested Schema for maintenance_window
- Nested Schema for ml_model
- Nested Schema for shard_group
- Nested Schema for shards
- Nested Schema for shards.resources
- Nested Schema for zookeeper
- Nested Schema for zookeeper.resources
- Argument Reference
Get information about a Yandex Managed ClickHouse cluster. For more information,
see the official documentation.
Example usage
//
// Get information about existing MDB Clickhouse Cluster.
//
data "yandex_mdb_clickhouse_cluster_v2" "my_cluster" {
name = "test"
}
output "network_id" {
value = data.yandex_mdb_clickhouse_cluster_v2.my_cluster.network_id
}
Schema
Optional
cluster_id(String) ID of the ClickHouse cluster. This ID is assigned by MDB at creation time.name(String) Name of the ClickHouse cluster. Provided by the client when the cluster is created.timeouts(Attributes) (see below for nested schema)
Read-Only
access(Attributes) Access policy to the ClickHouse cluster. (see below for nested schema)admin_password(String, Sensitive) A password used to authorize as useradminwhensql_user_managementenabled.backup_retain_period_days(Number) The period in days during which backups are stored.backup_window_start(Attributes) Time to start the daily backup, in the UTC timezone. (see below for nested schema)clickhouse(Attributes) Configuration of the ClickHouse subcluster. (see below for nested schema)cloud_storage(Attributes) Cloud Storage settings. (see below for nested schema)copy_schema_on_new_hosts(Boolean) Whether to copy schema on new ClickHouse hosts.created_at(String) The creation timestamp of the resource.deletion_protection(Boolean) Thetruevalue means that resource is protected from accidental deletion.description(String) The resource description.disk_encryption_key_id(String) ID of the KMS key for cluster disk encryption.embedded_keeper(Boolean) Whether to use ClickHouse Keeper as a coordination system.environment(String) Deployment environment of the ClickHouse cluster.folder_id(String) The folder identifier that resource belongs to. If it is not provided, the default providerfolder-idis used.format_schema(Block Set) A set ofprotobuforcapnprotoformat schemas. (see below for nested schema)hosts(Attributes Map) A host configuration of the ClickHouse cluster. (see below for nested schema)id(String) The resource identifier.labels(Map of String) A set of key/value label pairs which assigned to resource.maintenance_window(Block, Read-only) Maintenance window settings. (see below for nested schema)ml_model(Block Set) A group of machine learning models. (see below for nested schema)network_id(String) TheVPC Network IDof subnets which resource attached to.security_group_ids(Set of String) The list of security groups applied to resource or their components.service_account_id(String) Service account which linked to the resource.shard_group(Block List) A group of clickhouse shards. (see below for nested schema)shards(Attributes Map) A shards of the ClickHouse cluster. (see below for nested schema)sql_database_management(Boolean) Grantsadminuser database management permission.sql_user_management(Boolean) Enablesadminuser with user management permission.version(String) Version of the ClickHouse server software.zookeeper(Attributes) Configuration of the ZooKeeper subcluster. (see below for nested schema)
Nested Schema for timeouts
Optional:
create(String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).delete(String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.update(String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
Nested Schema for access
Read-Only:
data_lens(Boolean) Allow access for DataLens.data_transfer(Boolean) Allow access for DataTransfer.metrika(Boolean) Allow access for Yandex.Metrika.serverless(Boolean) Allow access for Serverless.web_sql(Boolean) Allow access for Web SQL.yandex_query(Boolean) Allow access for YandexQuery.
Nested Schema for backup_window_start
Read-Only:
hours(Number) The hour at which backup will be started (UTC).minutes(Number) The minute at which backup will be started (UTC).
Nested Schema for clickhouse
Read-Only:
config(Attributes) Configuration of the ClickHouse subcluster. (see below for nested schema)resources(Attributes) Resources allocated to hosts. (see below for nested schema)
Nested Schema for clickhouse.config
Read-Only:
access_control_improvements(Attributes) Access control settings. (see below for nested schema)async_insert_threads(Number) Maximum number of threads to parse and insert data in background.asynchronous_insert_log_enabled(Boolean) Enable or disable asynchronous_insert_log system table.asynchronous_insert_log_retention_size(Number) The maximum size that asynchronous_insert_log can grow to before old data will be removed.asynchronous_insert_log_retention_time(Number) The maximum time that asynchronous_insert_log records will be retained before removal.asynchronous_metric_log_enabled(Boolean) Enable or disable asynchronous_metric_log system table.asynchronous_metric_log_retention_size(Number) The maximum size that asynchronous_metric_log can grow to before old data will be removed.asynchronous_metric_log_retention_time(Number) The maximum time that asynchronous_metric_log records will be retained before removal.background_buffer_flush_schedule_pool_size(Number) The maximum number of threads that will be used for performing flush operations for Buffer-engine tables in the background.background_common_pool_size(Number) The maximum number of threads that will be used for performing a variety of operations (mostly garbage collection) for MergeTree-engine tables in a background.background_distributed_schedule_pool_size(Number) The maximum number of threads that will be used for executing distributed sends.background_fetches_pool_size(Number) The maximum number of threads that will be used for fetching data parts from another replica for MergeTree-engine tables in a background.background_merges_mutations_concurrency_ratio(Number) Sets a ratio between the number of threads and the number of background merges and mutations that can be executed concurrently.background_message_broker_schedule_pool_size(Number) The maximum number of threads that will be used for executing background operations for message streaming.background_move_pool_size(Number) The maximum number of threads that will be used for moving data parts to another disk or volume for MergeTree-engine tables in a background.background_pool_size(Number) Sets the number of threads performing background merges and mutations for MergeTree-engine tables.background_schedule_pool_size(Number) The maximum number of threads that will be used for constantly executing some lightweight periodic operations for replicated tables, Kafka streaming, and DNS cache updates.backup_threads(Number) The maximum number of threads to execute BACKUP requests.compression(Attributes List) Data compression configuration. (see below for nested schema)custom_macros(Attributes List) Custom ClickHouse macros. (see below for nested schema)default_database(String) Default database name.dictionaries_lazy_load(Boolean) Lazy loading of dictionaries. If true, then each dictionary is loaded on the first use.error_log_enabled(Boolean) Enables or disables error_log system table.error_log_retention_size(Number) The maximum size that error_log can grow to before old data will be removed. If set to 0, automatic removal of error_log data based on size is disabled.error_log_retention_time(Number) The maximum time that error_log records will be retained before removal. If set to 0, automatic removal of error_log data based on time is disabled.geobase_enabled(Boolean) Enable or disable geobase.geobase_uri(String) Address of the archive with the user geobase in Object Storage.graphite_rollup(Attributes List) Graphite rollup configuration. (see below for nested schema)jdbc_bridge(Attributes) JDBC bridge configuration. (see below for nested schema)kafka(Attributes) Kafka connection configuration. (see below for nested schema)keep_alive_timeout(Number) The number of seconds that ClickHouse waits for incoming requests for HTTP protocol before closing the connection.log_level(String) Logging level.max_concurrent_queries(Number) Limit on total number of concurrently executed queries.max_connections(Number) Max server connections.max_partition_size_to_drop(Number) Restriction on dropping partitions.max_table_size_to_drop(Number) Restriction on deleting tables.merge_tree(Attributes) MergeTree engine configuration. (see below for nested schema)metric_log_enabled(Boolean) Enable or disable metric_log system table.metric_log_retention_size(Number) The maximum size that metric_log can grow to before old data will be removed.metric_log_retention_time(Number) The maximum time that metric_log records will be retained before removal.mysql_protocol(Boolean) Enables or disables MySQL interface on ClickHouse server.opentelemetry_span_log_enabled(Boolean) Enable or disable opentelemetry_span_log system table.opentelemetry_span_log_retention_size(Number) The maximum size that opentelemetry_span_log can grow to before old data will be removed.opentelemetry_span_log_retention_time(Number) The maximum time that opentelemetry_span_log records will be retained before removal.part_log_retention_size(Number) The maximum size that part_log can grow to before old data will be removed.part_log_retention_time(Number) The maximum time that part_log records will be retained before removal.processors_profile_log_enabled(Boolean) Enables or disables processors_profile_log system table.processors_profile_log_retention_size(Number) The maximum time that processors_profile_log records will be retained before removal. If set to 0, automatic removal of processors_profile_log data based on time is disabled.processors_profile_log_retention_time(Number) Enables or disables error_log system table.query_cache(Attributes) Query cache configuration. (see below for nested schema)query_log_retention_size(Number) The maximum size that query_log can grow to before old data will be removed.query_log_retention_time(Number) The maximum time that query_log records will be retained before removal.query_masking_rules(Attributes List) Query masking rules configuration. (see below for nested schema)query_thread_log_enabled(Boolean) Enable or disable query_thread_log system table.query_thread_log_retention_size(Number) The maximum size that query_thread_log can grow to before old data will be removed.query_thread_log_retention_time(Number) The maximum time that query_thread_log records will be retained before removal.query_views_log_enabled(Boolean) Enable or disable query_views_log system table.query_views_log_retention_size(Number) The maximum size that query_views_log can grow to before old data will be removed.query_views_log_retention_time(Number) The maximum time that query_views_log records will be retained before removal.rabbitmq(Attributes) RabbitMQ connection configuration. (see below for nested schema)restore_threads(Number) The maximum number of threads to execute RESTORE requests.session_log_enabled(Boolean) Enable or disable session_log system table.session_log_retention_size(Number) The maximum size that session_log can grow to before old data will be removed.session_log_retention_time(Number) The maximum time that session_log records will be retained before removal.text_log_enabled(Boolean) Enable or disable text_log system table.text_log_level(String) Logging level for text_log system table.text_log_retention_size(Number) The maximum size that text_log can grow to before old data will be removed.text_log_retention_time(Number) The maximum time that text_log records will be retained before removal.timezone(String) The server's time zone.total_memory_profiler_step(Number) Whenever server memory usage becomes larger than every next step in number of bytes the memory profiler will collect the allocating stack trace.total_memory_tracker_sample_probability(Number) Allows to collect random allocations and de-allocations and writes them in the system.trace_log system table with trace_type equal to a MemorySample with the specified probability.trace_log_enabled(Boolean) Enable or disable trace_log system table.trace_log_retention_size(Number) The maximum size that trace_log can grow to before old data will be removed.trace_log_retention_time(Number) The maximum time that trace_log records will be retained before removal.uncompressed_cache_size(Number) Cache size (in bytes) for uncompressed data used by table engines from the MergeTree family. Zero means disabled.zookeeper_log_enabled(Boolean) Enable or disable zookeeper_log system table.zookeeper_log_retention_size(Number) The maximum size that zookeeper_log can grow to before old data will be removed.zookeeper_log_retention_time(Number) The maximum time that zookeeper_log records will be retained before removal.
Nested Schema for clickhouse.config.access_control_improvements
Read-Only:
select_from_information_schema_requires_grant(Boolean) Sets whetherSELECT * FROM information_schema.<table>requires any grants and can be executed by any user. If set to true, then this query requiresGRANT SELECT ON information_schema.<table>, just as for ordinary tables.select_from_system_db_requires_grant(Boolean) Sets whetherSELECT * FROM system.<table>requires any grants and can be executed by any user. If set to true then this query requiresGRANT SELECT ON system.<table>just as for non-system tables.
Nested Schema for clickhouse.config.compression
Read-Only:
level(Number) Compression level forZSTDmethod.method(String) Compression method. Two methods are available:LZ4andzstd.min_part_size(Number) Min part size: Minimum size (in bytes) of a data part in a table. ClickHouse only applies the rule to tables with data parts greater than or equal to the Min part size value.min_part_size_ratio(Number) Min part size ratio: Minimum table part size to total table size ratio. ClickHouse only applies the rule to tables in which this ratio is greater than or equal to the Min part size ratio value.
Nested Schema for clickhouse.config.custom_macros
Read-Only:
name(String) Name of the macro.value(String) Value of the macro.
Nested Schema for clickhouse.config.graphite_rollup
Read-Only:
name(String) Graphite rollup configuration name.path_column_name(String) The name of the column storing the metric name (Graphite sensor). Default value: Path.patterns(Attributes List) Set of thinning rules. (see below for nested schema)time_column_name(String) The name of the column storing the time of measuring the metric. Default value: Time.value_column_name(String) The name of the column storing the value of the metric at the time set intime_column_name. Default value: Value.version_column_name(String) The name of the column storing the version of the metric. Default value: Timestamp.
Nested Schema for clickhouse.config.graphite_rollup.patterns
Read-Only:
function(String) Aggregation function name.regexp(String) Regular expression that the metric name must match.retention(Attributes List) Retain parameters. (see below for nested schema)
Nested Schema for clickhouse.config.graphite_rollup.version_column_name.retention
Read-Only:
age(Number) Minimum data age in seconds.precision(Number) Accuracy of determining the age of the data in seconds.
Nested Schema for clickhouse.config.jdbc_bridge
Read-Only:
host(String) Host of jdbc bridge.port(Number) Port of jdbc bridge. Default value: 9019.
Nested Schema for clickhouse.config.kafka
Read-Only:
auto_offset_reset(String) Action when no initial offset: 'smallest','earliest','largest','latest','error'.debug(String) A comma-separated list of debug contexts to enable.enable_ssl_certificate_verification(Boolean) Enable verification of SSL certificates.max_poll_interval_ms(Number) Maximum allowed time between calls to consume messages. If exceeded, consumer is considered failed.sasl_mechanism(String) SASL mechanism used in kafka authentication.sasl_password(String, Sensitive) User password on kafka server.sasl_username(String) Username on kafka server.security_protocol(String) Security protocol used to connect to kafka server.session_timeout_ms(Number) Client group session and failure detection timeout.
Nested Schema for clickhouse.config.merge_tree
Read-Only:
check_sample_column_is_correct(Boolean) Enables the check at table creation that the sampling column type is correct. Default value: true.cleanup_delay_period(Number) Minimum period to clean old queue logs, blocks hashes and parts.deduplicate_merge_projection_mode(String) Determines the behavior of background merges for MergeTree tables with projections.fsync_after_insert(Boolean) Do fsync for every inserted part. Significantly decreases performance of inserts, not recommended to use with wide parts.fsync_part_directory(Boolean) Do fsync for part directory after all part operations (writes, renames, etc.).inactive_parts_to_delay_insert(Number) If the number of inactive parts in a single partition in the table at least that many the inactive_parts_to_delay_insert value, an INSERT artificially slows down. It is useful when a server fails to clean up parts quickly enough.inactive_parts_to_throw_insert(Number) If the number of inactive parts in a single partition more than the inactive_parts_to_throw_insert value, INSERT is interrupted with theToo many inactive parts (N). Parts cleaning are processing significantly slower than insertsexception.lightweight_mutation_projection_mode(String) Determines the behavior of lightweight deletes for MergeTree tables with projections.materialize_ttl_recalculate_only(Boolean) Only recalculate ttl info when MATERIALIZE TTL.max_avg_part_size_for_too_many_parts(Number) Thetoo many partscheck will be active only if the average part size is not larger than the specified threshold. This allows large tables if parts are successfully merged.max_bytes_to_merge_at_max_space_in_pool(Number) The maximum total parts size (in bytes) to be merged into one part, if there are enough resources available. Roughly corresponds to the maximum possible part size created by an automatic background merge.max_bytes_to_merge_at_min_space_in_pool(Number) Max bytes to merge at min space in pool: Maximum total size of a data part to merge when the number of free threads in the background pool is minimum.max_cleanup_delay_period(Number) Maximum period to clean old queue logs, blocks hashes and parts. Default value: 300 seconds.max_merge_selecting_sleep_ms(Number) Maximum sleep time for merge selecting. Default value: 60000 milliseconds (60 seconds).max_number_of_merges_with_ttl_in_pool(Number) When there is more than specified number of merges with TTL entries in pool, do not assign new merge with TTL.max_parts_in_total(Number) Maximum number of parts in all partitions.max_replicated_merges_in_queue(Number) Max replicated merges in queue: Maximum number of merge tasks that can be in the ReplicatedMergeTree queue at the same time.merge_max_block_size(Number) The number of rows that are read from the merged parts into memory. Default value: 8192.merge_selecting_sleep_ms(Number) Sleep time for merge selecting when no part is selected. Lower values increase ZooKeeper requests in large clusters.merge_with_recompression_ttl_timeout(Number) Minimum delay in seconds before repeating a merge with recompression TTL. Default value: 14400 seconds (4 hours).merge_with_ttl_timeout(Number) Minimum delay in seconds before repeating a merge with delete TTL. Default value: 14400 seconds (4 hours).min_age_to_force_merge_on_partition_only(Boolean) Whether min_age_to_force_merge_seconds should be applied only on the entire partition and not on subset.min_age_to_force_merge_seconds(Number) Merge parts if every part in the range is older than the value ofmin_age_to_force_merge_seconds.min_bytes_for_wide_part(Number) Minimum number of bytes in a data part that can be stored in Wide format. You can set one, both or none of these settings.min_compressed_bytes_to_fsync_after_fetch(Number) Minimal number of rows to do fsync for part after merge. 0 means disabled.min_compressed_bytes_to_fsync_after_merge(Number) Minimal number of compressed bytes to do fsync for part after merge. 0 means disabled.min_rows_for_wide_part(Number) Minimum number of rows in a data part that can be stored in Wide format. You can set one, both or none of these settings.min_rows_to_fsync_after_merge(Number) Minimal number of rows to do fsync for part after merge. 0 means disabled.number_of_free_entries_in_pool_to_execute_mutation(Number) When there is less than specified number of free entries in pool, do not execute part mutations. This is to leave free threads for regular merges and avoidToo many parts. Default value: 20.number_of_free_entries_in_pool_to_lower_max_size_of_merge(Number) Number of free entries in pool to lower max size of merge: Threshold value of free entries in the pool. If the number of entries in the pool falls below this value, ClickHouse reduces the maximum size of a data part to merge. This helps handle small merges faster, rather than filling the pool with lengthy merges.parts_to_delay_insert(Number) Parts to delay insert: Number of active data parts in a table, on exceeding which ClickHouse starts artificially reduce the rate of inserting data into the tableparts_to_throw_insert(Number) Parts to throw insert: Threshold value of active data parts in a table, on exceeding which ClickHouse throws the 'Too many parts ...' exception.replicated_deduplication_window(Number) Replicated deduplication window: Number of recent hash blocks that ZooKeeper will store (the old ones will be deleted).replicated_deduplication_window_seconds(Number) Replicated deduplication window seconds: Time during which ZooKeeper stores the hash blocks (the old ones will be deleted).ttl_only_drop_parts(Boolean) Enables zero-copy replication when a replica is located on a remote filesystem.
Nested Schema for clickhouse.config.query_cache
Read-Only:
max_entries(Number) The maximum number of SELECT query results stored in the cache. Default value: 1024.max_entry_size_in_bytes(Number) The maximum size in bytes SELECT query results may have to be saved in the cache. Default value: 1048576 (1 MiB).max_entry_size_in_rows(Number) The maximum number of rows SELECT query results may have to be saved in the cache. Default value: 30000000 (30 mil).max_size_in_bytes(Number) The maximum cache size in bytes. 0 means the query cache is disabled. Default value: 1073741824 (1 GiB).
Nested Schema for clickhouse.config.query_masking_rules
Read-Only:
name(String) Name for the rule.regexp(String) RE2 compatible regular expression.replace(String) Substitution string for sensitive data. Default value: six asterisks.
Nested Schema for clickhouse.config.rabbitmq
Read-Only:
password(String, Sensitive) RabbitMQ user password.username(String) RabbitMQ username.vhost(String) RabbitMQ vhost. Default:\.
Nested Schema for clickhouse.resources
Read-Only:
disk_size(Number) Volume of the storage available to a host, in gigabytes.disk_type_id(String) Type of the storage of hosts. For more information see the official documentation.resource_preset_id(String) The ID of the preset for computational resources available to a host (CPU, memory etc.). For more information, see the official documentation.
Nested Schema for cloud_storage
Read-Only:
data_cache_enabled(Boolean) Enables temporary storage in the cluster repository of data requested from the object repository.data_cache_max_size(Number) Defines the maximum amount of memory (in bytes) allocated in the cluster storage for temporary storage of data requested from the object storage.enabled(Boolean) Whether to use Yandex Object Storage for storing ClickHouse data. Can be eithertrueorfalse.move_factor(Number) Sets the minimum free space ratio in the cluster storage. If the free space is lower than this value, the data is transferred to Yandex Object Storage. Acceptable values are 0 to 1, inclusive.prefer_not_to_merge(Boolean) Disables merging of data parts inYandex Object Storage.
Nested Schema for format_schema
Read-Only:
name(String) The name of the format schema.type(String) Type of the format schema.uri(String) Format schema file URL. You can only use format schemas stored in Yandex Object Storage.
Nested Schema for hosts
Read-Only:
assign_public_ip(Boolean) Whether the host should get a public IP address.fqdn(String) The fully qualified domain name of the host.shard_name(String) The name of the shard to which the host belongs.subnet_id(String) ID of the subnet where the host is located.type(String) The type of the host to be deployed. Can be eitherCLICKHOUSEorZOOKEEPER.zone(String) The availability zone where resource is located. If it is not provided, the default provider zone will be used.
Nested Schema for maintenance_window
Read-Only:
day(String) Day of week for maintenance window if window type is weekly. Possible values:MON,TUE,WED,THU,FRI,SAT,SUN.hour(Number) Hour of day in UTC time zone (1-24) for maintenance window if window type is weekly.type(String) Type of maintenance window. Can be eitherANYTIMEorWEEKLY. A day and hour of window need to be specified with weekly window.
Nested Schema for ml_model
Read-Only:
name(String) The name of the ml model.type(String) Type of the model.uri(String) Model file URL. You can only use models stored in Yandex Object Storage.
Nested Schema for shard_group
Read-Only:
description(String) MarkdownDescription of the shard group.name(String) The name of the shard group, used as cluster name in Distributed tables.shard_names(List of String) List of shards names that belong to the shard group.
Nested Schema for shards
Read-Only:
resources(Attributes) Resources allocated to hosts. (see below for nested schema)weight(Number) The weight of shard.
Nested Schema for shards.resources
Read-Only:
disk_size(Number) Volume of the storage available to a host, in gigabytes.disk_type_id(String) Type of the storage of hosts. For more information see the official documentation.resource_preset_id(String) The ID of the preset for computational resources available to a host (CPU, memory etc.). For more information, see the official documentation.
Nested Schema for zookeeper
Read-Only:
resources(Attributes) Resources allocated to hosts. (see below for nested schema)
Nested Schema for zookeeper.resources
Read-Only:
disk_size(Number) Volume of the storage available to a host, in gigabytes.disk_type_id(String) Type of the storage of hosts. For more information see the official documentation.resource_preset_id(String) The ID of the preset for computational resources available to a host (CPU, memory etc.). For more information, see the official documentation.
Argument Reference
One of the following arguments are required:
cluster_id- The ID of the ClickHouse cluster.name- The name of the ClickHouse cluster.