Terraform
- Terraform Enterprise
- 1.0.x (latest)
- v202507-1
- v202506-1
- v202505-1
- v202504-1
- v202503-1
- v202502-2
- v202502-1
- v202501-1
- v202411-2
- v202411-1
- v202410-1
- v202409-3
- v202409-2
- v202409-1
- No versions of this document exist before v202408-1. Click below to redirect to the version homepage.
- v202408-1
- v202407-1
- v202406-1
- v202405-1
- v202404-2
- v202404-1
- v202402-2
- v202402-1
- v202401-2
- v202401-1
- v202312-1
- v202311-1
- v202310-1
- v202309-1
- v202308-1
- v202307-1
- v202306-1
- v202305-2
- v202305-1
- v202304-1
- v202303-1
- v202302-1
- v202301-2
- v202301-1
- v202212-2
- v202212-1
- v202211-1
- v202210-1
- v202209-2
- v202209-1
- v202208-3
- v202208-2
- v202207-2
- v202207-1
- v202206-1
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 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.
vault auth enable approleEnable the Transit Secrets Engine.
vault secrets enable transitCreate the
tfe-policy.hclfile with the following content:# To renew leases. path "sys/leases/renew" { capabilities = ["create", "update"] } path "sys/renew" { capabilities = ["create", "update"] } # To renew tokens. path "auth/token/renew" { capabilities = ["create", "update"] } path "auth/token/renew-self" { capabilities = ["create", "update"] } # To perform a login. path "auth/approle/login" { capabilities = ["create", "update"] } # To upsert transit keys used for key generation. path "transit/keys/atlas_*" { capabilities = ["read", "create", "update"] } path "transit/keys/archivist_*" { capabilities = ["read", "create", "update"] } # To allow for signing using transit keys path "transit/sign/atlas_*" { capabilities = ["create", "update"] } # Encryption and decryption of data. path "transit/encrypt/atlas_*" { capabilities = ["create", "update"] } path "transit/decrypt/atlas_*" { capabilities = ["create", "update"] } path "transit/encrypt/archivist_*" { capabilities = ["create", "update"] } path "transit/decrypt/archivist_*" { capabilities = ["create", "update"] } # For performing key derivation. path "transit/datakey/plaintext/archivist_*" { capabilities = ["create", "update"] } # For backup/restore operations. path "transit/keys/atlas_*/config" { capabilities = ["read", "create", "update"] } path "transit/backup/atlas_*" { capabilities = ["read"] } path "transit/restore/atlas_*" { capabilities = ["read", "create", "update"] } path "transit/keys/archivist_*/config" { capabilities = ["read", "create", "update"] } path "transit/backup/archivist_*" { capabilities = ["read"] } path "transit/restore/archivist_*" { capabilities = ["read", "create", "update"] } # For health checks to read the mount table. path "sys/mounts" { capabilities = ["read"] }Create the
tfepolicy using thetfe-policy.hclpolicy content.vault policy write tfe tfe-policy.hclCreate an AppRole with a periodic token using the
tfepolicy.vault write auth/approle/role/tfe policies="tfe" token_period=24hFetch the RoleID of the AppRole. This maps back to the
extern_vault_role_idTerraform Enterprise configuration setting.vault read auth/approle/role/tfe/role-idFetch the SecretID of the AppRole. This maps back to the
extern_vault_secret_idTerraform Enterprise configuration setting.vault write -f auth/approle/role/tfe/secret-id