Skip to content

Commit 93298a0

Browse files
authored
Allow read of PC type from API response to enable non-standard PC imports (#12690)
1 parent 94e30b3 commit 93298a0

File tree

2 files changed

+6
-25
lines changed

2 files changed

+6
-25
lines changed

mmv1/products/vmwareengine/PrivateCloud.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,6 @@ properties:
394394
description: |
395395
Initial type of the private cloud.
396396
immutable: true
397-
ignore_read: true
398397
diff_suppress_func: 'vmwareenginePrivateCloudStandardTypeDiffSuppressFunc'
399398
enum_values:
400399
- 'STANDARD'

mmv1/third_party/terraform/services/vmwareengine/resource_vmwareengine_private_cloud_test.go

+6-24
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ func TestAccVmwareenginePrivateCloud_vmwareEnginePrivateCloudUpdate(t *testing.T
4040
"data.google_vmwareengine_private_cloud.ds",
4141
"google_vmwareengine_private_cloud.vmw-engine-pc",
4242
map[string]struct{}{
43-
"type": {},
4443
"deletion_delay_hours": {},
4544
"send_deletion_delay_hours_if_zero": {},
4645
}),
@@ -52,7 +51,7 @@ func TestAccVmwareenginePrivateCloud_vmwareEnginePrivateCloudUpdate(t *testing.T
5251
ResourceName: "google_vmwareengine_private_cloud.vmw-engine-pc",
5352
ImportState: true,
5453
ImportStateVerify: true,
55-
ImportStateVerifyIgnore: []string{"location", "name", "update_time", "type", "deletion_delay_hours", "send_deletion_delay_hours_if_zero"},
54+
ImportStateVerifyIgnore: []string{"location", "name", "update_time", "deletion_delay_hours", "send_deletion_delay_hours_if_zero"},
5655
},
5756

5857
{
@@ -62,7 +61,6 @@ func TestAccVmwareenginePrivateCloud_vmwareEnginePrivateCloudUpdate(t *testing.T
6261
"data.google_vmwareengine_private_cloud.ds",
6362
"google_vmwareengine_private_cloud.vmw-engine-pc",
6463
map[string]struct{}{
65-
"type": {},
6664
"deletion_delay_hours": {},
6765
"send_deletion_delay_hours_if_zero": {},
6866
}),
@@ -72,7 +70,7 @@ func TestAccVmwareenginePrivateCloud_vmwareEnginePrivateCloudUpdate(t *testing.T
7270
ResourceName: "google_vmwareengine_private_cloud.vmw-engine-pc",
7371
ImportState: true,
7472
ImportStateVerify: true,
75-
ImportStateVerifyIgnore: []string{"location", "name", "update_time", "type", "deletion_delay_hours", "send_deletion_delay_hours_if_zero"},
73+
ImportStateVerifyIgnore: []string{"location", "name", "update_time", "deletion_delay_hours", "send_deletion_delay_hours_if_zero"},
7674
},
7775

7876
{
@@ -82,7 +80,6 @@ func TestAccVmwareenginePrivateCloud_vmwareEnginePrivateCloudUpdate(t *testing.T
8280
"data.google_vmwareengine_private_cloud.ds",
8381
"google_vmwareengine_private_cloud.vmw-engine-pc",
8482
map[string]struct{}{
85-
"type": {},
8683
"deletion_delay_hours": {},
8784
"send_deletion_delay_hours_if_zero": {},
8885
}),
@@ -92,7 +89,7 @@ func TestAccVmwareenginePrivateCloud_vmwareEnginePrivateCloudUpdate(t *testing.T
9289
ResourceName: "google_vmwareengine_private_cloud.vmw-engine-pc",
9390
ImportState: true,
9491
ImportStateVerify: true,
95-
ImportStateVerifyIgnore: []string{"location", "name", "update_time", "type", "deletion_delay_hours", "send_deletion_delay_hours_if_zero"},
92+
ImportStateVerifyIgnore: []string{"location", "name", "update_time", "deletion_delay_hours", "send_deletion_delay_hours_if_zero"},
9693
},
9794

9895
{
@@ -112,7 +109,6 @@ func TestAccVmwareenginePrivateCloud_vmwareEnginePrivateCloudUpdate(t *testing.T
112109
"data.google_vmwareengine_private_cloud.ds",
113110
"google_vmwareengine_private_cloud.vmw-engine-pc",
114111
map[string]struct{}{
115-
"type": {},
116112
"deletion_delay_hours": {},
117113
"send_deletion_delay_hours_if_zero": {},
118114
}),
@@ -122,7 +118,7 @@ func TestAccVmwareenginePrivateCloud_vmwareEnginePrivateCloudUpdate(t *testing.T
122118
ResourceName: "google_vmwareengine_private_cloud.vmw-engine-pc",
123119
ImportState: true,
124120
ImportStateVerify: true,
125-
ImportStateVerifyIgnore: []string{"location", "name", "update_time", "type", "deletion_delay_hours", "send_deletion_delay_hours_if_zero"},
121+
ImportStateVerifyIgnore: []string{"location", "name", "update_time", "deletion_delay_hours", "send_deletion_delay_hours_if_zero"},
126122
},
127123

128124
{
@@ -152,15 +148,15 @@ func TestAccVmwareenginePrivateCloud_vmwareEnginePrivateCloudUpdate(t *testing.T
152148
}
153149

154150
func testVmwareenginePrivateCloudCreateConfig(context map[string]interface{}) string {
155-
return testVmwareenginePrivateCloudConfig(context, "sample description", "STANDARD", 3, 8) + testVmwareengineVcenterNSXCredentailsConfig(context)
151+
return testVmwareenginePrivateCloudConfig(context, "sample description", "TIME_LIMITED", 1, 0) + testVmwareengineVcenterNSXCredentailsConfig(context)
156152
}
157153

158154
func testVmwareenginePrivateCloudUpdateNodeConfig(context map[string]interface{}) string {
159155
return testVmwareenginePrivateCloudConfig(context, "sample updated description", "STANDARD", 3, 8) + testVmwareengineVcenterNSXCredentailsConfig(context)
160156
}
161157

162158
func testVmwareenginePrivateCloudUpdateAutoscaleConfig(context map[string]interface{}) string {
163-
return testVmwareenginePrivateCloudAutoscaleConfig(context, "sample updated description", "STANDARD", 3, 8) + testVmwareengineVcenterNSXCredentailsConfig(context)
159+
return testVmwareenginePrivateCloudAutoscaleConfig(context, "sample updated description", "", 3, 8) + testVmwareengineVcenterNSXCredentailsConfig(context)
164160
}
165161

166162
func testVmwareenginePrivateCloudDelayedDeleteConfig(context map[string]interface{}) string {
@@ -209,20 +205,6 @@ resource "google_vmwareengine_private_cloud" "vmw-engine-pc" {
209205
node_type_id = "standard-72"
210206
node_count = "%{node_count}"
211207
custom_core_count = 32
212-
}
213-
autoscaling_settings {
214-
autoscaling_policies {
215-
autoscale_policy_id = "autoscaling-policy"
216-
node_type_id = "standard-72"
217-
scale_out_size = 1
218-
storage_thresholds {
219-
scale_out = 60
220-
scale_in = 20
221-
}
222-
}
223-
min_cluster_node_count = 3
224-
max_cluster_node_count = 8
225-
cool_down_period = "1800s"
226208
}
227209
}
228210
}

0 commit comments

Comments
 (0)