-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
parametersbugs & feature requests related to Dynamic Parametersbugs & feature requests related to Dynamic Parameters
Description
Problem
When a coder_parameter has option {} blocks defined, the parameter value is strictly validated against the option set. This creates friction when:
- Migrating existing workspaces: If a template author removes or changes an option value, existing workspaces with the old value are forced to select a new value before they can update.
- Deprecating options: There's no graceful way to deprecate an option while still allowing existing workspaces to function.
- Power users: Some users may need values outside the predefined options while others benefit from the dropdown UI.
Proposal
Add an allow_custom (or similar) attribute to coder_parameter that:
- Keeps the dropdown UI with predefined options for discoverability
- Allows workspaces to retain/use values that aren't in the option set
- Optionally shows a text input alongside the dropdown for custom values
Example
data "coder_parameter" "instance_type" {
name = "Instance Type"
type = "string"
allow_custom = true # New attribute
default = "t3.medium"
option {
name = "Small"
value = "t3.small"
}
option {
name = "Medium"
value = "t3.medium"
}
option {
name = "Large"
value = "t3.large"
}
}Current Workarounds
- Temporarily add legacy values as options before pushing template updates
- Use
validation {}with regex instead ofoption {}(loses dropdown UI) - Use dynamic parameters to include legacy/custom values programmatically
Additional Context
This would make template evolution smoother and reduce the friction of updating workspaces when option sets change.
njzydark
Metadata
Metadata
Assignees
Labels
parametersbugs & feature requests related to Dynamic Parametersbugs & feature requests related to Dynamic Parameters