From 5e02fd8056af102b4406b151e4aa0abfb33af9b1 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Tue, 22 Oct 2024 11:30:19 +0500 Subject: [PATCH] Add data sources to Jupyter Notebook module Enables dynamic retrieval of workspace owner and details, improving flexibility and accuracy in referencing coder workspace information. --- jupyter-notebook/main.tf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jupyter-notebook/main.tf b/jupyter-notebook/main.tf index e846fad..05db5a8 100644 --- a/jupyter-notebook/main.tf +++ b/jupyter-notebook/main.tf @@ -90,6 +90,10 @@ resource "coder_app" "jupyter-notebook" { threshold = 6 } } + +data "coder_workspace_owner" "me" {} +data "coder_workspace" "me" {} + locals { server_base_path = var.subdomain ? "" : format(var.agent_name != null ? "/@%s/%s.%s/apps/%s" : "/@%s/%s/apps/%s", data.coder_workspace_owner.me.name, data.coder_workspace.me.name, var.agent_name, var.slug) url = "http://localhost:${var.port}${local.server_base_path}"