diff --git a/mmv1/products/vpcaccess/api.yaml b/mmv1/products/vpcaccess/api.yaml index 49ca0fe63ac3..24e71e5faa1c 100644 --- a/mmv1/products/vpcaccess/api.yaml +++ b/mmv1/products/vpcaccess/api.yaml @@ -119,9 +119,10 @@ objects: name: maxThroughput # The API documentation says this will default to 200, but when I tried that I got an error that the minimum # throughput must be lower than the maximum. The console defaults to 1000, so I changed it to that. + # API returns 300 if it is not sent description: | - Maximum throughput of the connector in Mbps, must be greater than `min_throughput`. Default is 1000. - default_value: 1000 + Maximum throughput of the connector in Mbps, must be greater than `min_throughput`. Default is 300. + default_value: 300 - !ruby/object:Api::Type::String name: 'selfLink' description: | diff --git a/mmv1/third_party/terraform/tests/resource_vpc_access_connector_test.go.erb b/mmv1/third_party/terraform/tests/resource_vpc_access_connector_test.go.erb new file mode 100644 index 000000000000..d0dc5918167d --- /dev/null +++ b/mmv1/third_party/terraform/tests/resource_vpc_access_connector_test.go.erb @@ -0,0 +1,65 @@ +<% autogen_exception -%> +package google +<% unless version == 'ga' -%> + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +func TestAccVPCAccessConnector_vpcAccessConnectorThroughput(t *testing.T) { + t.Parallel() + + context := map[string]interface{}{ + "random_suffix": randString(t, 10), + } + + vcrTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProvidersOiCS, + CheckDestroy: testAccCheckVPCAccessConnectorDestroyProducer(t), + Steps: []resource.TestStep{ + { + Config: testAccVPCAccessConnector_vpcAccessConnectorThroughput(context), + }, + { + ResourceName: "google_vpc_access_connector.connector", + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func testAccVPCAccessConnector_vpcAccessConnectorThroughput(context map[string]interface{}) string { + return Nprintf(` +resource "google_vpc_access_connector" "connector" { + provider = google-beta + name = "tf-test-vpc-con%{random_suffix}" + subnet { + name = google_compute_subnetwork.custom_test.name + } + machine_type = "e2-standard-4" + min_instances = 2 + max_instances = 3 + region = "us-central1" +} + +resource "google_compute_subnetwork" "custom_test" { + provider = google-beta + name = "tf-test-vpc-con%{random_suffix}" + ip_cidr_range = "10.2.0.0/28" + region = "us-central1" + network = google_compute_network.custom_test.id +} + +resource "google_compute_network" "custom_test" { + provider = google-beta + name = "tf-test-vpc-con%{random_suffix}" + auto_create_subnetworks = false +} +`, context) +} + +<% end -%>