Skip to content

Commit f323a73

Browse files
Cloud Workstations - Workstation Cluster (#7005) (#13619)
Closes #12763 Signed-off-by: Modular Magician <[email protected]>
1 parent 99cfa67 commit f323a73

File tree

3 files changed

+254
-0
lines changed

3 files changed

+254
-0
lines changed

.changelog/7005.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:new-resource
2+
google_workstations_workstation_cluster
3+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package google
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,250 @@
1+
---
2+
# ----------------------------------------------------------------------------
3+
#
4+
# *** AUTO GENERATED CODE *** Type: MMv1 ***
5+
#
6+
# ----------------------------------------------------------------------------
7+
#
8+
# This file is automatically generated by Magic Modules and manual
9+
# changes will be clobbered when the file is regenerated.
10+
#
11+
# Please read more about how to change this file in
12+
# .github/CONTRIBUTING.md.
13+
#
14+
# ----------------------------------------------------------------------------
15+
subcategory: "Workstations"
16+
description: |-
17+
A managed workstation cluster.
18+
---
19+
20+
# google\_workstations\_workstation\_cluster
21+
22+
A managed workstation cluster.
23+
24+
~> **Warning:** This resource is in beta, and should be used with the terraform-provider-google-beta provider.
25+
See [Provider Versions](https://terraform.io/docs/providers/google/guides/provider_versions.html) for more details on beta resources.
26+
27+
To get more information about WorkstationCluster, see:
28+
29+
* [API documentation](https://cloud.google.com/workstations/docs/reference/rest/v1beta/projects.locations.workstationClusters/create)
30+
* How-to Guides
31+
* [Workstations](https://cloud.google.com/workstations/docs/)
32+
33+
<div class = "oics-button" style="float: right; margin: 0 0 -15px">
34+
<a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.jpy.wang%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_working_dir=workstation_cluster_basic&cloudshell_image=gcr.io%2Fgraphite-cloud-shell-images%2Fterraform%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" target="_blank">
35+
<img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;">
36+
</a>
37+
</div>
38+
## Example Usage - Workstation Cluster Basic
39+
40+
41+
```hcl
42+
resource "google_workstations_workstation_cluster" "default" {
43+
provider = google-beta
44+
workstation_cluster_id = "workstation-cluster"
45+
network = google_compute_network.default.id
46+
subnetwork = google_compute_subnetwork.default.id
47+
location = "us-central1"
48+
49+
labels = {
50+
"label" = "key"
51+
}
52+
53+
annotations = {
54+
label-one = "value-one"
55+
}
56+
}
57+
58+
data "google_project" "project" {
59+
provider = google-beta
60+
}
61+
62+
resource "google_compute_network" "default" {
63+
provider = google-beta
64+
name = "workstation-cluster"
65+
auto_create_subnetworks = false
66+
}
67+
68+
resource "google_compute_subnetwork" "default" {
69+
provider = google-beta
70+
name = "workstation-cluster"
71+
ip_cidr_range = "10.0.0.0/24"
72+
region = "us-central1"
73+
network = google_compute_network.default.name
74+
}
75+
```
76+
<div class = "oics-button" style="float: right; margin: 0 0 -15px">
77+
<a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.jpy.wang%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_working_dir=workstation_cluster_private&cloudshell_image=gcr.io%2Fgraphite-cloud-shell-images%2Fterraform%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" target="_blank">
78+
<img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;">
79+
</a>
80+
</div>
81+
## Example Usage - Workstation Cluster Private
82+
83+
84+
```hcl
85+
resource "google_workstations_workstation_cluster" "default" {
86+
provider = google-beta
87+
workstation_cluster_id = "workstation-cluster-private"
88+
network = google_compute_network.default.id
89+
subnetwork = google_compute_subnetwork.default.id
90+
location = "us-central1"
91+
92+
private_cluster_config {
93+
enable_private_endpoint = true
94+
}
95+
96+
labels = {
97+
"label" = "key"
98+
}
99+
100+
annotations = {
101+
label-one = "value-one"
102+
}
103+
}
104+
105+
data "google_project" "project" {
106+
provider = google-beta
107+
}
108+
109+
resource "google_compute_network" "default" {
110+
provider = google-beta
111+
name = "workstation-cluster-private"
112+
auto_create_subnetworks = false
113+
}
114+
115+
resource "google_compute_subnetwork" "default" {
116+
provider = google-beta
117+
name = "workstation-cluster-private"
118+
ip_cidr_range = "10.0.0.0/24"
119+
region = "us-central1"
120+
network = google_compute_network.default.name
121+
}
122+
```
123+
124+
## Argument Reference
125+
126+
The following arguments are supported:
127+
128+
129+
* `network` -
130+
(Required)
131+
The relative resource name of the VPC network on which the instance can be accessed.
132+
It is specified in the following form: "projects/{projectNumber}/global/networks/{network_id}".
133+
134+
* `subnetwork` -
135+
(Required)
136+
Name of the Compute Engine subnetwork in which instances associated with this cluster will be created.
137+
Must be part of the subnetwork specified for this cluster.
138+
139+
* `workstation_cluster_id` -
140+
(Required)
141+
The ID of the workstation cluster.
142+
143+
144+
- - -
145+
146+
147+
* `labels` -
148+
(Optional)
149+
Client-specified labels that are applied to the resource and that are also propagated to the underlying Compute Engine resources.
150+
151+
* `display_name` -
152+
(Optional)
153+
Human-readable name for this resource.
154+
155+
* `annotations` -
156+
(Optional)
157+
Client-specified annotations. This is distinct from labels.
158+
159+
* `private_cluster_config` -
160+
(Optional)
161+
Configuration for private cluster.
162+
Structure is [documented below](#nested_private_cluster_config).
163+
164+
* `location` -
165+
(Optional)
166+
The location where the workstation cluster should reside.
167+
168+
* `project` - (Optional) The ID of the project in which the resource belongs.
169+
If it is not provided, the provider project is used.
170+
171+
172+
<a name="nested_private_cluster_config"></a>The `private_cluster_config` block supports:
173+
174+
* `enable_private_endpoint` -
175+
(Required)
176+
Whether Workstations endpoint is private.
177+
178+
* `cluster_hostname` -
179+
Hostname for the workstation cluster.
180+
This field will be populated only when private endpoint is enabled.
181+
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.
182+
183+
* `service_attachment_uri` -
184+
Service attachment URI for the workstation cluster.
185+
The service attachemnt is created when private endpoint is enabled.
186+
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].
187+
188+
## Attributes Reference
189+
190+
In addition to the arguments listed above, the following computed attributes are exported:
191+
192+
* `id` - an identifier for the resource with format `projects/{{project}}/locations/{{location}}/workstationClusters/{{workstation_cluster_id}}`
193+
194+
* `name` -
195+
The name of the cluster resource.
196+
197+
* `uid` -
198+
The system-generated UID of the resource.
199+
200+
* `degraded` -
201+
Whether this resource is in degraded mode, in which case it may require user action to restore full functionality.
202+
Details can be found in the conditions field.
203+
204+
* `etag` -
205+
Checksum computed by the server.
206+
May be sent on update and delete requests to ensure that the client has an up-to-date value before proceeding.
207+
208+
* `create_time` -
209+
Time the Instance was created in UTC.
210+
211+
* `conditions` -
212+
Status conditions describing the current resource state.
213+
Structure is [documented below](#nested_conditions).
214+
215+
216+
<a name="nested_conditions"></a>The `conditions` block contains:
217+
218+
* `code` -
219+
The status code, which should be an enum value of google.rpc.Code.
220+
221+
* `message` -
222+
Human readable message indicating details about the current status.
223+
224+
* `details` -
225+
A list of messages that carry the error details.
226+
227+
## Timeouts
228+
229+
This resource provides the following
230+
[Timeouts](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-timeouts) configuration options:
231+
232+
- `create` - Default is 60 minutes.
233+
- `update` - Default is 60 minutes.
234+
- `delete` - Default is 60 minutes.
235+
236+
## Import
237+
238+
239+
WorkstationCluster can be imported using any of these accepted formats:
240+
241+
```
242+
$ terraform import google_workstations_workstation_cluster.default projects/{{project}}/locations/{{location}}/workstationClusters/{{workstation_cluster_id}}
243+
$ terraform import google_workstations_workstation_cluster.default {{project}}/{{location}}/{{workstation_cluster_id}}
244+
$ terraform import google_workstations_workstation_cluster.default {{location}}/{{workstation_cluster_id}}
245+
$ terraform import google_workstations_workstation_cluster.default {{workstation_cluster_id}}
246+
```
247+
248+
## User Project Overrides
249+
250+
This resource supports [User Project Overrides](https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference#user_project_override).

0 commit comments

Comments
 (0)