@@ -146,9 +146,29 @@ variable "jetbrains_ides" {
146146 }
147147}
148148
149+ variable "releases_base_link" {
150+ type = string
151+ description = " "
152+ default = " https://data.services.jetbrains.com"
153+ validation {
154+ condition = can (regex (" ^https?://.+$" , var. releases_base_link ))
155+ error_message = " The releases_base_link must be a valid HTTP/S address."
156+ }
157+ }
158+
159+ variable "download_base_link" {
160+ type = string
161+ description = " "
162+ default = " https://download.jetbrains.com"
163+ validation {
164+ condition = can (regex (" ^https?://.+$" , var. download_base_link ))
165+ error_message = " The download_base_link must be a valid HTTP/S address."
166+ }
167+ }
168+
149169data "http" "jetbrains_ide_versions" {
150170 for_each = var. latest ? toset (var. jetbrains_ides ) : toset ([])
151- url = " https://data.services.jetbrains.com /products/releases?code=${ each . key } &latest=true&type=${ var . channel } "
171+ url = " ${ var . releases_base_link } /products/releases?code=${ each . key } &latest=true&type=${ var . channel } "
152172}
153173
154174locals {
@@ -158,63 +178,63 @@ locals {
158178 name = " GoLand" ,
159179 identifier = " GO" ,
160180 build_number = var.jetbrains_ide_versions[" GO" ].build_number,
161- download_link = " https://download.jetbrains.com /go/goland-${ var . jetbrains_ide_versions [" GO" ]. version } .tar.gz"
181+ download_link = " ${ var . download_base_link } /go/goland-${ var . jetbrains_ide_versions [" GO" ]. version } .tar.gz"
162182 version = var.jetbrains_ide_versions[" GO" ].version
163183 },
164184 " WS" = {
165185 icon = " /icon/webstorm.svg" ,
166186 name = " WebStorm" ,
167187 identifier = " WS" ,
168188 build_number = var.jetbrains_ide_versions[" WS" ].build_number,
169- download_link = " https://download.jetbrains.com /webstorm/WebStorm-${ var . jetbrains_ide_versions [" WS" ]. version } .tar.gz"
189+ download_link = " ${ var . download_base_link } /webstorm/WebStorm-${ var . jetbrains_ide_versions [" WS" ]. version } .tar.gz"
170190 version = var.jetbrains_ide_versions[" WS" ].version
171191 },
172192 " IU" = {
173193 icon = " /icon/intellij.svg" ,
174194 name = " IntelliJ IDEA Ultimate" ,
175195 identifier = " IU" ,
176196 build_number = var.jetbrains_ide_versions[" IU" ].build_number,
177- download_link = " https://download.jetbrains.com /idea/ideaIU-${ var . jetbrains_ide_versions [" IU" ]. version } .tar.gz"
197+ download_link = " ${ var . download_base_link } /idea/ideaIU-${ var . jetbrains_ide_versions [" IU" ]. version } .tar.gz"
178198 version = var.jetbrains_ide_versions[" IU" ].version
179199 },
180200 " PY" = {
181201 icon = " /icon/pycharm.svg" ,
182202 name = " PyCharm Professional" ,
183203 identifier = " PY" ,
184204 build_number = var.jetbrains_ide_versions[" PY" ].build_number,
185- download_link = " https://download.jetbrains.com /python/pycharm-professional-${ var . jetbrains_ide_versions [" PY" ]. version } .tar.gz"
205+ download_link = " ${ var . download_base_link } /python/pycharm-professional-${ var . jetbrains_ide_versions [" PY" ]. version } .tar.gz"
186206 version = var.jetbrains_ide_versions[" PY" ].version
187207 },
188208 " CL" = {
189209 icon = " /icon/clion.svg" ,
190210 name = " CLion" ,
191211 identifier = " CL" ,
192212 build_number = var.jetbrains_ide_versions[" CL" ].build_number,
193- download_link = " https://download.jetbrains.com /cpp/CLion-${ var . jetbrains_ide_versions [" CL" ]. version } .tar.gz"
213+ download_link = " ${ var . download_base_link } /cpp/CLion-${ var . jetbrains_ide_versions [" CL" ]. version } .tar.gz"
194214 version = var.jetbrains_ide_versions[" CL" ].version
195215 },
196216 " PS" = {
197217 icon = " /icon/phpstorm.svg" ,
198218 name = " PhpStorm" ,
199219 identifier = " PS" ,
200220 build_number = var.jetbrains_ide_versions[" PS" ].build_number,
201- download_link = " https://download.jetbrains.com /webide/PhpStorm-${ var . jetbrains_ide_versions [" PS" ]. version } .tar.gz"
221+ download_link = " ${ var . download_base_link } /webide/PhpStorm-${ var . jetbrains_ide_versions [" PS" ]. version } .tar.gz"
202222 version = var.jetbrains_ide_versions[" PS" ].version
203223 },
204224 " RM" = {
205225 icon = " /icon/rubymine.svg" ,
206226 name = " RubyMine" ,
207227 identifier = " RM" ,
208228 build_number = var.jetbrains_ide_versions[" RM" ].build_number,
209- download_link = " https://download.jetbrains.com /ruby/RubyMine-${ var . jetbrains_ide_versions [" RM" ]. version } .tar.gz"
229+ download_link = " ${ var . download_base_link } /ruby/RubyMine-${ var . jetbrains_ide_versions [" RM" ]. version } .tar.gz"
210230 version = var.jetbrains_ide_versions[" RM" ].version
211231 }
212232 " RD" = {
213233 icon = " /icon/rider.svg" ,
214234 name = " Rider" ,
215235 identifier = " RD" ,
216236 build_number = var.jetbrains_ide_versions[" RD" ].build_number,
217- download_link = " https://download.jetbrains.com /rider/JetBrains.Rider-${ var . jetbrains_ide_versions [" RD" ]. version } .tar.gz"
237+ download_link = " ${ var . download_base_link } /rider/JetBrains.Rider-${ var . jetbrains_ide_versions [" RD" ]. version } .tar.gz"
218238 version = var.jetbrains_ide_versions[" RD" ].version
219239 }
220240 }
0 commit comments