From 6fad996f80431e375e0546099428fa2bce68d132 Mon Sep 17 00:00:00 2001 From: Birdie K <5210502+moo-im-a-cow@users.noreply.github.com> Date: Sun, 18 May 2025 14:44:00 +1000 Subject: [PATCH 1/3] add optional vault namespace --- registry/coder/modules/vault-token/README.md | 11 ++++++----- registry/coder/modules/vault-token/main.tf | 12 ++++++++++++ 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/registry/coder/modules/vault-token/README.md b/registry/coder/modules/vault-token/README.md index 26428dfa5..01e0da1c3 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.1.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 } ``` 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 From f41d470ca22b2aa71b9d132ccb3242f2f8b814da Mon Sep 17 00:00:00 2001 From: Birdie Kingston Date: Fri, 23 May 2025 05:47:19 +0000 Subject: [PATCH 2/3] update version --- registry/coder/modules/vault-token/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/registry/coder/modules/vault-token/README.md b/registry/coder/modules/vault-token/README.md index 01e0da1c3..1597dceb1 100644 --- a/registry/coder/modules/vault-token/README.md +++ b/registry/coder/modules/vault-token/README.md @@ -21,7 +21,7 @@ variable "vault_token" { module "vault" { source = "registry.coder.com/coder/vault-token/coder" - version = "1.1.0" + version = "1.1.1" agent_id = coder_agent.example.id vault_token = var.token # optional vault_addr = "https://vault.example.com" @@ -75,7 +75,7 @@ variable "vault_token" { module "vault" { source = "registry.coder.com/coder/vault-token/coder" - version = "1.1.0" + version = "1.1.1" agent_id = coder_agent.example.id vault_addr = "https://vault.example.com" vault_token = var.token From 26410e2b183a4d2be998088d526ef17c77a040dc Mon Sep 17 00:00:00 2001 From: Birdie Kingston Date: Sat, 24 May 2025 06:56:11 +0000 Subject: [PATCH 3/3] update version --- registry/coder/modules/vault-token/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/registry/coder/modules/vault-token/README.md b/registry/coder/modules/vault-token/README.md index 54584b9fa..f6a4b0847 100644 --- a/registry/coder/modules/vault-token/README.md +++ b/registry/coder/modules/vault-token/README.md @@ -21,7 +21,7 @@ variable "vault_token" { module "vault" { source = "registry.coder.com/coder/vault-token/coder" - version = "1.1.1" + version = "1.2.0" agent_id = coder_agent.example.id vault_token = var.token # optional vault_addr = "https://vault.example.com" @@ -75,7 +75,7 @@ variable "vault_token" { module "vault" { source = "registry.coder.com/coder/vault-token/coder" - version = "1.1.1" + version = "1.2.0" agent_id = coder_agent.example.id vault_addr = "https://vault.example.com" vault_token = var.token