Prompt
What should I use to manage secrets across GitHub Actions and Terraform?
Latest observation
Nov 19, 2026
OpenAI APIWeb search: off
Use a central secret manager rather than storing secrets separately in GitHub and Terraform.
Best options
- HashiCorp Vault — best if you want Terraform-native workflows and strong secret lifecycle control.
- AWS Secrets Manager / Parameter Store — best if you’re already on AWS.
- Azure Key Vault — best if you’re on Azure.
- Google Secret Manager — best if you’re on GCP.
Recommended pattern
- Store secrets in the central secret manager.
- Have GitHub Actions authenticate using OIDC to cloud provider credentials or Vault.
- Let Terraform read secrets at runtime from that secret manager instead of hardcoding them in:
- GitHub repo secrets
- Terraform variables
.tfvarsfiles- state files
Why this is better
- Avoids duplicate secret storage
- Reduces risk of secret leakage in Git history and Terraform state
- Makes rotation and auditing easier
- Centralizes access control
Important note
Terraform state can still expose secrets if you pass them into managed resources or outputs, so:
- mark outputs as
sensitive = true - avoid putting secrets directly into resource arguments unless necessary
- prefer data sources or external secret references where supported
If you tell me your cloud provider, I can recommend the exact setup and workflow.