HashiCorp Certified: Terraform Associate — Question 125

You are making changes to existing Terraform code to add some new infrastructure.

When is the best time to run terraform validate?

Answer options

Correct answer: B

Explanation

The correct answer is B because running terraform validate before terraform plan helps to catch any syntax errors in your configuration files early on. Options A, C, and D are incorrect because they suggest validating after planning or applying, which does not address potential syntax issues in the code before those steps.