From 82c7b9488bc2c9e895eba08ab664ab79486248f8 Mon Sep 17 00:00:00 2001 From: The Magician Date: Tue, 18 Jun 2024 10:45:20 -0700 Subject: [PATCH] Make `google_vpc_access_connector` acc tests use a bootstrapped VPC network (#10995) (#7560) [upstream:207c6125a1bf60f774074a895b3cbecb6259be69] Signed-off-by: Modular Magician --- .changelog/10995.txt | 3 +++ .../resource_vpc_access_connector_generated_test.go | 11 ++++------- website/docs/r/vpc_access_connector.html.markdown | 7 +------ 3 files changed, 8 insertions(+), 13 deletions(-) create mode 100644 .changelog/10995.txt diff --git a/.changelog/10995.txt b/.changelog/10995.txt new file mode 100644 index 0000000000..42b910df15 --- /dev/null +++ b/.changelog/10995.txt @@ -0,0 +1,3 @@ +```release-note:none + +``` \ No newline at end of file diff --git a/google-beta/services/vpcaccess/resource_vpc_access_connector_generated_test.go b/google-beta/services/vpcaccess/resource_vpc_access_connector_generated_test.go index 2cd5e7b781..06e4cccd94 100644 --- a/google-beta/services/vpcaccess/resource_vpc_access_connector_generated_test.go +++ b/google-beta/services/vpcaccess/resource_vpc_access_connector_generated_test.go @@ -34,6 +34,7 @@ func TestAccVPCAccessConnector_vpcAccessConnectorExample(t *testing.T) { t.Parallel() context := map[string]interface{}{ + "network_name": acctest.BootstrapSharedServiceNetworkingConnection(t, "vpc-access-connector"), "random_suffix": acctest.RandString(t, 10), } @@ -60,7 +61,7 @@ func testAccVPCAccessConnector_vpcAccessConnectorExample(context map[string]inte resource "google_vpc_access_connector" "connector" { name = "tf-test-vpc-con%{random_suffix}" ip_cidr_range = "10.8.0.0/28" - network = "default" + network = "%{network_name}" } `, context) } @@ -69,6 +70,7 @@ func TestAccVPCAccessConnector_vpcAccessConnectorSharedVpcExample(t *testing.T) t.Parallel() context := map[string]interface{}{ + "network_name": acctest.BootstrapSharedServiceNetworkingConnection(t, "vpc-access-connector"), "random_suffix": acctest.RandString(t, 10), } @@ -104,12 +106,7 @@ resource "google_compute_subnetwork" "custom_test" { 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" { - name = "tf-test-vpc-con%{random_suffix}" - auto_create_subnetworks = false + network = "%{network_name}" } `, context) } diff --git a/website/docs/r/vpc_access_connector.html.markdown b/website/docs/r/vpc_access_connector.html.markdown index d5073bfefb..99b8055b41 100644 --- a/website/docs/r/vpc_access_connector.html.markdown +++ b/website/docs/r/vpc_access_connector.html.markdown @@ -64,12 +64,7 @@ resource "google_compute_subnetwork" "custom_test" { name = "vpc-con" ip_cidr_range = "10.2.0.0/28" region = "us-central1" - network = google_compute_network.custom_test.id -} - -resource "google_compute_network" "custom_test" { - name = "vpc-con" - auto_create_subnetworks = false + network = "default" } ```