added workspace for env vars

This commit is contained in:
Stephen Kirby
2023-09-29 15:47:43 +00:00
parent c0f035e5e0
commit ee5a01a664

View File

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