A single instance of a developer workstation with its own persistent storage.
To get more information about Workstation, see:
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"
}
}
The following arguments are supported:
workstation_id
-
(Required)
ID to use for the workstation.
workstation_config_id
-
(Required)
The ID of the parent workstation cluster config.
workstation_cluster_id
-
(Required)
The ID of the parent workstation cluster.
location
-
(Required)
The location where the workstation parent resources reside.
display_name
-
(Optional)
Human-readable name for this resource.
labels
-
(Optional)
Client-specified labels that are applied to the resource and that are also propagated to the underlying Compute Engine resources.
Note: This field is non-authoritative, and will only manage the labels present in your configuration.
Please refer to the field effective_labels
for all of the labels present on the resource.
annotations
-
(Optional)
Client-specified annotations. This is distinct from labels.
Note: This field is non-authoritative, and will only manage the annotations present in your configuration.
Please refer to the field effective_annotations
for all of the annotations present on the resource.
env
-
(Optional)
'Client-specified environment variables passed to the workstation container's entrypoint.'
project
- (Optional) The ID of the project in which the resource belongs.
If it is not provided, the provider project is used.
In addition to the arguments listed above, the following computed attributes are exported:
id
- an identifier for the resource with format projects/{{project}}/locations/{{location}}/workstationClusters/{{workstation_cluster_id}}/workstationConfigs/{{workstation_config_id}}/workstations/{{workstation_id}}
name
-
Full name of this resource.
uid
-
A system-assigned unique identified for this resource.
create_time
-
Time when this resource was created.
host
-
Host to which clients can send HTTPS traffic that will be received by the workstation.
Authorized traffic will be received to the workstation as HTTP on port 80.
To send traffic to a different port, clients may prefix the host with the destination port in the format "{port}-{host}".
state
-
Current state of the workstation.
terraform_labels
-
The combination of labels configured directly on the resource
and default labels configured on the provider.
effective_labels
-
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Terraform, other clients and services.
effective_annotations
-
All of annotations (key/value pairs) present on the resource in GCP, including the annotations configured through Terraform, other clients and services.
This resource provides the following Timeouts configuration options:
create
- Default is 30 minutes.update
- Default is 30 minutes.delete
- Default is 30 minutes.Workstation can be imported using any of these accepted formats:
projects/{{project}}/locations/{{location}}/workstationClusters/{{workstation_cluster_id}}/workstationConfigs/{{workstation_config_id}}/workstations/{{workstation_id}}
{{project}}/{{location}}/{{workstation_cluster_id}}/{{workstation_config_id}}/{{workstation_id}}
{{location}}/{{workstation_cluster_id}}/{{workstation_config_id}}/{{workstation_id}}
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}}
This resource supports User Project Overrides.