@@ -15,7 +15,7 @@ terraform {
15
15
provider "coder" {}
16
16
17
17
provider "google" {
18
- zone = data . coder_parameter . zone . value
18
+ zone = module . gcp_region . value
19
19
project = var. project_id
20
20
}
21
21
@@ -41,40 +41,10 @@ variable "cache_repo_docker_config_path" {
41
41
type = string
42
42
}
43
43
44
- data "coder_parameter" "zone" {
45
- name = " zone"
46
- display_name = " Zone"
47
- description = " Which zone should your workspace live in?"
48
- type = " string"
49
- icon = " /emojis/1f30e.png"
50
- default = " us-central1-a"
51
- mutable = false
52
- order = 1
53
- option {
54
- name = " North America (Northeast)"
55
- value = " northamerica-northeast1-a"
56
- icon = " /emojis/1f1fa-1f1f8.png"
57
- }
58
- option {
59
- name = " North America (Central)"
60
- value = " us-central1-a"
61
- icon = " /emojis/1f1fa-1f1f8.png"
62
- }
63
- option {
64
- name = " North America (West)"
65
- value = " us-west2-c"
66
- icon = " /emojis/1f1fa-1f1f8.png"
67
- }
68
- option {
69
- name = " Europe (West)"
70
- value = " europe-west4-b"
71
- icon = " /emojis/1f1ea-1f1fa.png"
72
- }
73
- option {
74
- name = " South America (East)"
75
- value = " southamerica-east1-a"
76
- icon = " /emojis/1f1e7-1f1f7.png"
77
- }
44
+ module "gcp_region" {
45
+ source = " registry.coder.com/modules/gcp-region/coder"
46
+ version = " 1.0.12"
47
+ regions = [" us" , " europe" ]
78
48
}
79
49
80
50
data "coder_parameter" "instance_type" {
@@ -311,12 +281,36 @@ resource "coder_agent" "dev" {
311
281
}
312
282
}
313
283
314
- # Install code-server via Terraform module.
284
+ # See https://registry.coder.com/modules/ code-server
315
285
module "code-server" {
316
- count = data. coder_workspace . me . start_count
317
- source = " registry.coder.com/modules/code-server/coder"
318
- version = " 1.0.18"
319
- agent_id = coder_agent. dev [0 ]. id
286
+ count = data. coder_workspace . me . start_count
287
+ source = " registry.coder.com/modules/code-server/coder"
288
+
289
+ # This ensures that the latest version of the module gets downloaded, you can also pin the module version to prevent breaking changes in production.
290
+ version = " >= 1.0.0"
291
+
292
+ agent_id = coder_agent. main . id
293
+ order = 1
294
+ }
295
+
296
+ # See https://registry.coder.com/modules/jetbrains-gateway
297
+ module "jetbrains_gateway" {
298
+ count = data. coder_workspace . me . start_count
299
+ source = " registry.coder.com/modules/jetbrains-gateway/coder"
300
+
301
+ # JetBrains IDEs to make available for the user to select
302
+ jetbrains_ides = [" IU" , " PY" , " WS" , " PS" , " RD" , " CL" , " GO" , " RM" ]
303
+ default = " IU"
304
+
305
+ # Default folder to open when starting a JetBrains IDE
306
+ folder = " /home/coder"
307
+
308
+ # This ensures that the latest version of the module gets downloaded, you can also pin the module version to prevent breaking changes in production.
309
+ version = " >= 1.0.0"
310
+
311
+ agent_id = coder_agent. main . id
312
+ agent_name = " main"
313
+ order = 2
320
314
}
321
315
322
316
# Create metadata for the workspace and home disk.
@@ -331,7 +325,7 @@ resource "coder_metadata" "workspace_info" {
331
325
332
326
item {
333
327
key = " zone"
334
- value = data . coder_parameter . zone . value
328
+ value = module . gcp_region . value
335
329
}
336
330
}
337
331
0 commit comments