google_workstations_workstation

A single instance of a developer workstation with its own persistent storage.

To get more information about Workstation, see:

Open in Cloud Shell

Example Usage - Workstation Basic

resource "google_compute_network" "default" {
  provider                = google-beta
  name                    = "workstation-cluster"
  auto_create_subnetworks = false
}

resource "google_compute_subnetwork" "default" {
  provider      = google-beta
  name          = "workstation-cluster"
  ip_cidr_range = "10.0.0.0/24"
  region        = "us-central1"
  network       = google_compute_network.default.name
}

resource "google_workstations_workstation_cluster" "default" {
  provider               = google-beta
  workstation_cluster_id = "workstation-cluster"
  network                = google_compute_network.default.id
  subnetwork             = google_compute_subnetwork.default.id
  location               = "us-central1"

  labels = {
    "label" = "key"
  }

  annotations = {
    label-one = "value-one"
  }
}

resource "google_workstations_workstation_config" "default" {
  provider               = google-beta
  workstation_config_id  = "workstation-config"
  workstation_cluster_id = google_workstations_workstation_cluster.default.workstation_cluster_id
  location                   = "us-central1"

  host {
    gce_instance {
      machine_type                = "e2-standard-4"
      boot_disk_size_gb           = 35
      disable_public_ip_addresses = true
    }
  }
}

resource "google_workstations_workstation" "default" {
  provider               = google-beta
  workstation_id         = "work-station"
  workstation_config_id  = google_workstations_workstation_config.default.workstation_config_id
  workstation_cluster_id = google_workstations_workstation_cluster.default.workstation_cluster_id
  location                   = "us-central1"

  labels = {
    "label" = "key"
  }

  env = {
    name = "foo"
  }

  annotations = {
    label-one = "value-one"
  }
}

Argument Reference

The following arguments are supported:


Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

Timeouts

This resource provides the following Timeouts configuration options:

Import

Workstation can be imported using any of these accepted formats:

In Terraform v1.5.0 and later, use an import block to import Workstation using one of the formats above. For example:

import {
  id = "projects/{{project}}/locations/{{location}}/workstationClusters/{{workstation_cluster_id}}/workstationConfigs/{{workstation_config_id}}/workstations/{{workstation_id}}"
  to = google_workstations_workstation.default
}

When using the terraform import command, Workstation can be imported using one of the formats above. For example:

$ terraform import google_workstations_workstation.default projects/{{project}}/locations/{{location}}/workstationClusters/{{workstation_cluster_id}}/workstationConfigs/{{workstation_config_id}}/workstations/{{workstation_id}}
$ terraform import google_workstations_workstation.default {{project}}/{{location}}/{{workstation_cluster_id}}/{{workstation_config_id}}/{{workstation_id}}
$ terraform import google_workstations_workstation.default {{location}}/{{workstation_cluster_id}}/{{workstation_config_id}}/{{workstation_id}}

User Project Overrides

This resource supports User Project Overrides.