HashiCorp Certified: Terraform Associate — Question 126

When should you run terraform init?

Answer options

Correct answer: C

Explanation

The correct answer is C because terraform init must be run to initialize the working directory and download necessary provider plugins before you can execute terraform plan. Options A and B are incorrect as they suggest running terraform init after commands that cannot be executed without prior initialization. Option D is incorrect because the initialization should happen after coding has started but before any plans are made.