# Terraform: Error: Provider produced invalid plan — provider produced an invalid plan for aws_x.y, but we are tolerating it because it is using the legacy plugin SDK

**Code:** `Provider produced invalid plan / inconsistent final plan` · **Category:** Terraform · **Seen on:** Terraform

The provider changed planned values between plan and apply (a provider bug), so Terraform aborts.

## Meaning

Update the provider, avoid computed/unknown values changing between plan and apply (e.g. `timestamp()` or `uuid()` in arguments), and consider saved plan staleness. For "inconsistent final plan", values unknown at plan time resolved differently at apply — re-plan and apply again; replace non-deterministic expressions.

## Common causes

- Non-deterministic expressions (`timestamp()`, `uuid()`) in resource arguments
- Provider bug
- Unknown values resolved differently at apply
- Modules using `depends_on` producing unknowns
- Changes made between plan and apply

## Quick fix

1. `terraform init -upgrade`; re-plan and apply
2. Remove `timestamp()`/random from arguments (use `lifecycle { ignore_changes }` or `time_static`)
3. Report/check the provider issue tracker

## Detailed fix by platform

### Terraform

1. `terraform plan -out=tfplan && terraform apply tfplan`

## How to diagnose

1. **Expression** — Non-deterministic?
2. **Provider** — Updated?
3. **Plan** — Fresh?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/terraform/provider-produced-invalid-plan-or-final-plan)
