Skip to content

docs: Custom resource icon #4041

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions docs/templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,14 +225,9 @@ resource "kubernetes_pod" "podName" {

### Delete templates

<<<<<<< HEAD
You can delete a template using both the coder CLI and UI. Only
[template admins and owners](./admin/users.md) can delete a template, and the template
must not have any running workspaces associated to it.
=======
You can delete a template using both the Coder CLI and UI. Only
[template admins and owners](./admin/users.md) can delete a template.
>>>>>>> 0407c2294c5c7321071c17013f2e39bd70568165

Using the CLI, login to Coder and run the following command to delete a template:

Expand Down Expand Up @@ -322,7 +317,7 @@ We recommend source controlling your templates as you would other code.
CI is as simple as running `coder templates push` with the appropriate
credentials.


## Next Steps

- Learn about [Authentication & Secrets](templates/authentication.md)
- Learn about [Workspaces](workspaces.md)
26 changes: 26 additions & 0 deletions docs/templates/resource-metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,32 @@ resource "coder_metadata" "hide_serviceaccount" {
}
```

## Using custom resource icon

To use custom icons on your resources, use the `icon` attribute (must be a valid path or URL):

```hcl
resource "coder_metadata" "resource_with_icon" {
count = data.coder_workspace.me.start_count
resource_id = kubernetes_service_account.user_data.id
icon = "/icon/database.svg"
item {
key = "name"
value = kubernetes_deployment.coder[0].metadata[0].name
}
}
```

To make easier for you to customize your resource we added some built-in icons:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it! ❤️


- Folder `/icon/folder.svg`
- Memory `/icon/memory.svg`
- Image `/icon/image.svg`
- Widgets `/icon/widgets.svg`
- Database `/icon/database.svg`

We also have other icons related to the IDEs. You can see all the icons [here](https://github.com/coder/coder/tree/main/site/static/icon).

## Up next

- Learn about [secrets](../secrets.md)