Terraform variable precedence

The fixed order Terraform uses to decide which value wins when a variable is set in more than one place.

In more detail

From weakest to strongest: the default, TF_VAR_ environment variables, terraform.tfvars, terraform.tfvars.json, *.auto.tfvars files in alphabetical order, then -var and -var-file options in the order given. When someone says their change had no effect, walk this list.

Related terms

Taught in

References

Certification courses