mongodb / terraform-provider-mongodbatlas

Terraform MongoDB Atlas Provider: Deploy, update, and manage MongoDB Atlas infrastructure as code through HashiCorp Terraform
https://registry.terraform.io/providers/mongodb/mongodbatlas
Mozilla Public License 2.0
242 stars 168 forks source link

mongodbatlas_search_index does not recreate when cluster_name and project_id fields change. #1053

Closed Bhutania closed 1 year ago

Bhutania commented 1 year ago

Terraform CLI and Terraform MongoDB Atlas Provider Version

Terraform v1.3.7
on darwin_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.42.0
+ provider registry.terraform.io/mongodb/mongodbatlas v1.8.0

Terraform Configuration File

resource "mongodbatlas_search_index" "search-index" {
  name         = "search-index"
  project_id   = data.mongodbatlas_project.project.id
  cluster_name = data.mongodbatlas_cluster.cluster.name

  analyzer         = "lucene.standard"
  collection_name  = "some-collection"
  database         = "some-db"
  mappings_dynamic = false

  search_analyzer = "lucene.standard"

  mappings_fields = <<-EOF
LARGE JSON INPUT
}

Steps to Reproduce

  1. Have present mongodbatlas_serach_index
  2. Attempt to move search index to new cluster and project by referencing different cluster name and project id.
  3. Search index will not be created in new project/cluster when running terraform apply, despite changing attributes.

Expected Behavior

Search index is destroyed on old cluster/project and recreated on new cluster/project

Actual Behavior

Search index is not destroyed, and new search index is not built.

Debug Output

Crash Output

N/A

Additional Context

References

N/A

martinstibbe commented 1 year ago

@Bhutania I will attempt same steps to replicate issue

martinstibbe commented 1 year ago

@Bhutania Was able to replicate will fix in engineering ticket INTMDB-576

Zuhairahmed commented 1 year ago

@Bhutania v1.8.1 has been published to the Terraform Public Registry! take a spin and let us know if you need anything else.

Zuhairahmed commented 1 year ago

closing this issue, but feel free to re-open if you need anything else here