This error occurs when your Terraform configuration contains attributes that the provider doesn't recognize. It typically stems from provider version mismatches, deprecated attributes, or state file synchronization issues.
The "Unknown configuration attributes" error in Terraform indicates a schema mismatch between your configuration code and the provider's schema definition. Terraform validates all configuration arguments against the provider's resource schema, and when it encounters attributes that don't exist in that schema, it raises this error. This commonly happens when provider versions change, attributes are renamed or removed, or the state file references attributes no longer supported by the current provider version.
Run terraform version to see what versions you have installed:
terraform versionThis shows your Terraform version and all required providers. Compare these against your .terraform/versions lock file or required_providers block in your code. If versions differ significantly from your configuration expectations, this is likely the root cause.
The error message will typically specify which attribute is unknown. For example:
Error: Unsupported argument
on main.tf line 5, in resource "aws_instance" "example":
5: deprecated_field = "value"
An argument named "deprecated_field" is not expected here.Make note of the exact attribute name and resource type mentioned. Check the provider's documentation to see if this attribute exists in your provider version or if it was renamed/removed.
Edit your terraform block to pin provider versions if you want stability:
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0" # Pin to 5.x series
}
}
}Then run:
terraform init -upgradeThis initializes Terraform and upgrades providers to match your constraints. If you want to downgrade instead, update the version constraint to a lower version and repeat.
Check the provider documentation for the correct attribute name and update your configuration. For example, if 'deprecated_field' was renamed to 'new_field', update your code:
# Before (causes error)
resource "aws_instance" "example" {
deprecated_field = "value"
}
# After (correct)
resource "aws_instance" "example" {
new_field = "value"
}If the attribute was removed entirely, delete it from your configuration.
If you've updated your configuration but still encounter the error, your state file may be out of sync. First, back up your state:
terraform state pull > backup.tfstateThen remove the problematic resource from state (if it's safe to do so):
terraform state rm aws_instance.exampleFinally, reinitialize Terraform:
terraform init
terraform planThis allows Terraform to re-create the resource with the current provider schema. Only use this if the resource can be safely recreated.
Visit the provider's official documentation and release notes to understand what changed between versions. For example, for AWS provider:
https://registry.terraform.io/providers/hashicorp/aws/latest/docsLook at the CHANGELOG to see what attributes were added, removed, or renamed in the versions between your old and new provider. This helps you understand whether to update your code or adjust provider versions.
Provider version management is critical in Terraform workflows. Using version pinning in your terraform block prevents unexpected breaking changes when teammates or CI/CD systems reinitialize the workspace. Additionally, terraform state files embed provider version information; if a newer state file is applied with an older provider, you may encounter unknown attribute errors. Always keep provider versions synchronized across your team using .terraform.lock.hcl (committed to version control). For remote state backends (Terraform Cloud, S3), ensure all users and CI/CD pipelines use the same provider version constraints.
Error: Error installing helm release: cannot re-use a name that is still in use
How to fix "release name in use" error in Terraform with Helm
Error: Error creating GKE Cluster: BadRequest
BadRequest error creating GKE cluster in Terraform
Error: External program failed to produce valid JSON
External program failed to produce valid JSON
Error: Unsupported argument in child module call
How to fix "Unsupported argument in child module call" in Terraform
Error: network is unreachable
How to fix "network is unreachable" in Terraform