Skip to content

Commit 73a59e4

Browse files
committed
Add additional examples
1 parent d901870 commit 73a59e4

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

docs/resources/metadata.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,26 @@ resource "kubernetes_pod" "dev" {
2020
count = data.coder_workspace.me.start_count
2121
}
2222
23+
resource "tls_private_key" "example_key_pair" {
24+
algorithm = "ECDSA"
25+
ecdsa_curve = "P256"
26+
}
27+
2328
resource "coder_metadata" "pod_info" {
2429
count = data.coder_workspace.me.start_count
2530
resource_id = kubernetes_pod.dev[0].id
31+
pair {
32+
key = "description"
33+
value = "This description will show up in the Coder dashboard."
34+
}
2635
pair {
2736
key = "pod_uid"
2837
value = kubernetes_pod.dev[0].uid
2938
}
39+
pair {
40+
key = "public_key"
41+
value = tls_private_key.example_key.public_key_openssh
42+
}
3043
}
3144
```
3245

examples/resources/coder_metadata/resource.tf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,26 @@ resource "kubernetes_pod" "dev" {
55
count = data.coder_workspace.me.start_count
66
}
77

8+
resource "tls_private_key" "example_key_pair" {
9+
algorithm = "ECDSA"
10+
ecdsa_curve = "P256"
11+
}
12+
813
resource "coder_metadata" "pod_info" {
914
count = data.coder_workspace.me.start_count
1015
resource_id = kubernetes_pod.dev[0].id
16+
pair {
17+
key = "description"
18+
value = "This description will show up in the Coder dashboard."
19+
}
1120
pair {
1221
key = "pod_uid"
1322
value = kubernetes_pod.dev[0].uid
1423
}
24+
pair {
25+
key = "public_key"
26+
value = tls_private_key.example_key.public_key_openssh
27+
# The value of this item will be hidden from view by default
28+
sensitive = true
29+
}
1530
}

0 commit comments

Comments
 (0)