Skip to content
Latchkey

Terraform AWS provider "produced an unexpected new value" (inconsistent result) in CI

After apply, Terraform compared the AWS provider's returned value against the plan and they differ. Terraform flags this as a provider inconsistency: the result after apply was not what the plan promised.

What this error means

apply ends with "Error: Provider produced inconsistent result after apply ... .<attr>: was <X>, but now <Y>. This is a bug in the provider, which should be reported in the provider's own issue tracker."

Terraform
Error: Provider produced inconsistent result after apply

When applying changes to aws_instance.app, provider
"registry.terraform.io/hashicorp/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

Eventual consistency in the returned attribute

AWS returns a value (a DNS name, an ARN) slightly after creation that the provider read at a moment it differed from the plan.

A provider version bug

A specific provider version mishandles a computed attribute, producing a value that does not match what it planned.

How to fix it

Re-run the apply

  1. Re-run apply; with eventual consistency the second run usually converges.
  2. If it converges, the state is correct and no change is needed.
  3. If it repeats on the same attribute, treat it as a provider bug.
Terminal
terraform apply

Pin or upgrade the AWS provider

If a version reproducibly mishandles the attribute, move to a version where the bug is fixed and lock it.

versions.tf
terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 5.60"
    }
  }
}

How to prevent it

  • Pin the AWS provider to a known-good version.
  • Re-run apply when eventual consistency is the likely cause.
  • Report reproducible inconsistencies to the provider issue tracker.

Related guides

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