Skip to content

Commit 551393d

Browse files
alloydb: machine_type in the machine_config block is not yet GA in the API (#14344) (#23415)
[upstream:73eb7730f287bba861d5ad22fa53dd645b8e3c59] Signed-off-by: Modular Magician <[email protected]>
1 parent 4ef4561 commit 551393d

File tree

5 files changed

+5
-30
lines changed

5 files changed

+5
-30
lines changed

.changelog/14344.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:bug
2+
alloydb: `machine_type` in the `machine_config` block is not yet GA in the API
3+
```

google/services/alloydb/resource_alloydb_instance.go

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -194,14 +194,6 @@ Please refer to the field 'effective_labels' for all of the labels present on th
194194
Optional: true,
195195
Description: `The number of CPU's in the VM instance.`,
196196
},
197-
"machine_type": {
198-
Type: schema.TypeString,
199-
Computed: true,
200-
Optional: true,
201-
Description: `Machine type of the VM instance.
202-
E.g. "n2-highmem-4", "n2-highmem-8", "c4a-highmem-4-lssd".
203-
'cpu_count' must match the number of vCPUs in the machine type.`,
204-
},
205197
},
206198
},
207199
},
@@ -1188,8 +1180,6 @@ func flattenAlloydbInstanceMachineConfig(v interface{}, d *schema.ResourceData,
11881180
transformed := make(map[string]interface{})
11891181
transformed["cpu_count"] =
11901182
flattenAlloydbInstanceMachineConfigCpuCount(original["cpuCount"], d, config)
1191-
transformed["machine_type"] =
1192-
flattenAlloydbInstanceMachineConfigMachineType(original["machineType"], d, config)
11931183
return []interface{}{transformed}
11941184
}
11951185
func flattenAlloydbInstanceMachineConfigCpuCount(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
@@ -1209,10 +1199,6 @@ func flattenAlloydbInstanceMachineConfigCpuCount(v interface{}, d *schema.Resour
12091199
return v // let terraform core handle it otherwise
12101200
}
12111201

1212-
func flattenAlloydbInstanceMachineConfigMachineType(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
1213-
return v
1214-
}
1215-
12161202
func flattenAlloydbInstanceClientConnectionConfig(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
12171203
if v == nil {
12181204
return nil
@@ -1556,24 +1542,13 @@ func expandAlloydbInstanceMachineConfig(v interface{}, d tpgresource.TerraformRe
15561542
transformed["cpuCount"] = transformedCpuCount
15571543
}
15581544

1559-
transformedMachineType, err := expandAlloydbInstanceMachineConfigMachineType(original["machine_type"], d, config)
1560-
if err != nil {
1561-
return nil, err
1562-
} else if val := reflect.ValueOf(transformedMachineType); val.IsValid() && !tpgresource.IsEmptyValue(val) {
1563-
transformed["machineType"] = transformedMachineType
1564-
}
1565-
15661545
return transformed, nil
15671546
}
15681547

15691548
func expandAlloydbInstanceMachineConfigCpuCount(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
15701549
return v, nil
15711550
}
15721551

1573-
func expandAlloydbInstanceMachineConfigMachineType(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
1574-
return v, nil
1575-
}
1576-
15771552
func expandAlloydbInstanceClientConnectionConfig(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
15781553
l := v.([]interface{})
15791554
if len(l) == 0 || l[0] == nil {

google/services/alloydb/resource_alloydb_instance_generated_meta.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ fields:
2626
- field: 'ip_address'
2727
- field: 'labels'
2828
- field: 'machine_config.cpu_count'
29-
- field: 'machine_config.machine_type'
3029
- field: 'name'
3130
- field: 'network_config.allocated_ip_range_override'
3231
- field: 'network_config.authorized_external_networks.cidr_range'

google/services/alloydb/resource_alloydb_instance_test.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//
99
// This code is generated by Magic Modules using the following:
1010
//
11-
// Source file: https://github.com/GoogleCloudPlatform/magic-modules/tree/main/mmv1/third_party/terraform/services/alloydb/resource_alloydb_instance_test.go
11+
// Source file: https://github.com/GoogleCloudPlatform/magic-modules/tree/main/mmv1/third_party/terraform/services/alloydb/resource_alloydb_instance_test.go.tmpl
1212
//
1313
// DO NOT EDIT this file directly. Any changes made to this file will be
1414
// overwritten during the next generation cycle.
@@ -97,7 +97,6 @@ resource "google_alloydb_instance" "default" {
9797
9898
machine_config {
9999
cpu_count = 4
100-
machine_type = "n2-highmem-4"
101100
}
102101
103102
labels = {
@@ -970,7 +969,6 @@ resource "google_alloydb_instance" "default" {
970969
instance_type = "PRIMARY"
971970
machine_config {
972971
cpu_count = 2
973-
machine_type = "n2-highmem-2"
974972
}
975973
psc_instance_config {
976974
allowed_consumer_projects = ["${data.google_project.project.number}"]

website/docs/r/alloydb_instance.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ The following arguments are supported:
347347
The number of CPU's in the VM instance.
348348

349349
* `machine_type` -
350-
(Optional)
350+
(Optional, [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html))
351351
Machine type of the VM instance.
352352
E.g. "n2-highmem-4", "n2-highmem-8", "c4a-highmem-4-lssd".
353353
`cpu_count` must match the number of vCPUs in the machine type.

0 commit comments

Comments
 (0)