Interview Prep/Terraform/Pipelines Terraform Cloud and OpenTofu

When would you use OpenTofu's native state encryption?

AdvancedScenarioPipelines Terraform Cloud and OpenTofu
Answer

Situation read → State holds secrets; backend encryption protects at rest, but anyone with read access sees plaintext.

What I'd do →

  1. Configure an encryption block with a key provider (KMS, PBKDF2 passphrase) and method (AES-GCM).
  2. Apply to state and plan files.
  3. Roll out with a fallback block so existing plaintext state migrates smoothly.

Why → Client-side encryption means the backend operator, or someone who can read the bucket, can't read secrets without the key.

Interview tip → Key loss means state loss; back up key material and test recovery.

All Terraform questions Roadmap: Terraform in production

More on Pipelines Terraform Cloud and OpenTofu