Environment variable management and secret rotation

2148
0

Environment variables configure applications without code changes. The twelve-factor app methodology stores config in the environment. .env files provide local defaults—never commit them to Git. dotenv libraries load .env files in development. Production secrets live in AWS Secrets Manager, HashiCorp Vault, or Kubernetes Secrets. Secret rotation updates credentials without downtime using dual-read patterns. AWS Secrets Manager supports automatic rotation with Lambda functions. Connection pooling libraries handle credential refresh transparently. Config validation at startup fails fast on missing variables. Environment-specific config files (production.env, staging.env) separate concerns. envsubst substitutes variables in templates. Secret scanning in CI prevents accidental credential commits.