Install the provider

To install the SecretHub Terraform provider, download and extract the latest release and move the binary to your Terraform plugin directory (~/.terraform.d/plugins/, or %APPDATA%\terraform.d\plugins on Windows). You may have to create this directory if it doesn’t exist yet.

Configure the provider

With the provider installed, you can configure it in your project by passing in a credential for your SecretHub account.

provider "secrethub" {
  credential = "${file("~/.secrethub/credential")}"

You can also source the credential from the SECRETHUB_CREDENTIAL environment variable.

If upon signup you’ve chosen to lock your credential with a passphrase, you need to set the credential_passphrase field on the provider. You can use a Terraform variable for this and let it prompt on every run:

variable "secrethub_passphrase" {}

provider "secrethub" {
  credential            = "${file("~/.secrethub/credential")}"
  credential_passphrase = "${var.secrethub_passphrase}"

These values can also be put in a .tfvars file or defined as an enviroment variable prefixed with TF_VAR to save some typing and help with automation.

With the provider configured, you can run:

terraform init

That’s it. The SecretHub Terraform provider is now properly setup and ready to be used.