Visitar URL original
[Bug]: produced an unexpected new value · Issue #4238 · mongodb/terraform-provider-mongodbatlas · GitHub
Skip to content

[Bug]: produced an unexpected new value #4238

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

Activity

github-actions commented on Feb 26, 2026

@github-actions
Contributor

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-384558 was created for internal tracking.

black-snow commented on Feb 26, 2026

@black-snow
Author

Deleting the disk specs (that I took from the import) seems to fix this.

AgustinBettati commented on Feb 27, 2026

@AgustinBettati
Member

Hi @black-snow, thank you for providing these details.

I was able to reproduce the inconsistent result after apply error by creating the configuration you shared and then doing a follow-up apply that enables use_effective_fields.

I can also confirm that your workaround of removing analytics_specs.disk_size_gb successfully allows Terraform to reach an empty plan.

We have identified an inconsistent behavior in the upstream API that is causing this. We are looking into it and will get back to you here as soon as we have an update.

added a commit that references this issue on Sep 14, 2026
1becd37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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