From d38bbdd389e8cf22d5665272b39c1a5ef12a3253 Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Fri, 2 Jun 2023 12:42:57 +0200 Subject: [PATCH 1/2] docs: unsupported legacy parameters --- docs/templates/parameters.md | 36 ++++++++++-------------------------- 1 file changed, 10 insertions(+), 26 deletions(-) diff --git a/docs/templates/parameters.md b/docs/templates/parameters.md index dfcf25ca0a71f..fb430c80399d1 100644 --- a/docs/templates/parameters.md +++ b/docs/templates/parameters.md @@ -188,37 +188,21 @@ data "coder_parameter" "project_id" { ## Legacy -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 May 2023. +### Legacy parameters are unsupported now -```hcl -variable "use_kubeconfig" { - sensitive = true # Template-level parameter (not editable when creating a workspace) - type = bool - description = <<-EOF - Use host kubeconfig? (true/false) - EOF -} +In Coder, workspaces using legacy parameters can't be deployed anymore. To address this, it is necessary to either remove or adjust incompatible templates. +In some cases, deleting a workspace with a hard dependency on a legacy parameter may be challenging. To cleanup unsupported workspaces, administrators are advised to take the following actions for affected templates: -variable "cpu" { - sensitive = false # User (workspace-level) parameter - description = "CPU (__ cores)" - default = 2 - validation { - condition = contains([ - "2", - "4", - "6", - "8" - ], var.cpu) - error_message = "Invalid cpu!" - } -} -``` - -> ⚠️ Legacy (`variable`) parameters and rich parameters can't be used in the same template. +1. Enable the `feature_use_managed_variables` provider flag. +2. Ensure that every legacy variable block has defined missing default values, or convert it to `coder_parameter`. +3. Push the new template version using UI or CLI. +4. Update unsupported workspaces to the newest template version. +5. Delete the affected workspaces that have been updated to the newest template version. ### Migration +> ⚠️ Migration is available until v0.24.0 (Jun 2023) release. + Terraform variables shouldn't be used for workspace scoped parameters anymore, and it's recommended to convert variables to `coder_parameter` resources. To make the migration smoother, there is a special property introduced - `legacy_variable` and `legacy_variable_name` , which can link `coder_parameter` with a legacy variable. From a64c63e78d80918b7ed568a3190c3b4aee14f70a Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Fri, 2 Jun 2023 18:00:38 +0200 Subject: [PATCH 2/2] Update docs/templates/parameters.md Co-authored-by: Muhammad Atif Ali --- docs/templates/parameters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/templates/parameters.md b/docs/templates/parameters.md index fb430c80399d1..5dbf6a72614b3 100644 --- a/docs/templates/parameters.md +++ b/docs/templates/parameters.md @@ -203,7 +203,7 @@ In some cases, deleting a workspace with a hard dependency on a legacy parameter > ⚠️ Migration is available until v0.24.0 (Jun 2023) release. -Terraform variables shouldn't be used for workspace scoped parameters anymore, and it's recommended to convert variables to `coder_parameter` resources. To make the migration smoother, there is a special property introduced - +Terraform `variable` shouldn't be used for workspace scoped parameters anymore, and it's required to convert `variable` to `coder_parameter` resources. To make the migration smoother, there is a special property introduced - `legacy_variable` and `legacy_variable_name` , which can link `coder_parameter` with a legacy variable. ```hcl