@@ -34,8 +34,7 @@ variable "use_kubeconfig" {
34
34
EOF
35
35
}
36
36
37
- provider "coder" {
38
- }
37
+ provider "coder" {}
39
38
40
39
variable "namespace" {
41
40
type = string
@@ -95,30 +94,40 @@ resource "coder_agent" "main" {
95
94
cp /etc/skel/.bashrc $HOME
96
95
fi
97
96
98
- # Install the latest code-server.
99
- # Append "--version x.x.x" to install a specific version of code-server.
100
- curl -fsSL https://code-server.dev/install.sh | sh -s -- --method=standalone --prefix=/tmp/code-server
101
-
102
- # Start code-server in the background.
103
- /tmp/code-server/bin/code-server --auth none --port 13337 >/tmp/code-server.log 2>&1 &
97
+ # Add any commands that should be executed at workspace startup (e.g install requirements, start a program, etc) here
104
98
EOT
105
99
}
106
100
107
- # code-server
108
- resource "coder_app" "code-server" {
109
- agent_id = coder_agent. main . id
110
- slug = " code-server"
111
- display_name = " code-server"
112
- icon = " /icon/code.svg"
113
- url = " http://localhost:13337?folder=/home/coder"
114
- subdomain = false
115
- share = " owner"
116
-
117
- healthcheck {
118
- url = " http://localhost:13337/healthz"
119
- interval = 3
120
- threshold = 10
121
- }
101
+ # See https://registry.coder.com/modules/code-server
102
+ module "code-server" {
103
+ count = data. coder_workspace . me . start_count
104
+ source = " registry.coder.com/modules/code-server/coder"
105
+
106
+ # This ensures that the latest version of the module gets downloaded, you can also pin the module version to prevent breaking changes in production.
107
+ version = " >= 1.0.0"
108
+
109
+ agent_id = coder_agent. main . id
110
+ order = 1
111
+ }
112
+
113
+ # See https://registry.coder.com/modules/jetbrains-gateway
114
+ module "jetbrains_gateway" {
115
+ count = data. coder_workspace . me . start_count
116
+ source = " registry.coder.com/modules/jetbrains-gateway/coder"
117
+
118
+ # JetBrains IDEs to make available for the user to select
119
+ jetbrains_ides = [" IU" , " PY" , " WS" , " PS" , " RD" , " CL" , " GO" , " RM" ]
120
+ default = " IU"
121
+
122
+ # Default folder to open when starting a JetBrains IDE
123
+ folder = " /home/coder"
124
+
125
+ # This ensures that the latest version of the module gets downloaded, you can also pin the module version to prevent breaking changes in production.
126
+ version = " >= 1.0.0"
127
+
128
+ agent_id = coder_agent. main . id
129
+ agent_name = " main"
130
+ order = 2
122
131
}
123
132
124
133
resource "kubernetes_persistent_volume_claim" "home" {
0 commit comments