HashiCorp Certified: Terraform Associate — Question 318

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 allows you to catch any syntax errors in your code early on. Options A, C, and D are incorrect as they suggest validating at times when the code may already be in a state of execution or potential error, which does not address syntax issues beforehand.