Skip to content

docs: document workspace presets feature #16612

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 11 commits into from
Mar 5, 2025
Prev Previous commit
Next Next commit
s/tabs/spaces
  • Loading branch information
EdwardAngert committed Feb 24, 2025
commit 45d9caf5cf67f6ff43f18f2bf1f2540cba62b0bb
41 changes: 21 additions & 20 deletions docs/admin/templates/extending-templates/parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,46 +325,47 @@ Use `prebuilds` to define how many instances of the template should be stored as
When a developer selects the associated template, the workspace will be assigned to that developer and the server will build a new prebuilt workspace.

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

```tf
data "coder_workspace_preset" "goland-gpu" {
name = "GoLand with GPU"
parameters = {
"machine_type" = "n1-standard-1"
"attach_gpu" = "true"
"gcp_region" = "europe-west4-c"
"jetbrains_ide" = "GO"
"machine_type" = "n1-standard-1"
"attach_gpu" = "true"
"gcp_region" = "europe-west4-c"
"jetbrains_ide" = "GO"
}
prebuilds {
instances = 1
}
}

data "coder_parameter" "machine_type" {
name = "machine_type"
display_name = "Machine Type"
type = "string"
default = "n1-standard-2"
name = "machine_type"
display_name = "Machine Type"
type = "string"
default = "n1-standard-2"
}

data "coder_workspace_preset" "attach_gpu" {
name = "attach_gpu"
display_name = "Attach GPU?"
type = "bool"
default = "false"
name = "attach_gpu"
display_name = "Attach GPU?"
type = "bool"
default = "false"
}

data "coder_workspace_preset" "gcp_region" {
name = "gcp_region"
display_name = "Machine Type"
type = "string"
default = "n1-standard-2"
name = "gcp_region"
display_name = "Machine Type"
type = "string"
default = "n1-standard-2"
}

data "coder_workspace_preset" "jetbrains_ide" {
name = "jetbrains_ide"
display_name = "Machine Type"
type = "string"
default = "n1-standard-2"
name = "jetbrains_ide"
display_name = "Machine Type"
type = "string"
default = "n1-standard-2"
}
```

Expand Down
Loading