| --- |
| # ---------------------------------------------------------------------------- |
| # |
| # *** AUTO GENERATED CODE *** Type: MMv1 *** |
| # |
| # ---------------------------------------------------------------------------- |
| # |
| # This file is automatically generated by Magic Modules and manual |
| # changes will be clobbered when the file is regenerated. |
| # |
| # Please read more about how to change this file in |
| # .github/CONTRIBUTING.md. |
| # |
| # ---------------------------------------------------------------------------- |
| subcategory: "Cloud Workstations" |
| description: |- |
| A grouping of workstation configurations and the associated workstations in that region. |
| --- |
| |
| # google\_workstations\_workstation\_cluster |
| |
| A grouping of workstation configurations and the associated workstations in that region. |
| |
| ~> **Warning:** This resource is in beta, and should be used with the terraform-provider-google-beta provider. |
| See [Provider Versions](https://terraform.io/docs/providers/google/guides/provider_versions.html) for more details on beta resources. |
| |
| To get more information about WorkstationCluster, see: |
| |
| * [API documentation](https://cloud.google.com/workstations/docs/reference/rest/v1beta/projects.locations.workstationClusters/create) |
| * How-to Guides |
| * [Workstations](https://cloud.google.com/workstations/docs/) |
| |
| <div class = "oics-button" style="float: right; margin: 0 0 -15px"> |
| <a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_working_dir=workstation_cluster_basic&cloudshell_image=gcr.io%2Fcloudshell-images%2Fcloudshell%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" target="_blank"> |
| <img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;"> |
| </a> |
| </div> |
| ## Example Usage - Workstation Cluster Basic |
| |
| |
| ```hcl |
| 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 |
| } |
| ``` |
| <div class = "oics-button" style="float: right; margin: 0 0 -15px"> |
| <a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_working_dir=workstation_cluster_private&cloudshell_image=gcr.io%2Fcloudshell-images%2Fcloudshell%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" target="_blank"> |
| <img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;"> |
| </a> |
| </div> |
| ## Example Usage - Workstation Cluster Private |
| |
| |
| ```hcl |
| 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 |
| } |
| ``` |
| <div class = "oics-button" style="float: right; margin: 0 0 -15px"> |
| <a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_working_dir=workstation_cluster_custom_domain&cloudshell_image=gcr.io%2Fcloudshell-images%2Fcloudshell%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" target="_blank"> |
| <img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;"> |
| </a> |
| </div> |
| ## Example Usage - Workstation Cluster Custom Domain |
| |
| |
| ```hcl |
| 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 |
| } |
| ``` |
| |
| ## 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. |
| |
| * `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](#nested_private_cluster_config). |
| |
| * `domain_config` - |
| (Optional) |
| Configuration options for a custom domain. |
| Structure is [documented below](#nested_domain_config). |
| |
| * `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. |
| |
| |
| <a name="nested_private_cluster_config"></a>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. |
| |
| <a name="nested_domain_config"></a>The `domain_config` block supports: |
| |
| * `domain` - |
| (Required) |
| Domain used by Workstations for HTTP ingress. |
| |
| ## 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/{{workstation_cluster_id}}` |
| |
| * `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. |
| |
| * `create_time` - |
| Time when this resource was created. |
| |
| * `conditions` - |
| Status conditions describing the current resource state. |
| Structure is [documented below](#nested_conditions). |
| |
| * `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. |
| |
| |
| <a name="nested_conditions"></a>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](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-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: |
| |
| * `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](https://developer.hashicorp.com/terraform/language/import) to import WorkstationCluster using one of the formats above. For example: |
| |
| ```tf |
| import { |
| id = "projects/{{project}}/locations/{{location}}/workstationClusters/{{workstation_cluster_id}}" |
| to = google_workstations_workstation_cluster.default |
| } |
| ``` |
| |
| When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), 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}} |
| ``` |
| |
| ## User Project Overrides |
| |
| This resource supports [User Project Overrides](https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference#user_project_override). |