Skip to content
Latchkey

Terraform "Provider produced inconsistent final plan" (known after apply) in CI

Between plan and apply, the provider returned a value that differs from what it planned for an attribute. This is usually a provider bug or an attribute that genuinely cannot be predicted until apply.

What this error means

apply fails with "Provider produced inconsistent final plan", naming an attribute that was "known after apply" but ended up different. It points at the provider, not your HCL syntax.

terraform
Error: Provider produced inconsistent final plan

When expanding the plan for aws_instance.app to include new values learned so far
during apply, provider "registry.terraform.io/hashicorp/aws" produced an invalid
new value for .private_ip: was cty.StringVal("10.0.1.5"), but now
cty.StringVal("10.0.1.9").

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

Common causes

Provider mispredicted an attribute

A provider bug returns a different value than it planned for a computed attribute, breaking the plan/apply contract.

Value depends on unpredictable runtime state

An attribute computed from data not available at plan time (assigned IPs, generated IDs) cannot be reliably predicted.

How to fix it

Upgrade the provider and avoid depending on the value

Update to a provider version that fixes the misprediction; avoid feeding the volatile attribute into other resources.

versions.tf
terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = ">= 5.60.0"   # version with the fix
    }
  }
}

Work around the unpredictable attribute

  1. Stop referencing the volatile computed attribute downstream where possible.
  2. Use an explicit value or separate data source instead of the predicted one.
  3. Re-run apply after upgrading; the second plan often reconciles.

How to prevent it

  • Keep providers current to pick up plan-consistency fixes.
  • Avoid wiring unpredictable computed attributes into other resources.
  • Report and track provider bugs that produce inconsistent plans.

Frequently asked questions

What causes ""inconsistent final plan""?
A provider bug returns a different value than it planned for a computed attribute, breaking the plan/apply contract.
How do I fix "inconsistent final plan"?
Update to a provider version that fixes the misprediction; avoid feeding the volatile attribute into other resources.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card