You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> Parameters are an [alpha feature](./contributing/feature-stages.md#alpha-features). See the [Rich Parameters Milestone](https://github.com/coder/coder/milestone/11) for more details.
189
191
190
192
Templates can contain _parameters_, which prompt the user for additional information
191
193
in the "create workspace" screen.
@@ -231,9 +233,34 @@ provider "docker" {
231
233
> For a complete list of supported parameter types, see the
Prior to Coder v0.16.0 (Jan 2023), parameters were defined via Terraform `variable` blocks. These "legacy parameters" can still be used in templates, but will be removed in April 2023.
Prior to Coder v0.16.0 (Jan 2023), parameters were defined via Terraform `variable` blocks. These "legacy parameters" can still be used in templates, but are deprecated and will be removed in April 2023.
249
+
variable "cpu" {
250
+
sensitive = false # User (workspace-level) parameter
251
+
description = "CPU (__ cores)"
252
+
default = 2
253
+
validation {
254
+
condition = contains([
255
+
"2",
256
+
"4",
257
+
"6",
258
+
"8"
259
+
], var.cpu)
260
+
error_message =
57C9
"Invalid cpu!"
261
+
}
262
+
}
263
+
```
237
264
238
265
> ⚠️ Legacy (`variable`) parameters and rich parameters cannot be used in the same template.
0 commit comments