yandex_mdb_mongodb_cluster (DataSource)
Written by
Updated at February 9, 2026
Get information about a Yandex Managed MongoDB cluster. For more information, see the official documentation.
Warning
Either cluster_id or name should be specified.
Example usage
//
// Get information about existing MDB MongoDB Cluster.
//
data "yandex_mdb_mongodb_cluster" "foo" {
name = "test"
}
output "network_id" {
value = data.yandex_mdb_mongodb_cluster.foo.network_id
}
Arguments & Attributes Reference
cluster_id(String). The ID of the cluster.created_at(Read-Only) (String). The creation timestamp of the resource.deletion_protection(Bool). 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.environment(Required)(String). Deployment environment of the MongoDB cluster. Can be eitherPRESTABLEorPRODUCTION.folder_id(String). The folder identifier that resource belongs to. If it is not provided, the default providerfolder-idis used.health(Read-Only) (String). Aggregated health of the cluster. Can be eitherALIVE,DEGRADED,DEADorHEALTH_UNKNOWN. For more information seehealthfield of JSON representation in the official documentation.id(String).labels(Map Of String). A set of key/value label pairs which assigned to resource.name(Required)(String). The resource name.network_id(Required)(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.sharded(Read-Only) (Bool). MongoDB Cluster mode enabled/disabled.status(Read-Only) (String). Status of the cluster. Can be eitherCREATING,STARTING,RUNNING,UPDATING,STOPPING,STOPPED,ERRORorSTATUS_UNKNOWN. For more information seestatusfield of JSON representation in the official documentation.cluster_config[Block]. Configuration of the MongoDB subcluster.backup_retain_period_days(Number). Retain period of automatically created backup in days.feature_compatibility_version(String). Feature compatibility version of MongoDB. If not provided version is taken. Can be either6.0,5.0,4.4and4.2.version(Required)(String). Version of the MongoDB server software. Can be either4.2,4.4,4.4-enterprise,5.0,5.0-enterprise,6.0and6.0-enterprise.access[Block]. Access policy to the MongoDB cluster.data_lens(Bool). Allow access for Yandex DataLens.data_transfer(Bool). Allow access for DataTransfer.web_sql(Bool). Allow access for WebSQL.
backup_window_start[Block]. Time to start the daily backup, in the UTC timezone.hours(Number). The hour at which backup will be started.minutes(Number). The minute at which backup will be started.
mongocfg[Block]. Configuration of the mongocfg service.chaining_allowed(Bool). Chained replication setting. For more information, see the chainingAllowed description in the official documentation.audit_log[Block]. A set of audit log settings (see the auditLog option). Available only in enterprise edition.filter(String). Configuration of the audit log filter in JSON format. For more information see auditLog.filter description in the official documentation. Available only in enterprise edition.
net[Block]. A set of network settings (see the net option).max_incoming_connections(Number). The maximum number of simultaneous connections that host will accept. For more information, see the net.maxIncomingConnections description in the official documentation.
operation_profiling[Block]. A set of profiling settings (see the operationProfiling option).mode(String). Specifies which operations should be profiled. The following profiler levels are available: off, slow_op, all. For more information, see the operationProfiling.mode description in the official documentation.slow_op_threshold(Number). The slow operation time threshold, in milliseconds. Operations that run for longer than this threshold are considered slow. For more information, see the operationProfiling.slowOpThresholdMs description in the official documentation.
oplog[Block]. A set of oplog settings (see the oplog option).max_size_percent(Number). The maximum size of the oplog, as a percentage of the total storage size. For more information, see the oplog.oplogSizeMB description in the official documentation.min_retention_hours(Number). The minimum number of hours to preserve an oplog entry, where decimal values represent the fractions of an hour. For more information, see the oplog.minRetentionHours description in the official documentation.
set_parameter[Block]. A set of MongoDB Server Parameters (see the setParameter option).audit_authorization_success(Bool). Enables the auditing of authorization successes. Can be either true or false. For more information, see the auditAuthorizationSuccess description in the official documentation. Available only in enterprise edition.enable_flow_control(Bool). Enables the flow control. Can be either true or false. For more information, see the enableFlowControl description in the official documentation.
storage[Block]. A set of storage settings (see the storage option).wired_tiger[Block]. The WiredTiger engine settings. (see the storage.wiredTiger option).cache_size(Number). Defines the maximum size of the internal cache that WiredTiger will use for all data in percents. For more information, see the storage.wiredTiger.engineConfig.cacheSize description in the official documentation.cache_size_gb(Number). Defines the maximum size of the internal cache that WiredTiger will use for all data. For more information, see the storage.wiredTiger.engineConfig.cacheSizeGB description in the official documentation.
mongod[Block]. Configuration of the mongod service.chaining_allowed(Bool). Chained replication setting. For more information, see the chainingAllowed description in the official documentation.audit_log[Block]. A set of audit log settings (see the auditLog option). Available only in enterprise edition.filter(String). Configuration of the audit log filter in JSON format. For more information see auditLog.filter description in the official documentation. Available only in enterprise edition.runtime_configuration(Bool). Specifies if a node allows runtime configuration of audit filters and the auditAuthorizationSuccess variable. For more information see auditLog.runtimeConfiguration description in the official documentation. Available only in enterprise edition.
net[Block]. A set of network settings (see the net option).compressors(List Of String). Specifies the default compressor(s) to use for communication between this mongod or mongos. Accepts array of compressors. Order matters. Available compressors: snappy, zlib, zstd, disabled. To disable network compression, makedisabledthe only value. For more information, see the net.Compression.Compressors description in the official documentation.max_incoming_connections(Number). The maximum number of simultaneous connections that host will accept. For more information, see the net.maxIncomingConnections description in the official documentation.
operation_profiling[Block]. A set of profiling settings (see the operationProfiling option).mode(String). Specifies which operations should be profiled. The following profiler levels are available: off, slow_op, all. For more information, see the operationProfiling.mode description in the official documentation.slow_op_sample_rate(Number). The fraction of slow operations that should be profiled or logged. Accepts values between 0 and 1, inclusive. For more information, see the operationProfiling.slowOpSampleRate description in the official documentation.slow_op_threshold(Number). The slow operation time threshold, in milliseconds. Operations that run for longer than this threshold are considered slow. For more information, see the operationProfiling.slowOpThresholdMs description in the official documentation.
oplog[Block]. A set of oplog settings (see the oplog option).max_size_percent(Number). The maximum size of the oplog, as a percentage of the total storage size. For more information, see the oplog.oplogSizeMB description in the official documentation.min_retention_hours(Number). The minimum number of hours to preserve an oplog entry, where decimal values represent the fractions of an hour. For more information, see the oplog.minRetentionHours description in the official documentation.
security[Block]. A set of MongoDB Security settings (see the security option). Available only in enterprise edition.enable_encryption(Bool). Enables the encryption for the WiredTiger storage engine. Can be either true or false. For more information see security.enableEncryption description in the official documentation. Available only in enterprise edition.kmip[Block]. Configuration of the third party key management appliance via the Key Management Interoperability Protocol (KMIP) (see Encryption tutorial ). Requiresenable_encryptionto be true. The structure is documented below. Available only in enterprise edition.client_certificate(String). String containing the client certificate used for authenticating MongoDB to the KMIP server. For more information see security.kmip.clientCertificateFile description in the official documentation.key_identifier(String). Unique KMIP identifier for an existing key within the KMIP server. For more information see security.kmip.keyIdentifier description in the official documentation.port(Number). Port number to use to communicate with the KMIP server. Default: 5696 For more information see security.kmip.port description in the official documentation.server_ca(String). Path to CA File. Used for validating secure client connection to KMIP server. For more information see security.kmip.serverCAFile description in the official documentation.server_name(String). Hostname or IP address of the KMIP server to connect to. For more information see security.kmip.serverName description in the official documentation.
set_parameter[Block]. A set of MongoDB Server Parameters (see the setParameter option).audit_authorization_success(Bool). Enables the auditing of authorization successes. Can be either true or false. For more information, see the auditAuthorizationSuccess description in the official documentation. Available only in enterprise edition.enable_flow_control(Bool). Enables the flow control. Can be either true or false. For more information, see the enableFlowControl description in the official documentation.flow_control_target_lag_seconds(Number). The target maximum majority committed lag when running with flow control. For more information, see the flowControlTargetLagSeconds description in the official documentation.flow_control_warn_threshold_seconds(Number). The amount of time to wait to log a warning once the flow control mechanism detects the majority commit point has not moved. For more information, see the flowControlWarnThresholdSeconds description in the official documentation.migrate_clone_insertion_batch_delay_ms(Number). Time in milliseconds to wait between batches of insertions during cloning step of the migration process. For more information, see the migrateCloneInsertionBatchDelayMs description in the official documentation.migrate_clone_insertion_batch_size(Number). The maximum number of documents to insert in a single batch during the cloning step of the migration process. For more information, see the migrateCloneInsertionBatchSize description in the official documentation.min_snapshot_history_window_in_seconds(Number). The minimum time window in seconds for which the storage engine keeps the snapshot history. For more information, see the minSnapshotHistoryWindowInSeconds description in the official documentation.orphan_cleanup_delay_secs(Number). Minimum delay before a migrated chunk is deleted from the source shard. For more information, see the orphanCleanupDelaySecs description in the official documentation.persisted_chunk_cache_update_max_batch_size(Number). Specifies the maximum batch size used for updating the persisted chunk cache. For more information, see the persistedChunkCacheUpdateMaxBatchSize description in the official documentation.range_deleter_batch_delay_ms(Number). The amount of time in milliseconds to wait before the next batch of deletion during the cleanup stage of chunk migration (or the cleanupOrphaned command). For more information, see the rangeDeleterBatchDelayMS description in the official documentation.range_deleter_batch_size(Number). The maximum number of documents in each batch to delete during the cleanup stage of chunk migration (or the cleanupOrphaned command). For more information, see the rangeDeleterBatchSize description in the official documentation.mirror_reads[Block]. A set of MongoDB Mirror Reads settings (see the mirrorReads option).max_time_ms(Number). The maximum time in milliseconds for the mirrored reads. For more information see mirrorReads.maxTimeMS description in the official documentationsampling_rate(Number). The sampling rate used to mirror a subset of operations that support mirroring. For more information see mirrorReads.samplingRate description in the official documentation
storage[Block]. A set of storage settings (see the storage option).journal[Block]. The durability journal to ensure data files remain valid and recoverable.commit_interval(Number). The maximum amount of time in milliseconds that the mongod process allows between journal operations. For more information, see the storage.journal.commitIntervalMs description in the official documentation.
wired_tiger[Block]. The WiredTiger engine settings. (see the storage.wiredTiger option). These settings available only onmongodhosts.block_compressor(String). Specifies the default compression for collection data. You can override this on a per-collection basis when creating collections. Available compressors are: none, snappy, zlib, zstd. This setting available only onmongodhosts. For more information, see the storage.wiredTiger.collectionConfig.blockCompressor description in the official documentation.cache_size(Number). Defines the maximum size of the internal cache that WiredTiger will use for all data in percents. For more information, see the storage.wiredTiger.engineConfig.cacheSize description in the official documentation.cache_size_gb(Number). Defines the maximum size of the internal cache that WiredTiger will use for all data. For more information, see the storage.wiredTiger.engineConfig.cacheSizeGB description in the official documentation.prefix_compression(Bool). Enables or disables prefix compression for index data. Сan be either true or false. For more information, see the storage.wiredTiger.indexConfig.prefixCompression description in the official documentation.
mongos[Block]. Configuration of the mongos service.chunk_size(Number). The size of the chunk, in bytes. For more information, see the chunkSize description in the official documentation.audit_log[Block]. A set of audit log settings (see the auditLog option). Available only in enterprise edition.filter(String). Configuration of the audit log filter in JSON format. For more information see auditLog.filter description in the official documentation. Available only in enterprise edition.
net[Block]. A set of network settings (see the net option).compressors(List Of String). Specifies the default compressor(s) to use for communication between this mongod or mongos. Accepts array of compressors. Order matters. Available compressors: snappy, zlib, zstd, disabled. To disable network compression, makedisabledthe only value. For more information, see the net.Compression.Compressors description in the official documentation.max_incoming_connections(Number). The maximum number of simultaneous connections that host will accept. For more information, see the net.maxIncomingConnections description in the official documentation.
set_parameter[Block]. A set of MongoDB Server Parameters (see the setParameter option).audit_authorization_success(Bool). Enables the auditing of authorization successes. Can be either true or false. For more information, see the auditAuthorizationSuccess description in the official documentation. Available only in enterprise edition.read_hedging_mode(String). Specifies whether mongos supports hedged reads for those read operations whose read preference have enabled the hedged read option. For more information, see the readHedgingMode description in the official documentation.sharding_task_executor_pool_host_timeout_ms(Number). Maximum time that mongos goes without communication to a host before mongos drops all connections to the host. For more information, see the shardingTaskExecutorPoolHostTimeoutMS description in the official documentation.sharding_task_executor_pool_max_connecting(Number). Maximum number of simultaneous initiating connections (including pending connections in setup/refresh state) each TaskExecutor connection pool can have to a mongod instance. For more information, see the shardingTaskExecutorPoolMaxConnecting description in the official documentation.sharding_task_executor_pool_max_size(Number). Maximum number of outbound connections each TaskExecutor connection pool can open to any given mongod instance. For more information, see the shardingTaskExecutorPoolMaxSize description in the official documentation.sharding_task_executor_pool_max_size_for_config_servers(Number). Optional override for ShardingTaskExecutorPoolMaxSize to set the maximum number of outbound connections each TaskExecutor connection pool can open to a configuration server. For more information, see the shardingTaskExecutorPoolMaxSizeForConfigServers description in the official documentation.sharding_task_executor_pool_min_size(Number). Minimum number of outbound connections each TaskExecutor connection pool can open to any given mongod instance. For more information, see the shardingTaskExecutorPoolMinSize description in the official documentation.sharding_task_executor_pool_min_size_for_config_servers(Number). Optional override for ShardingTaskExecutorPoolMinSize to set the minimum number of outbound connections each TaskExecutor connection pool can open to a configuration server. For more information, see the shardingTaskExecutorPoolMinSizeForConfigServers description in the official documentation.sharding_task_executor_pool_refresh_requirement_ms(Number). Maximum time the mongos waits before attempting to heartbeat an idle connection in the pool. For more information, see the shardingTaskExecutorPoolRefreshRequirementMS description in the official documentation.sharding_task_executor_pool_refresh_timeout_ms(Number). Maximum time the mongos waits for a heartbeat before timing out the heartbeat. For more information, see the shardingTaskExecutorPoolRefreshTimeoutMS description in the official documentation.sharding_task_executor_pool_replica_set_matching(String). On a mongos instance, this parameter sets the policy that determines the minimum size limit of its connection pools to nodes within replica sets. For more information, see the shardingTaskExecutorPoolReplicaSetMatching description in the official documentation.warm_min_connections_in_sharding_task_executor_pool_on_startup(Bool). Configures a mongos instance to prewarm its connection pool on startup. For more information, see the warmMinConnectionsInShardingTaskExecutorPoolOnStartup description in the official documentation.warm_min_connections_in_sharding_task_executor_pool_on_startup_wait_ms(Number). Sets the timeout threshold in milliseconds for a mongos to wait for ShardingTaskExecutorPoolMinSize connections to be established per shard host when using the warmMinConnectionsInShardingTaskExecutorPoolOnStartup parameter. For more information, see the warmMinConnectionsInShardingTaskExecutorPoolOnStartupWaitMS description in the official documentation.
performance_diagnostics[Block]. Performance diagnostics to the MongoDB cluster.enabled(Bool). Enable or disable performance diagnostics.
database[Block]. A database of the MongoDB cluster.name(Required)(String). The name of the database.
disk_size_autoscaling_mongocfg[Block]. Disk size autoscaling settings for mongocfg.disk_size_limit(Required)(Number). Limit of disk size after autoscaling (GiB).emergency_usage_threshold(Number). Immediate autoscaling disk usage (percent).planned_usage_threshold(Number). Maintenance window autoscaling disk usage (percent).
disk_size_autoscaling_mongod[Block]. Disk size autoscaling settings for mongod.disk_size_limit(Required)(Number). Limit of disk size after autoscaling (GiB).emergency_usage_threshold(Number). Immediate autoscaling disk usage (percent).planned_usage_threshold(Number). Maintenance window autoscaling disk usage (percent).
disk_size_autoscaling_mongoinfra[Block]. Disk size autoscaling settings for mongoinfra.disk_size_limit(Required)(Number). Limit of disk size after autoscaling (GiB).emergency_usage_threshold(Number). Immediate autoscaling disk usage (percent).planned_usage_threshold(Number). Maintenance window autoscaling disk usage (percent).
disk_size_autoscaling_mongos[Block]. Disk size autoscaling settings for mongos.disk_size_limit(Required)(Number). Limit of disk size after autoscaling (GiB).emergency_usage_threshold(Number). Immediate autoscaling disk usage (percent).planned_usage_threshold(Number). Maintenance window autoscaling disk usage (percent).
host[Block]. A host of the MongoDB cluster.assign_public_ip(Bool). Should this host have assigned public IP assigned. Can be eithertrueorfalse.health(Read-Only) (String). The health of the host.name(Read-Only) (String). The fully qualified domain name of the host. Computed on server side.role(String). The role of the cluster (either PRIMARY or SECONDARY).shard_name(String). The name of the shard to which the host belongs. Only for sharded cluster.subnet_id(Required)(String). The ID of the subnet, to which the host belongs. The subnet must be a part of the network to which the cluster belongs.type(String). Type of Mongo daemon which runs on this host (mongod, mongos, mongocfg, mongoinfra). Defaults tomongod.zone_id(Required)(String). The availability zone where resource is located. If it is not provided, the default provider zone will be used.host_parameters[Block]. The parameters of mongod host in replicaset.hidden(Bool). Should this host be hidden in replicaset. Can be eithertrueoffalse. For more information see the official documentation .priority(Number). A floating point number that indicates the relative likelihood of a replica set member to become the primary. For more information see the official documentation .secondary_delay_secs(Number). The number of secondsbehindthe primary that this replica set member shouldlag. For more information see the official documentation .tags(Map Of String). A set of key/value pairs to assign for the replica set member. For more information see the official documentation .
maintenance_window[Block]. Maintenance window settings of the MongoDB cluster.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(Required)(String). Type of maintenance window. Can be eitherANYTIMEorWEEKLY. A day and hour of window need to be specified with weekly window.
resources[Block]. (DEPRECATED, useresources_*instead) Resources allocated to hosts of the MongoDB cluster.disk_size(Required)(Number). Volume of the storage available to a MongoDB host, in gigabytes.disk_type_id(Required)(String). Type of the storage of MongoDB hosts. For more information see the official documentation.resource_preset_id(Required)(String). The ID of the preset for computational resources available to a MongoDB host (CPU, memory etc.). For more information, see the official documentation.
resources_mongocfg[Block]. Resources allocated tomongocfghosts of the MongoDB cluster.disk_size(Required)(Number). Volume of the storage available to a MongoDB host, in gigabytes.disk_type_id(Required)(String). Type of the storage of MongoDB hosts. For more information see the official documentation.resource_preset_id(Required)(String). The ID of the preset for computational resources available to a MongoDB host (CPU, memory etc.). For more information, see the official documentation.
resources_mongod[Block]. Resources allocated tomongodhosts of the MongoDB cluster.disk_size(Required)(Number). Volume of the storage available to a MongoDB host, in gigabytes.disk_type_id(Required)(String). Type of the storage of MongoDB hosts. For more information see the official documentation.resource_preset_id(Required)(String). The ID of the preset for computational resources available to a MongoDB host (CPU, memory etc.). For more information, see the official documentation.
resources_mongoinfra[Block]. Resources allocated tomongoinfrahosts of the MongoDB cluster.disk_size(Required)(Number). Volume of the storage available to a MongoDB host, in gigabytes.disk_type_id(Required)(String). Type of the storage of MongoDB hosts. For more information see the official documentation.resource_preset_id(Required)(String). The ID of the preset for computational resources available to a MongoDB host (CPU, memory etc.). For more information, see the official documentation.
resources_mongos[Block]. Resources allocated tomongoshosts of the MongoDB cluster.disk_size(Required)(Number). Volume of the storage available to a MongoDB host, in gigabytes.disk_type_id(Required)(String). Type of the storage of MongoDB hosts. For more information see the official documentation.resource_preset_id(Required)(String). The ID of the preset for computational resources available to a MongoDB host (CPU, memory etc.). For more information, see the official documentation.
restore[Block]. The cluster will be created from the specified backup.backup_id(Required)(String). Backup ID. The cluster will be created from the specified backup. How to get a list of PostgreSQL backups.time(String). Timestamp of the moment to which the MongoDB cluster should be restored. (Format:2006-01-02T15:04:05- UTC). When not set, current time is used.
user[Block]. A user of the MongoDB cluster.name(Required)(String). The name of the user.password(Required)(String). The password of the user.permission[Block]. Set of permissions granted to the user.database_name(Required)(String). The name of the database that the permission grants access to.roles(List Of String). The roles of the user in this database. For more information see the official documentation.