CertKeen

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?

  1. A.An encrypted copy of the current state for disaster recovery
  2. B.A list of provider versions selected during init
  3. C.The previous version of the state, written before Terraform saved the latest state
  4. 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