What is the name of the default file where Terraform stores the 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

What is the name of the default file where Terraform stores the state?

Explanation:
Terraform stores its state by default in a local file when using the local backend. That file is named terraform.tfstate (all lowercase) in your working directory. The lowercase naming matters because many filesystems are case-sensitive, so Terraform expects that exact name. A backup file, terraform.tfstate.backup, is also created after successful changes. If you switch to a remote backend (like S3, etc.), the state is stored remotely and the local terraform.tfstate file may not be used.

Terraform stores its state by default in a local file when using the local backend. That file is named terraform.tfstate (all lowercase) in your working directory. The lowercase naming matters because many filesystems are case-sensitive, so Terraform expects that exact name. A backup file, terraform.tfstate.backup, is also created after successful changes. If you switch to a remote backend (like S3, etc.), the state is stored remotely and the local terraform.tfstate file may not be used.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy