@@ -164,12 +164,7 @@ resource "coder_agent" "dev" {
164
164
startup_script = <<- EOT
165
165
set -e
166
166
167
- # Install the latest code-server.
168
- # Append "--version x.x.x" to install a specific version of code-server.
169
- curl -fsSL https://code-server.dev/install.sh | sh -s -- --method=standalone --prefix=/tmp/code-server
170
-
171
- # Start code-server in the background.
172
- /tmp/code-server/bin/code-server --auth none --port 13337 >/tmp/code-server.log 2>&1 &
167
+ # Add any commands that should be executed at workspace startup (e.g install requirements, start a program, etc) here
173
168
EOT
174
169
175
170
metadata {
@@ -195,21 +190,36 @@ resource "coder_agent" "dev" {
195
190
}
196
191
}
197
192
198
- resource "coder_app" "code-server" {
199
- count = data. coder_workspace . me . start_count
200
- agent_id = coder_agent. dev [0 ]. id
201
- slug = " code-server"
202
- display_name = " code-server"
203
- url = " http://localhost:13337/?folder=/home/coder"
204
- icon = " /icon/code.svg"
205
- subdomain = false
206
- share = " owner"
193
+ # See https://registry.coder.com/modules/code-server
194
+ module "code-server" {
195
+ count = data. coder_workspace . me . start_count
196
+ source = " registry.coder.com/modules/code-server/coder"
207
197
208
- healthcheck {
209
- url = " http://localhost:13337/healthz"
210
- interval = 3
211
- threshold = 10
212
- }
198
+ # This ensures that the latest version of the module gets downloaded, you can also pin the module version to prevent breaking changes in production.
199
+ version = " >= 1.0.0"
200
+
201
+ agent_id = coder_agent. dev [0 ]. id
202
+ order = 1
203
+ }
204
+
205
+ # See https://registry.coder.com/modules/jetbrains-gateway
206
+ module "jetbrains_gateway" {
207
+ count = data. coder_workspace . me . start_count
208
+ source = " registry.coder.com/modules/jetbrains-gateway/coder"
209
+
210
+ # JetBrains IDEs to make available for the user to select
211
+ jetbrains_ides = [" IU" , " PY" , " WS" , " PS" , " RD" , " CL" , " GO" , " RM" ]
212
+ default = " IU"
213
+
214
+ # Default folder to open when starting a JetBrains IDE
215
+ folder = " /home/coder"
216
+
217
+ # This ensures that the latest version of the module gets downloaded, you can also pin the module version to prevent breaking changes in production.
218
+ version = " >= 1.0.0"
219
+
220
+ agent_id = coder_agent. dev [0 ]. id
221
+ agent_name = " dev"
222
+ order = 2
213
223
}
214
224
215
225
locals {
0 commit comments