Skip to content

[Bug]: produced an unexpected new value #4238

@black-snow

Description

@black-snow

Is there an existing issue for this?

  • I have searched the existing issues

Provider Version

2.7.0

Terraform Version

1.14.6

Terraform Edition

Terraform Open Source (OSS)

Current Behavior

I added use_effective_fields = true on my imported cluster and then added electable_specs as well since I was confronted with REPLICATION_SPECS_REQUIRES_ELECTABLE_SPECS. The apply seems to succeed within mongo but then fails on the state/output side of things:

Error: Provider produced inconsistent result after apply

│ When applying changes to mongodbatlas_advanced_cluster.this, provider "provider["registry.terraform.io/mongodb/mongodbatlas"]" produced an unexpected new value: .replication_specs[0].region_configs[0].analytics_specs.disk_size_gb: was cty.NumberIntVal(2048),
│ but now null.

│ This is a bug in the provider, which should be reported in the provider's own issue tracker.

Terraform configuration to reproduce the issue

resource "mongodbatlas_advanced_cluster" "this" {
  project_id           = local.project_id
  name                 = local.cluster_name
  cluster_type         = "REPLICASET"
  use_effective_fields = true
  replication_specs = [
    {
      region_configs = [
        {
          provider_name = "AZURE"
          priority      = 7
          region_name   = "GERMANY_WEST_CENTRAL"
          analytics_specs = {
            disk_iops     = 7500
            disk_size_gb  = 2048
            instance_size = "M60"
            node_count    = 0
          }
          auto_scaling = {
            compute_enabled            = true
            compute_max_instance_size  = "M60"
            compute_min_instance_size  = "M50"
            compute_scale_down_enabled = true
            disk_gb_enabled            = true
          }
          electable_specs = {
            instance_size = "M50"
            node_count    = 3
          }
        }
      ]
    }
  ]
}

Steps To Reproduce

not sure, create above without effective fields and then add it, perhaps

Logs

Code of Conduct

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    not_staleNot stale issue or PR

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions