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:
parent
d77d4a8f19
commit
9a2e48b1da
@ -21,9 +21,9 @@ variable "vault_token" {
|
|||||||
|
|
||||||
module "vault" {
|
module "vault" {
|
||||||
source = "registry.coder.com/coder/vault-token/coder"
|
source = "registry.coder.com/coder/vault-token/coder"
|
||||||
version = "1.0.7"
|
version = "1.1.0"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
vault_token = var.token
|
vault_token = var.token # optional
|
||||||
vault_addr = "https://vault.example.com"
|
vault_addr = "https://vault.example.com"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@ -74,10 +74,10 @@ variable "vault_token" {
|
|||||||
|
|
||||||
module "vault" {
|
module "vault" {
|
||||||
source = "registry.coder.com/coder/vault-token/coder"
|
source = "registry.coder.com/coder/vault-token/coder"
|
||||||
version = "1.0.7"
|
version = "1.1.0"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
vault_addr = "https://vault.example.com"
|
vault_addr = "https://vault.example.com"
|
||||||
vault_token = var.token
|
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, {
|
testRequiredVariables(import.meta.dir, {
|
||||||
agent_id: "foo",
|
agent_id: "foo",
|
||||||
vault_addr: "foo",
|
vault_addr: "foo",
|
||||||
vault_token: "foo",
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -24,6 +24,7 @@ variable "vault_token" {
|
|||||||
type = string
|
type = string
|
||||||
description = "The Vault token to use for authentication."
|
description = "The Vault token to use for authentication."
|
||||||
sensitive = true
|
sensitive = true
|
||||||
|
default = null
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "vault_cli_version" {
|
variable "vault_cli_version" {
|
||||||
@ -56,6 +57,7 @@ resource "coder_env" "vault_addr" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
resource "coder_env" "vault_token" {
|
resource "coder_env" "vault_token" {
|
||||||
|
count = var.vault_token != null ? 1 : 0
|
||||||
agent_id = var.agent_id
|
agent_id = var.agent_id
|
||||||
name = "VAULT_TOKEN"
|
name = "VAULT_TOKEN"
|
||||||
value = var.vault_token
|
value = var.vault_token
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user