Skip to content

googleWorkstationsWorkstation

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

\~> 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 Workstation, see:

Example Usage - Workstation 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");
const googleWorkstationsWorkstationConfigDefault =
  new google.workstationsWorkstationConfig.WorkstationsWorkstationConfig(
    this,
    "default_3",
    {
      host: [
        {
          gce_instance: [
            {
              boot_disk_size_gb: 35,
              disable_public_ip_addresses: true,
              machine_type: "e2-standard-4",
            },
          ],
        },
      ],
      location: "us-central1",
      provider: "${google-beta}",
      workstation_cluster_id:
        googleWorkstationsWorkstationClusterDefault.workstationClusterId,
      workstation_config_id: "workstation-config",
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
googleWorkstationsWorkstationConfigDefault.overrideLogicalId("default");
const googleWorkstationsWorkstationDefault =
  new google.workstationsWorkstation.WorkstationsWorkstation(
    this,
    "default_4",
    {
      annotations: [
        {
          "label-one": "value-one",
        },
      ],
      labels: [
        {
          label: "key",
        },
      ],
      location: "us-central1",
      provider: "${google-beta}",
      workstation_cluster_id:
        googleWorkstationsWorkstationClusterDefault.workstationClusterId,
      workstation_config_id:
        googleWorkstationsWorkstationConfigDefault.workstationConfigId,
      workstation_id: "workstation",
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
googleWorkstationsWorkstationDefault.overrideLogicalId("default");

Argument Reference

The following arguments are supported:

  • workstationId - (Required) ID to use for the workstation.

  • workstationConfigId - (Required) The ID of the workstation cluster config.

  • workstationClusterId - (Required) The name of the workstation cluster.

  • location - (Required) The location where the workstation cluster config should reside.


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

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

  • project - (Optional) The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

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}}/workstationConfigs/{{workstationConfigId}}/workstations/{{workstationId}}

  • name - The name of the cluster resource.

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

  • createTime - Time the Instance was created in UTC.

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

Timeouts

This resource provides the following Timeouts configuration options:

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

Import

Workstation can be imported using any of these accepted formats:

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