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 →
- Secrets Manager or SSM Parameter Store: native, IAM-controlled, easiest on AWS.
- Vault: dynamic, short-lived credentials and a policy engine; more to operate.
- 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.
More on Secrets Provisioners and Policy as Code
A developer hardcodes a DB password in `terraform.tfvars` and commits it. What do you do right now, and what's the long-term fix?BeginnerHow do you avoid Terraform persisting a secret in state when creating a secret in AWS Secrets Manager?AdvancedSomeone wants a `remote-exec` provisioner to configure servers after creation. What's your advice?BeginnerYou must run a one-off command after a resource is created, such as registering with an external system.IntermediateHow do you generate and manage the master password for a new RDS instance?IntermediateCompare Sentinel, OPA/Conftest and Checkov for policy as code.Intermediate