Skip to content

Commit e79e74a

Browse files
fix MM locations (#4394) (#2863)
Co-authored-by: upodroid <[email protected]> Signed-off-by: Modular Magician <[email protected]> Co-authored-by: upodroid <[email protected]>
1 parent 80182c7 commit e79e74a

9 files changed

+42
-42
lines changed

.changelog/4394.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
```release-note:enhancement
2+
memcache: fixed an issue where `google_memcached_instance` resource was not inferring the region from the provider.
3+
```
4+
```release-note:enhancement
5+
vpcaccess: fixed an issue where `google_vpc_access_connector` resource was not inferring the region from the provider.
6+
```
7+
```release-note:enhancement
8+
tpu: fixed an issue where `google_tpu_node` resource was not inferring the zone from the provider.
9+
```

google-beta/resource_memcache_instance.go

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,6 @@ func resourceMemcacheInstance() *schema.Resource {
7676
Required: true,
7777
Description: `Number of nodes in the memcache instance.`,
7878
},
79-
"region": {
80-
Type: schema.TypeString,
81-
Required: true,
82-
ForceNew: true,
83-
Description: `The name of the Memcache region of the instance.`,
84-
},
8579
"authorized_network": {
8680
Type: schema.TypeString,
8781
Optional: true,
@@ -132,6 +126,13 @@ Currently the latest supported major version is MEMCACHE_1_5. The minor version
132126
determined by our system based on the latest supported minor version. Default value: "MEMCACHE_1_5" Possible values: ["MEMCACHE_1_5"]`,
133127
Default: "MEMCACHE_1_5",
134128
},
129+
"region": {
130+
Type: schema.TypeString,
131+
Computed: true,
132+
Optional: true,
133+
ForceNew: true,
134+
Description: `The region of the Memcache instance. If it is not provided, the provider region is used.`,
135+
},
135136
"zones": {
136137
Type: schema.TypeSet,
137138
Computed: true,
@@ -350,14 +351,6 @@ func resourceMemcacheInstanceRead(d *schema.ResourceData, meta interface{}) erro
350351
return fmt.Errorf("Error reading Instance: %s", err)
351352
}
352353

353-
region, err := getRegion(d, config)
354-
if err != nil {
355-
return err
356-
}
357-
if err := d.Set("region", region); err != nil {
358-
return fmt.Errorf("Error reading Instance: %s", err)
359-
}
360-
361354
if err := d.Set("display_name", flattenMemcacheInstanceDisplayName(res["displayName"], d, config)); err != nil {
362355
return fmt.Errorf("Error reading Instance: %s", err)
363356
}

google-beta/resource_memcache_instance_generated_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ resource "google_service_networking_connection" "private_service_connection" {
7171
resource "google_memcache_instance" "instance" {
7272
provider = google-beta
7373
name = "tf-test-test-instance%{random_suffix}"
74-
region = "us-central1"
7574
authorized_network = google_service_networking_connection.private_service_connection.network
7675
7776
node_config {

google-beta/resource_tpu_node.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,6 @@ func resourceTPUNode() *schema.Resource {
110110
Required: true,
111111
Description: `The version of Tensorflow running in the Node.`,
112112
},
113-
"zone": {
114-
Type: schema.TypeString,
115-
Required: true,
116-
ForceNew: true,
117-
Description: `The GCP location for the TPU.`,
118-
},
119113
"cidr_block": {
120114
Type: schema.TypeString,
121115
Computed: true,
@@ -186,6 +180,13 @@ TPU Node to is a Shared VPC network, the node must be created with this this fie
186180
Default: false,
187181
ConflictsWith: []string{"cidr_block"},
188182
},
183+
"zone": {
184+
Type: schema.TypeString,
185+
Computed: true,
186+
Optional: true,
187+
ForceNew: true,
188+
Description: `The GCP location for the TPU. If it is not provided, the provider zone is used.`,
189+
},
189190
"network_endpoints": {
190191
Type: schema.TypeList,
191192
Computed: true,

google-beta/resource_vpc_access_connector.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,6 @@ func resourceVPCAccessConnector() *schema.Resource {
5959
ForceNew: true,
6060
Description: `Name of a VPC network.`,
6161
},
62-
"region": {
63-
Type: schema.TypeString,
64-
Required: true,
65-
ForceNew: true,
66-
Description: `Region where the VPC Access connector resides`,
67-
},
6862
"max_throughput": {
6963
Type: schema.TypeInt,
7064
Optional: true,
@@ -81,6 +75,13 @@ func resourceVPCAccessConnector() *schema.Resource {
8175
Description: `Minimum throughput of the connector in Mbps. Default and min is 200.`,
8276
Default: 200,
8377
},
78+
"region": {
79+
Type: schema.TypeString,
80+
Computed: true,
81+
Optional: true,
82+
ForceNew: true,
83+
Description: `Region where the VPC Access connector resides. If it is not provided, the provider region is used.`,
84+
},
8485
"self_link": {
8586
Type: schema.TypeString,
8687
Computed: true,

google-beta/resource_vpc_access_connector_generated_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ func testAccVPCAccessConnector_vpcAccessConnectorExample(context map[string]inte
5555
return Nprintf(`
5656
resource "google_vpc_access_connector" "connector" {
5757
name = "tf-test-vpc-con%{random_suffix}"
58-
region = "us-central1"
5958
ip_cidr_range = "10.8.0.0/28"
6059
network = "default"
6160
}

website/docs/r/memcache_instance.html.markdown

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ resource "google_service_networking_connection" "private_service_connection" {
6666
resource "google_memcache_instance" "instance" {
6767
provider = google-beta
6868
name = "test-instance"
69-
region = "us-central1"
7069
authorized_network = google_service_networking_connection.private_service_connection.network
7170
7271
node_config {
@@ -96,10 +95,6 @@ The following arguments are supported:
9695
Configuration for memcache nodes.
9796
Structure is documented below.
9897

99-
* `region` -
100-
(Required)
101-
The name of the Memcache region of the instance.
102-
10398

10499
The `node_config` block supports:
105100

@@ -145,6 +140,10 @@ The `node_config` block supports:
145140
User-specified parameters for this memcache instance.
146141
Structure is documented below.
147142

143+
* `region` -
144+
(Optional)
145+
The region of the Memcache instance. If it is not provided, the provider region is used.
146+
148147
* `project` - (Optional) The ID of the project in which the resource belongs.
149148
If it is not provided, the provider project is used.
150149

website/docs/r/tpu_node.html.markdown

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,6 @@ The following arguments are supported:
123123
(Required)
124124
The version of Tensorflow running in the Node.
125125

126-
* `zone` -
127-
(Required)
128-
The GCP location for the TPU.
129-
130126

131127
- - -
132128

@@ -169,6 +165,10 @@ The following arguments are supported:
169165
(Optional)
170166
Resource labels to represent user provided metadata.
171167

168+
* `zone` -
169+
(Optional)
170+
The GCP location for the TPU. If it is not provided, the provider zone is used.
171+
172172
* `project` - (Optional) The ID of the project in which the resource belongs.
173173
If it is not provided, the provider project is used.
174174

website/docs/r/vpc_access_connector.html.markdown

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ To get more information about Connector, see:
4242
```hcl
4343
resource "google_vpc_access_connector" "connector" {
4444
name = "vpc-con"
45-
region = "us-central1"
4645
ip_cidr_range = "10.8.0.0/28"
4746
network = "default"
4847
}
@@ -65,10 +64,6 @@ The following arguments are supported:
6564
(Required)
6665
The range of internal addresses that follows RFC 4632 notation. Example: `10.132.0.0/28`.
6766

68-
* `region` -
69-
(Required)
70-
Region where the VPC Access connector resides
71-
7267

7368
- - -
7469

@@ -81,6 +76,10 @@ The following arguments are supported:
8176
(Optional)
8277
Maximum throughput of the connector in Mbps, must be greater than `min_throughput`. Default is 1000.
8378

79+
* `region` -
80+
(Optional)
81+
Region where the VPC Access connector resides. If it is not provided, the provider region is used.
82+
8483
* `project` - (Optional) The ID of the project in which the resource belongs.
8584
If it is not provided, the provider project is used.
8685

0 commit comments

Comments
 (0)