TA-002-P · Question #252
You have created a custom variable definition file my_vars.tfvars. How will you use it for provisioning infrastructure?
The correct answer is D. terraform apply -var-file="my_vars.tfvars". To set lots of variables, it is more convenient to specify their values in a variable definitions file (with a filename ending in either .tfvars or .tfvars.json) and then specify that file on the command line with -var-file: terraform apply -var-file="my_vars.tfvars"
Question
You have created a custom variable definition file my_vars.tfvars. How will you use it for provisioning infrastructure?
Options
- Aterraform apply -var-state-file ="my_vars.tfvars"
- Bterraform apply var-file="my_vars.tfvars"
- Cterraform plan -var-file="my_vars.tfvar"
- Dterraform apply -var-file="my_vars.tfvars"
How the community answered
(48 responses)- A2% (1)
- B6% (3)
- C2% (1)
- D90% (43)
Explanation
To set lots of variables, it is more convenient to specify their values in a variable definitions file (with a filename ending in either .tfvars or .tfvars.json) and then specify that file on the command line with -var-file: terraform apply -var-file="my_vars.tfvars"
Topics
Community Discussion
No community discussion yet for this question.