You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
![]() Co-authored-by: Mathias Fredriksson <mafredri@gmail.com> |
1 year ago | |
---|---|---|
.. | ||
README.md | 1 year ago | |
main.tf | 1 year ago |
README.md
display_name | description | icon | maintainer_github | partner_github | verified | tags | |||||
---|---|---|---|---|---|---|---|---|---|---|---|
HCP Vault Secrets | Fetch secrets from HCP Vault | ../.icons/vault.svg | coder | hashicorp | true |
|
HCP Vault Secrets
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.
module "vault" {
source = "registry.coder.com/modules/hcp-vault-secrets/coder"
version = "1.0.3"
agent_id = coder_agent.example.id
app_name = "demo-app"
}
Configuration
To configure the HCP Vault Secrets module, follow these steps,
- Create secrets in HCP Vault Secrets
- Create an HCP Service Principal from the HCP Vault Secrets app in the HCP console. This will give you the
HCP_CLIENT_ID
andHCP_CLIENT_SECRET
that you need to authenticate with HCP Vault Secrets. - Set
HCP_CLIENT_ID
andHCP_CLIENT_SECRET
variables on the coder provisioner (recommended) or supply them as input to the module.
See the HCP Vault Secrets documentation for more information.
Fetch All Secrets
To fetch all secrets from the HCP Vault Secrets app, skip the secrets
input.
module "vault" {
source = "registry.coder.com/modules/hcp-vault-secrets/coder"
version = "1.0.3"
agent_id = coder_agent.example.id
app_name = "demo-app"
}
Fetch Selective Secrets
To fetch selective secrets from the HCP Vault Secrets app, set the secrets
input.
module "vault" {
source = "registry.coder.com/modules/hcp-vault-secrets/coder"
version = "1.0.3"
agent_id = coder_agent.example.id
app_name = "demo-app"
secrets = ["MY_SECRET_1", "MY_SECRET_2"]
}
Set Client ID and Client Secret as Inputs
Set client_id
and client_secret
as module inputs.
module "vault" {
source = "registry.coder.com/modules/hcp-vault-secrets/coder"
version = "1.0.3"
agent_id = coder_agent.example.id
app_name = "demo-app"
client_id = "HCP_CLIENT_ID"
client_secret = "HCP_CLIENT_SECRET"
}