Skip to content

Commit 7cf1e20

Browse files
authored
docs: clarify alpha state of rich parameters (#6369)
1 parent 418a8a7 commit 7cf1e20

File tree

1 file changed

+30
-3
lines changed

1 file changed

+30
-3
lines changed

docs/templates.md

+30-3
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,9 @@ coder dotfiles -y ${var.dotfiles_uri}
185185
}
186186
```
187187

188-
### Parameters
188+
### Parameters (alpha)
189+
190+
> 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.
189191
190192
Templates can contain _parameters_, which prompt the user for additional information
191193
in the "create workspace" screen.
@@ -231,9 +233,34 @@ provider "docker" {
231233
> For a complete list of supported parameter types, see the
232234
> [coder_parameter Terraform reference](https://registry.terraform.io/providers/coder/coder/latest/docs/data-sources/parameter)
233235
234-
#### Legacy parameters (deprecated)
236+
#### Legacy parameters
237+
238+
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.
239+
240+
```hcl
241+
variable "use_kubeconfig" {
242+
sensitive = true # Admin (template-level) parameter
243+
type = bool
244+
description = <<-EOF
245+
Use host kubeconfig? (true/false)
246+
EOF
247+
}
235248
236-
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 = "Invalid cpu!"
261+
}
262+
}
263+
```
237264

238265
> ⚠️ Legacy (`variable`) parameters and rich parameters cannot be used in the same template.
239266

0 commit comments

Comments
 (0)