yandex_mdb_opensearch_cluster (Resource)
Written by
Updated at February 12, 2026
Manages a OpenSearch cluster within the Yandex Cloud. For more information, see the official documentation.
Example usage
//
// Create a new MDB OpenSearch Cluster.
//
resource "yandex_mdb_opensearch_cluster" "my_cluster" {
name = "test"
environment = "PRESTABLE"
network_id = yandex_vpc_network.foo.id
config {
admin_password = "super-password"
opensearch {
node_groups {
name = "group0"
assign_public_ip = true
hosts_count = 1
subnet_ids = ["${yandex_vpc_subnet.foo.id}"]
zone_ids = ["ru-central1-d"]
roles = ["data", "manager"]
resources {
resource_preset_id = "s2.micro"
disk_size = 10737418240
disk_type_id = "network-ssd"
}
}
}
}
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.5.0.0/24"]
}
//
// Create a new MDB OpenSearch Cluster.
//
locals {
zones = ["ru-central1-a", "ru-central1-b", "ru-central1-d"]
}
resource "yandex_mdb_opensearch_cluster" "my_cluster" {
name = "my-cluster"
environment = "PRODUCTION"
network_id = yandex_vpc_network.es-net.id
config {
admin_password = "super-password"
opensearch {
node_groups {
name = "hot_group0"
assign_public_ip = true
hosts_count = 2
zone_ids = local.zones
roles = ["data"]
resources {
resource_preset_id = "s2.small"
disk_size = 10737418240
disk_type_id = "network-ssd"
}
}
node_groups {
name = "cold_group0"
assign_public_ip = true
hosts_count = 2
zone_ids = local.zones
roles = ["data"]
resources {
resource_preset_id = "s2.micro"
disk_size = 10737418240
disk_type_id = "network-hdd"
}
}
node_groups {
name = "managers_group"
assign_public_ip = true
hosts_count = 3
zone_ids = local.zones
roles = ["manager"]
resources {
resource_preset_id = "s2.micro"
disk_size = 10737418240
disk_type_id = "network-ssd"
}
}
plugins = ["analysis-icu"]
}
dashboards {
node_groups {
name = "dashboards"
assign_public_ip = true
hosts_count = 1
zone_ids = local.zones
resources {
resource_preset_id = "s2.micro"
disk_size = 10737418240
disk_type_id = "network-ssd"
}
}
}
}
auth_settings = {
saml = {
idp_entity_id = "urn:dev.auth0.example.com"
idp_metadata_file_content = "<EntityDescriptor entityID=\"https://test_identity_provider.example.com\"></EntityDescriptor>"
sp_entity_id = "https://test.example.com",
dashboards_url = "https://dashboards.example.com"
}
}
depends_on = [
yandex_vpc_subnet.es-subnet-a,
yandex_vpc_subnet.es-subnet-b,
yandex_vpc_subnet.es-subnet-d,
]
}
// Auxiliary resources
resource "yandex_vpc_network" "es-net" {}
resource "yandex_vpc_subnet" "es-subnet-a" {
zone = "ru-central1-a"
network_id = yandex_vpc_network.es-net.id
v4_cidr_blocks = ["10.1.0.0/24"]
}
resource "yandex_vpc_subnet" "es-subnet-b" {
zone = "ru-central1-b"
network_id = yandex_vpc_network.es-net.id
v4_cidr_blocks = ["10.2.0.0/24"]
}
resource "yandex_vpc_subnet" "es-subnet-d" {
zone = "ru-central1-d"
network_id = yandex_vpc_network.es-net.id
v4_cidr_blocks = ["10.3.0.0/24"]
}
Arguments & Attributes Reference
auth_settings[Block]. Authentication settings for Dashboards.saml[Block]. SAML authentication options.dashboards_url(Required)(String). Dashboards URL.enabled(Required)(Bool). Enables SAML authentication.idp_entity_id(Required)(String). ID of the SAML Identity Provider.idp_metadata_file_content(Required)(String). Metadata file content of the SAML Identity Provider. You can either put file content manually or usefilefunctionroles_key(String). Roles key.sp_entity_id(Required)(String). Service provider entity ID.subject_key(String). Subject key.
cluster_id(String). The ID of the OpenSearch cluster that the resource belongs to.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(String). Deployment environment of the OpenSearch cluster. Can be eitherPRESTABLEorPRODUCTION. Default:PRODUCTION. It is not possible to change this value after cluster creation.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.hosts[Block]. A hosts of the OpenSearch cluster.assign_public_ip(Bool). Sets whether the host should get a public IP address. Can be eithertrueorfalse.fqdn(Read-Only) (String). The fully qualified domain name of the host.node_group(Read-Only) (String). Name of the node group.roles(Read-Only) (Set Of String). The roles of the deployed host. Can containDATAand/orMANAGERroles. Will be empty forDASHBOARDStype.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.type(Read-Only) (String). The type of the deployed host. Can be eitherOPENSEARCHorDASHBOARDS.zone(Read-Only) (String). The availability zone where the OpenSearch host will be created. For more information see the official documentation.
id(Read-Only) (String). The resource identifier.labels(Map Of String). A set of key/value label pairs which assigned to resource.name(Required)(String). Name of the OpenSearch cluster. The name must be unique within the folder.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.service_account_id(String). ID of the service account authorized for this cluster.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.config[Block]. Configuration of the OpenSearch cluster.admin_password(Required)(String). Password for admin user of OpenSearch.version(String). Version of OpenSearch.access[Block]. Enable access to the Yandex Cloud services.data_transfer(Bool). Enable access to the Data Transfer service.serverless(Bool). Enable access to the Cloud Functions service.
dashboards[Block]. Configuration for Dashboards node groups.node_groups[Block].assign_public_ip(Bool). Sets whether the hosts should get a public IP address.hosts_count(Required)(Number). Number of hosts in this node group.name(Required)(String). Name of OpenSearch node group.subnet_ids(List Of String). A set of the subnets, to which the hosts belongs. The subnets must be a part of the network to which the cluster belongs.zone_ids(Required)(Set Of String). A set of availability zones where hosts of node group may be allocated.resources[Block]. Resources allocated to hosts of this OpenSearch node group.disk_size(Required)(Number). Volume of the storage available to a host, in bytes.disk_type_id(Required)(String). Type of the storage of OpenSearch hosts.resource_preset_id(Required)(String). The ID of the preset for computational resources available to a host (CPU, memory etc.). For more information, see the official documentation.
opensearch[Block]. Configuration for OpenSearch node groups.plugins(Set Of String). A set of requested OpenSearch plugins.node_groups[Block]. A set of named OpenSearch node group configurations.assign_public_ip(Bool). Sets whether the hosts should get a public IP address.disk_size_autoscaling[Block]. Node group disk size autoscaling settings.disk_size_limit(Required)(Number). The overall maximum for disk size that limit all autoscaling iterations. See the documentation for details.emergency_usage_threshold(Number). Threshold of storage usage (in percent) that triggers immediate automatic scaling of the storage. Zero value means disabled threshold.planned_usage_threshold(Number). Threshold of storage usage (in percent) that triggers automatic scaling of the storage during the maintenance window. Zero value means disabled threshold.
hosts_count(Required)(Number). Number of hosts in this node group.name(Required)(String). Name of OpenSearch node group.roles(Required)(Set Of String). A set of OpenSearch roles assigned to hosts. Available roles are:DATA,MANAGER. Default: [DATA,MANAGER].subnet_ids(List Of String). A set of the subnets, to which the hosts belongs. The subnets must be a part of the network to which the cluster belongs.zone_ids(Required)(Set Of String). A set of availability zones where hosts of node group may be allocated.resources[Block]. Resources allocated to hosts of this OpenSearch node group.disk_size(Required)(Number). Volume of the storage available to a host, in bytes.disk_type_id(Required)(String). Type of the storage of OpenSearch hosts.resource_preset_id(Required)(String). The ID of the preset for computational resources available to a host (CPU, memory etc.). For more information, see the official documentation.
maintenance_window[Block].day(String).hour(Number).type(Required)(String).
Import
The resource can be imported by using their resource ID. For getting it you can use Yandex Cloud Web Console
# terraform import yandex_mdb_opensearch_cluster.<resource Name> <resource Id>
terraform import yandex_mdb_opensearch_cluster.my_cluster ...