Interview Prep/Terraform/Security, Secrets and Access

How do you avoid hardcoded credentials in Terraform?

BeginnerProductionSecurity, Secrets and Access
Answer

Never put keys in .tf files or tfvars. Use IAM roles and OIDC federation in CI, instance profiles on runners, and SSO profiles for humans. Scan with gitleaks or detect-secrets pre-commit and in CI. For application secrets, store them in a secrets manager and pass ARNs.

All Terraform questions Roadmap: Terraform in production

More on Security, Secrets and Access