mongodb/terraform-provider-mongodbatlas

[Bug]: Cannot create `mongodbatlas_flex_cluster`

Closed this issue · 3 comments

Is there an existing issue for this?

  • I have searched the existing issues

Provider Version

v1.22.0

Terraform Version

v1.10.1 (Linux)

Terraform Edition

Terraform Open Source (OSS)

Current Behavior

Resources of type mongodbatlas_flex_cluster are not supported from provider. But the documentation explicitily states them: https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/flex_cluster

Terraform configuration to reproduce the issue

resource "mongodbatlas_flex_cluster" "test-cluster" {
  project_id = "000000000000000000000000"
  name       = "test-cluster"
  provider_settings = {
    backing_provider_name = "AZURE"
    region_name           = "EUROPE_WEST"
  }
  termination_protection_enabled = true
}

resource "mongodbatlas_project" "test_project" {
  name   = "TEST_PROJECT"
  org_id = "000000000000000000000000"

  is_collect_database_specifics_statistics_enabled = true

  is_realtime_performance_panel_enabled = true
  is_data_explorer_enabled              = true
  is_performance_advisor_enabled        = true
  is_schema_advisor_enabled             = true

  is_extended_storage_sizes_enabled = false

  with_default_alerts_settings = true
}

provider "mongodbatlas" {
  public_key  = "aaaaaaaa"
  private_key = "00000000-0000-0000-0000-000000000000"
}

terraform {
  required_version = "~> 1.10.0"

  required_providers {
    mongodbatlas = {
      source  = "mongodb/mongodbatlas"
      version = "1.22.0"
    }
  }
}

Steps To Reproduce

$ tf init

Initializing the backend...
Initializing modules...
Initializing provider plugins...
- Reusing previous version of mongodb/mongodbatlas from the dependency lock file
- Using previously-installed mongodb/mongodbatlas v1.22.0

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.

tf plan

╷
│ Error: Invalid resource type
│ 
│   on test.tf line 1, in resource "mongodbatlas_flex_cluster" "test-cluster":
│   26: resource "mongodbatlas_flex_cluster" "test-cluster" {
│ 
│ The provider mongodb/mongodbatlas does not support resource type "mongodbatlas_flex_cluster".

Logs

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Thanks for opening this issue! Please make sure you've followed our guidelines when opening the issue. In short, to help us reproduce the issue we need:

  • Terraform configuration file used to reproduce the issue
  • Terraform log files from the run where the issue occurred
  • Terraform Atlas provider version used to reproduce the issue
  • Terraform version used to reproduce the issue
  • Confirmation if Terraform OSS, Terraform Cloud, or Terraform Enterprise deployment

The ticket CLOUDP-289358 was created for internal tracking.

Hi @RobertRad,
thanks for opening this issue. As specified in the Upgrade Guide, it's a preview feature.

You'll need to define an environment variable MONGODB_ATLAS_ENABLE_PREVIEW to true in order to use it.

Sorry the resource doc is not clearly stating this, doc will be updated in the next release.