Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

feat(vault-token): make supplying a vault token optional #466

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion vault-token/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ describe("vault-token", async () => {
testRequiredVariables(import.meta.dir, {
agent_id: "foo",
vault_addr: "foo",
vault_token: "foo",
});
});
2 changes: 2 additions & 0 deletions vault-token/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down Expand Up @@ -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
Expand Down