How to manage secrets in Terraform

To help you manage secrets in Terraform, we’ve built a Terraform provider and a state backend. For a detailed use case, check out the beta announcement.

In this step-by-step guide, you’ll learn how to keep hardcoded secrets out of Terraform code and securely share your .tfstate file.

  1. Install the SecretHub Terraform provider
  2. Write secrets using the secrethub_secret resource
  3. Read secrets using the secrethub_secret data source
  4. Import exisiting secrets into your Terraform project
  5. Use SecretHub as a secure backend for your .tfstate

For full reference, check out the GitHub repository and the reference documentation.

Getting help

Come chat with us on Discord or email us at