added workspace for env vars

pull/68/head
Stephen Kirby 2 years ago
parent c0f035e5e0
commit ee5a01a664

@ -14,21 +14,13 @@ variable "agent_id" {
description = "The ID of a Coder agent." description = "The ID of a Coder agent."
} }
variable "coder_user_token" { data "coder_workspace" "me" {}
type = string
description = "Coder user token for authentication. Replace with second agent?"
}
variable "coder_deployment_url" {
type = string
description = "Coder Deployment URL,"
}
resource "coder_script" "coder-login" { resource "coder_script" "coder-login" {
agent_id = var.agent_id agent_id = var.agent_id
script = templatefile("${path.module}/run.sh", { script = templatefile("${path.module}/run.sh", {
CODER_USER_TOKEN : var.coder_user_token, CODER_USER_TOKEN : data.coder_workspace.me.owner_session_token,
CODER_DEPLOYMENT_URL : var.coder_deployment_url CODER_DEPLOYMENT_URL : data.coder_workspace.me.access_url
}) })
display_name = "Personalize" display_name = "Personalize"
icon = "/emojis/1f511.png" icon = "/emojis/1f511.png"

Loading…
Cancel
Save