@@ -1118,8 +1118,13 @@ func TestAccServer_PrivateNetwork(t *testing.T) {
11181118 Steps : []resource.TestStep {
11191119 {
11201120 Config : `
1121+ resource scaleway_vpc main {
1122+ region = "fr-par"
1123+ }
1124+
11211125 resource scaleway_vpc_private_network internal {
11221126 name = "private_network_instance"
1127+ vpc_id = scaleway_vpc.main.id
11231128 }
11241129
11251130 resource "scaleway_instance_server" "base" {
@@ -1146,8 +1151,11 @@ func TestAccServer_PrivateNetwork(t *testing.T) {
11461151 },
11471152 {
11481153 Config : `
1154+ resource scaleway_vpc main {}
1155+
11491156 resource scaleway_vpc_private_network pn01 {
11501157 name = "private_network_instance"
1158+ vpc_id = scaleway_vpc.main.id
11511159 }
11521160
11531161 resource "scaleway_instance_server" "base" {
@@ -1172,12 +1180,16 @@ func TestAccServer_PrivateNetwork(t *testing.T) {
11721180 },
11731181 {
11741182 Config : `
1183+ resource scaleway_vpc main {}
1184+
11751185 resource scaleway_vpc_private_network pn01 {
11761186 name = "private_network_instance"
1187+ vpc_id = scaleway_vpc.main.id
11771188 }
11781189
11791190 resource scaleway_vpc_private_network pn02 {
11801191 name = "private_network_instance_02"
1192+ vpc_id = scaleway_vpc.main.id
11811193 }
11821194
11831195 resource "scaleway_instance_server" "base" {
@@ -1201,12 +1213,16 @@ func TestAccServer_PrivateNetwork(t *testing.T) {
12011213 },
12021214 {
12031215 Config : `
1216+ resource scaleway_vpc main {}
1217+
12041218 resource scaleway_vpc_private_network pn01 {
12051219 name = "private_network_instance"
1220+ vpc_id = scaleway_vpc.main.id
12061221 }
12071222
12081223 resource scaleway_vpc_private_network pn02 {
12091224 name = "private_network_instance_02"
1225+ vpc_id = scaleway_vpc.main.id
12101226 }
12111227
12121228 resource "scaleway_instance_server" "base" {
@@ -1241,12 +1257,16 @@ func TestAccServer_PrivateNetwork(t *testing.T) {
12411257 },
12421258 {
12431259 Config : `
1260+ resource scaleway_vpc main {}
1261+
12441262 resource scaleway_vpc_private_network pn01 {
12451263 name = "private_network_instance"
1264+ vpc_id = scaleway_vpc.main.id
12461265 }
12471266
12481267 resource scaleway_vpc_private_network pn02 {
12491268 name = "private_network_instance_02"
1269+ vpc_id = scaleway_vpc.main.id
12501270 }
12511271
12521272 resource "scaleway_instance_server" "base" {
@@ -1980,7 +2000,11 @@ func TestAccServer_PrivateNetworkMissingPNIC(t *testing.T) {
19802000 Steps : []resource.TestStep {
19812001 {
19822002 Config : `
1983- resource scaleway_vpc_private_network pn {}
2003+ resource scaleway_vpc main {}
2004+
2005+ resource scaleway_vpc_private_network pn {
2006+ vpc_id = scaleway_vpc.main.id
2007+ }
19842008
19852009 resource "scaleway_instance_server" "main" {
19862010 image = "ubuntu_jammy"
@@ -2004,7 +2028,11 @@ func TestAccServer_PrivateNetworkMissingPNIC(t *testing.T) {
20042028 },
20052029 {
20062030 Config : `
2007- resource scaleway_vpc_private_network pn {}
2031+ resource scaleway_vpc main {}
2032+
2033+ resource scaleway_vpc_private_network pn {
2034+ vpc_id = scaleway_vpc.main.id
2035+ }
20082036
20092037 resource "scaleway_instance_server" "main" {
20102038 image = "ubuntu_jammy"
@@ -2037,7 +2065,11 @@ func TestAccServer_PrivateNetworkMissingPNIC(t *testing.T) {
20372065 },
20382066 { // We import private nic as a separate resource to trigger its deletion.
20392067 Config : `
2040- resource scaleway_vpc_private_network pn {}
2068+ resource scaleway_vpc main {}
2069+
2070+ resource scaleway_vpc_private_network pn {
2071+ vpc_id = scaleway_vpc.main.id
2072+ }
20412073
20422074 resource "scaleway_instance_server" "main" {
20432075 image = "ubuntu_jammy"
@@ -2085,7 +2117,11 @@ func TestAccServer_PrivateNetworkMissingPNIC(t *testing.T) {
20852117 },
20862118 {
20872119 Config : `
2088- resource scaleway_vpc_private_network pn {}
2120+ resource scaleway_vpc main {}
2121+
2122+ resource scaleway_vpc_private_network pn {
2123+ vpc_id = scaleway_vpc.main.id
2124+ }
20892125
20902126 resource "scaleway_instance_server" "main" {
20912127 image = "ubuntu_jammy"
@@ -2110,7 +2146,11 @@ func TestAccServer_PrivateNetworkMissingPNIC(t *testing.T) {
21102146 },
21112147 {
21122148 Config : `
2113- resource scaleway_vpc_private_network pn {}
2149+ resource scaleway_vpc main {}
2150+
2151+ resource scaleway_vpc_private_network pn {
2152+ vpc_id = scaleway_vpc.main.id
2153+ }
21142154
21152155 resource "scaleway_instance_server" "main" {
21162156 image = "ubuntu_jammy"
0 commit comments