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…
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)- A4% (3)
- B7% (5)
- C87% (62)
- D1% (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
Community Discussion
No community discussion yet for this question.