File tree Expand file tree Collapse file tree 4 files changed +13
-0
lines changed
examples/resources/coder_metadata Expand file tree Collapse file tree 4 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,8 @@ resource "tls_private_key" "example_key_pair" {
28
28
resource "coder_metadata" "pod_info" {
29
29
count = data.coder_workspace.me.start_count
30
30
resource_id = kubernetes_pod.dev[0].id
31
+ # (Enterprise-only) this resource consumes 200 quota units
32
+ cost = 200
31
33
item {
32
34
key = "description"
33
35
value = "This description will show up in the Coder dashboard."
@@ -55,6 +57,7 @@ resource "coder_metadata" "pod_info" {
55
57
56
58
### Optional
57
59
60
+ - ` cost ` (Number) (Enterprise) The amount of quota units this resource consumes
58
61
- ` hide ` (Boolean) Hide the resource from the UI.
59
62
- ` icon ` (String) A URL to an icon that will display in the dashboard. View built-in icons here: https://github.com/coder/coder/tree/main/site/static/icon . Use a built-in icon with ` data.coder_workspace.me.access_url + "/icons/<path>" ` .
60
63
Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ resource "tls_private_key" "example_key_pair" {
13
13
resource "coder_metadata" "pod_info" {
14
14
count = data. coder_workspace . me . start_count
15
15
resource_id = kubernetes_pod. dev [0 ]. id
16
+ # (Enterprise-only) this resource consumes 200 quota units
17
+ cost = 200
16
18
item {
17
19
key = " description"
18
20
value = " This description will show up in the Coder dashboard."
Original file line number Diff line number Diff line change @@ -61,6 +61,12 @@ func metadataResource() *schema.Resource {
61
61
return nil , nil
62
62
},
63
63
},
64
+ "cost" : {
65
+ Type : schema .TypeInt ,
66
+ Description : "(Enterprise) The amount of quota units this resource consumes" ,
67
+ ForceNew : true ,
68
+ Optional : true ,
69
+ },
64
70
"item" : {
65
71
Type : schema .TypeList ,
66
72
Description : "Each \" item\" block defines a single metadata item consisting of a key/value pair." ,
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ func TestMetadata(t *testing.T) {
31
31
resource_id = coder_agent.dev.id
32
32
hide = true
33
33
icon = "/icons/storage.svg"
34
+ cost = 200
34
35
item {
35
36
key = "foo"
36
37
value = "bar"
@@ -65,6 +66,7 @@ func TestMetadata(t *testing.T) {
65
66
"resource_id" : agent .Primary .Attributes ["id" ],
66
67
"hide" : "true" ,
67
68
"icon" : "/icons/storage.svg" ,
69
+ "cost" : "200" ,
68
70
"item.#" : "5" ,
69
71
"item.0.key" : "foo" ,
70
72
"item.0.value" : "bar" ,
You can’t perform that action at this time.
0 commit comments