terraform-provider-mongodbatlas
terraform-provider-mongodbatlas copied to clipboard
Provider try to update M2/M5 even without changes
Hello,
If I'm running terraform apply twice with this resource
resource "mongodbatlas_cluster" "lcm" { project_id = "my-project" name = "cluster-my" num_shards = 1
mongo_db_major_version = "4.0" backup_enabled = false auto_scaling_disk_gb_enabled = false
//Provider Settings "block"
provider_name = "TENANT"
backing_provider_name = "AZURE"
provider_instance_size_name = "M2"
provider_region_name = "EUROPE_NORTH"
disk_size_gb = 10
}
First it will create the resource, but second time it will show error message
Error: error updating MongoDB Cluster (cluster-yelocal-cloud-lcm): PATCH https://cloud.mongodb.com/api/atlas/v1.0/groups/5e0f1fadcf09a21c829808a9/clusters/cluster-yelocal-cloud-lcm: 400 (request "Bad Request") Cannot update a M0/M2/M5 cluster through the public API.
As workaround I may change disk_size_gb to 2 for M2 and 5 for M5 but I think it shouldn't even allow me to set disk_size_gb for M2 and M5 cluster (I needed to set it due to getting an error message "The cluster's disk size of 0.0 GB is invalid. The disk size must be a positive whole number."
Hi @ezavgorodniy , We now have an official MongoDB version of the provider hosted within Terraform's GitHub repo - https://github.com/terraform-providers/terraform-provider-mongodbatlas and the config above looks like you may be using that version. I've recently updated the doc to be a bit more clear about M2/M5s and that will launch at the Terraform website very soon. We also will improve the way this works as we mature the Provider. Thank you for the feedback and feel free to add it at https://github.com/terraform-providers/terraform-provider-mongodbatlas/issues as well.