A grouping of workstation configurations and the associated workstations in that region.
To get more information about WorkstationCluster, see:
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"
}
}
data "google_project" "project" {
provider = google-beta
}
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-private"
network = google_compute_network.default.id
subnetwork = google_compute_subnetwork.default.id
location = "us-central1"
private_cluster_config {
enable_private_endpoint = true
}
labels = {
"label" = "key"
}
annotations = {
label-one = "value-one"
}
}
data "google_project" "project" {
provider = google-beta
}
resource "google_compute_network" "default" {
provider = google-beta
name = "workstation-cluster-private"
auto_create_subnetworks = false
}
resource "google_compute_subnetwork" "default" {
provider = google-beta
name = "workstation-cluster-private"
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-custom-domain"
network = google_compute_network.default.id
subnetwork = google_compute_subnetwork.default.id
location = "us-central1"
private_cluster_config {
enable_private_endpoint = true
}
domain_config {
domain = "workstations.example.com"
}
labels = {
"label" = "key"
}
annotations = {
label-one = "value-one"
}
}
data "google_project" "project" {
provider = google-beta
}
resource "google_compute_network" "default" {
provider = google-beta
name = "workstation-cluster-custom-domain"
auto_create_subnetworks = false
}
resource "google_compute_subnetwork" "default" {
provider = google-beta
name = "workstation-cluster-custom-domain"
ip_cidr_range = "10.0.0.0/24"
region = "us-central1"
network = google_compute_network.default.name
}
The following arguments are supported:
network
-
(Required)
The relative resource name of the VPC network on which the instance can be accessed.
It is specified in the following form: "projects/{projectNumber}/global/networks/{network_id}".
subnetwork
-
(Required)
Name of the Compute Engine subnetwork in which instances associated with this cluster will be created.
Must be part of the subnetwork specified for this cluster.
workstation_cluster_id
-
(Required)
ID to use for the workstation cluster.
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.
display_name
-
(Optional)
Human-readable name for this 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.
private_cluster_config
-
(Optional)
Configuration for private cluster.
Structure is documented below.
domain_config
-
(Optional)
Configuration options for a custom domain.
Structure is documented below.
location
-
(Optional)
The location where the workstation cluster should reside.
project
- (Optional) The ID of the project in which the resource belongs.
If it is not provided, the provider project is used.
The private_cluster_config
block supports:
enable_private_endpoint
-
(Required)
Whether Workstations endpoint is private.
cluster_hostname
-
(Output)
Hostname for the workstation cluster.
This field will be populated only when private endpoint is enabled.
To access workstations in the cluster, create a new DNS zone mapping this domain name to an internal IP address and a forwarding rule mapping that address to the service attachment.
service_attachment_uri
-
(Output)
Service attachment URI for the workstation cluster.
The service attachment is created when private endpoint is enabled.
To access workstations in the cluster, configure access to the managed service using (Private Service Connect)[https://cloud.google.com/vpc/docs/configure-private-service-connect-services].
allowed_projects
-
(Optional)
Additional project IDs that are allowed to attach to the workstation cluster's service attachment.
By default, the workstation cluster's project and the VPC host project (if different) are allowed.
The domain_config
block supports:
domain
-
(Required)
Domain used by Workstations for HTTP ingress.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}}
name
-
The name of the cluster resource.
uid
-
The system-generated UID of the resource.
control_plane_ip
-
The private IP address of the control plane for this workstation cluster.
Workstation VMs need access to this IP address to work with the service, so make sure that your firewall rules allow egress from the workstation VMs to this address.
degraded
-
Whether this resource is in degraded mode, in which case it may require user action to restore full functionality.
Details can be found in the conditions field.
etag
-
Checksum computed by the server.
May be sent on update and delete requests to ensure that the client has an up-to-date value before proceeding.
create_time
-
Time when this resource was created.
conditions
-
Status conditions describing the current resource state.
Structure is documented below.
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.
The conditions
block contains:
code
-
(Output)
The status code, which should be an enum value of google.rpc.Code.
message
-
(Output)
Human readable message indicating details about the current status.
details
-
(Output)
A list of messages that carry the error details.
This resource provides the following Timeouts configuration options:
create
- Default is 60 minutes.update
- Default is 60 minutes.delete
- Default is 60 minutes.WorkstationCluster can be imported using any of these accepted formats:
projects/{{project}}/locations/{{location}}/workstationClusters/{{workstation_cluster_id}}
{{project}}/{{location}}/{{workstation_cluster_id}}
{{location}}/{{workstation_cluster_id}}
In Terraform v1.5.0 and later, use an import
block to import WorkstationCluster using one of the formats above. For example:
import {
id = "projects/{{project}}/locations/{{location}}/workstationClusters/{{workstation_cluster_id}}"
to = google_workstations_workstation_cluster.default
}
When using the terraform import
command, WorkstationCluster can be imported using one of the formats above. For example:
$ terraform import google_workstations_workstation_cluster.default projects/{{project}}/locations/{{location}}/workstationClusters/{{workstation_cluster_id}}
$ terraform import google_workstations_workstation_cluster.default {{project}}/{{location}}/{{workstation_cluster_id}}
$ terraform import google_workstations_workstation_cluster.default {{location}}/{{workstation_cluster_id}}
This resource supports User Project Overrides.