Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

Commit aef9b3b

Browse files
authored
Add build numbers and versions to jetbrains gateway module (#150)
1 parent a5c4d00 commit aef9b3b

File tree

1 file changed

+61
-10
lines changed

1 file changed

+61
-10
lines changed

jetbrains-gateway/main.tf

Lines changed: 61 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,68 @@ variable "default" {
3030
description = "Default IDE"
3131
}
3232

33+
locals {
34+
supported_ides = ["IU", "PS", "WS", "PY", "CL", "GO", "RM"]
35+
}
36+
37+
variable "jetbrains_ide_versions" {
38+
type = map(object({
39+
build_number = string
40+
version = string
41+
}))
42+
description = "The set of versions for each jetbrains IDE"
43+
default = {
44+
"IU" = {
45+
build_number = "232.10203.10"
46+
version = "2023.2.4"
47+
}
48+
"PS" = {
49+
build_number = "232.10072.32"
50+
version = "2023.2.3"
51+
}
52+
"WS" = {
53+
build_number = "232.10203.14"
54+
version = "2023.2.4"
55+
}
56+
"PY" = {
57+
build_number = "232.10203.26"
58+
version = "2023.2.4"
59+
}
60+
"CL" = {
61+
build_number = "232.9921.42"
62+
version = "2023.2.2"
63+
}
64+
"GO" = {
65+
build_number = "232.10203.20"
66+
version = "2023.2.4"
67+
}
68+
"RM" = {
69+
build_number = "232.10203.15"
70+
version = "2023.2.4"
71+
}
72+
73+
}
74+
validation {
75+
condition = (
76+
alltrue([
77+
for code in var.jetbrains_ide_versions : contains(local.supported_ides, code)
78+
])
79+
)
80+
error_message = "The jetbrains_ide_versions must contain a map of valid product codes. Valid product codes are ${join(",", local.supported_ides)}."
81+
}
82+
}
83+
3384
variable "jetbrains_ides" {
3485
type = list(string)
3586
description = "The list of IDE product codes."
36-
default = ["IU", "PS", "WS", "PY", "CL", "GO", "RM"]
87+
default = local.supported_ides
3788
validation {
3889
condition = (
3990
alltrue([
40-
for code in var.jetbrains_ides : contains(["IU", "PS", "WS", "PY", "CL", "GO", "RM"], code)
91+
for code in var.jetbrains_ides : contains(local.supported_ides, code)
4192
])
4293
)
43-
error_message = "The jetbrains_ides must be a list of valid product codes. Valid product codes are IU, PS, WS, PY, CL, GO, RM."
94+
error_message = "The jetbrains_ides must be a list of valid product codes. Valid product codes are ${join(",", local.supported_ides)}."
4495
}
4596
# check if the list is empty
4697
validation {
@@ -59,37 +110,37 @@ locals {
59110
"GO" = {
60111
icon = "/icon/goland.svg",
61112
name = "GoLand",
62-
value = jsonencode(["GO", "232.10203.20", "https://download.jetbrains.com/go/goland-2023.2.4.tar.gz"])
113+
value = jsonencode(["GO", var.jetbrains_ide_versions["GO"].build_number, "https://download.jetbrains.com/go/goland-${var.jetbrains_ide_versions["GO"].version}.tar.gz"])
63114
},
64115
"WS" = {
65116
icon = "/icon/webstorm.svg",
66117
name = "WebStorm",
67-
value = jsonencode(["WS", "232.10203.14", "https://download.jetbrains.com/webstorm/WebStorm-2023.2.4.tar.gz"])
118+
value = jsonencode(["WS", var.jetbrains_ide_versions["WS"].build_number, "https://download.jetbrains.com/webstorm/WebStorm-${var.jetbrains_ide_versions["WS"].version}.tar.gz"])
68119
},
69120
"IU" = {
70121
icon = "/icon/intellij.svg",
71122
name = "IntelliJ IDEA Ultimate",
72-
value = jsonencode(["IU", "232.10203.10", "https://download.jetbrains.com/idea/ideaIU-2023.2.4.tar.gz"])
123+
value = jsonencode(["IU", var.jetbrains_ide_versions["IU"].build_number, "https://download.jetbrains.com/idea/ideaIU-${var.jetbrains_ide_versions["IU"].version}.tar.gz"])
73124
},
74125
"PY" = {
75126
icon = "/icon/pycharm.svg",
76127
name = "PyCharm Professional",
77-
value = jsonencode(["PY", "232.10203.26", "https://download.jetbrains.com/python/pycharm-professional-2023.2.4.tar.gz"])
128+
value = jsonencode(["PY", var.jetbrains_ide_versions["PY"].build_number, "https://download.jetbrains.com/python/pycharm-professional-${var.jetbrains_ide_versions["PY"].version}.tar.gz"])
78129
},
79130
"CL" = {
80131
icon = "/icon/clion.svg",
81132
name = "CLion",
82-
value = jsonencode(["CL", "232.9921.42", "https://download.jetbrains.com/cpp/CLion-2023.2.2.tar.gz"])
133+
value = jsonencode(["CL", var.jetbrains_ide_versions["CL"].build_number, "https://download.jetbrains.com/cpp/CLion-${var.jetbrains_ide_versions["CL"].version}.tar.gz"])
83134
},
84135
"PS" = {
85136
icon = "/icon/phpstorm.svg",
86137
name = "PhpStorm",
87-
value = jsonencode(["PS", "232.10072.32", "https://download.jetbrains.com/webide/PhpStorm-2023.2.3.tar.gz"])
138+
value = jsonencode(["PS", var.jetbrains_ide_versions["PS"].build_number, "https://download.jetbrains.com/webide/PhpStorm-${var.jetbrains_ide_versions["PS"].version}.tar.gz"])
88139
},
89140
"RM" = {
90141
icon = "/icon/rubymine.svg",
91142
name = "RubyMine",
92-
value = jsonencode(["RM", "232.10203.15", "https://download.jetbrains.com/ruby/RubyMine-2023.2.4.tar.gz"])
143+
value = jsonencode(["RM", var.jetbrains_ide_versions["RM"].build_number, "https://download.jetbrains.com/ruby/RubyMine-${var.jetbrains_ide_versions["RM"].version}.tar.gz"])
93144
}
94145
}
95146
}

0 commit comments

Comments
 (0)