400 (request "INVALID_ENUM_VALUE") An invalid enumeration value M0 was specified

Hi all, I was following this tutorial How to Deploy MongoDB Atlas with Terraform on AWS | MongoDB to set up mongoDB via Terraform, the only change I’ve made was changing the instance type from M10 to M0 and I got the following error

│ Error: error creating MongoDB ClusterAdvanced: POST https://cloud.mongodb.com/api/atlas/v1.5/groups/6449771ea35c5c54dad100a1/clusters: 400 (request "INVALID_ENUM_VALUE") An invalid enumeration value M0 was specified.
│   with module.mongodb.mongodbatlas_advanced_cluster.atlas-cluster,
│   on ../../modules/mongodb/deployment.tf line 58, in resource "mongodbatlas_advanced_cluster" "atlas-cluster":
│   58: resource "mongodbatlas_advanced_cluster" "atlas-cluster" {

are those shared tier types not supported for this cluster configuration?

Hi @Steven_Leng - Welcome to the community :wave:

If you’re attempting to downgrade an M10 to an M0 then it won’t be possible as per the Free Cluster and Shared Cluster Considerations documentation:

  • You can’t downgrade an M10+ dedicated cluster to an M0 free cluster or M2/M5 shared cluster.

In saying the above, I assume since you are following the tutorial, the cluster was not even created to begin with? Please clarify.

Please note that you might also need to change the provider_name value to TENANT and set the backing_provider_name as per the terraform docs for Example Tenant Cluster.

Look forward to hearing from you.


If you’re still encountering issues, would you be able to send a code snippet of the mongodbatlas_advanced_cluster resource from the terraform file you have? Please redact any sensitive information before posting here.

A post was split to a new topic: M0 creation issue