HashiCorp Terraform Associate (004) exam dumps

HashiCorp Terraform Associate (004) practice question 164 of 223

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

HashiCorp Terraform Associate (004) Question 164

Single answer6a Describe the local backend

A small operations team is using Terraform to manage a test environment from a shared jump host. Their configuration does not define any backend block. One engineer runs terraform apply successfully, but later another engineer on a different machine runs terraform plan against the same configuration and Terraform proposes recreating resources that already exist. The team wants to understand what happened before deciding whether to adopt a remote backend. Which explanation best describes this behavior?

  1. A

    Terraform used the local backend by default, so state was stored on the first engineer's machine and was not available on the second engineer's machine.

  2. B

    Terraform automatically created a shared remote state in the Terraform Registry, but the second engineer was missing registry credentials.

  3. C

    Terraform stored state only in memory during apply, so the second engineer needed to rerun terraform refresh to recover it.

  4. D

    Terraform used the HTTP backend implicitly, but the second engineer did not export the required backend authentication variables.

Show answer and explanation

Correct answer: A

Explanation

Terraform uses the local backend by default when no backend is explicitly configured. The local backend stores state locally on disk, which works for individual use but creates collaboration risks because the state is not inherently shared or centrally managed. In this scenario, the second engineer likely ran Terraform without access to the first engineer's state file, so Terraform compared configuration against an empty or different local state and proposed creating resources. HashiCorp documentation describes the local backend as the default backend and notes that local state can be problematic for team workflows because it is not shared and requires manual handling. This is one of the main reasons teams adopt a remote backend for shared state, locking support where available, and safer collaboration.

  • A. Correct.

    Correct. If no backend is configured, Terraform uses the local backend by default. The local backend stores state on the local filesystem, typically in a terraform.tfstate file in the working directory. If engineers run Terraform from different machines or different copies of the configuration, they do not automatically share state. As a result, Terraform on the second machine may not know the infrastructure already exists and can propose creating resources again.

  • B. Incorrect.

    Incorrect. Terraform does not automatically store state in the Terraform Registry. The Registry is used for discovering providers and modules, not as an implicit state backend. This option reflects a common misconception that Terraform Cloud/Enterprise or Registry services are used automatically for state storage.

  • C. Incorrect.

    Incorrect. Terraform state is not stored only in memory after apply. With the local backend, Terraform persists state to a local file. Running terraform refresh would not magically recover state from another machine if that state file is unavailable locally. This distractor targets confusion between in-memory planning operations and persistent state storage.

  • D. Incorrect.

    Incorrect. Terraform does not implicitly use the HTTP backend when no backend block is present. The HTTP backend must be explicitly configured. This option is plausible because HTTP is a real backend type, but it is not the 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