Terraform Variable Inheritance
In Terraform, environment variables take the least precedence, so they will not override variables defined in *.tf
or *.tfvars
files.
Variables defined on the project and environment entities (environment values override project values) will be passed into the command line - i.e. with highest precedence.
The user can still define inputs as environment values (i.e. TF_VAR_*
) but as noted above they will take least precedence.
The order of variable precedence in Code Pipes is:
- TF inputs defined as ENV variables (
TF_VAR_*
) on Project entity - TF inputs defined as ENV variables (
TF_VAR_*
) on Environment entity - TF variable default values defined in
\*.tf
files in repo - TF variable values defined in
\*.tfvars
files in repo - TF variables defined on Project entity
- TF variables defined on Environment entity
Updated over 1 year ago