# Terraform: Error: Provider produced inconsistent result after apply — When applying changes to aws_x.y, provider produced an unexpected new value: Root resource was present, but now absent

**Code:** `Provider produced inconsistent result after apply` · **Category:** Terraform · **Seen on:** Terraform

After creating/updating a resource, the provider returned values that don't match what Terraform planned — usually a provider bug or eventual consistency.

## Meaning

Often transient: re-run `terraform apply`. Upgrade the provider (`terraform init -upgrade`) since many such bugs are fixed; check provider issues for the resource. Workarounds: `depends_on`, `lifecycle { ignore_changes }`, or a `time_sleep` between dependent resources when the API is eventually consistent.

## Common causes

- Provider bug with that resource/version
- Eventual consistency (resource not visible yet)
- Computed attribute changes after apply
- Remote API normalising values
- Parallel modifications by another process

## Quick fix

1. Re-run apply
2. Upgrade the provider
3. Add `time_sleep`/`depends_on` or `ignore_changes` for the attribute

## Detailed fix by platform

### Terraform

1. `terraform init -upgrade && terraform apply`

## How to diagnose

1. **Retry** — Passes?
2. **Provider** — Latest?
3. **Attribute** — Normalised?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/terraform/provider-produced-inconsistent-result-after-apply)
