Where is the Terraform state file typically stored by default?

  1. Local file system in the working directory ✓
  2. Git repository
  3. AWS S3 bucket
  4. Terraform Cloud

Correct answer: Local file system in the working directory

Option A is correct because by default Terraform stores state in a local file named terraform.tfstate in the current working directory, requiring no backend configuration. Option B is wrong because storing state in a Git repository is explicitly discouraged by HashiCorp due to the risk of exposing sensitive values and merge conflicts; it is not the default behavior. Option C is wrong because using an AWS S3 bucket requires explicit backend configuration and is a remote backend option, not the default. Option D is wrong because Terraform Cloud also requires explicit configuration and opt-in; it is not where state is written by default.

Topic: · terraform state, local backend, state management, terraform basics

Practice HashiCorp Terraform Associate (003) Questions Free