Terraform Associate Exam QuestionsBrowse all questions from this exam

Terraform Associate Exam - Question 269


You must initialize your working directory before running terraform validate.

Show Answer
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

2 comments
Sign in to comment
DevoteamAnalytixOption: A
Jun 26, 2023

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

LemonadeSoftwareOption: A
Nov 15, 2023

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.