`Error: No value for required variable` — `The root module input variable "db_password" is not set, and has no default value.` in CI.
BeginnerTroubleshootingModules, Variables, Sensitive Values and Workspaces
Answer
Likely causes → The local terraform.tfvars (gitignored) or your shell's TF_VAR_db_password isn't present in CI.
Diagnose → env | grep TF_VAR_ in the job (masked); check which -var-file is passed.
Fix → Provide it from the CI secret store as TF_VAR_db_password, or better, read the secret inside Terraform from Secrets Manager (or use an ephemeral resource/write-only argument where supported).
Prevent → Commit non-secret env/*.tfvars; keep secrets out of variables entirely where possible.
More on Modules, Variables, Sensitive Values and Workspaces
`Error: Module not installed` — `This module is not yet installed. Run "terraform init" to install all modules required by this configuration.`Beginner`Error: Failed to download module` — `git::https://github.com/acme/tf-modules.git?ref=v2.3.0 ... exit status 128` in CI, works locally.Intermediate`Error: Invalid module source address` for `source = "github.com/acme/modules//vpc?ref=v1.0"` with a `version = "1.0.0"` argument.BeginnerAfter bumping a registry module from 4.x to 5.x, plan shows dozens of resources destroyed and recreated.Advanced`Error: Invalid value for variable` — `This was checked by the validation rule at variables.tf:8,3-13.`Beginner`Warning: Value for undeclared variable` — `The root module does not declare a variable named "regoin" but a value was found in file "terraform.tfvars".` and the region silently defaults.Intermediate