nerdexam
HashiCorpHashiCorp

TA-002-P · Question #252

TA-002-P Question #252: Real Exam Question with Answer & Explanation

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"

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

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"

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

#terraform apply#variables#tfvars files#CLI usage

Community Discussion

No community discussion yet for this question.

Full TA-002-P PracticeBrowse All TA-002-P Questions