You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
modules/jupyterlab/main.tf

55 lines
1.1 KiB
HCL

terraform {
required_version = ">= 1.0"
required_providers {
coder = {
source = "coder/coder"
version = ">= 0.12"
}
}
}
locals {
icon_url = "/icon/jupyter.svg"
}
# Add required variables for your modules and remove any unneeded variables
variable "agent_id" {
type = string
description = "The ID of a Coder agent."
}
variable "log_path" {
type = string
description = "The path to log jupyterlab to."
default = "/tmp/jupyterlab.log"
}
variable "port" {
type = number
description = "The port to run jupyterlab on."
default = 19999
}
resource "coder_script" "jupyterlab" {
agent_id = var.agent_id
display_name = "jupyterlab"
icon = local.icon_url
script = templatefile("${path.module}/run.sh", {
LOG_PATH : var.log_path,
PORT : var.port
})
run_on_start = true
run_on_stopt = false
}
resource "coder_app" "jupyterlab" {
agent_id = var.agent_id
slug = "jupyterlab"
display_name = "JupyterLab"
url = "http://localhost:${var.port}"
icon = local.icon_url
subdomain = true
share = "owner"
}