Terraform Associate (004) · Free practice question 2 of 12
Local state backup file
After an apply with the local backend, an engineer at Pellow Farms notices a file named terraform.tfstate.backup next to terraform.tfstate. What does it contain?
- A.An encrypted copy of the current state for disaster recovery
- B.A list of provider versions selected during init
- C.The previous version of the state, written before Terraform saved the latest state
- D.The saved plan from the most recent apply
Show answer and explanation
Correct answer: C. The previous version of the state, written before Terraform saved the latest state
Why: With the local backend, Terraform keeps a backup of the prior state in terraform.tfstate.backup each time it writes new state. It is not encrypted. Provider selections are recorded in .terraform.lock.hcl, and saved plans exist only when created with plan -out.
More free Terraform Associate (004) questions
- Skipping refresh during plan
- Default CLI workspace cannot be deleted
- Local execution mode in HCP Terraform
- Self-hosted agents for private networks
- Run triggers between workspaces
- Health assessments for drift detection
- Dynamic provider credentials with OIDC
- terraform_data triggers_replace argument
- Provisioners as a last resort
- Running tests with terraform test
- Lock file hashes for multiple platforms