mirror of
https://github.com/coder/registry.git
synced 2026-06-02 20:48:14 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user