This repository was archived by the owner on May 15, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +8
-11
lines changed Expand file tree Collapse file tree 2 files changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -17,16 +17,6 @@ module "vault" {
17
17
agent_id = coder_agent.example.id
18
18
vault_addr = "https://vault.example.com"
19
19
}
20
-
21
- # A workaround until we have https://github.com/coder/terraform-provider-coder/issues/170
22
- resource "coder_agent" "example" {
23
- ...
24
- env = {
25
- VAULT_ADDR = "https://vault.example.com"
26
- }
27
- ...
28
- }
29
-
30
20
```
31
21
32
22
Then you can use the Vault CLI in your workspaces to fetch secrets from Vault:
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ terraform {
4
4
required_providers {
5
5
coder = {
6
6
source = " coder/coder"
7
- version = " >= 0.12"
7
+ version = " >= 0.12.4 "
8
8
}
9
9
}
10
10
}
@@ -43,6 +43,7 @@ variable "vault_cli_version" {
43
43
}
44
44
45
45
data "coder_workspace" "me" {}
46
+
46
47
resource "coder_script" "vault" {
47
48
agent_id = var. agent_id
48
49
display_name = " Vault (GitHub)"
@@ -57,6 +58,12 @@ resource "coder_script" "vault" {
57
58
start_blocks_login = true
58
59
}
59
60
61
+ resource "coder_env" "vault_addr" {
62
+ agent_id = var. agent_id
63
+ name = " VAULT_ADDR"
64
+ value = var. vault_addr
65
+ }
66
+
60
67
data "coder_external_auth" "github" {
61
68
id = var. coder_github_auth_id
62
69
}
You can’t perform that action at this time.
0 commit comments