Exam Terraform-Associate-004 Topic 4 Question 178 Discussion
Actual exam question for HashiCorp's Terraform-Associate-004 exam
Question #: 178
Topic #: 4
Question #: 178
Topic #: 4
What is the purpose of the .terraform directory in a Terraform workspace?
Suggested Answer: D Vote an answer
Detailed Explanation:
* Rationale for Correct answer: The .terraform directory is created by terraform init and is used to store downloaded provider plugins , module code , and other initialization artifacts (such as backend- related data and dependency selections used by the working directory). This directory is typically not committed to version control.
* Analysis of Incorrect Options (Distractors):
* A: Incorrect. State is usually stored as terraform.tfstate in the working directory for local state, or remotely in a backend (not inside .terraform as the primary location).
* B: Incorrect. Terraform doesn't store "converted API calls" in .terraform; it computes provider actions during plan/apply.
* C: Incorrect. Provider credentials and .tfvars files are not stored in .terraform by design; secrets should be handled via variables, env vars, Vault, or HCP Terraform sensitive variables.
* Key Concept: .terraform contains init-time artifacts : providers, modules, and metadata needed for the working directory.
Reference: Read, Generate, and Modify Configurations - working directory structure and terraform init behavior.
* Rationale for Correct answer: The .terraform directory is created by terraform init and is used to store downloaded provider plugins , module code , and other initialization artifacts (such as backend- related data and dependency selections used by the working directory). This directory is typically not committed to version control.
* Analysis of Incorrect Options (Distractors):
* A: Incorrect. State is usually stored as terraform.tfstate in the working directory for local state, or remotely in a backend (not inside .terraform as the primary location).
* B: Incorrect. Terraform doesn't store "converted API calls" in .terraform; it computes provider actions during plan/apply.
* C: Incorrect. Provider credentials and .tfvars files are not stored in .terraform by design; secrets should be handled via variables, env vars, Vault, or HCP Terraform sensitive variables.
* Key Concept: .terraform contains init-time artifacts : providers, modules, and metadata needed for the working directory.
Reference: Read, Generate, and Modify Configurations - working directory structure and terraform init behavior.
by Cecilia at Jun 16, 2026, 09:02 PM
0
0
0
10
Comments
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Report Comment
Commenting
You can sign-up / login (it's free).