fix(jetbrains): update Terraform version requirement to 1.9+ (#513)
## 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 <noreply@anthropic.com>
Co-authored-by: DevCats <christofer@coder.com>
This commit is contained in:
parent
d3b40c08f1
commit
d64851774b
@ -14,7 +14,7 @@ This module adds JetBrains IDE buttons to launch IDEs directly from the dashboar
|
|||||||
module "jetbrains" {
|
module "jetbrains" {
|
||||||
count = data.coder_workspace.me.start_count
|
count = data.coder_workspace.me.start_count
|
||||||
source = "registry.coder.com/coder/jetbrains/coder"
|
source = "registry.coder.com/coder/jetbrains/coder"
|
||||||
version = "1.1.0"
|
version = "1.1.1"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
folder = "/home/coder/project"
|
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
|
# 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" {
|
module "jetbrains" {
|
||||||
count = data.coder_workspace.me.start_count
|
count = data.coder_workspace.me.start_count
|
||||||
source = "registry.coder.com/coder/jetbrains/coder"
|
source = "registry.coder.com/coder/jetbrains/coder"
|
||||||
version = "1.1.0"
|
version = "1.1.1"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
folder = "/home/coder/project"
|
folder = "/home/coder/project"
|
||||||
default = ["PY", "IU"] # Pre-configure GoLand and IntelliJ IDEA
|
default = ["PY", "IU"] # Pre-configure GoLand and IntelliJ IDEA
|
||||||
@ -53,7 +53,7 @@ module "jetbrains" {
|
|||||||
module "jetbrains" {
|
module "jetbrains" {
|
||||||
count = data.coder_workspace.me.start_count
|
count = data.coder_workspace.me.start_count
|
||||||
source = "registry.coder.com/coder/jetbrains/coder"
|
source = "registry.coder.com/coder/jetbrains/coder"
|
||||||
version = "1.1.0"
|
version = "1.1.1"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
folder = "/home/coder/project"
|
folder = "/home/coder/project"
|
||||||
# Show parameter with limited options
|
# Show parameter with limited options
|
||||||
@ -67,7 +67,7 @@ module "jetbrains" {
|
|||||||
module "jetbrains" {
|
module "jetbrains" {
|
||||||
count = data.coder_workspace.me.start_count
|
count = data.coder_workspace.me.start_count
|
||||||
source = "registry.coder.com/coder/jetbrains/coder"
|
source = "registry.coder.com/coder/jetbrains/coder"
|
||||||
version = "1.1.0"
|
version = "1.1.1"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
folder = "/home/coder/project"
|
folder = "/home/coder/project"
|
||||||
default = ["IU", "PY"]
|
default = ["IU", "PY"]
|
||||||
@ -82,7 +82,7 @@ module "jetbrains" {
|
|||||||
module "jetbrains" {
|
module "jetbrains" {
|
||||||
count = data.coder_workspace.me.start_count
|
count = data.coder_workspace.me.start_count
|
||||||
source = "registry.coder.com/coder/jetbrains/coder"
|
source = "registry.coder.com/coder/jetbrains/coder"
|
||||||
version = "1.1.0"
|
version = "1.1.1"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
folder = "/workspace/project"
|
folder = "/workspace/project"
|
||||||
|
|
||||||
@ -108,7 +108,7 @@ module "jetbrains" {
|
|||||||
module "jetbrains_pycharm" {
|
module "jetbrains_pycharm" {
|
||||||
count = data.coder_workspace.me.start_count
|
count = data.coder_workspace.me.start_count
|
||||||
source = "registry.coder.com/coder/jetbrains/coder"
|
source = "registry.coder.com/coder/jetbrains/coder"
|
||||||
version = "1.1.0"
|
version = "1.1.1"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
folder = "/workspace/project"
|
folder = "/workspace/project"
|
||||||
|
|
||||||
@ -128,7 +128,7 @@ Add helpful tooltip text that appears when users hover over the IDE app buttons:
|
|||||||
module "jetbrains" {
|
module "jetbrains" {
|
||||||
count = data.coder_workspace.me.start_count
|
count = data.coder_workspace.me.start_count
|
||||||
source = "registry.coder.com/coder/jetbrains/coder"
|
source = "registry.coder.com/coder/jetbrains/coder"
|
||||||
version = "1.1.0"
|
version = "1.1.1"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
folder = "/home/coder/project"
|
folder = "/home/coder/project"
|
||||||
default = ["IU", "PY"]
|
default = ["IU", "PY"]
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
terraform {
|
terraform {
|
||||||
required_version = ">= 1.0"
|
required_version = ">= 1.9"
|
||||||
|
|
||||||
required_providers {
|
required_providers {
|
||||||
coder = {
|
coder = {
|
||||||
@ -163,7 +163,8 @@ variable "ide_config" {
|
|||||||
condition = length(var.ide_config) > 0
|
condition = length(var.ide_config) > 0
|
||||||
error_message = "The ide_config must not be empty."
|
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 {
|
validation {
|
||||||
condition = alltrue([
|
condition = alltrue([
|
||||||
for code in var.options : contains(keys(var.ide_config), code)
|
for code in var.options : contains(keys(var.ide_config), code)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user