1. A HCP Terraform workspace is configured with a remote backend. A developer runs `terraform state pull` from their local machine. What does this command do, and what format is the output?
- A. It downloads the current state file from the remote backend and prints it to stdout in raw JSON format✓ Correct
- B. It compares the local state with the remote state and prints a human-readable diff
- C. It locks the remote state and prevents other operations until `terraform state push` is run
- D. It retrieves the state and writes it to a local `terraform.tfstate` file, overwriting any existing local state
Explanation
`terraform state pull` retrieves the current state from the configured backend (including remote backends like HCP Terraform) and prints it to stdout as raw JSON. This is useful for inspecting state, piping it to tools like `jq`, or creating a local backup. Option B is wrong: `state pull` does not perform a diff; it simply retrieves and prints the current state. Option C is wrong: `state pull` is a read-only operation and does not acquire a lock (state-modifying commands like `apply` acquire locks). Option D is wrong: `state pull` writes to stdout, not to a file; if you want to save it, you redirect stdout (e.g., `terraform state pull > backup.tfstate`).