Skip to content

Commit 88c9f31

Browse files
authored
docs: explain how to display secrets (#3443)
1 parent fd59e2e commit 88c9f31

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

docs/images/secret-metadata-ui.png

702 KB
Loading

docs/secrets.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,32 @@ A catch-all variation of this approach is dynamically provisioning a cloud servi
5555
for each workspace and then making the relevant secrets available via the cloud's secret management
5656
system.
5757

58+
## Displaying Secrets
59+
60+
While you can inject secrets into the workspace via environment variables, you
61+
can also show them in the Workspace UI with [`coder_metadata`](https://registry.terraform.io/providers/coder/coder/latest/docs/resources/metadata).
62+
63+
![secret UI](./images/secret-metadata-ui.png)
64+
65+
Can be produced with
66+
67+
```hcl
68+
resource "twilio_iam_api_key" "api_key" {
69+
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
70+
friendly_name = "Test API Key"
71+
}
72+
73+
74+
resource "coder_metadata" "twilio_key" {
75+
resource_id = twilio_iam_api_key.api_key.id
76+
item {
77+
key = "secret"
78+
value = twilio_iam_api_key.api_key.secret
79+
sensitive = true
80+
}
81+
}
82+
```
83+
5884
## Coder SSH Key
5985

6086
Coder automatically inserts an account-wide SSH key into each workspace. In MacOS

0 commit comments

Comments
 (0)