@@ -49,7 +49,7 @@ func TestAccComputeSubnetwork_subnetworkBasicExample(t *testing.T) {
49
49
ResourceName : "google_compute_subnetwork.network-with-private-secondary-ip-ranges" ,
50
50
ImportState : true ,
51
51
ImportStateVerify : true ,
52
- ImportStateVerifyIgnore : []string {"network" , "region" , "reserved_internal_range" },
52
+ ImportStateVerifyIgnore : []string {"ip_collection" , " network" , "region" , "reserved_internal_range" },
53
53
},
54
54
},
55
55
})
@@ -94,7 +94,7 @@ func TestAccComputeSubnetwork_subnetworkLoggingConfigExample(t *testing.T) {
94
94
ResourceName : "google_compute_subnetwork.subnet-with-logging" ,
95
95
ImportState : true ,
96
96
ImportStateVerify : true ,
97
- ImportStateVerifyIgnore : []string {"network" , "region" , "reserved_internal_range" },
97
+ ImportStateVerifyIgnore : []string {"ip_collection" , " network" , "region" , "reserved_internal_range" },
98
98
},
99
99
},
100
100
})
@@ -141,7 +141,7 @@ func TestAccComputeSubnetwork_subnetworkIpv6Example(t *testing.T) {
141
141
ResourceName : "google_compute_subnetwork.subnetwork-ipv6" ,
142
142
ImportState : true ,
143
143
ImportStateVerify : true ,
144
- ImportStateVerifyIgnore : []string {"network" , "region" , "reserved_internal_range" },
144
+ ImportStateVerifyIgnore : []string {"ip_collection" , " network" , "region" , "reserved_internal_range" },
145
145
},
146
146
},
147
147
})
@@ -187,7 +187,7 @@ func TestAccComputeSubnetwork_subnetworkInternalIpv6Example(t *testing.T) {
187
187
ResourceName : "google_compute_subnetwork.subnetwork-internal-ipv6" ,
188
188
ImportState : true ,
189
189
ImportStateVerify : true ,
190
- ImportStateVerifyIgnore : []string {"network" , "region" , "reserved_internal_range" },
190
+ ImportStateVerifyIgnore : []string {"ip_collection" , " network" , "region" , "reserved_internal_range" },
191
191
},
192
192
},
193
193
})
@@ -234,7 +234,7 @@ func TestAccComputeSubnetwork_subnetworkIpv6OnlyInternalExample(t *testing.T) {
234
234
ResourceName : "google_compute_subnetwork.subnetwork-ipv6-only" ,
235
235
ImportState : true ,
236
236
ImportStateVerify : true ,
237
- ImportStateVerifyIgnore : []string {"network" , "region" , "reserved_internal_range" },
237
+ ImportStateVerifyIgnore : []string {"ip_collection" , " network" , "region" , "reserved_internal_range" },
238
238
},
239
239
},
240
240
})
@@ -258,6 +258,50 @@ resource "google_compute_network" "custom-test" {
258
258
` , context )
259
259
}
260
260
261
+ func TestAccComputeSubnetwork_subnetworkWithSubnetModePdpExample (t * testing.T ) {
262
+ t .Parallel ()
263
+
264
+ context := map [string ]interface {}{
265
+ "ip_collection_url" : "projects/tf-static-byoip/regions/us-central1/publicDelegatedPrefixes/tf-test-subnet-mode-pdp" ,
266
+ "random_suffix" : acctest .RandString (t , 10 ),
267
+ }
268
+
269
+ acctest .VcrTest (t , resource.TestCase {
270
+ PreCheck : func () { acctest .AccTestPreCheck (t ) },
271
+ ProtoV5ProviderFactories : acctest .ProtoV5ProviderFactories (t ),
272
+ CheckDestroy : testAccCheckComputeSubnetworkDestroyProducer (t ),
273
+ Steps : []resource.TestStep {
274
+ {
275
+ Config : testAccComputeSubnetwork_subnetworkWithSubnetModePdpExample (context ),
276
+ },
277
+ {
278
+ ResourceName : "google_compute_subnetwork.subnetwork-with-subnet-mode-pdp" ,
279
+ ImportState : true ,
280
+ ImportStateVerify : true ,
281
+ ImportStateVerifyIgnore : []string {"ip_collection" , "network" , "region" , "reserved_internal_range" },
282
+ },
283
+ },
284
+ })
285
+ }
286
+
287
+ func testAccComputeSubnetwork_subnetworkWithSubnetModePdpExample (context map [string ]interface {}) string {
288
+ return acctest .Nprintf (`
289
+ resource "google_compute_subnetwork" "subnetwork-with-subnet-mode-pdp" {
290
+ name = "tf-test-subnet-mode-pdp-subnet%{random_suffix}"
291
+ region = "us-central1"
292
+ network = google_compute_network.custom-test-network.id
293
+ stack_type = "IPV6_ONLY"
294
+ ipv6_access_type = "EXTERNAL"
295
+ ip_collection = "%{ip_collection_url}"
296
+ }
297
+
298
+ resource "google_compute_network" "custom-test-network" {
299
+ name = "tf-test-network-byoipv6-external%{random_suffix}"
300
+ auto_create_subnetworks = false
301
+ }
302
+ ` , context )
303
+ }
304
+
261
305
func TestAccComputeSubnetwork_subnetworkIpv6OnlyExternalExample (t * testing.T ) {
262
306
t .Parallel ()
263
307
@@ -277,7 +321,7 @@ func TestAccComputeSubnetwork_subnetworkIpv6OnlyExternalExample(t *testing.T) {
277
321
ResourceName : "google_compute_subnetwork.subnetwork-ipv6-only" ,
278
322
ImportState : true ,
279
323
ImportStateVerify : true ,
280
- ImportStateVerifyIgnore : []string {"network" , "region" , "reserved_internal_range" },
324
+ ImportStateVerifyIgnore : []string {"ip_collection" , " network" , "region" , "reserved_internal_range" },
281
325
},
282
326
},
283
327
})
0 commit comments