HashiCorp Certified: Terraform Associate — Question 317

When should you run terraform init?

Answer options

Correct answer: C

Explanation

The correct answer is C because terraform init prepares the working directory for a new Terraform project, setting up the necessary files and modules before the first terraform plan. Options A and B suggest running terraform init at inappropriate times, while option D implies running it before any code starts, which is not the correct sequence.