exam questions

Exam Terraform Associate All Questions

View all questions & answers for the Terraform Associate exam

Exam Terraform Associate topic 1 question 224 discussion

Actual exam question from HashiCorp's Terraform Associate
Question #: 224
Topic #: 1
[All Terraform Associate Questions]

When should you run terraform init?

  • A. After you run terraform apply for the first time in a new Terraform project and before you run terraform plan
  • B. After you run terraform plan for the first time in a new Terraform project and before you run terraform apply
  • C. After you start coding a new Terraform project and before you run terraform plan for the first time
  • D. Before you start coding a new Terraform project
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Tlakmini
7 months ago
Selected Answer: C
C. his is the first command that should be run after writing a new Terraform configuration or cloning an existing one from version control.
upvoted 2 times
...
Jhaggar
10 months ago
Selected Answer: C
After you start coding a new Terraform project and before you run Terraform plan for the first time
upvoted 1 times
...
tbhtp
11 months, 2 weeks ago
Selected Answer: C
C. After you start coding a new Terraform project and before you run terraform plan for the first time
upvoted 2 times
...
micropbl4
11 months, 2 weeks ago
Selected Answer: C
definitely "C"
upvoted 1 times
...
camps
11 months, 3 weeks ago
Selected Answer: C
Therefore, the correct answer is C. You should run terraform init after you start coding a new Terraform project and before you run terraform plan for the first time. This ensures that the necessary provider plugins and modules are downloaded and installed, and that the backend is set up correctly. Running terraform init after coding the project ensures that Terraform has the correct dependencies and can properly execute the configuration. Option A is incorrect because running terraform init after the first terraform apply can lead to errors, as not all necessary dependencies may have been installed. Option B is incorrect because running terraform init after the first terraform plan can result in missing provider plugins or modules needed to complete the plan. Option D is incorrect because terraform init is used to initialize a Terraform working directory that already exists. It cannot be used to create a new Terraform project.
upvoted 3 times
...
Ravi528
11 months, 3 weeks ago
Selected Answer: C
After writing code and before Plan we should execute INIT to import plugins or modules..etc
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago