8000 examples out of table · coder/coder@bd61338 · GitHub
[go: up one dir, main page]

Skip to content

Commit bd61338

Browse files
committed
examples out of table
1 parent d944f24 commit bd61338

File tree

1 file changed

+32
-31
lines changed

1 file changed

+32
-31
lines changed

docs/admin/templates/extending-templates/parameters.md

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -398,12 +398,13 @@ Dynamic Parameters enhances Coder's existing parameter system with real-time val
398398
conditional parameter behavior, and richer input types.
399399
This feature allows template authors to create more interactive and responsive workspace creation experiences.
400400
401-
### Enable Dynamic Parameters
401+
### Enable Dynamic Parameters (Early Access)
402402
403-
To use Dynamic Parameters, enable the experiment flag or set the environment variable. Note that as of v.22.0, Dynamic parameters are an _unsafe_ experiment and will not be enabled by using the experiment wildcard.
403+
To use Dynamic Parameters, enable the experiment flag or set the environment variable.
404404
405-
<div class="tabs">
405+
Note that as of v2.22.0, Dynamic parameters are an unsafe experiment and will not be enabled with the experiment wildcard.
406406
407+
<div class="tabs">
407408
408409
#### Flag
409410
@@ -419,7 +420,9 @@ CODER_EXPERIMENTS=dynamic-parameters
419420
420421
</div>
421422
422-
Dynamic Parameters also require version >=2.4.0 of the coder provider. Inject the following at the top of your template after enabling the experiment:
423+
Dynamic Parameters also require version >=2.4.0 of the Coder provider.
424+
425+
Enable the experiment, then include the following at the top of your template:
423426
424427
```terraform
425428
terraform {
@@ -432,7 +435,6 @@ terraform {
432435
}
433436
```
434437
435-
436438
Once enabled, users can toggle between the experimental and classic interfaces during
437439
workspace creation using an escape hatch in the workspace creation form.
438440
@@ -451,8 +453,8 @@ Dynamic Parameters introduces three primary enhancements to the standard paramet
451453
452454
- Read user data at build time from [`coder_workspace_owner`](https://registry.terraform.io/providers/coder/coder/latest/docs/data-sources/workspace_owner)
453455
- Conditionally hide parameters based on user's role
454-
- Change parameter options based on user groups
455-
- Reference user name in parameters
456+
- Change parameter options based on user groups
457+
- Reference user name in parameters
456458
457459
- **Additional Form Inputs**
458460
@@ -471,23 +473,23 @@ Different parameter types support different form types.
471473
472474
The "Options" column in the table below indicates whether the form type requires options to be defined (Yes) or doesn't support/require them (No). When required, options are specified using one or more `option` blocks in your parameter definition, where each option has a `name` (displayed to the user) and a `value` (used in your template logic).
473475
474-
| Form Type | Parameter Types | Options | Notes | Example |
475-
|----------------|--------------------------------------------|---------|---------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
476-
| `checkbox` | `bool` | No | A single checkbox for boolean parameters.<br>Default for boolean parameters. | <details><summary>checkbox</summary> ``` tf data "coder_parameter" "enable_gpu" { name = "enable_gpu" display_name = "Enable GPU" type = "bool" form_type = "checkbox" # This is the default for boolean parameters default = false } ``` </ details > |
477-
| `dropdown` | `string`, `number` | Yes | Searchable dropdown list for choosing a single option from a list.<br>Default for `string` or `number` parameters with options. | placeholder |
478-
| `input` | `string`, `number` | No | Standard single-line text input field.<br>Default for string/number parameters without options. | placeholder |
479-
| `key-value` | `string` | No | For entering key-value pairs (as JSON). | placeholder |
480-
| `multi-select` | `list(string)` | Yes | Select multiple items from a list with checkboxes. | placeholder |
481-
| `password` | `string` | No | Masked input field for sensitive information. | placeholder |
482-
| `radio` | `string`, `number`, `bool`, `list(string)` | Yes | Radio buttons for selecting a single option with all choices visible at once. | placeholder E29B |
483-
| `slider` | `number` | No | Slider selection with min/max validation for numeric values. | placeholder |
484-
| `switch` | `bool` | No | Toggle switch alternative for boolean parameters. | placeholder |
485-
| `tag-select` | `list(string)` | No | Default for list(string) parameters without options. | placeholder |
486-
| `textarea` | `string` | No | Multi-line text input field for longer content. | placeholder |
476+
| Form Type | Parameter Types | Options | Notes |
477+
|----------------|--------------------------------------------|---------|------------------------------------------------------------------------------------------------------------------------------|
478+
| `checkbox` | `bool` | No | A single checkbox for boolean parameters. Default for boolean parameters. |
479+
| `dropdown` | `string`, `number` | Yes | Searchable dropdown list for choosing a single option from a list. Default for `string` or `number` parameters with options. |
480+
| `input` | `string`, `number` | No | Standard single-line text input field. Default for string/number parameters without options. |
481+
| `key-value` | `string` | No | For entering key-value pairs (as JSON). |
482+
| `multi-select` | `list(string)` | Yes | Select multiple items from a list with checkboxes. |
483+
| `password` | `string` | No | Masked input field for sensitive information. |
484+
| `radio` | `string`, `number`, `bool`, `list(string)` | Yes | Radio buttons for selecting a single option with all choices visible at once. |
485+
| `slider` | `number` | No | Slider selection with min/max validation for numeric values. |
486+
| `switch` | `bool` | No | Toggle switch alternative for boolean parameters. |
487+
| `tag-select` | `list(string)` | No | Default for list(string) parameters without options. |
488+
| `textarea` | `string` | No | Multi-line text input field for longer content. | |
487489
488490
### Form Type Examples
489491
490-
<details><summary>checkbox: A single checkbox for boolean values</summary>
492+
<details><summary>`checkbox`: A single checkbox for boolean values</summary>
491493
492494
```tf
493495
data "coder_parameter" "enable_gpu" {
@@ -501,7 +503,7 @@ data "coder_parameter" "enable_gpu" {
501503
502504
</details>
503505
504-
<details><summary>dropdown: A searchable select menu for choosing a single option from a list</summary>
506+
<details><summary>`dropdown`: A searchable select menu for choosing a single option from a list</summary>
505507
506508
```tf
507509
data "coder_parameter" "region" {
@@ -524,7 +526,7 @@ data "coder_parameter" "region" {
524526
525527
</details>
526528
527-
<details><summary>input: A standard text input field</summary>
529+
<details><summary>`input`: A standard text input field</summary>
528530
529531
```tf
530532
data "coder_parameter" "custom_domain" {
@@ -538,7 +540,7 @@ data "coder_parameter" "custom_domain" {
538540
539541
</details>
540542
541-
<details><summary>key-value: Input for entering key-value pairs</summary>
543+
<details><summary>`key-value`: Input for entering key-value pairs</summary>
542544
543545
```tf
544546
data "coder_parameter" "environment_vars" {
@@ -552,7 +554,7 @@ data "coder_parameter" "environment_vars" {
552554
553555
</details>
554556
555-
<details><summary>multi-select: Checkboxes for selecting multiple options from a list</summary>
557+
<details><summary>`multi-select`: Checkboxes for selecting multiple options from a list</summary>
556558
557559
```tf
558560
data "coder_parameter" "tools" {
@@ -579,7 +581,7 @@ data "coder_parameter" "tools" {
579581
580582
</details>
581583
582-
<details><summary>password: A text input that masks sensitive information</summary>
584+
<details><summary>`password`: A text input that masks sensitive information</summary>
583585
584586
```tf
585587
data "coder_parameter" "api_key" {
@@ -593,7 +595,7 @@ data "coder_parameter" "api_key" {
593595
594596
</details>
595597
596-
<details><summary>radio: Radio buttons for selecting a single option with high visibility</summary>
598+
<details><summary>`radio`: Radio buttons for selecting a single option with high visibility</summary>
597599
598600
```tf
599601
data "coder_parameter" "environment" {
@@ -616,7 +618,7 @@ data "coder_parameter" "environment" {
616618
617619
</details>
618620
619-
<details><summary>slider: A slider for selecting numeric values within a range</summary>
621+
<details><summary>`slider`: A slider for selecting numeric values within a range</summary>
620622
621623
```tf
622624
data "coder_parameter" "cpu_cores" {
@@ -634,7 +636,7 @@ data "coder_parameter" "cpu_cores" {
634636
635637
</details>
636638
637-
<details><summary>switch: A toggle switch for boolean values</summary>
639+
<details><summary>`switch`: A toggle switch for boolean values</summary>
638640
639641
```tf
640642
data "coder_parameter" "advanced_mode" {
@@ -648,7 +650,7 @@ data "coder_parameter" "advanced_mode" {
648650
649651
</details>
650652
651-
<details><summary>textarea: A multi-line text input field for longer content</summary>
653+
<details><summary>`textarea`: A multi-line text input field for longer content</summary>
652654
653655
```tf
654656
data "coder_parameter" "init_script" {
@@ -934,4 +936,3 @@ data "coder_parameter" "cpu_count" {
934936
```
935937
936938
</details>
937-

0 commit comments

Comments
 (0)
0