Skip to content

Latest commit

 

History

History
67 lines (55 loc) · 1.53 KB

index.md

File metadata and controls

67 lines (55 loc) · 1.53 KB
page_title subcategory description
Coder Provider
Infrastructure
Terraform provider for managing Coder templates, which are the underlying infrastructure for Coder workspaces.

Coder Provider

Terraform provider for managing Coder templates, which are the underlying infrastructure for Coder workspaces.

Example

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
}

Schema

Optional

  • url (String) The URL to access Coder.