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.
Question
Which backend does the Terraform CLI use by default?
Options
- ATerraform Cloud
- BConsul
- CRemote
- DLocal
How the community answered
(30 responses)- A3% (1)
- C3% (1)
- D93% (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.
Terraform Cloud requires explicit configuration using the `remote` backend type to be used; it is not the default backend.
Consul is a specific type of remote backend that requires explicit configuration in the Terraform code; it is not the default backend.
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.
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
Community Discussion
No community discussion yet for this question.