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

Support for Mongo DB Cluster 4.4 #487

Closed aagashe1 closed 3 years ago

aagashe1 commented 3 years ago

Terraform CLI and Terraform MongoDB Atlas Provider Version

Terraform v0.14.7
Mongodbatlas v0.9.1
We cant upgrade Terraform to the latest version.

Terraform Configuration File

resource "mongodbatlas_cluster" "mongodbatlas_cluster" {
  project_id          = var.mongodbatlas_cluster_project_id
  provider_name       = var.mongodbatlas_cluster_provider_name
  name                =  var.mongodbatlas_cluster_name
  provider_instance_size_name   = var.mongodbatlas_cluster_provider_instance_size_name
  cluster_type                  = var.mongodbatlas_cluster_cluster_type
  replication_specs {
    num_shards = var.mongodbatlas_cluster_replication_specs_num_shards
    regions_config {
      region_name     = var.mongodbatlas_cluster_mongodbatlas_cluster_region_name
      electable_nodes = var.mongodbatlas_cluster_replication_specs_regions_config_electable_nodes
      priority        = var.mongodbatlas_cluster_replication_specs_regions_config_priority
      read_only_nodes = var.mongodbatlas_cluster_replication_specs_regions_config_read_only_nodes
    }
  }
  mongo_db_major_version        = var.mongodbatlas_cluster_mongo_db_major_version
  provider_backup_enabled       = var.mongodbatlas_cluster_provider_backup_enabled
  auto_scaling_disk_gb_enabled  = var.mongodbatlas_cluster_auto_scaling_disk_gb_enabled
}

Steps to Reproduce

  1. terraform init
  2. terraform apply

Expected Behavior

What should have happened?

Actual Behavior

Should provision version 4.4

Debug Output

Terraform v0.14.7 Configuring remote state backend... Initializing Terraform configuration...

Error: Invalid value for variable

on main.tf line 55, in module "mongodb": 55: mongodbatlas_cluster_mongo_db_major_version = 4.4

Crash Output

None

Additional Context

I have read the doco here. Version 4.4 is not supported https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/cluster#mongo_db_major_version

References

None

aagashe1 commented 3 years ago

Sorry. It was my bad. The above error was due to validation I added. However note that the validations I added as per the documentation on Terraform website for Mongo atlas cluster