nerdexam
HashiCorp

TA-002-P · Question #9

What command does Terraform require the first time you run it within a configuration directory?

The correct answer is B. terraform init. terraform init must be run first in any new or cloned configuration directory. It initializes the working directory by downloading the required provider plugins, setting up the backend for state storage, and installing any referenced modules. Without running init, commands like p

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

Question

What command does Terraform require the first time you run it within a configuration directory?

Options

  • Aterraform import
  • Bterraform init
  • Cterraform plan
  • Dterraform workspace

How the community answered

(26 responses)
  • A
    4% (1)
  • B
    96% (25)

Explanation

terraform init must be run first in any new or cloned configuration directory. It initializes the working directory by downloading the required provider plugins, setting up the backend for state storage, and installing any referenced modules. Without running init, commands like plan and apply will fail because the necessary plugins and modules are not present locally.

Topics

#terraform init#initialization#CLI commands

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice