|
|
@ -25,6 +25,7 @@ variable "project_directory" {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
variable "default" {
|
|
|
|
variable "default" {
|
|
|
|
|
|
|
|
default = null
|
|
|
|
type = string
|
|
|
|
type = string
|
|
|
|
description = "Default IDE"
|
|
|
|
description = "Default IDE"
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -40,6 +41,16 @@ variable "jetbrains_ides" {
|
|
|
|
)
|
|
|
|
)
|
|
|
|
error_message = "The jetbrains_ides must be a list of valid product codes. https://plugins.jetbrains.com/docs/marketplace/product-codes.html"
|
|
|
|
error_message = "The jetbrains_ides must be a list of valid product codes. https://plugins.jetbrains.com/docs/marketplace/product-codes.html"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# check if the list is empty
|
|
|
|
|
|
|
|
validation {
|
|
|
|
|
|
|
|
condition = length(var.jetbrains_ides) > 0
|
|
|
|
|
|
|
|
error_message = "The jetbrains_ides must not be empty."
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#ccheck if the list contains duplicates
|
|
|
|
|
|
|
|
validation {
|
|
|
|
|
|
|
|
condition = length(var.jetbrains_ides) == length(set(var.jetbrains_ides))
|
|
|
|
|
|
|
|
error_message = "The jetbrains_ides must not contain duplicates."
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
locals {
|
|
|
|
locals {
|
|
|
@ -108,7 +119,8 @@ data "coder_parameter" "jetbrains_ide" {
|
|
|
|
display_name = "JetBrains IDE"
|
|
|
|
display_name = "JetBrains IDE"
|
|
|
|
icon = "/icon/gateway.svg"
|
|
|
|
icon = "/icon/gateway.svg"
|
|
|
|
mutable = true
|
|
|
|
mutable = true
|
|
|
|
default = var.default != null && var.default != "" ? local.jetbrains_ides[var.default].value : null
|
|
|
|
# check if default is in the jet_brains_ides list and if it is not empty or null otherwise set it to null
|
|
|
|
|
|
|
|
default = contains(var.jetbrains_ides.keys, var.default) && var.default != null && var.default != "" ? var.default : null
|
|
|
|
|
|
|
|
|
|
|
|
dynamic "option" {
|
|
|
|
dynamic "option" {
|
|
|
|
for_each = { for key, value in local.jetbrains_ides : key => value if contains(var.jetbrains_ides, key) }
|
|
|
|
for_each = { for key, value in local.jetbrains_ides : key => value if contains(var.jetbrains_ides, key) }
|
|
|
|