1. A team is migrating Terraform state from a local backend to a new GCS (Google Cloud Storage) backend. They update the `terraform` block with the new backend configuration and run `terraform init`. During init, Terraform detects an existing local state file. Which of the following accurately describes what happens next and what the team should be aware of? (Select THREE)
- A. Terraform will prompt the user to copy the existing local state to the new GCS backend✓ Correct
- B. If the user declines the copy prompt, the existing local state file is permanently deleted
- C. After a successful state migration, the team should verify the state was copied correctly before deleting the local state file✓ Correct
- D. The `terraform init -migrate-state` flag can be used to automatically migrate state without an interactive prompt✓ Correct
- E. Terraform automatically backs up the local state to a `.terraform/` subdirectory before migration
- F. After migration, the local `terraform.tfstate` file is left intact and Terraform will continue reading from it unless manually removed
Explanation
A is correct: `terraform init` detects the existing local state and interactively asks the user whether to copy it to the new backend. C is correct: best practice is to verify the migrated state (e.g., via `terraform state list`) before removing the local file, since the local file is not automatically deleted. D is correct: `-migrate-state` is a valid flag that triggers state migration non-interactively (useful in CI pipelines). Option B is wrong: declining the copy prompt does NOT delete the local state; it simply leaves it in place and initializes the new backend with an empty state. Option E is wrong: Terraform does not back up local state to `.terraform/`; it may create a `terraform.tfstate.backup` file in the working directory during apply operations, but not specifically for backend migration. Option F is wrong: after successful migration, Terraform uses the new backend exclusively; it does not continue reading from the local file.