External Vault Requirements for Terraform Enterprise
Terraform Enterprise automatically creates an internally-managed Vault server that stores its data in the PostgreSQL Database. We strongly recommend that organizations use this internally-managed Vault server. However, some organizations have specific requirements around data encryption and auditing. Those organizations can configure Terraform Enterprise to use an external Vault server rather than the internally-managed Vault server.
We only recommend using external Vault when you have experience managing Vault in production. This approach requires that you assume full responsibility for the Vault server, including sealing, unsealing, replication, etc.
Warning: Do not configure multiple Terraform Enterprise instances to use the same namespace on an external Vault server unless they are part of an Active/Active installation. Doing so will result in data loss.
External Vault Configuration
Important: You must configure External Vault during initial installation. After installation, you can only change the configuration using the backup and restore API.
Run the following commands to configure your external Vault server for use with Terraform Enterprise.
- Enable the AppRole Auth Method.
- Enable the Transit Secrets Engine.
- Create the
tfe-policy.hcl
file with the following content:
- Create the
tfe
policy using thetfe-policy.hcl
policy content.
- Create an AppRole with a periodic token using the
tfe
policy.
- Fetch the RoleID of the AppRole. This maps back to the
extern_vault_role_id
Terraform Enterprise configuration setting.
- Fetch the SecretID of the AppRole. This maps back to the
extern_vault_secret_id
Terraform Enterprise configuration setting.