page_title | subcategory | description |
---|---|---|
Coder Provider |
Infrastructure |
Terraform provider for managing Coder templates, which are the underlying infrastructure for Coder workspaces. |
Terraform provider for managing Coder templates, which are the underlying infrastructure for Coder workspaces.
-> Requires Coder v2.18.0 or later.
!> coder_git_auth
and owner related fields of coder_workspace
data source have been removed. Follow the Version 2 Upgrade Guide to update your code.
terraform {
required_providers {
coder = {
source = "coder/coder"
}
}
}
provider "google" {
region = "us-central1"
}
data "coder_workspace" "me" {}
resource "coder_agent" "dev" {
arch = "amd64"
os = "linux"
auth = "google-instance-identity"
}
data "google_compute_default_service_account" "default" {}
resource "google_compute_instance" "dev" {
zone = "us-central1-a"
count = data.coder_workspace.me.start_count
name = "coder-${data.coder_workspace.me.owner}-${data.coder_workspace.me.name}"
machine_type = "e2-medium"
network_interface {
network = "default"
access_config {
// Ephemeral public IP
}
}
boot_disk {
initialize_params {
image = "debian-cloud/debian-9"
}
}
service_account {
email = data.google_compute_default_service_account.default.email
scopes = ["cloud-platform"]
}
metadata_startup_script = coder_agent.dev.init_script
}
url
(String) The URL to access Coder.