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

Co-authored-by: Birdie K <5210502+moo-im-a-cow@users.noreply.github.com>
Co-authored-by: M Atif Ali <atif@coder.com>
This commit is contained in:
Birdie Kingston
2025-05-16 03:12:36 +10:00
committed by GitHub
parent d77d4a8f19
commit 9a2e48b1da
3 changed files with 6 additions and 5 deletions
+4 -4
View File
@@ -21,9 +21,9 @@ variable "vault_token" {
module "vault" {
source = "registry.coder.com/coder/vault-token/coder"
version = "1.0.7"
version = "1.1.0"
agent_id = coder_agent.example.id
vault_token = var.token
vault_token = var.token # optional
vault_addr = "https://vault.example.com"
}
```
@@ -74,10 +74,10 @@ variable "vault_token" {
module "vault" {
source = "registry.coder.com/coder/vault-token/coder"
version = "1.0.7"
version = "1.1.0"
agent_id = coder_agent.example.id
vault_addr = "https://vault.example.com"
vault_token = var.token
vault_cli_version = "1.15.0"
vault_cli_version = "1.19.0"
}
```
@@ -7,6 +7,5 @@ describe("vault-token", async () => {
testRequiredVariables(import.meta.dir, {
agent_id: "foo",
vault_addr: "foo",
vault_token: "foo",
});
});
@@ -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