Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore(docs): document preset description and icon fields#20705

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
johnstcn wants to merge2 commits intomain
base:main
Choose a base branch
Loading
fromcj/docs-preset-icons
Open
Changes fromall 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
49 changes: 42 additions & 7 deletionsdocs/admin/templates/extending-templates/parameters.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -322,15 +322,33 @@ their needs.

![Template with options in the preset dropdown](../../../images/admin/templates/extend-templates/template-preset-dropdown.png)

Use `coder_workspace_preset` to define the preset parameters.
After you save the template file, the presets will be available for all new
workspace deployments.
Use the
[`coder_workspace_preset`](https://registry.terraform.io/providers/coder/coder/latest/docs/data-sources/workspace_preset)
data source to define the preset parameters. After you save the template file,
the presets will be available for all new workspace deployments.

### Optional preset fields

In addition to the required `name` and `parameters` fields, you can enhance your
workspace presets with optional `description` and `icon` fields:

- **description**: A helpful text description that provides additional context
about the preset. This helps users understand what the preset is for and when
to use it.
- **icon**: A visual icon displayed alongside the preset name in the UI. Use
emoji icons with the format `/emojis/{code}.png` (e.g.,
`/emojis/1f1fa-1f1f8.png` for the US flag emoji 🇺🇸).

For a complete list of all available fields, see the
[Terraform provider documentation](https://registry.terraform.io/providers/coder/coder/latest/docs/data-sources/workspace_preset#schema).

<details><summary>Expand for an example</summary>

```tf
data "coder_workspace_preset" "goland-gpu" {
name = "GoLand with GPU"
description = "Development workspace with GPU acceleration for GoLand IDE"
icon = "/emojis/1f680.png"
parameters = {
"machine_type" = "n1-standard-1"
"attach_gpu" = "true"
Expand All@@ -339,6 +357,16 @@ data "coder_workspace_preset" "goland-gpu" {
}
}

data "coder_workspace_preset" "pittsburgh" {
name = "Pittsburgh"
description = "Development workspace hosted in United States"
icon = "/emojis/1f1fa-1f1f8.png"
parameters = {
"region" = "us-pittsburgh"
"machine_type" = "n1-standard-2"
}
}

Comment on lines +360 to +369
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

self-review: The addition of aregion parameter is slightly confusing withgcp_region.

data "coder_parameter" "machine_type" {
name = "machine_type"
display_name = "Machine Type"
Expand All@@ -355,16 +383,23 @@ data "coder_parameter" "attach_gpu" {

data "coder_parameter" "gcp_region" {
name = "gcp_region"
display_name = "Machine Type"
display_name = "GCP Region"
type = "string"
default = "n1-standard-2"
default = "us-central1-a"
}

data "coder_parameter" "jetbrains_ide" {
name = "jetbrains_ide"
display_name = "Machine Type"
display_name = "JetBrains IDE"
type = "string"
default = "n1-standard-2"
default = "IU"
}

data "coder_parameter" "region" {
name = "region"
display_name = "Region"
type = "string"
default = "us-east-1"
}
```

Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp