From d64851774bd902f78fadd6e7bcac38d675345b70 Mon Sep 17 00:00:00 2001 From: Atif Ali Date: Mon, 27 Oct 2025 18:36:19 +0500 Subject: [PATCH] fix(jetbrains): update Terraform version requirement to 1.9+ (#513) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary - Updated `required_version` constraint from `>= 1.0` to `>= 1.9` in jetbrains module - Added inline comment explaining the cross-variable validation requirement - Bumped module version from `1.1.0` to `1.1.1` (patch version) ## Issue The jetbrains module uses cross-variable validation at line 169-171 where `var.options` is referenced within the `var.ide_config` validation block: ```tf validation { condition = alltrue([ for code in var.options : contains(keys(var.ide_config), code) ]) error_message = "The ide_config must be a superset of var.options." } ``` This pattern requires Terraform 1.9+ and fails on earlier versions with: ``` Error: Invalid reference in variable validation The condition for variable "ide_config" can only refer to the variable itself, using var.ide_config. ``` ## References - Terrafomr release blog that talks abut this feature: https://www.hashicorp.com/en/blog/terraform-1-9-enhances-input-variable-validations - Terraform PR that added this feature: https://github.com/hashicorp/terraform/pull/34955 - HashiCorp Support Article: https://support.hashicorp.com/hc/en-us/articles/43291233547027 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Co-authored-by: DevCats --- registry/coder/modules/jetbrains/README.md | 14 +++++++------- registry/coder/modules/jetbrains/main.tf | 5 +++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/registry/coder/modules/jetbrains/README.md b/registry/coder/modules/jetbrains/README.md index ef19ec20..9d08e645 100644 --- a/registry/coder/modules/jetbrains/README.md +++ b/registry/coder/modules/jetbrains/README.md @@ -14,7 +14,7 @@ This module adds JetBrains IDE buttons to launch IDEs directly from the dashboar module "jetbrains" { count = data.coder_workspace.me.start_count source = "registry.coder.com/coder/jetbrains/coder" - version = "1.1.0" + version = "1.1.1" agent_id = coder_agent.example.id folder = "/home/coder/project" # tooltip = "You need to [Install Coder Desktop](https://coder.com/docs/user-guides/desktop#install-coder-desktop) to use this button." # Optional @@ -40,7 +40,7 @@ When `default` contains IDE codes, those IDEs are created directly without user module "jetbrains" { count = data.coder_workspace.me.start_count source = "registry.coder.com/coder/jetbrains/coder" - version = "1.1.0" + version = "1.1.1" agent_id = coder_agent.example.id folder = "/home/coder/project" default = ["PY", "IU"] # Pre-configure GoLand and IntelliJ IDEA @@ -53,7 +53,7 @@ module "jetbrains" { module "jetbrains" { count = data.coder_workspace.me.start_count source = "registry.coder.com/coder/jetbrains/coder" - version = "1.1.0" + version = "1.1.1" agent_id = coder_agent.example.id folder = "/home/coder/project" # Show parameter with limited options @@ -67,7 +67,7 @@ module "jetbrains" { module "jetbrains" { count = data.coder_workspace.me.start_count source = "registry.coder.com/coder/jetbrains/coder" - version = "1.1.0" + version = "1.1.1" agent_id = coder_agent.example.id folder = "/home/coder/project" default = ["IU", "PY"] @@ -82,7 +82,7 @@ module "jetbrains" { module "jetbrains" { count = data.coder_workspace.me.start_count source = "registry.coder.com/coder/jetbrains/coder" - version = "1.1.0" + version = "1.1.1" agent_id = coder_agent.example.id folder = "/workspace/project" @@ -108,7 +108,7 @@ module "jetbrains" { module "jetbrains_pycharm" { count = data.coder_workspace.me.start_count source = "registry.coder.com/coder/jetbrains/coder" - version = "1.1.0" + version = "1.1.1" agent_id = coder_agent.example.id folder = "/workspace/project" @@ -128,7 +128,7 @@ Add helpful tooltip text that appears when users hover over the IDE app buttons: module "jetbrains" { count = data.coder_workspace.me.start_count source = "registry.coder.com/coder/jetbrains/coder" - version = "1.1.0" + version = "1.1.1" agent_id = coder_agent.example.id folder = "/home/coder/project" default = ["IU", "PY"] diff --git a/registry/coder/modules/jetbrains/main.tf b/registry/coder/modules/jetbrains/main.tf index d33fc6b2..8f0e0ac7 100644 --- a/registry/coder/modules/jetbrains/main.tf +++ b/registry/coder/modules/jetbrains/main.tf @@ -1,5 +1,5 @@ terraform { - required_version = ">= 1.0" + required_version = ">= 1.9" required_providers { coder = { @@ -163,7 +163,8 @@ variable "ide_config" { condition = length(var.ide_config) > 0 error_message = "The ide_config must not be empty." } - # ide_config must be a superset of var.. options + # ide_config must be a superset of var.options + # Requires Terraform 1.9+ for cross-variable validation references validation { condition = alltrue([ for code in var.options : contains(keys(var.ide_config), code)