HashiCorp Terraform Associate Practice Exam

Access More Questions
Which file stores the Terraform state locally?
Correct Answer:
terraform.tfstate
Explanation:
Terraform keeps a local state file that tracks what it manages and how resources map to real-world objects. By default, when you don’t configure a different backend, Terraform writes this state to a file named terraform.tfstate in your working directory. This file is JSON and includes resource addresses, IDs assigned by providers, and current attributes and dependencies, which is what allows Terraform to plan changes accurately and reconcile drift. A backup of the previous state is kept as terraform.tfstate.backup. If you configure a remote backend (like S3, Consul, etc.), the state is stored remotely, and there isn’t a local terraform.tfstate file. The other file name options don’t match Terraform’s local-state convention, so terraform.tfstate is the correct choice.

Access more questions from this quiz

Continue to HashiCorp Terraform Associate Practice Exam for more practice questions and the full quiz experience.

Access More Questions