You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use this resource to attach key/value pairs to a resource. They will be displayed in the Coder dashboard.
7
+
---
8
+
9
+
# coder_metadata (Resource)
10
+
11
+
Use this resource to attach key/value pairs to a resource. They will be displayed in the Coder dashboard.
12
+
13
+
## Example Usage
14
+
15
+
```terraform
16
+
data "coder_workspace" "me" {
17
+
}
18
+
19
+
resource "kubernetes_pod" "dev" {
20
+
count = data.coder_workspace.me.start_count
21
+
}
22
+
23
+
resource "tls_private_key" "example_key_pair" {
24
+
algorithm = "ECDSA"
25
+
ecdsa_curve = "P256"
26
+
}
27
+
28
+
resource "coder_metadata" "pod_info" {
29
+
count = data.coder_workspace.me.start_count
30
+
resource_id = kubernetes_pod.dev[0].id
31
+
item {
32
+
key = "description"
33
+
value = "This description will show up in the Coder dashboard."
34
+
}
35
+
item {
36
+
key = "pod_uid"
37
+
value = kubernetes_pod.dev[0].uid
38
+
}
39
+
item {
40
+
key = "public_key"
41
+
value = tls_private_key.example_key_pair.public_key_openssh
42
+
# The value of this item will be hidden from view by default
43
+
sensitive = true
44
+
}
45
+
}
46
+
```
47
+
48
+
<!-- schema generated by tfplugindocs -->
49
+
## Schema
50
+
51
+
### Required
52
+
53
+
-`item` (Block List, Min: 1) Each "item" block defines a single metadata item consisting of a key/value pair. (see [below for nested schema](#nestedblock--item))
54
+
-`resource_id` (String) The "id" property of another resource that metadata should be attached to.
55
+
56
+
### Read-Only
57
+
58
+
-`id` (String) The ID of this resource.
59
+
60
+
<aid="nestedblock--item"></a>
61
+
### Nested Schema for `item`
62
+
63
+
Required:
64
+
65
+
-`key` (String) The key of this metadata item.
66
+
67
+
Optional:
68
+
69
+
-`sensitive` (Boolean) Set to "true" to for items such as API keys whose values should be hidden from view by default. Note that this does not prevent metadata from being retrieved using the API, so it is not suitable for secrets that should not be exposed to workspace users.
70
+
-`value` (String) The value of this metadata item.
0 commit comments