diff --git a/registry/coder/modules/vault-jwt/README.md b/registry/coder/modules/vault-jwt/README.md index 7fd048f0d..bc5be88e9 100644 --- a/registry/coder/modules/vault-jwt/README.md +++ b/registry/coder/modules/vault-jwt/README.md @@ -14,7 +14,7 @@ This module lets you authenticate with [Hashicorp Vault](https://www.vaultprojec module "vault" { count = data.coder_workspace.me.start_count source = "registry.coder.com/coder/vault-jwt/coder" - version = "1.2.2" + version = "1.3.0" agent_id = coder_agent.example.id vault_addr = "https://vault.example.com" vault_jwt_role = "coder" # The Vault role to use for authentication @@ -42,7 +42,7 @@ curl -H "X-Vault-Token: ${VAULT_TOKEN}" -X GET "${VAULT_ADDR}/v1/coder/secrets/d module "vault" { count = data.coder_workspace.me.start_count source = "registry.coder.com/coder/vault-jwt/coder" - version = "1.2.2" + version = "1.3.0" agent_id = coder_agent.example.id vault_addr = "https://vault.example.com" vault_jwt_auth_path = "oidc" @@ -58,7 +58,7 @@ data "coder_workspace_owner" "me" {} module "vault" { count = data.coder_workspace.me.start_count source = "registry.coder.com/coder/vault-jwt/coder" - version = "1.2.2" + version = "1.3.0" agent_id = coder_agent.example.id vault_addr = "https://vault.example.com" vault_jwt_role = data.coder_workspace_owner.me.groups[0] @@ -71,7 +71,7 @@ module "vault" { module "vault" { count = data.coder_workspace.me.start_count source = "registry.coder.com/coder/vault-jwt/coder" - version = "1.2.2" + version = "1.3.0" agent_id = coder_agent.example.id vault_addr = "https://vault.example.com" vault_jwt_role = "coder" # The Vault role to use for authentication @@ -79,6 +79,22 @@ module "vault" { } ``` +### Customize the workspace logs display name + +By default the workspace logs entry is labeled `Vault (JWT)`. Override it with `display_name` if you run multiple Vault modules in the same workspace: + +```tf +module "vault" { + count = data.coder_workspace.me.start_count + source = "registry.coder.com/coder/vault-jwt/coder" + version = "1.3.0" + agent_id = coder_agent.example.id + vault_addr = "https://vault.example.com" + vault_jwt_role = "coder" # The Vault role to use for authentication + display_name = "Vault (Coder OIDC)" +} +``` + ### Use a custom JWT token ```tf @@ -132,7 +148,7 @@ resource "jwt_signed_token" "vault" { module "vault" { count = data.coder_workspace.me.start_count source = "registry.coder.com/coder/vault-jwt/coder" - version = "1.2.2" + version = "1.3.0" agent_id = coder_agent.example.id vault_addr = "https://vault.example.com" vault_jwt_role = "coder" # The Vault role to use for authentication diff --git a/registry/coder/modules/vault-jwt/main.tf b/registry/coder/modules/vault-jwt/main.tf index 69ae9e07e..e7dcb909f 100644 --- a/registry/coder/modules/vault-jwt/main.tf +++ b/registry/coder/modules/vault-jwt/main.tf @@ -54,9 +54,15 @@ variable "vault_cli_version" { } } +variable "display_name" { + description = "The display name of the coder_script resource shown in the workspace logs." + type = string + default = "Vault (JWT)" +} + resource "coder_script" "vault" { agent_id = var.agent_id - display_name = "Vault (GitHub)" + display_name = var.display_name icon = "/icon/vault.svg" script = templatefile("${path.module}/run.sh", { CODER_OIDC_ACCESS_TOKEN : var.vault_jwt_token != null ? var.vault_jwt_token : data.coder_workspace_owner.me.oidc_access_token,