- Notifications
You must be signed in to change notification settings - Fork905
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
11 commits Select commitHold shift + click to select a range
f5be2a7
init workspace presets
EdwardAngertb24deaf
move presets to parameters
EdwardAngertd73abd0
example of prebuild
EdwardAngert45d9caf
s/tabs/spaces
EdwardAngertfaee979
rm prebuilt
EdwardAngert6cedd01
fix extra presets that should be params
EdwardAngertfa0a54a
copy edit
EdwardAngert5d5db87
available for new
EdwardAngerte190310
Merge remote-tracking branch 'origin/main' into 16475-workspace-presets
EdwardAngerte82afb3
add preset screenshot
EdwardAngert7bada4b
Merge remote-tracking branch 'origin/main' into 16475-workspace-presets
EdwardAngertFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
56 changes: 56 additions & 0 deletionsdocs/admin/templates/extending-templates/parameters.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -313,6 +313,62 @@ data "coder_parameter" "project_id" { | ||
} | ||
``` | ||
## Workspace presets | ||
Workspace presets allow you to configure commonly used combinations of parameters | ||
into a single option, which makes it easier for developers to pick one that fits | ||
their needs. | ||
 | ||
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. | ||
EdwardAngert marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
<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" | ||
} | ||
} | ||
data "coder_parameter" "machine_type" { | ||
name = "machine_type" | ||
display_name = "Machine Type" | ||
type = "string" | ||
default = "n1-standard-2" | ||
} | ||
data "coder_parameter" "attach_gpu" { | ||
name = "attach_gpu" | ||
display_name = "Attach GPU?" | ||
type = "bool" | ||
default = "false" | ||
} | ||
data "coder_parameter" "gcp_region" { | ||
name = "gcp_region" | ||
display_name = "Machine Type" | ||
type = "string" | ||
default = "n1-standard-2" | ||
} | ||
data "coder_parameter" "jetbrains_ide" { | ||
name = "jetbrains_ide" | ||
display_name = "Machine Type" | ||
type = "string" | ||
default = "n1-standard-2" | ||
} | ||
``` | ||
</details> | ||
## Create Autofill | ||
When the template doesn't specify default values, Coder may still autofill | ||
Loading
Sorry, something went wrong.Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.