| page_title | coderd Provider |
|---|---|
| description | The coderd provider can be used to manage resources on a Coder deployment. The provider exposes resources and data sources for users, groups, templates, and workspace proxies. ~> Warning This provider is only compatible with Coder version 2.10.1 https://github.com/coder/coder/releases/tag/v2.10.1 and later. |
The coderd provider can be used to manage resources on a Coder deployment. The provider exposes resources and data sources for users, groups, templates, and workspace proxies.
~> Warning This provider is only compatible with Coder version 2.10.1 and later.
terraform {
required_providers {
coderd = {
source = "coder/coderd"
}
}
}
provider "coderd" {
url = "https://coder.example.com"
token = "****"
}
data "coderd_organization" "default" {
is_default = true
}
data "coderd_user" "admin" {
username = "admin"
}
resource "coderd_user" "manager" {
username = "Manager"
email = "manager@example.com"
}
resource "coderd_group" "bosses" {
name = "group"
members = [
data.coderd_user.admin.id,
resource.coderd_user.manager.id
]
}
resource "coderd_template" "example" {
name = "example-template"
versions = [{
directory = "./example-template"
active = true
tf_vars = [{
name = "image_id"
value = "ami-12345678"
}]
# Version names can be randomly generated if null/omitted
}]
acl = {
groups = [{
id = data.coderd_organization.default.id
role = "use"
},
{
id = resource.coderd_group.bosses.id
role = "admin"
}]
users = []
}
allow_user_cancel_workspace_jobs = false
}default_organization_id(String) Default organization ID to use when creating resources. Defaults to the first organization the token has access to.headers(Map of String) Additional HTTP headers to include in all API requests. Provide as a map of header names to values. For example, setX-Coder-Bypass-Ratelimitto"true"to bypass rate limits (requires Owner role). Can also be specified with theCODER_HEADERenvironment variable as comma-separatedkey=valuepairs (CSV format, matching the coder CLI).token(String) API token for communicating with the deployment. Most resource types require elevated permissions. Defaults to$CODER_SESSION_TOKEN.url(String) URL to the Coder deployment. Defaults to$CODER_URL.