Skip to content

Commit 9de7649

Browse files
Update netapp tests to use bootstrapped networks (#13877) (#983)
[upstream:2bd90791ede9b76e572fd50cb52628d6995c3c43] Signed-off-by: Modular Magician <[email protected]>
1 parent 45fc5a9 commit 9de7649

File tree

1 file changed

+2
-31
lines changed

1 file changed

+2
-31
lines changed

Storage_pool_create/main.tf

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,7 @@
1-
# Create a network or use datasource to reference existing network
2-
resource "google_compute_network" "peering_network" {
1+
data "google_compute_network" "default" {
32
name = "test-network-${local.name_suffix}"
43
}
54

6-
# Reserve a CIDR for NetApp Volumes to use
7-
# When using shared-VPCs, this resource needs to be created in host project
8-
resource "google_compute_global_address" "private_ip_alloc" {
9-
name = "test-address-${local.name_suffix}"
10-
purpose = "VPC_PEERING"
11-
address_type = "INTERNAL"
12-
prefix_length = 16
13-
network = google_compute_network.peering_network.id
14-
}
15-
16-
# Create a Private Service Access connection
17-
# When using shared-VPCs, this resource needs to be created in host project
18-
resource "google_service_networking_connection" "default" {
19-
network = google_compute_network.peering_network.id
20-
service = "netapp.servicenetworking.goog"
21-
reserved_peering_ranges = [google_compute_global_address.private_ip_alloc.name]
22-
}
23-
24-
# Modify the PSA Connection to allow import/export of custom routes
25-
# When using shared-VPCs, this resource needs to be created in host project
26-
resource "google_compute_network_peering_routes_config" "route_updates" {
27-
peering = google_service_networking_connection.default.peering
28-
network = google_compute_network.peering_network.name
29-
30-
import_custom_routes = true
31-
export_custom_routes = true
32-
}
33-
345
# Create a storage pool
356
# Create this resource in the project which is expected to own the volumes
367
resource "google_netapp_storage_pool" "test_pool" {
@@ -39,5 +10,5 @@ resource "google_netapp_storage_pool" "test_pool" {
3910
location = "us-central1"
4011
service_level = "PREMIUM"
4112
capacity_gib = "2048"
42-
network = google_compute_network.peering_network.id
13+
network = data.google_compute_network.default.id
4314
}

0 commit comments

Comments
 (0)