Exam Terraform Associate All QuestionsBrowse all questions from this exam
Question 269

You must initialize your working directory before running terraform validate.

    Correct Answer: A

    Terraform requires the working directory to be initialized before running the terraform validate command. This is because the validation process needs to access the referenced plugins and modules, which are installed during the initialization process with terraform init. Thus, you must initialize your working directory before running terraform validate.

Discussion
DevoteamAnalytixOption: A

"Validation requires an initialized working directory with any referenced plugins and modules installed. " https://developer.hashicorp.com/terraform/cli/commands/validate

LemonadeSoftwareOption: A

A. True Before running the terraform validate command, it is recommended to initialize your working directory using the terraform init command. The Terraform init command initializes the working directory and downloads the necessary providers and modules specified in your Terraform configuration. After initialization, you can use Terraform validate to check the syntax and validity of your Terraform files.