How do you manage tfvars that contain sensitive values?
IntermediateProductionSecurity, Secrets and Access
Answer
Avoid it: use secret references. When unavoidable, encrypt files with SOPS (KMS-backed) and decrypt in CI via the carlpett/sops provider or a pipeline step, or inject through TF_VAR_ from the CI secret store or HCP Terraform sensitive variables. Never commit plain secrets.tfvars.
More on Security, Secrets and Access
How do you avoid hardcoded credentials in Terraform?BeginnerIs reading a secret with a data source safe?IntermediateHow do ephemeral resources and write-only arguments keep secrets out of state?AdvancedWhat is the better pattern for RDS master passwords?BeginnerHow do you scope IAM for the Terraform deploy role?IntermediateWhat are dynamic provider credentials in HCP Terraform?Intermediate