Terraform provisions a production database, and its local state file on an engineer's laptop contains the generated administrator password. What should the team do?
Show the answer
Correct answerC. Use an encrypted remote backend with access control and locking
AWhy not this: Deleting state breaks Terraform's mapping to real resources, so later runs cannot manage or destroy them correctly.
BWhy not this: A repository exposes the plaintext secrets in state to every reader and keeps them in history.
CWhy this is right: A remote backend protects state at rest, limits who can read it, and locking prevents concurrent corrupting runs.
DWhy not this: The .tf files hold the declarations, but the secrets are in the state, which would remain unprotected on the laptop.
Terraform state can hold sensitive values in plaintext, so it belongs in a remote backend with encryption, restricted access and locking. Committing it to Git spreads the secrets to everyone with repository access.