Skip to content

googleWorkstationsWorkstationCluster

A managed workstation cluster.

\~> Warning: This resource is in beta, and should be used with the terraform-provider-google-beta provider. See Provider Versions for more details on beta resources.

To get more information about WorkstationCluster, see:

Example Usage - Workstation Cluster Basic

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
const googleComputeNetworkDefault = new google.computeNetwork.ComputeNetwork(
  this,
  "default",
  {
    auto_create_subnetworks: false,
    name: "workstation-cluster",
    provider: "${google-beta}",
  }
);
const googleComputeSubnetworkDefault =
  new google.computeSubnetwork.ComputeSubnetwork(this, "default_1", {
    ip_cidr_range: "10.0.0.0/24",
    name: "workstation-cluster",
    network: googleComputeNetworkDefault.name,
    provider: "${google-beta}",
    region: "us-central1",
  });
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
googleComputeSubnetworkDefault.overrideLogicalId("default");
const googleWorkstationsWorkstationClusterDefault =
  new google.workstationsWorkstationCluster.WorkstationsWorkstationCluster(
    this,
    "default_2",
    {
      annotations: [
        {
          "label-one": "value-one",
        },
      ],
      labels: [
        {
          label: "key",
        },
      ],
      location: "us-central1",
      network: googleComputeNetworkDefault.id,
      provider: "${google-beta}",
      subnetwork: googleComputeSubnetworkDefault.id,
      workstation_cluster_id: "workstation-cluster",
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
googleWorkstationsWorkstationClusterDefault.overrideLogicalId("default");
new google.dataGoogleProject.DataGoogleProject(this, "project", {
  provider: "${google-beta}",
});

Example Usage - Workstation Cluster Private

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
const googleComputeNetworkDefault = new google.computeNetwork.ComputeNetwork(
  this,
  "default",
  {
    auto_create_subnetworks: false,
    name: "workstation-cluster-private",
    provider: "${google-beta}",
  }
);
const googleComputeSubnetworkDefault =
  new google.computeSubnetwork.ComputeSubnetwork(this, "default_1", {
    ip_cidr_range: "10.0.0.0/24",
    name: "workstation-cluster-private",
    network: googleComputeNetworkDefault.name,
    provider: "${google-beta}",
    region: "us-central1",
  });
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
googleComputeSubnetworkDefault.overrideLogicalId("default");
const googleWorkstationsWorkstationClusterDefault =
  new google.workstationsWorkstationCluster.WorkstationsWorkstationCluster(
    this,
    "default_2",
    {
      annotations: [
        {
          "label-one": "value-one",
        },
      ],
      labels: [
        {
          label: "key",
        },
      ],
      location: "us-central1",
      network: googleComputeNetworkDefault.id,
      private_cluster_config: [
        {
          enable_private_endpoint: true,
        },
      ],
      provider: "${google-beta}",
      subnetwork: googleComputeSubnetworkDefault.id,
      workstation_cluster_id: "workstation-cluster-private",
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
googleWorkstationsWorkstationClusterDefault.overrideLogicalId("default");
new google.dataGoogleProject.DataGoogleProject(this, "project", {
  provider: "${google-beta}",
});

Argument Reference

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.

  • workstationClusterId - (Required) The ID of 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.

  • displayName - (Optional) Human-readable name for this resource.

  • annotations - (Optional) Client-specified annotations. This is distinct from labels.

  • privateClusterConfig - (Optional) Configuration for private cluster. 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 privateClusterConfig block supports:

  • enablePrivateEndpoint - (Required) Whether Workstations endpoint is private.

  • clusterHostname - (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.

  • serviceAttachmentUri - (Output) Service attachment URI for the workstation cluster. The service attachemnt 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].

Attributes Reference

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/{{workstationClusterId}}

  • name - The name of the cluster resource.

  • uid - The system-generated UID of the resource.

  • 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.

  • createTime - Time the Instance was created in UTC.

  • conditions - Status conditions describing the current resource state. Structure is documented below.

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.

Timeouts

This resource provides the following Timeouts configuration options:

  • create - Default is 60 minutes.
  • update - Default is 60 minutes.
  • delete - Default is 60 minutes.

Import

WorkstationCluster can be imported using any of these accepted formats:

$ 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}}

User Project Overrides

This resource supports User Project Overrides.