Skip to content
Latchkey

Terraform "Provider produced inconsistent result after apply" in CI

After applying, the provider returned a resource value that differs from what it told Terraform to expect. This is a provider-side inconsistency - often a known bug or an attribute the API populates asynchronously.

What this error means

terraform apply reports the provider produced an inconsistent result after apply, naming an attribute whose post-apply value differs from the plan. The resource may actually be created, but Terraform flags the mismatch as an error.

terraform apply output
Error: Provider produced inconsistent result after apply

When applying changes to aws_instance.web, provider "aws" produced an unexpected
new value: .private_dns: was cty.StringVal(""), but now cty.StringVal("ip-10-0-...").

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

Common causes

Provider bug

The provider promised one value at plan time and returned another after apply. The error text itself says this should be reported to the provider - it is a provider-side defect.

Eventually-consistent or computed attribute

An attribute the API fills in asynchronously (a DNS name, ARN, or generated field) may not be settled when the provider reads it back, producing a transient mismatch.

How to fix it

Upgrade the provider

Many inconsistent-result bugs are fixed in newer provider releases. Bump the provider and re-lock.

Terminal
terraform init -upgrade
terraform apply

Re-run and report if it persists

  1. Re-run apply - a transient eventual-consistency mismatch often clears on the next run.
  2. If it reproduces, pin a known-good provider version or report it to the provider’s issue tracker with the resource and attribute named.
  3. As a stopgap, ignore_changes on the offending computed attribute can avoid the perpetual diff.

How to prevent it

  • Keep providers reasonably current to pick up consistency fixes.
  • Pin provider versions so behavior is reproducible across runs.
  • Report reproducible inconsistencies upstream rather than working around them silently.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →