Skip to content

Commit 492da84

Browse files
fixed default for max_throughput (#4823) (#3294)
* fixed default for max_throughput * updated a test Signed-off-by: Modular Magician <[email protected]>
1 parent fbb7844 commit 492da84

File tree

5 files changed

+68
-5
lines changed

5 files changed

+68
-5
lines changed

.changelog/4823.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:bug
2+
vpcaccess: fixed permadiff when `max_throughput` is not set on `google_vpc_access_connector`
3+
```

google-beta/resource_dataproc_cluster_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ import (
1313
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
1414
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
1515

16-
"google.golang.org/api/googleapi"
17-
1816
dataproc "google.golang.org/api/dataproc/v1beta2"
17+
"google.golang.org/api/googleapi"
1918
)
2019

2120
func TestDataprocExtractInitTimeout(t *testing.T) {

google-beta/resource_vpc_access_connector.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ func resourceVPCAccessConnector() *schema.Resource {
7373
Optional: true,
7474
ForceNew: true,
7575
ValidateFunc: validation.IntBetween(200, 1000),
76-
Description: `Maximum throughput of the connector in Mbps, must be greater than 'min_throughput'. Default is 1000.`,
77-
Default: 1000,
76+
Description: `Maximum throughput of the connector in Mbps, must be greater than 'min_throughput'. Default is 300.`,
77+
Default: 300,
7878
},
7979
"min_instances": {
8080
Type: schema.TypeInt,
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
package google
2+
3+
import (
4+
"testing"
5+
6+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
7+
)
8+
9+
func TestAccVPCAccessConnector_vpcAccessConnectorThroughput(t *testing.T) {
10+
t.Parallel()
11+
12+
context := map[string]interface{}{
13+
"random_suffix": randString(t, 10),
14+
}
15+
16+
vcrTest(t, resource.TestCase{
17+
PreCheck: func() { testAccPreCheck(t) },
18+
Providers: testAccProvidersOiCS,
19+
CheckDestroy: testAccCheckVPCAccessConnectorDestroyProducer(t),
20+
Steps: []resource.TestStep{
21+
{
22+
Config: testAccVPCAccessConnector_vpcAccessConnectorThroughput(context),
23+
},
24+
{
25+
ResourceName: "google_vpc_access_connector.connector",
26+
ImportState: true,
27+
ImportStateVerify: true,
28+
},
29+
},
30+
})
31+
}
32+
33+
func testAccVPCAccessConnector_vpcAccessConnectorThroughput(context map[string]interface{}) string {
34+
return Nprintf(`
35+
resource "google_vpc_access_connector" "connector" {
36+
provider = google-beta
37+
name = "tf-test-vpc-con%{random_suffix}"
38+
subnet {
39+
name = google_compute_subnetwork.custom_test.name
40+
}
41+
machine_type = "e2-standard-4"
42+
min_instances = 2
43+
max_instances = 3
44+
region = "us-central1"
45+
}
46+
47+
resource "google_compute_subnetwork" "custom_test" {
48+
provider = google-beta
49+
name = "tf-test-vpc-con%{random_suffix}"
50+
ip_cidr_range = "10.2.0.0/28"
51+
region = "us-central1"
52+
network = google_compute_network.custom_test.id
53+
}
54+
55+
resource "google_compute_network" "custom_test" {
56+
provider = google-beta
57+
name = "tf-test-vpc-con%{random_suffix}"
58+
auto_create_subnetworks = false
59+
}
60+
`, context)
61+
}

website/docs/r/vpc_access_connector.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ The following arguments are supported:
118118

119119
* `max_throughput` -
120120
(Optional)
121-
Maximum throughput of the connector in Mbps, must be greater than `min_throughput`. Default is 1000.
121+
Maximum throughput of the connector in Mbps, must be greater than `min_throughput`. Default is 300.
122122

123123
* `subnet` -
124124
(Optional, [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html))

0 commit comments

Comments
 (0)