HashiCorp Terraform Associate (004) exam dumps

HashiCorp Terraform Associate (004) practice question 161 of 223

Terraform Associate 004. Associate level, HashiCorp. Free question with the correct answer and a full explanation.

HashiCorp Terraform Associate (004) Question 161

Single answer6a Describe the local backend

A small operations team stores their Terraform configuration in Git and runs terraform apply manually from a shared jump host. They have not configured any explicit backend, and they notice that Terraform state is being written to a file in the working directory. The team asks what this means for their current setup and whether Terraform is using the local backend. Which statement best describes the situation and its practical implication?

  1. A

    Terraform is using the local backend by default, which stores state on the local filesystem of the machine running Terraform unless another backend is configured.

  2. B

    Terraform is using the local backend, which automatically provides remote state locking and version history for all users on the shared jump host.

  3. C

    Terraform is using the local backend only because the configuration is stored in Git; if Git were removed, Terraform would switch to the cloud backend automatically.

  4. D

    Terraform is not using any backend because a backend must be explicitly declared in the terraform block before state can be stored.

Show answer and explanation

Correct answer: A

Explanation

This question tests understanding of the local backend in a realistic operational scenario. In Terraform, backends determine how state is loaded and stored. If you do not configure a backend explicitly, Terraform uses the local backend by default. The local backend stores state on the local filesystem of the machine executing Terraform, commonly in a file named terraform.tfstate. This is suitable for simple or single-user workflows, but it is generally less appropriate for team collaboration because it does not inherently provide the centralized storage, locking, and versioning commonly associated with remote backends. HashiCorp documentation on backends and the local backend specifically notes that local state is the default behavior and that remote backends are typically preferred for collaborative environments.

  • A. Correct.

    Correct. If no backend is explicitly configured, Terraform uses the local backend by default. With the local backend, state is stored as a file on the local filesystem, typically terraform.tfstate in the working directory unless otherwise configured. In this scenario, because they run Terraform on a shared jump host, the state file exists on that host's filesystem and is tied to that execution environment.

  • B. Incorrect.

    Incorrect. This is a common misconception. The local backend stores state locally and does not automatically provide the collaboration features associated with many remote backends, such as centralized remote state storage, built-in locking, or state versioning. A shared jump host may reduce some coordination problems, but those capabilities do not come from the local backend itself.

  • C. Incorrect.

    Incorrect. Git version control for Terraform configuration is separate from Terraform backend behavior. Storing .tf files in Git does not determine which backend Terraform uses. Terraform does not switch to a cloud backend automatically based on whether Git is present or absent; a backend must be intentionally configured.

  • D. Incorrect.

    Incorrect. Terraform always uses a backend to store state, even when none is explicitly declared. If no backend block is configured, Terraform defaults to the local backend. The existence of a local state file in the working directory is consistent with that default behavior.

Timed practice exam

Take a HashiCorp Terraform Associate (004) practice test under exam conditions

70 questions in 60 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam