Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions mmv1/products/vpcaccess/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
Original file line number Diff line number Diff line change
@@ -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 -%>