Skip to content

Commit 2d8e277

Browse files
Update Cloud Workstations resources in the beta provider. (#7629) (#5585)
* Update mutability of fields in Cloud Workstations resources. * Revert WorkstationsConfig persistent directories fields to be default_from_api. * Revert and mark breaking changes for Cloud Workstations resources. * Update display name for Cloud Workstation. * Revert default_from_api on fields not sent by API if not changed. * Add an update test for Cloud Workstations host field. * Add more update tests to include all recently changed fields. * Revert addition of idle and running timeout fields. * Fix config tests for newly mutable attributes. * Use default value instead of sending empty for advanced host options. * Send empty values for special nested objects, configure diff suppress when empty. * Add custom flatteners for instance configs. * Add default_from_ap to ssubfields where custom flatteners are used. * Send default_from_api on entire config block instead of fields. * Fix formatting for attributes not caught by rebase. Signed-off-by: Modular Magician <[email protected]>
1 parent 9677871 commit 2d8e277

12 files changed

+430
-116
lines changed

.changelog/7629.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
```release-note:enhancement
2+
workstations: supported in-place update for `host` and `container` in `google_workstations_workstation_config` (beta)
3+
```
4+
```release-note:bug
5+
workstations: fixed an issue where unsetting the container working directory in `google_workstations_workstations_config` was not propagated to the underlying resource (beta)
6+
```
7+
```release-note:bug
8+
workstations: fixed an issue where modifying `persistent_directories` and `encryption_key` would fail with API errors; now updating them will recreate the resource (beta)
9+
```

google-beta/iam_workstations_workstation_config_generated_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ resource "google_workstations_workstation_config" "default" {
155155
workstation_config_id = "tf-test-workstation-config%{random_suffix}"
156156
workstation_cluster_id = google_workstations_workstation_cluster.default.workstation_cluster_id
157157
location = "us-central1"
158-
158+
159159
host {
160160
gce_instance {
161161
machine_type = "e2-standard-4"
@@ -214,7 +214,7 @@ resource "google_workstations_workstation_config" "default" {
214214
workstation_config_id = "tf-test-workstation-config%{random_suffix}"
215215
workstation_cluster_id = google_workstations_workstation_cluster.default.workstation_cluster_id
216216
location = "us-central1"
217-
217+
218218
host {
219219
gce_instance {
220220
machine_type = "e2-standard-4"
@@ -280,7 +280,7 @@ resource "google_workstations_workstation_config" "default" {
280280
workstation_config_id = "tf-test-workstation-config%{random_suffix}"
281281
workstation_cluster_id = google_workstations_workstation_cluster.default.workstation_cluster_id
282282
location = "us-central1"
283-
283+
284284
host {
285285
gce_instance {
286286
machine_type = "e2-standard-4"
@@ -342,7 +342,7 @@ resource "google_workstations_workstation_config" "default" {
342342
workstation_config_id = "tf-test-workstation-config%{random_suffix}"
343343
workstation_cluster_id = google_workstations_workstation_cluster.default.workstation_cluster_id
344344
location = "us-central1"
345-
345+
346346
host {
347347
gce_instance {
348348
machine_type = "e2-standard-4"
@@ -401,7 +401,7 @@ resource "google_workstations_workstation_config" "default" {
401401
workstation_config_id = "tf-test-workstation-config%{random_suffix}"
402402
workstation_cluster_id = google_workstations_workstation_cluster.default.workstation_cluster_id
403403
location = "us-central1"
404-
404+
405405
host {
406406
gce_instance {
407407
machine_type = "e2-standard-4"

google-beta/resource_workstations_workstation.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,19 @@ func ResourceWorkstationsWorkstation() *schema.Resource {
4747
Type: schema.TypeString,
4848
Required: true,
4949
ForceNew: true,
50-
Description: `The location where the workstation cluster config should reside.`,
50+
Description: `The location where the workstation parent resources reside.`,
5151
},
5252
"workstation_cluster_id": {
5353
Type: schema.TypeString,
5454
Required: true,
5555
ForceNew: true,
56-
Description: `The name of the workstation cluster.`,
56+
Description: `The ID of the parent workstation cluster.`,
5757
},
5858
"workstation_config_id": {
5959
Type: schema.TypeString,
6060
Required: true,
6161
ForceNew: true,
62-
Description: `The ID of the workstation cluster config.`,
62+
Description: `The ID of the parent workstation cluster config.`,
6363
},
6464
"workstation_id": {
6565
Type: schema.TypeString,
@@ -87,7 +87,7 @@ func ResourceWorkstationsWorkstation() *schema.Resource {
8787
"create_time": {
8888
Type: schema.TypeString,
8989
Computed: true,
90-
Description: `Time the Instance was created in UTC.`,
90+
Description: `Time when this resource was created.`,
9191
},
9292
"host": {
9393
Type: schema.TypeString,
@@ -99,7 +99,7 @@ To send traffic to a different port, clients may prefix the host with the destin
9999
"name": {
100100
Type: schema.TypeString,
101101
Computed: true,
102-
Description: `The name of the cluster resource.`,
102+
Description: `Full name of this resource.`,
103103
},
104104
"state": {
105105
Type: schema.TypeString,
@@ -109,7 +109,7 @@ To send traffic to a different port, clients may prefix the host with the destin
109109
"uid": {
110110
Type: schema.TypeString,
111111
Computed: true,
112-
Description: `The system-generated UID of the resource.`,
112+
Description: `A system-assigned unique identified for this resource.`,
113113
},
114114
"project": {
115115
Type: schema.TypeString,

google-beta/resource_workstations_workstation_cluster.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Must be part of the subnetwork specified for this cluster.`,
6161
Type: schema.TypeString,
6262
Required: true,
6363
ForceNew: true,
64-
Description: `The ID of the workstation cluster.`,
64+
Description: `ID to use for the workstation cluster.`,
6565
},
6666
"annotations": {
6767
Type: schema.TypeMap,
@@ -110,7 +110,7 @@ To access workstations in the cluster, create a new DNS zone mapping this domain
110110
Type: schema.TypeString,
111111
Computed: true,
112112
Description: `Service attachment URI for the workstation cluster.
113-
The service attachemnt is created when private endpoint is enabled.
113+
The service attachment is created when private endpoint is enabled.
114114
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].`,
115115
},
116116
},
@@ -146,7 +146,7 @@ To access workstations in the cluster, configure access to the managed service u
146146
"create_time": {
147147
Type: schema.TypeString,
148148
Computed: true,
149-
Description: `Time the Instance was created in UTC.`,
149+
Description: `Time when this resource was created.`,
150150
},
151151
"degraded": {
152152
Type: schema.TypeBool,

0 commit comments

Comments
 (0)