TF_VAR_ environment variable

An environment variable named TF_VAR_ followed by a variable name, which Terraform reads as that variable's value.

In more detail

Pipelines use it to inject secrets without writing them into a file. It is overridden by .tfvars files and command-line options, and a forgotten one in your shell profile is a classic cause of a value that will not change.

Example

export TF_VAR_environment=production

Related terms

Taught in

References

Certification courses