- Notifications
You must be signed in to change notification settings - Fork928
Description
Problem statement
Developers want to see additional metadata about resources in Coder. This could be an instance type, the number of cores an instance has, or a link to the cloud resource itself (say in a GCP dashboard).
As a developer, I want to see information about my workspace, both information that is dynamic (e.g external IP) and the most relevant aspects of the template (no. CPUs).
Definition of done
We should add arbitrary key/value pairs that allow template authors to expose additional metadata. This should be added in our Terraform Provider, allowing customers to expose arbitrary values from existing resources that are provisioned. The key/value pairs would be available from the CLI and the dashboard.
Implementation notes (@bpmct)
Dashboard(figma):
Template:
resource"null_resource""about" {}resource"coder_metadata""about_info" {resource_id=null_resource.about.iditem {key="type"value=null }item {key="quicklinks"value="[onboarding guide](https://mywiki.com/onboarding), [troubleshooting](https://mywiki.com/troubleshooting)" }}resource"kubernetes_pod""main-dev" {# ...}resource"coder_metadata""dev_info" {resource_id=kubernetes_pod.main-dev.iditem {key="api_key"value="asdfjkl" sensitive:true }}
CLI:
$ coder metadata my-workspaceRESOURCE_NAME KEY VALUEabout workspace-id acf2a70d-6347-4b8cabout quicklinks [onboarding guide](https://mywiki.com/onboarding), [troubleshooting](https://mywiki.com/troubleshooting)main-devtype kubernetes_podmain-dev api_key (hidden)Some values are sensitive. Use`coder metadata myworkspace<key>` to fetch individual values.
In the future, perhapsresource_id = "global"
orglobal = true
could be used to display metadata workspace-wide in another panel if the hack is widely used.
Related: