Interview Prep/Terraform/Secrets Provisioners and Policy as Code

Compare using SOPS or Vault with plain Secrets Manager for providing secrets to Terraform.

IntermediateScenarioSecrets Provisioners and Policy as Code
Answer

Situation read → Choose a source of truth for secrets.

What I'd do →

  1. Secrets Manager or SSM Parameter Store: native, IAM-controlled, easiest on AWS.
  2. Vault: dynamic, short-lived credentials and a policy engine; more to operate.
  3. SOPS: encrypted files in Git, good for small teams but secrets still land in state.

Why → The question is "where does the value live and who rotates it?"; Terraform should reference, not own, secret values where possible.

Interview tip → Whichever is chosen, keep the secret value out of state when you can.

All Terraform questions

More on Secrets Provisioners and Policy as Code