Provider configuration not present (removed resource) Terraform Origin: Platform & cloud OSI layer 7 · Application Last updated 5 Nov 2026

Terraform: Error: Provider configuration not present — its original provider configuration is required, but it has been removed

A resource in state needs a provider configuration (alias) that no longer exists in the code.

Exact message you may see Error: Provider configuration not presentTo work with aws_x.y its original provider configuration at provider["registry.terraform.io/hashicorp/aws"].west is required, but it has been removedProvider configuration not present. To work with module.x.aws_y.z its original provider configurationError: Provider configuration not present ... required, but it has been removedError: Invalid provider configuration was removed
Seen on: Terraform

Meaning

Re-add the provider block (alias) temporarily so Terraform can destroy the resource, apply/destroy, and then remove both the resource and the provider. Or terraform state rm the resource if it should no longer be managed. Happens when removing a module/provider alias before destroying its resources.

Common causes

  • Removed provider "aws" { alias = ... } while resources remain in state
  • Deleted a module with its own provider config
  • Renamed provider alias
  • Removed a resource block whose provider is also removed
  • Changed provider passing (providers = {})

⚡ Quick fix

  1. Restore the provider block, destroy the resources, then remove both
  2. terraform state rm ADDRESS to stop managing it
  3. Keep provider configs until resources are gone

Detailed fix by platform

Terraform

  1. terraform state list | grep west; terraform destroy -target=aws_instance.west

How to diagnose

  1. Alias — Still declared?
  2. Resource — In state?
  3. Option — Destroy or state rm?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):

Backend configuration changed (migrate or reconfigure) — Terraform: Error: Backend configuration changed — A change in the backend configuration has been detected, which may require migrating existing state (Terraform)Backend configuration…Cannot import non-existent remote object — Terraform: Error: Cannot import non-existent remote object — While attempting to import an existing object to "aws_s3_bucket.logs", the provider detected that no object exists with the given id (Terraform)Cannot import non-exi…Failed to query available provider packages — Terraform: Error: Failed to query available provider packages — Could not retrieve the list of available versions for provider hashicorp/aws: no available releases match the given constraints (Terraform)Failed to query avail…Inconsistent dependency lock file — Terraform: Error: Inconsistent dependency lock file — provider x: required by this configuration but no version is selected (Terraform)Inconsistent dependen…Instance cannot be destroyed (lifecycle.prevent_destroy) — Terraform: Error: Instance cannot be destroyed — Resource aws_db_instance.prod has lifecycle.prevent_destroy set, but the plan calls for this resource to be destroyed (Terraform)Instance cannot be de…Invalid target address / No matching objects found (state commands) — Terraform: Error: Invalid target address — No matching objects found. To view the available instances, use "terraform state list" (Terraform)Invalid target addres…Moved object still exists — Terraform: Error: Moved object still exists — This statement declares a move from aws_x.old, but that resource instance is still declared at main.tf (Terraform)Moved object still ex…Reference to undeclared resource — Terraform: Error: Reference to undeclared resource / Reference to undeclared input variable (Terraform)Reference to undeclar…Provider …

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.