Terraform documented errors
Browse documented Terraform errors with exact messages, troubleshooting context, and practical remediation steps.
Configuration
Configuration errors
no Terraform configuration filesTerraform command ran without configuration files in the working directoryTerraform could not find any .tf configuration in the current working directory, so commands that depend on configuration cannot proceed normally.
Unsupported argumentTerraform configuration contains an unsupported argumentTerraform found an argument in a resource, module, or provider block that the target schema does not support.
Missing required argumentTerraform configuration is missing a required argumentTerraform rejected the configuration because a required argument for a resource, module, or provider block was omitted.
Invalid function argumentTerraform could not convert the value to boolTerraform could not convert the supplied value to a boolean because tobool only accepts booleans, null, or the exact strings true and false.
Invalid function argumentTerraform could not convert the value to numberTerraform could not convert the supplied value to a number because tonumber only accepts numbers, null, or strings containing decimal numeric text.
Reference to undeclared local valueTerraform could not find the referenced local valueTerraform could not evaluate the expression because the referenced local value was never declared in the current module.
Invalid expressionTerraform could not parse the expressionTerraform could not parse the expression because the value does not form a valid HCL expression in that position.
CycleTerraform detected a dependency cycleTerraform found a circular dependency in the resource graph, so it could not determine a valid order to create or update the resources involved.
Invalid "each" attributeTerraform each object does not contain the referenced attributeTerraform could not evaluate the each object because the expression referenced an attribute that does not exist for the current for_each context.
Unsupported block typeTerraform found a block type that is not expected hereTerraform found a nested block where the schema expected an argument assignment or a different configuration structure.
Invalid characterTerraform found an invalid character in the configurationTerraform could not parse the configuration because it encountered a character sequence that is not valid in the current expression or HCL syntax context.
Invalid referenceTerraform found an invalid resource referenceTerraform could not interpret the reference because it does not follow Terraform's expected resource, attribute, or collection access pattern.
Invalid function argumentTerraform one function received too many elementsTerraform could not use one because the collection contains more than one element, while one only accepts zero-or-one collections.
Missing resource instance keyTerraform requires a specific resource instance keyTerraform cannot access an attribute on a resource that uses for_each or count unless the expression identifies a specific instance or iterates over all instances.
Installation
Installation errors
Unsupported Terraform Core versionTerraform CLI version does not satisfy the configuration constraintTerraform refused to initialize because the current CLI version does not match the configuration's required_version constraint.
provider registry.terraform.io does not have a provider namedTerraform could not find the requested provider in the registryTerraform could not install a provider because the declared provider source or local name does not map to a valid provider in the registry.
Providers
Providers errors
locked provider does not match configured version constraintTerraform dependency lock file is inconsistent with provider constraintsTerraform found that the provider version pinned in the dependency lock file no longer satisfies the configured provider version constraints.
Failed to query available provider packagesTerraform failed to query available provider packagesTerraform could not select or retrieve provider versions that satisfy the current configuration and lock file constraints.
the current package doesn't match any of the checksums previously recorded in the dependency lock fileTerraform provider checksum does not match the dependency lock fileTerraform refused to install a provider because the package checksum did not match what was recorded in .terraform.lock.hcl for that provider version.
State
State errors
Error acquiring the state lockTerraform could not acquire the state lockTerraform could not continue because the backend reported that the state was already locked or could not be locked safely for a write operation.
Failed to marshal state to json: unsupported attributeTerraform failed to marshal state to JSON with unsupported attributeTerraform failed while processing state because the provider schema and the stored state no longer agree about an attribute present in the state.
Saved plan does not match the given stateTerraform saved plan does not match the current stateTerraform rejected the saved plan because the plan file no longer corresponds to the state snapshot it was created against.
Saved plan is staleTerraform saved plan is staleTerraform refused to apply a previously saved plan because the current state changed after the plan file was created.
state snapshot was created by Terraform vX, which is newer than current vYTerraform state was created by a newer Terraform versionTerraform could not safely work with the current state because the state snapshot was last written by a newer Terraform version than the one currently running.