page_title | subcategory | description |
---|---|---|
coder_agent Resource - terraform-provider-coder |
Use this resource to associate an agent. |
Use this resource to associate an agent.
data "coder_workspace" "me" {
}
resource "coder_agent" "dev" {
os = "linux"
arch = "amd64"
dir = "/workspace"
}
resource "kubernetes_pod" "dev" {
count = data.coder_workspace.me.start_count
spec {
container {
command = ["sh", "-c", coder_agent.dev.init_script]
env {
name = "CODER_AGENT_TOKEN"
value = coder_agent.dev.token
}
}
}
}
arch
(String) The architecture the agent will run on. Must be one of: "amd64", "armv7", "arm64".os
(String) The operating system the agent will run on. Must be one of: "linux", "darwin", or "windows".
auth
(String) The authentication type the agent will use. Must be one of: "token", "google-instance-identity", "aws-instance-identity", "azure-instance-identity".connection_timeout
(Number) Time in seconds until the agent is marked as timed out when a connection with the server cannot be established.dir
(String) The starting directory when a user creates a shell session. Defaults to $HOME.env
(Map of String) A mapping of environment variables to set inside the workspace.motd_file
(String) The path to a file within the workspace containing a message to display to users when they login via SSH. A typical value would be /etc/motd.startup_script
(String) A script to run after the agent starts.troubleshooting_url
(String) A URL to a document with instructions for troubleshooting problems with the agent.
id
(String) The ID of this resource.init_script
(String) Run this script on startup of an instance to initialize the agent.token
(String, Sensitive) Set the environment variable "CODER_AGENT_TOKEN" with this token to authenticate an agent.