@@ -14,6 +14,7 @@ func TestAccNetappStoragePool_storagePoolCreateExample_update(t *testing.T) {
14
14
t .Parallel ()
15
15
16
16
context := map [string ]interface {}{
17
+ "network_name" : acctest .BootstrapSharedServiceNetworkingConnection (t , "gcnv-network-config-1" , acctest .ServiceNetworkWithParentService ("netapp.servicenetworking.goog" )),
17
18
"random_suffix" : acctest .RandString (t , 10 ),
18
19
}
19
20
@@ -46,32 +47,16 @@ func TestAccNetappStoragePool_storagePoolCreateExample_update(t *testing.T) {
46
47
func testAccNetappStoragePool_storagePoolCreateExample_full (context map [string ]interface {}) string {
47
48
return acctest .Nprintf (`
48
49
49
- resource "google_compute_network" "peering_network" {
50
- name = "tf-test-network%{random_suffix}"
51
- }
52
-
53
- # Create an IP address
54
- resource "google_compute_global_address" "private_ip_alloc" {
55
- name = "tf-test-address%{random_suffix}"
56
- purpose = "VPC_PEERING"
57
- address_type = "INTERNAL"
58
- prefix_length = 16
59
- network = google_compute_network.peering_network.id
60
- }
61
-
62
- # Create a private connection
63
- resource "google_service_networking_connection" "default" {
64
- network = google_compute_network.peering_network.id
65
- service = "netapp.servicenetworking.goog"
66
- reserved_peering_ranges = [google_compute_global_address.private_ip_alloc.name]
50
+ data "google_compute_network" "default" {
51
+ name = "%{network_name}"
67
52
}
68
53
69
54
resource "google_netapp_storage_pool" "test_pool" {
70
55
name = "tf-test-pool%{random_suffix}"
71
56
location = "us-central1"
72
57
service_level = "PREMIUM"
73
58
capacity_gib = "2048"
74
- network = google_compute_network.peering_network .id
59
+ network = data. google_compute_network.default .id
75
60
active_directory = ""
76
61
description = "this is a test description"
77
62
kms_config = ""
@@ -88,32 +73,16 @@ resource "google_netapp_storage_pool" "test_pool" {
88
73
func testAccNetappStoragePool_storagePoolCreateExample_update (context map [string ]interface {}) string {
89
74
return acctest .Nprintf (`
90
75
91
- resource "google_compute_network" "peering_network" {
92
- name = "tf-test-network%{random_suffix}"
93
- }
94
-
95
- # Create an IP address
96
- resource "google_compute_global_address" "private_ip_alloc" {
97
- name = "tf-test-address%{random_suffix}"
98
- purpose = "VPC_PEERING"
99
- address_type = "INTERNAL"
100
- prefix_length = 16
101
- network = google_compute_network.peering_network.id
102
- }
103
-
104
- # Create a private connection
105
- resource "google_service_networking_connection" "default" {
106
- network = google_compute_network.peering_network.id
107
- service = "netapp.servicenetworking.goog"
108
- reserved_peering_ranges = [google_compute_global_address.private_ip_alloc.name]
76
+ data "google_compute_network" "default" {
77
+ name = "%{network_name}"
109
78
}
110
79
111
80
resource "google_netapp_storage_pool" "test_pool" {
112
81
name = "tf-test-pool%{random_suffix}"
113
82
location = "us-central1"
114
83
service_level = "PREMIUM"
115
84
capacity_gib = "4096"
116
- network = google_compute_network.peering_network .id
85
+ network = data. google_compute_network.default .id
117
86
active_directory = ""
118
87
description = "this is test"
119
88
kms_config = ""
@@ -156,32 +125,16 @@ func TestAccNetappStoragePool_autoTieredStoragePoolCreateExample_update(t *testi
156
125
157
126
func testAccNetappStoragePool_autoTieredStoragePoolCreateExample_full (context map [string ]interface {}) string {
158
127
return acctest .Nprintf (`
159
- resource "google_compute_network" "peering_network" {
160
- name = "tf-test-network%{random_suffix}"
161
- }
162
-
163
- # Create an IP address
164
- resource "google_compute_global_address" "private_ip_alloc" {
165
- name = "tf-test-address%{random_suffix}"
166
- purpose = "VPC_PEERING"
167
- address_type = "INTERNAL"
168
- prefix_length = 16
169
- network = google_compute_network.peering_network.id
170
- }
171
-
172
- # Create a private connection
173
- resource "google_service_networking_connection" "default" {
174
- network = google_compute_network.peering_network.id
175
- service = "netapp.servicenetworking.goog"
176
- reserved_peering_ranges = [google_compute_global_address.private_ip_alloc.name]
128
+ data "google_compute_network" "default" {
129
+ name = "%{network_name}"
177
130
}
178
131
179
132
resource "google_netapp_storage_pool" "test_pool" {
180
133
name = "tf-test-pool%{random_suffix}"
181
134
location = "us-east4"
182
135
service_level = "PREMIUM"
183
136
capacity_gib = "2048"
184
- network = google_compute_network.peering_network .id
137
+ network = data. google_compute_network.default .id
185
138
active_directory = ""
186
139
description = "this is a test description"
187
140
kms_config = ""
0 commit comments