The Mongodb provider for terraform during apply deployment fails to understand that if a project is already created and configured, simply ignore it.
I keep getting duplicate 400 errors for my subsequent requests to Atlas if the first run fails. How do I resolve this?
error creating MongoDB ClusterAdvanced: POST https://cloud.mongodb.com/api/atlas/v1.5/groups/123/clusters: 400 (request "DUPLICATE_CLUSTER_NAME")
A cluster or serverless instance named test-cluster is already present in group 123.
│resource "mongodbatlas_advanced_cluster" "atlas-cluster" {
project_id = mongodbatlas_project.atlas-project.id
name = "${var.atlas_project_name}-cluster"
cluster_type = "REPLICASET"
backup_enabled = true
mongo_db_major_version = var.mongodb_version
replication_specs {
region_configs {
electable_specs {
instance_size = var.cluster_instance_size_name
node_count = 3
}
analytics_specs {
instance_size = var.cluster_instance_size_name
node_count = 1
}
priority = 7
provider_name = var.cloud_provider
region_name = var.atlas_region
}
}
}