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" {
2828resource "coder_metadata" "pod_info" {
2929 count = data.coder_workspace.me.start_count
3030 resource_id = kubernetes_pod.dev[0].id
31+ # (Enterprise-only) this resource consumes 200 quota units
32+ cost = 200
3133 item {
3234 key = "description"
3335 value = "This description will show up in the Coder dashboard."
@@ -55,6 +57,7 @@ resource "coder_metadata" "pod_info" {
5557
5658### Optional
5759
60+ - ` cost ` (Number) (Enterprise) The amount of quota units this resource consumes
5861- ` hide ` (Boolean) Hide the resource from the UI.
5962- ` 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>" ` .
6063
Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ resource "tls_private_key" "example_key_pair" {
1313resource "coder_metadata" "pod_info" {
1414 count = data. coder_workspace . me . start_count
1515 resource_id = kubernetes_pod. dev [0 ]. id
16+ # (Enterprise-only) this resource consumes 200 quota units
17+ cost = 200
1618 item {
1719 key = " description"
1820 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 {
6161 return nil , nil
6262 },
6363 },
64+ "cost" : {
65+ Type : schema .TypeInt ,
66+ Description : "(Enterprise) The amount of quota units this resource consumes" ,
67+ ForceNew : true ,
68+ Optional : true ,
69+ },
6470 "item" : {
6571 Type : schema .TypeList ,
6672 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) {
3131 resource_id = coder_agent.dev.id
3232 hide = true
3333 icon = "/icons/storage.svg"
34+ cost = 200
3435 item {
3536 key = "foo"
3637 value = "bar"
@@ -65,6 +66,7 @@ func TestMetadata(t *testing.T) {
6566 "resource_id" : agent .Primary .Attributes ["id" ],
6667 "hide" : "true" ,
6768 "icon" : "/icons/storage.svg" ,
69+ "cost" : "200" ,
6870 "item.#" : "5" ,
6971 "item.0.key" : "foo" ,
7072 "item.0.value" : "bar" ,
You can’t perform that action at this time.
0 commit comments