@ -16,7 +16,7 @@ variable "agent_id" {
variable " port " {
variable " port " {
type = number
type = number
description = " The port to run VS Code W b e on."
description = " The port to run VS Code W eb on."
default = 13338
default = 13338
}
}
@ -32,20 +32,10 @@ variable "log_path" {
default = " /tmp/vscode-server.log "
default = " /tmp/vscode-server.log "
}
}
variable " telemetry " {
type = string
description = " Telemetry options for vscode-server. "
default = " off "
validation {
condition = var . telemetry == " off " | | var . telemetry == " crash " | | var . telemetry == " error " | | var . telemetry == " all "
error_message = " Variable telemetry must be set to 'off', 'crash', 'error' or 'all'. "
}
}
variable " install_dir " {
variable " install_dir " {
type = string
type = string
description = " The directory to install VS Code Server "
description = " The directory to install VS Code CLI "
default = " /tmp/vscode- server "
default = " /tmp/vscode-cli "
}
}
variable " accept_license " {
variable " accept_license " {
@ -60,13 +50,12 @@ variable "accept_license" {
resource " coder_script " " vscode-server " {
resource " coder_script " " vscode-server " {
agent_id = var . agent_id
agent_id = var . agent_id
display_name = " vscode-server "
display_name = " VS Code Web "
icon = " /icon/code.svg "
icon = " /icon/code.svg "
script = templatefile ( " ${ path . module } /run.sh " , {
script = templatefile ( " ${ path . module } /run.sh " , {
PORT : var . port ,
PORT : var . port ,
LOG_PATH : var . log_path ,
LOG_PATH : var . log_path ,
INSTALL_DIR : var . install_dir ,
INSTALL_DIR : var . install_dir ,
TELEMETRY : var . telemetry ,
} )
} )
run_on_start = true
run_on_start = true
}
}
@ -74,7 +63,7 @@ resource "coder_script" "vscode-server" {
resource " coder_app " " vscode-server " {
resource " coder_app " " vscode-server " {
agent_id = var . agent_id
agent_id = var . agent_id
slug = " vscode-server "
slug = " vscode-server "
display_name = " VS Code Server "
display_name = " VS Code Web "
url = var . folder == " " ? " http://localhost: ${ var . port } " : " http://localhost: ${ var . port } ?folder= ${ var . folder } "
url = var . folder == " " ? " http://localhost: ${ var . port } " : " http://localhost: ${ var . port } ?folder= ${ var . folder } "
icon = " /icon/code.svg "
icon = " /icon/code.svg "
subdomain = true
subdomain = true