From c340425a9fc67ca8bd36067bf36d49e14a468ca7 Mon Sep 17 00:00:00 2001 From: Birdie K <5210502+moo-im-a-cow@users.noreply.github.com> Date: Fri, 9 May 2025 15:35:28 +1000 Subject: [PATCH 1/2] make the vault token optional --- vault-token/main.tf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vault-token/main.tf b/vault-token/main.tf index 94517d10..3461ba56 100644 --- a/vault-token/main.tf +++ b/vault-token/main.tf @@ -24,6 +24,7 @@ variable "vault_token" { type = string description = "The Vault token to use for authentication." sensitive = true + default = null } variable "vault_cli_version" { @@ -56,6 +57,7 @@ resource "coder_env" "vault_addr" { } resource "coder_env" "vault_token" { + count = var.vault_token != null ? 1 : 0 agent_id = var.agent_id name = "VAULT_TOKEN" value = var.vault_token From ef603c9138b86b05ab903b863c07c938a2aba747 Mon Sep 17 00:00:00 2001 From: Birdie K <5210502+moo-im-a-cow@users.noreply.github.com> Date: Fri, 9 May 2025 16:00:48 +1000 Subject: [PATCH 2/2] remove required variable vault_token from vault-token module tests --- vault-token/main.test.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/vault-token/main.test.ts b/vault-token/main.test.ts index d5134252..91ad50b5 100644 --- a/vault-token/main.test.ts +++ b/vault-token/main.test.ts @@ -7,6 +7,5 @@ describe("vault-token", async () => { testRequiredVariables(import.meta.dir, { agent_id: "foo", vault_addr: "foo", - vault_token: "foo", }); });