Skip to content

Latest commit

 

History

History
51 lines (37 loc) · 1.34 KB

File metadata and controls

51 lines (37 loc) · 1.34 KB
page_title subcategory description
coder_env Resource - terraform-provider-coder
Use this resource to set an environment variable in a workspace. Note that this resource cannot be used to overwrite existing environment variables set on the "coder_agent" resource.

coder_env (Resource)

Use this resource to set an environment variable in a workspace. Note that this resource cannot be used to overwrite existing environment variables set on the "coder_agent" resource.

Example Usage

data "coder_workspace" "me" {}

resource "coder_agent" "dev" {
  os   = "linux"
  arch = "amd64"
  dir  = "/workspace"
}

resource "coder_env" "welcome_message" {
  agent_id = coder_agent.dev.id
  name     = "WELCOME_MESSAGE"
  value    = "Welcome to your Coder workspace!"
}

resource "coder_env" "internal_api_url" {
  agent_id = coder_agent.dev.id
  name     = "INTERNAL_API_URL"
  value    = "https://api.internal.company.com/v1"
}

Schema

Required

  • agent_id (String) The "id" property of a "coder_agent" resource to associate with.
  • name (String) The name of the environment variable.

Optional

  • value (String) The value of the environment variable.

Read-Only

  • id (String) The ID of this resource.