Terraform: Error: No value for required variable — The root module input variable "region" is not set, and has no default value
A variable without a default wasn't supplied.
Error: No value for required variableThe root module input variable "region" is not set, and has no default valueUse a -var or -var-file command line argument to provide a value for this variableError: No value for required variable on variables.tf line 1Error: Missing required variable Meaning
Provide it: -var region=eu-west-1, a terraform.tfvars/*.auto.tfvars file, -var-file, or TF_VAR_region. In CI (non-interactive) Terraform can't prompt (-input=false) so the run fails. Add defaults for optional values.
Common causes
- Variable has no default and isn't passed
- tfvars filename not auto-loaded
- CI run with
-input=false - Environment variable name case wrong (
TF_VAR_Region) - Module call missing the argument
⚡ Quick fix
- Pass
-var/-var-fileor setTF_VAR_name - Name the file
terraform.tfvarsor*.auto.tfvars - Add
default = ...where sensible
Detailed fix by platform
Terraform
TF_VAR_region=eu-west-1 terraform plan -input=false
How to diagnose
- Variable — Default?
- File — Auto-loaded?
- CI — input=false?
🔧 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
- Error building ARM Config: obtain subscription from Azure CLI Terraform: Error: building AzureRM Client: obtaining subscription ID / Please run 'az login' to setup account
- Invalid AWS Region Terraform: Error: Invalid AWS Region: us-east-3 / Error: configuring Terraform AWS Provider: validating provider credentials: operation error STS: GetCallerIdentity
- Invalid function argument Terraform: Error: Invalid function argument — Invalid value for "list" parameter: list of string required / Call to function "lookup" failed
Most viewed in Terraform
- Error acquiring the state lock Terraform: Error: Error acquiring the state lock — ConditionalCheckFailedException / state blob is already locked
- Inconsistent dependency lock file Terraform: Error: Inconsistent dependency lock file — provider x: required by this configuration but no version is selected
- Reference to undeclared resource Terraform: Error: Reference to undeclared resource / Reference to undeclared input variable
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