Yandex Cloud
Search
Contact UsGet started
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • AI Studio
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
© 2025 Direct Cursus Technology L.L.C.
Terraform in Yandex Cloud
  • Getting started
  • Solution library
    • Overview
    • Release notes
          • mdb_mongodb_cluster
          • mdb_mongodb_database
          • mdb_mongodb_user

In this article:

  • Example usage
  • Schema
  • Required
  • Optional
  • Read-Only
  • Nested Schema for cluster_config
  • Nested Schema for cluster_config.access
  • Nested Schema for cluster_config.backup_window_start
  • Nested Schema for cluster_config.mongocfg
  • Nested Schema for cluster_config.mongocfg.net
  • Nested Schema for cluster_config.mongocfg.operation_profiling
  • Nested Schema for cluster_config.mongocfg.storage
  • Nested Schema for cluster_config.mongocfg.storage.wired_tiger
  • Nested Schema for cluster_config.mongod
  • Nested Schema for cluster_config.mongod.audit_log
  • Nested Schema for cluster_config.mongod.net
  • Nested Schema for cluster_config.mongod.operation_profiling
  • Nested Schema for cluster_config.mongod.security
  • Nested Schema for cluster_config.mongod.security.kmip
  • Nested Schema for cluster_config.mongod.set_parameter
  • Nested Schema for cluster_config.mongod.storage
  • Nested Schema for cluster_config.mongod.storage.journal
  • Nested Schema for cluster_config.mongod.storage.wired_tiger
  • Nested Schema for cluster_config.mongos
  • Nested Schema for cluster_config.mongos.net
  • Nested Schema for cluster_config.performance_diagnostics
  • Nested Schema for host
  • Nested Schema for host.host_parameters
  • Nested Schema for database
  • Nested Schema for disk_size_autoscaling_mongocfg
  • Nested Schema for disk_size_autoscaling_mongod
  • Nested Schema for disk_size_autoscaling_mongoinfra
  • Nested Schema for disk_size_autoscaling_mongos
  • Nested Schema for maintenance_window
  • Nested Schema for resources
  • Nested Schema for resources_mongocfg
  • Nested Schema for resources_mongod
  • Nested Schema for resources_mongoinfra
  • Nested Schema for resources_mongos
  • Nested Schema for restore
  • Nested Schema for timeouts
  • Nested Schema for user
  • Nested Schema for user.permission
  • Import
  1. Terraform reference
  2. Resources
  3. Managed Service for MongoDB
  4. Resources
  5. mdb_mongodb_cluster

yandex_mdb_mongodb_cluster (Resource)

Written by
Yandex Cloud
Updated at August 7, 2025
  • Example usage
  • Schema
    • Required
    • Optional
    • Read-Only
    • Nested Schema for cluster_config
    • Nested Schema for cluster_config.access
    • Nested Schema for cluster_config.backup_window_start
    • Nested Schema for cluster_config.mongocfg
    • Nested Schema for cluster_config.mongocfg.net
    • Nested Schema for cluster_config.mongocfg.operation_profiling
    • Nested Schema for cluster_config.mongocfg.storage
    • Nested Schema for cluster_config.mongocfg.storage.wired_tiger
    • Nested Schema for cluster_config.mongod
    • Nested Schema for cluster_config.mongod.audit_log
    • Nested Schema for cluster_config.mongod.net
    • Nested Schema for cluster_config.mongod.operation_profiling
    • Nested Schema for cluster_config.mongod.security
    • Nested Schema for cluster_config.mongod.security.kmip
    • Nested Schema for cluster_config.mongod.set_parameter
    • Nested Schema for cluster_config.mongod.storage
    • Nested Schema for cluster_config.mongod.storage.journal
    • Nested Schema for cluster_config.mongod.storage.wired_tiger
    • Nested Schema for cluster_config.mongos
    • Nested Schema for cluster_config.mongos.net
    • Nested Schema for cluster_config.performance_diagnostics
    • Nested Schema for host
    • Nested Schema for host.host_parameters
    • Nested Schema for database
    • Nested Schema for disk_size_autoscaling_mongocfg
    • Nested Schema for disk_size_autoscaling_mongod
    • Nested Schema for disk_size_autoscaling_mongoinfra
    • Nested Schema for disk_size_autoscaling_mongos
    • Nested Schema for maintenance_window
    • Nested Schema for resources
    • Nested Schema for resources_mongocfg
    • Nested Schema for resources_mongod
    • Nested Schema for resources_mongoinfra
    • Nested Schema for resources_mongos
    • Nested Schema for restore
    • Nested Schema for timeouts
    • Nested Schema for user
    • Nested Schema for user.permission
  • Import

Manages a MongoDB cluster within the Yandex Cloud. For more information, see the official documentation.

Example usageExample usage

//
// Create a new MDB MongoDB Cluster.
//
resource "yandex_mdb_mongodb_cluster" "my_cluster" {
  name        = "test"
  environment = "PRESTABLE"
  network_id  = yandex_vpc_network.foo.id

  cluster_config {
    version = "4.2"
  }

  labels = {
    test_key = "test_value"
  }

  database {
    name = "testdb"
  }

  user {
    name     = "john"
    password = "password"
    permission {
      database_name = "testdb"
    }
  }

  resources_mongod {
    resource_preset_id = "s2.small"
    disk_size          = 16
    disk_type_id       = "network-hdd"
  }

  resources_mongos {
    resource_preset_id = "s2.small"
    disk_size          = 14
    disk_type_id       = "network-hdd"
  }

  resources_mongocfg {
    resource_preset_id = "s2.small"
    disk_size          = 14
    disk_type_id       = "network-hdd"
  }

  host {
    zone_id   = "ru-central1-d"
    subnet_id = yandex_vpc_subnet.foo.id
  }

  maintenance_window {
    type = "ANYTIME"
  }
}

// Auxiliary resources
resource "yandex_vpc_network" "foo" {}

resource "yandex_vpc_subnet" "foo" {
  zone           = "ru-central1-d"
  network_id     = yandex_vpc_network.foo.id
  v4_cidr_blocks = ["10.1.0.0/24"]
}

SchemaSchema

RequiredRequired

  • cluster_config (Block List, Min: 1, Max: 1) Configuration of the MongoDB subcluster. (see below for nested schema)
  • environment (String) Deployment environment of the MongoDB cluster. Can be either PRESTABLE or PRODUCTION.
  • host (Block List, Min: 1) A host of the MongoDB cluster. (see below for nested schema)
  • name (String) The resource name.
  • network_id (String) The VPC Network ID of subnets which resource attached to.

OptionalOptional

  • cluster_id (String) The ID of the cluster.
  • database (Block Set, Deprecated) A database of the MongoDB cluster. (see below for nested schema)
  • deletion_protection (Boolean) The true value means that resource is protected from accidental deletion.
  • description (String) The resource description.
  • disk_size_autoscaling_mongocfg (Block List, Max: 1) Disk size autoscaling settings for mongocfg. (see below for nested schema)
  • disk_size_autoscaling_mongod (Block List, Max: 1) Disk size autoscaling settings for mongod. (see below for nested schema)
  • disk_size_autoscaling_mongoinfra (Block List, Max: 1) Disk size autoscaling settings for mongoinfra. (see below for nested schema)
  • disk_size_autoscaling_mongos (Block List, Max: 1) Disk size autoscaling settings for mongos. (see below for nested schema)
  • folder_id (String) The folder identifier that resource belongs to. If it is not provided, the default provider folder-id is used.
  • labels (Map of String) A set of key/value label pairs which assigned to resource.
  • maintenance_window (Block List, Max: 1) Maintenance window settings of the MongoDB cluster. (see below for nested schema)
  • resources (Block List, Max: 1, Deprecated) (DEPRECATED, use resources_* instead) Resources allocated to hosts of the MongoDB cluster. (see below for nested schema)
  • resources_mongocfg (Block List, Max: 1) Resources allocated to mongocfg hosts of the MongoDB cluster. (see below for nested schema)
  • resources_mongod (Block List, Max: 1) Resources allocated to mongod hosts of the MongoDB cluster. (see below for nested schema)
  • resources_mongoinfra (Block List, Max: 1) Resources allocated to mongoinfra hosts of the MongoDB cluster. (see below for nested schema)
  • resources_mongos (Block List, Max: 1) Resources allocated to mongos hosts of the MongoDB cluster. (see below for nested schema)
  • restore (Block List, Max: 1) The cluster will be created from the specified backup. (see below for nested schema)
  • security_group_ids (Set of String) The list of security groups applied to resource or their components.
  • timeouts (Block, Optional) (see below for nested schema)
  • user (Block Set, Deprecated) A user of the MongoDB cluster. (see below for nested schema)

Read-OnlyRead-Only

  • created_at (String) The creation timestamp of the resource.
  • health (String) Aggregated health of the cluster. Can be either ALIVE, DEGRADED, DEAD or HEALTH_UNKNOWN. For more information see health field of JSON representation in the official documentation.
  • id (String) The ID of this resource.
  • sharded (Boolean) MongoDB Cluster mode enabled/disabled.
  • status (String) 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.

Nested Schema for Nested Schema for cluster_config

Required:

  • version (String) Version of the MongoDB server software. Can be either 4.2, 4.4, 4.4-enterprise, 5.0, 5.0-enterprise, 6.0 and 6.0-enterprise.

Optional:

  • access (Block List, Max: 1) Access policy to the MongoDB cluster. (see below for nested schema)
  • backup_retain_period_days (Number) Retain period of automatically created backup in days.
  • backup_window_start (Block List, Max: 1) Time to start the daily backup, in the UTC timezone. (see below for nested schema)
  • feature_compatibility_version (String) Feature compatibility version of MongoDB. If not provided version is taken. Can be either 6.0, 5.0, 4.4 and 4.2.
  • mongocfg (Block List, Max: 1) Configuration of the mongocfg service. (see below for nested schema)
  • mongod (Block List, Max: 1) Configuration of the mongod service. (see below for nested schema)
  • mongos (Block List, Max: 1) Configuration of the mongos service. (see below for nested schema)
  • performance_diagnostics (Block List, Max: 1) Performance diagnostics to the MongoDB cluster. (see below for nested schema)

Nested Schema for Nested Schema for cluster_config.access

Optional:

  • data_lens (Boolean) Allow access for Yandex DataLens.
  • data_transfer (Boolean) Allow access for DataTransfer.
  • web_sql (Boolean) Allow access for WebSQL.

Nested Schema for Nested Schema for cluster_config.backup_window_start

Optional:

  • hours (Number) The hour at which backup will be started.
  • minutes (Number) The minute at which backup will be started.

Nested Schema for Nested Schema for cluster_config.mongocfg

Optional:

  • net (Block List, Max: 1) A set of network settings (see the net option). (see below for nested schema)
  • operation_profiling (Block List, Max: 1) A set of profiling settings (see the operationProfiling option). (see below for nested schema)
  • storage (Block List, Max: 1) A set of storage settings (see the storage option). (see below for nested schema)

Nested Schema for Nested Schema for cluster_config.mongocfg.net

Optional:

  • 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.

Nested Schema for Nested Schema for cluster_config.mongocfg.operation_profiling

Optional:

  • 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.

Nested Schema for Nested Schema for cluster_config.mongocfg.storage

Optional:

  • wired_tiger (Block List, Max: 1) The WiredTiger engine settings. (see the storage.wiredTiger option). (see below for nested schema)

Nested Schema for Nested Schema for cluster_config.mongocfg.storage.wired_tiger

Optional:

  • 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.

Nested Schema for Nested Schema for cluster_config.mongod

Optional:

  • audit_log (Block List, Max: 1) A set of audit log settings (see the auditLog option). Available only in enterprise edition. (see below for nested schema)
  • net (Block List, Max: 1) A set of network settings (see the net option). (see below for nested schema)
  • operation_profiling (Block List, Max: 1) A set of profiling settings (see the operationProfiling option). (see below for nested schema)
  • security (Block List, Max: 1) A set of MongoDB Security settings (see the security option). Available only in enterprise edition. (see below for nested schema)
  • set_parameter (Block List, Max: 1) A set of MongoDB Server Parameters (see the setParameter option). (see below for nested schema)
  • storage (Block List, Max: 1) A set of storage settings (see the storage option). (see below for nested schema)

Nested Schema for Nested Schema for cluster_config.mongod.audit_log

Optional:

  • 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 (Boolean) 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.

Nested Schema for Nested Schema for cluster_config.mongod.net

Optional:

  • 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, make disabled the 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.

Nested Schema for Nested Schema for cluster_config.mongod.operation_profiling

Optional:

  • 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.

Nested Schema for Nested Schema for cluster_config.mongod.security

Optional:

  • enable_encryption (Boolean) 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 List, Max: 1) Configuration of the third party key management appliance via the Key Management Interoperability Protocol (KMIP) (see Encryption tutorial ). Requires enable_encryption to be true. The structure is documented below. Available only in enterprise edition. (see below for nested schema)

Nested Schema for Nested Schema for cluster_config.mongod.security.kmip

Optional:

  • 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.

Nested Schema for Nested Schema for cluster_config.mongod.set_parameter

Optional:

  • audit_authorization_success (Boolean) 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 (Boolean) Enables the flow control. Can be either true or false. For more information, see the enableFlowControl 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.

Nested Schema for Nested Schema for cluster_config.mongod.storage

Optional:

  • journal (Block List, Max: 1) The durability journal to ensure data files remain valid and recoverable. (see below for nested schema)
  • wired_tiger (Block List, Max: 1) The WiredTiger engine settings. (see the storage.wiredTiger option). These settings available only on mongod hosts. (see below for nested schema)

Nested Schema for Nested Schema for cluster_config.mongod.storage.journal

Optional:

  • 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.

Nested Schema for Nested Schema for cluster_config.mongod.storage.wired_tiger

Optional:

  • 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 on mongod hosts. For more information, see the storage.wiredTiger.collectionConfig.blockCompressor 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 (Boolean) Enables or disables prefix compression for index data. Can be either true or false. For more information, see the storage.wiredTiger.indexConfig.prefixCompression description in the official documentation.

Nested Schema for Nested Schema for cluster_config.mongos

Optional:

  • net (Block List, Max: 1) A set of network settings (see the net option). (see below for nested schema)

Nested Schema for Nested Schema for cluster_config.mongos.net

Optional:

  • 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, make disabled the 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.

Nested Schema for Nested Schema for cluster_config.performance_diagnostics

Optional:

  • enabled (Boolean) Enable or disable performance diagnostics.

Nested Schema for Nested Schema for host

Required:

  • subnet_id (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.
  • zone_id (String) The availability zone where resource is located. If it is not provided, the default provider zone will be used.

Optional:

  • assign_public_ip (Boolean) Should this host have assigned public IP assigned. Can be either true or false.
  • host_parameters (Block List, Max: 1) The parameters of mongod host in replicaset. (see below for nested schema)
  • 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.
  • type (String) Type of Mongo daemon which runs on this host (mongod, mongos, mongocfg, mongoinfra). Defaults to mongod.

Read-Only:

  • health (String) The health of the host.
  • name (String) The fully qualified domain name of the host. Computed on server side.

Nested Schema for Nested Schema for host.host_parameters

Optional:

  • hidden (Boolean) Should this host be hidden in replicaset. Can be either true of false. 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 seconds behind the primary that this replica set member should lag. 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.

Nested Schema for Nested Schema for database

Required:

  • name (String) The name of the database.

Nested Schema for Nested Schema for disk_size_autoscaling_mongocfg

Required:

  • disk_size_limit (Number) Limit of disk size after autoscaling (GiB).

Optional:

  • emergency_usage_threshold (Number) Immediate autoscaling disk usage (percent).
  • planned_usage_threshold (Number) Maintenance window autoscaling disk usage (percent).

Nested Schema for Nested Schema for disk_size_autoscaling_mongod

Required:

  • disk_size_limit (Number) Limit of disk size after autoscaling (GiB).

Optional:

  • emergency_usage_threshold (Number) Immediate autoscaling disk usage (percent).
  • planned_usage_threshold (Number) Maintenance window autoscaling disk usage (percent).

Nested Schema for Nested Schema for disk_size_autoscaling_mongoinfra

Required:

  • disk_size_limit (Number) Limit of disk size after autoscaling (GiB).

Optional:

  • emergency_usage_threshold (Number) Immediate autoscaling disk usage (percent).
  • planned_usage_threshold (Number) Maintenance window autoscaling disk usage (percent).

Nested Schema for Nested Schema for disk_size_autoscaling_mongos

Required:

  • disk_size_limit (Number) Limit of disk size after autoscaling (GiB).

Optional:

  • emergency_usage_threshold (Number) Immediate autoscaling disk usage (percent).
  • planned_usage_threshold (Number) Maintenance window autoscaling disk usage (percent).

Nested Schema for Nested Schema for maintenance_window

Required:

  • type (String) Type of maintenance window. Can be either ANYTIME or WEEKLY. A day and hour of window need to be specified with weekly window.

Optional:

  • 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.

Nested Schema for Nested Schema for resources

Required:

  • disk_size (Number) Volume of the storage available to a MongoDB host, in gigabytes.
  • disk_type_id (String) Type of the storage of MongoDB hosts. For more information see the official documentation.
  • resource_preset_id (String) The ID of the preset for computational resources available to a MongoDB host (CPU, memory etc.). For more information, see the official documentation.

Nested Schema for Nested Schema for resources_mongocfg

Required:

  • disk_size (Number) Volume of the storage available to a MongoDB host, in gigabytes.
  • disk_type_id (String) Type of the storage of MongoDB hosts. For more information see the official documentation.
  • resource_preset_id (String) The ID of the preset for computational resources available to a MongoDB host (CPU, memory etc.). For more information, see the official documentation.

Nested Schema for Nested Schema for resources_mongod

Required:

  • disk_size (Number) Volume of the storage available to a MongoDB host, in gigabytes.
  • disk_type_id (String) Type of the storage of MongoDB hosts. For more information see the official documentation.
  • resource_preset_id (String) The ID of the preset for computational resources available to a MongoDB host (CPU, memory etc.). For more information, see the official documentation.

Nested Schema for Nested Schema for resources_mongoinfra

Required:

  • disk_size (Number) Volume of the storage available to a MongoDB host, in gigabytes.
  • disk_type_id (String) Type of the storage of MongoDB hosts. For more information see the official documentation.
  • resource_preset_id (String) The ID of the preset for computational resources available to a MongoDB host (CPU, memory etc.). For more information, see the official documentation.

Nested Schema for Nested Schema for resources_mongos

Required:

  • disk_size (Number) Volume of the storage available to a MongoDB host, in gigabytes.
  • disk_type_id (String) Type of the storage of MongoDB hosts. For more information see the official documentation.
  • resource_preset_id (String) The ID of the preset for computational resources available to a MongoDB host (CPU, memory etc.). For more information, see the official documentation.

Nested Schema for Nested Schema for restore

Required:

  • backup_id (String) Backup ID. The cluster will be created from the specified backup. How to get a list of PostgreSQL backups.

Optional:

  • 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.

Nested Schema for 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 Nested Schema for user

Required:

  • name (String) The name of the user.
  • password (String, Sensitive) The password of the user.

Optional:

  • permission (Block Set) Set of permissions granted to the user. (see below for nested schema)

Nested Schema for Nested Schema for user.permission

Required:

  • database_name (String) The name of the database that the permission grants access to.

Optional:

  • roles (List of String) The roles of the user in this database. For more information see the official documentation.

ImportImport

The resource can be imported by using their resource ID. For getting the resource ID you can use Yandex Cloud Web Console or YC CLI.

# terraform import yandex_mdb_mongodb_cluster.<resource Name> <resource Id>
terraform import yandex_mdb_mongodb_cluster.my_cluster ...

Was the article helpful?

Previous
mdb_mongodb_user
Next
mdb_mongodb_database
© 2025 Direct Cursus Technology L.L.C.