TERRAFORM-ASSOCIATE-004 · Question #100
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 the first command run in a new or cloned Terraform configuration directory. It initializes the working directory by downloading and installing the required provider plugins, setting up the backend for state storage, and downloading any referenced modules. W
Question
Options
- Aterraform import
- Bterraform init
- Cterraform plan
- Dterraform workspace
How the community answered
(48 responses)- A6% (3)
- B90% (43)
- C2% (1)
- D2% (1)
Explanation
terraform init must be the first command run in a new or cloned Terraform configuration directory. It initializes the working directory by downloading and installing the required provider plugins, setting up the backend for state storage, and downloading any referenced modules. Without running init first, commands like plan or apply will fail. Option A (terraform import) imports existing infrastructure into state and requires prior initialization. Option C (terraform plan) shows a preview of changes but requires initialization first. Option D (terraform workspace) manages workspaces but also requires initialization.
Topics
Community Discussion
No community discussion yet for this question.