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.
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 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
- Restore the provider block, destroy the resources, then remove both
terraform state rm ADDRESSto stop managing it- Keep provider configs until resources are gone
Detailed fix by platform
Terraform
terraform state list | grep west; terraform destroy -target=aws_instance.west
How to diagnose
- Alias — Still declared?
- Resource — In state?
- 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:
Similar errors
- 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
- 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
- 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
Most viewed in Terraform
- Error acquiring the state lock Terraform: Error: Error acquiring the state lock — ConditionalCheckFailedException / state blob is already locked
- Error building ARM Config: obtain subscription from Azure CLI Terraform: Error: building AzureRM Client: obtaining subscription ID / Please run 'az login' to setup account
- UnauthorizedOperation / AccessDenied during Terraform apply Terraform: Error: creating EC2 Instance: UnauthorizedOperation: You are not authorized to perform this operation. User: arn:aws:iam::123:user/ci is not authorized to perform: ec2:RunInstances
Other ways to find it
Where this error sits
Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):
🧠 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.
Report a correction or suggest an improvement
Last updated 5 Nov 2026