This module lets you fetch all or selective secrets from a HCP Vault Secrets app into your Coder workspaces. It makes use of the hcp_vault_secrets_app
data source from the HCP provider.
1module "vault" { 2 source = "registry.coder.com/modules/hcp-vault-secrets/coder" 3 version = "1.0.7" 4 agent_id = coder_agent.example.id 5 app_name = "demo-app" 6 project_id = "aaa-bbb-ccc" 7}
To configure the HCP Vault Secrets module, follow these steps,
HCP_CLIENT_ID
and HCP_CLIENT_SECRET
that you need to authenticate with HCP Vault Secrets.
HCP_CLIENT_ID
and HCP_CLIENT_SECRET
variables on the coder provisioner (recommended) or supply them as input to the module.project_id
. This is the ID of the project where the HCP Vault Secrets app is running.See the HCP Vault Secrets documentation for more information.
To fetch all secrets from the HCP Vault Secrets app, skip the secrets
input.
1module "vault" { 2 source = "registry.coder.com/modules/hcp-vault-secrets/coder" 3 version = "1.0.7" 4 agent_id = coder_agent.example.id 5 app_name = "demo-app" 6 project_id = "aaa-bbb-ccc" 7}
To fetch selective secrets from the HCP Vault Secrets app, set the secrets
input.
1module "vault" { 2 source = "registry.coder.com/modules/hcp-vault-secrets/coder" 3 version = "1.0.7" 4 agent_id = coder_agent.example.id 5 app_name = "demo-app" 6 project_id = "aaa-bbb-ccc" 7 secrets = ["MY_SECRET_1", "MY_SECRET_2"] 8}
Set client_id
and client_secret
as module inputs.
1module "vault" { 2 source = "registry.coder.com/modules/hcp-vault-secrets/coder" 3 version = "1.0.7" 4 agent_id = coder_agent.example.id 5 app_name = "demo-app" 6 project_id = "aaa-bbb-ccc" 7 client_id = "HCP_CLIENT_ID" 8 client_secret = "HCP_CLIENT_SECRET" 9}