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 →
- Configure an
encryptionblock with a key provider (KMS, PBKDF2 passphrase) and method (AES-GCM). - Apply to state and plan files.
- 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.
More on Pipelines Terraform Cloud and OpenTofu
Build a basic GitHub Actions pipeline: plan on pull request, apply on merge to main.BeginnerReviewers can't read raw plan logs. How do you present the plan in the PR?IntermediateTwo PRs merge close together and both apply to the same stack. What prevents trouble?IntermediateHow do you add a manual approval before prod applies?IntermediateCompare Atlantis, HCP Terraform and a hand-built GitHub Actions pipeline.IntermediateA saved plan was approved yesterday and apply fails because main changed. How do you avoid dead approvals?Intermediate