Where does the Terraform local backend store its state?

Prepare for the HashiCorp Terraform Associate Exam with quizzes, flashcards, and multiple-choice questions. Each question includes hints and explanations. Boost your confidence and ace your exam!

Multiple Choice

Where does the Terraform local backend store its state?

Explanation:
The local backend stores Terraform state in a file on disk, typically named terraform.tfstate, in the module’s working directory. This JSON-formatted file keeps the mapping of your resources to real-world objects, their attributes, and dependencies, and Terraform reads/updates it on each apply. A backup file named terraform.tfstate.backup is kept as a snapshot of the previous state. If you configure a different path for the local backend, the file can live elsewhere, but by default it’s terraform.tfstate in the current directory. The other options don’t match how the local backend operates: /tmp isn’t the default location, there isn’t a file simply called terraform file, and the conventional state file isn’t named terraform.state.

The local backend stores Terraform state in a file on disk, typically named terraform.tfstate, in the module’s working directory. This JSON-formatted file keeps the mapping of your resources to real-world objects, their attributes, and dependencies, and Terraform reads/updates it on each apply. A backup file named terraform.tfstate.backup is kept as a snapshot of the previous state. If you configure a different path for the local backend, the file can live elsewhere, but by default it’s terraform.tfstate in the current directory. The other options don’t match how the local backend operates: /tmp isn’t the default location, there isn’t a file simply called terraform file, and the conventional state file isn’t named terraform.state.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy