nerdexam
HashiCorp

TA-002-P · Question #109

Environment variables can be used to set variables. The environment variables must be in the format "____"_<variablename>. Select the correct prefix string from the following list.

The correct answer is C. TF_VAR_. Terraform reads environment variables prefixed with TF_VAR_ to populate input variables. For example, setting TF_VAR_region=us-east-1 in the shell assigns the value us-east-1 to the Terraform variable named region. The prefix is TF_VAR_ (with the trailing underscore), not…

Use the Terraform CLI (terraform plan, apply, destroy, fmt, init, validate, workspace, import, taint, providers, output)

Question

Environment variables can be used to set variables. The environment variables must be in the format "___"<variablename>. Select the correct prefix string from the following list.

Options

  • ATF_CLI_ARGS
  • BTF_VAR
  • CTF_VAR_
  • DTF_VAR_ENV

How the community answered

(71 responses)
  • A
    4% (3)
  • B
    7% (5)
  • C
    87% (62)
  • D
    1% (1)

Explanation

Terraform reads environment variables prefixed with TF_VAR_ to populate input variables. For example, setting TF_VAR_region=us-east-1 in the shell assigns the value us-east-1 to the Terraform variable named region. The prefix is TF_VAR_ (with the trailing underscore), not TF_VAR (without it). TF_CLI_ARGS is a different prefix used to pass default CLI arguments.

Topics

#Terraform variables#Environment variables#CLI configuration#Variable precedence

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice