Closed 67726e closed 1 month ago
For the hell of it, I tried switching M0
to M2
and received the same error. However, setting the configuration to M10
brought out a new error:
╷
│ Error: error creating advanced cluster: https://cloud.mongodb.com/api/atlas/v2/groups/66b8f12fd04e950940cebf87/clusters POST: HTTP 400 Bad Request (Error code: "REPLICATION_SPECS_REQUIRES_ELECTABLE_SPECS") Detail: A replication spec requires at least three electable nodes. Reason: Bad Request. Params: []
│
│ with mongodbatlas_advanced_cluster.cluster,
│ on cluster.tf line 2, in resource "mongodbatlas_advanced_cluster" "cluster":
│ 2: resource "mongodbatlas_advanced_cluster" "cluster" {
│
╵
Guessing I'm running configuration from the examples that are meant for a proper server that don't apply to the lesser tiers?
from the README here:
To receive support for the MongoDB Atlas Terraform Provider, if you have a paid support option for your Atlas deployment, you can open a support case. If not, you can use the support chat option.
Whoops! Not sure how I ended up on this repository, thank you for letting me know!
In case SEO leads future developers here, the issue lies with some unfortunate sleight-of-hand in the current (as of August 2024) documentation on the Terraform resources page(s). The documentation for mongodbatlas_cluster
has a prominent alert at the start of the page telling users that they should use mongodbatlas_advanced_cluster
for new clusters. However, the mongodbatlas_advanced_cluster
page neglects to mention that it apparently does not support anything less than M10
, which is not actually documented but gleaned from other GitHub Issue comments. Further down on the original mongodbatlas_cluster
there is documentation confirming that M0
, M2
, and M5
are, in fact, supported.
Here is an example of a minimal M0
cluster created via Terraform that is working for me as of this comment:
resource "mongodbatlas_cluster" "cluster" {
project_id = mongodbatlas_project.project.id
name = "cluster-test"
cluster_type = "REPLICASET"
cloud_backup = false
auto_scaling_compute_enabled = false
auto_scaling_disk_gb_enabled = false
mongo_db_major_version = "7.0"
backing_provider_name = "AWS"
provider_instance_size_name = "M0"
provider_name = "TENANT"
provider_region_name = "US_EAST_1"
replication_specs {
num_shards = 1
regions_config {
region_name = "US_EAST_1"
electable_nodes = 3
priority = 7
read_only_nodes = 0
}
}
}
I am unable to create an cluster with the
M0
free tier.