Skip to content

Latest commit

 

History

History
100 lines (73 loc) · 4.34 KB

search_deployment.md

File metadata and controls

100 lines (73 loc) · 4.34 KB

Resource: mongodbatlas_search_deployment

mongodbatlas_search_deployment provides a Search Deployment resource. The resource lets you create, edit and delete dedicated search nodes in a cluster.

-> NOTE: For details on supported cloud providers and existing limitations you can visit the Search Node Documentation.

-> NOTE: Only a single search deployment resource can be defined for each cluster.

Example Usages

resource "mongodbatlas_project" "example" {
  name   = "project-name"
  org_id = var.org_id
}

resource "mongodbatlas_advanced_cluster" "example" {
  project_id   = mongodbatlas_project.example.id
  name         = "ClusterExample"
  cluster_type = "REPLICASET"

  replication_specs {
    region_configs {
      electable_specs {
        instance_size = "M10"
        node_count    = 3
      }
      provider_name = "AWS"
      priority      = 7
      region_name   = "US_EAST_1"
    }
  }
}

resource "mongodbatlas_search_deployment" "example" {
  project_id   = mongodbatlas_project.example.id
  cluster_name = mongodbatlas_advanced_cluster.example.name
  specs = [
    {
      instance_size = "S20_HIGHCPU_NVME"
      node_count    = 2
    }
  ]
}

data "mongodbatlas_search_deployment" "example" {
  project_id   = mongodbatlas_search_deployment.example.project_id
  cluster_name = mongodbatlas_search_deployment.example.cluster_name
}

output "mongodbatlas_search_deployment_id" {
  value = data.mongodbatlas_search_deployment.example.id
}

Schema

Required

  • cluster_name (String) Label that identifies the cluster to return the search nodes for.
  • project_id (String) Unique 24-hexadecimal digit string that identifies your project.
  • specs (Attributes List) List of settings that configure the search nodes for your cluster. This list is currently limited to defining a single element. (see below for nested schema)

Optional

Read-Only

  • encryption_at_rest_provider (String) Cloud service provider that manages your customer keys to provide an additional layer of Encryption At Rest for the cluster.
  • id (String) Unique 24-hexadecimal digit string that identifies the search deployment.
  • state_name (String) Human-readable label that indicates the current operating condition of this search deployment.

Nested Schema for specs

Required:

  • instance_size (String) Hardware specification for the search node instance sizes. The MongoDB Atlas API describes the valid values. More details can also be found in the Search Node Documentation.
  • node_count (Number) Number of search nodes in the cluster.

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

Import

Search node resource can be imported using the project ID and cluster name, in the format PROJECT_ID-CLUSTER_NAME, e.g.

$ terraform import mongodbatlas_search_deployment.test 650972848269185c55f40ca1-Cluster0

For more information see: MongoDB Atlas API - Search Node Documentation.