diff --git a/registry/coder/modules/vault-token/README.md b/registry/coder/modules/vault-token/README.md index fdbc5e390..f6a4b0847 100644 --- a/registry/coder/modules/vault-token/README.md +++ b/registry/coder/modules/vault-token/README.md @@ -20,11 +20,12 @@ variable "vault_token" { } module "vault" { - source = "registry.coder.com/coder/vault-token/coder" - version = "1.1.0" - agent_id = coder_agent.example.id - vault_token = var.token # optional - vault_addr = "https://vault.example.com" + source = "registry.coder.com/coder/vault-token/coder" + version = "1.2.0" + agent_id = coder_agent.example.id + vault_token = var.token # optional + vault_addr = "https://vault.example.com" + vault_namespace = "prod" # optional, vault enterprise only } ``` @@ -74,7 +75,7 @@ variable "vault_token" { module "vault" { source = "registry.coder.com/coder/vault-token/coder" - version = "1.1.0" + version = "1.2.0" agent_id = coder_agent.example.id vault_addr = "https://vault.example.com" vault_token = var.token diff --git a/registry/coder/modules/vault-token/main.tf b/registry/coder/modules/vault-token/main.tf index 3461ba565..51c3a9355 100644 --- a/registry/coder/modules/vault-token/main.tf +++ b/registry/coder/modules/vault-token/main.tf @@ -26,6 +26,11 @@ variable "vault_token" { sensitive = true default = null } +variable "vault_namespace" { + type = string + description = "The Vault namespace to use." + default = null +} variable "vault_cli_version" { type = string @@ -62,3 +67,10 @@ resource "coder_env" "vault_token" { name = "VAULT_TOKEN" value = var.vault_token } + +resource "coder_env" "vault_namespace" { + count = var.vault_namespace != null ? 1 : 0 + agent_id = var.agent_id + name = "VAULT_NAMESPACE" + value = var.vault_namespace +} \ No newline at end of file