nerdexam
HashiCorp

TA-002-P · Question #78

Which backend does the Terraform CLI use by default?

The correct answer is D. Local. By default, the Terraform CLI uses the local backend, which stores the state file in a directory named terraform.tfstate within the working directory.

Implement and maintain state

Question

Which backend does the Terraform CLI use by default?

Options

  • ATerraform Cloud
  • BConsul
  • CRemote
  • DLocal

How the community answered

(30 responses)
  • A
    3% (1)
  • C
    3% (1)
  • D
    93% (28)

Why each option

By default, the Terraform CLI uses the `local` backend, which stores the state file in a directory named `terraform.tfstate` within the working directory.

ATerraform Cloud

Terraform Cloud requires explicit configuration using the `remote` backend type to be used; it is not the default backend.

BConsul

Consul is a specific type of remote backend that requires explicit configuration in the Terraform code; it is not the default backend.

CRemote

The `remote` backend type is specifically used to connect to Terraform Cloud or Terraform Enterprise and must be explicitly configured; it is not the default.

DLocalCorrect

The `local` backend is the default backend used by Terraform. When no backend is explicitly configured in the HCL, Terraform stores the state file as `terraform.tfstate` in the current working directory, managing it locally.

Concept tested: Default Terraform backend

Source: https://developer.hashicorp.com/terraform/language/settings/backends/local

Topics

#Terraform CLI#Default Backend#Local State#State Management

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice