Skip to content

Commit 3ef9362

Browse files
authored
doc(lb): update static_config doc (#1685)
1 parent c8ac8c5 commit 3ef9362

File tree

4 files changed

+703
-713
lines changed

4 files changed

+703
-713
lines changed

docs/resources/lb.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ resource scaleway_lb main {
8686
8787
private_network {
8888
private_network_id = scaleway_vpc_private_network.main.id
89-
static_config = ["172.16.0.100", "172.16.0.101"]
89+
static_config = ["172.16.0.100"]
9090
}
9191
9292
private_network {
@@ -186,7 +186,7 @@ resource scaleway_lb main {
186186
release_ip = false
187187
private_network {
188188
private_network_id = scaleway_vpc_private_network.main.id
189-
static_config = ["172.16.0.100", "172.16.0.101"]
189+
static_config = ["172.16.0.100"]
190190
}
191191
}
192192
```
@@ -197,7 +197,7 @@ resource scaleway_lb main {
197197

198198
- ~> **Important:** Updates to `private_network` will recreate the attachment.
199199

200-
- `static_config` - (Optional) Define two local ip address of your choice for each load balancer instance. See below.
200+
- `static_config` - (Optional) Define a local ip address of your choice for the load balancer instance. See below.
201201

202202
- `dhcp_config` - (Optional) Set to true if you want to let DHCP assign IP addresses. See below.
203203

scaleway/resource_lb.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ func resourceScalewayLb() *schema.Resource {
105105
Type: schema.TypeString,
106106
ValidateFunc: validation.IsIPAddress,
107107
},
108+
MaxItems: 1,
108109
},
109110
"dhcp_config": {
110111
Description: "Set to true if you want to let DHCP assign IP addresses",

scaleway/resource_lb_test.go

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ func TestAccScalewayLbLb_WithIP(t *testing.T) {
255255
release_ip = false
256256
private_network {
257257
private_network_id = scaleway_vpc_private_network.pnLB01.id
258-
static_config = ["172.16.0.100", "172.16.0.101"]
258+
static_config = ["172.16.0.100"]
259259
}
260260
}
261261
`,
@@ -265,8 +265,6 @@ func TestAccScalewayLbLb_WithIP(t *testing.T) {
265265
resource.TestCheckResourceAttrSet("scaleway_vpc_private_network.pnLB01", "name"),
266266
resource.TestCheckResourceAttr("scaleway_lb.lb01",
267267
"private_network.0.static_config.0", "172.16.0.100"),
268-
resource.TestCheckResourceAttr("scaleway_lb.lb01",
269-
"private_network.0.static_config.1", "172.16.0.101"),
270268
),
271269
},
272270
{
@@ -289,12 +287,12 @@ func TestAccScalewayLbLb_WithIP(t *testing.T) {
289287
release_ip = false
290288
private_network {
291289
private_network_id = scaleway_vpc_private_network.pnLB01.id
292-
static_config = ["172.16.0.100", "172.16.0.101"]
290+
static_config = ["172.16.0.100"]
293291
}
294292
295293
private_network {
296294
private_network_id = scaleway_vpc_private_network.pnLB02.id
297-
static_config = ["172.16.0.105", "172.16.0.106"]
295+
static_config = ["172.16.0.105"]
298296
}
299297
}
300298
`,
@@ -303,12 +301,8 @@ func TestAccScalewayLbLb_WithIP(t *testing.T) {
303301
resource.TestCheckResourceAttr("scaleway_lb.lb01", "private_network.#", "2"),
304302
resource.TestCheckResourceAttr("scaleway_lb.lb01",
305303
"private_network.0.static_config.0", "172.16.0.100"),
306-
resource.TestCheckResourceAttr("scaleway_lb.lb01",
307-
"private_network.0.static_config.1", "172.16.0.101"),
308304
resource.TestCheckResourceAttr("scaleway_lb.lb01",
309305
"private_network.1.static_config.0", "172.16.0.105"),
310-
resource.TestCheckResourceAttr("scaleway_lb.lb01",
311-
"private_network.1.static_config.1", "172.16.0.106"),
312306
),
313307
},
314308
{
@@ -331,12 +325,12 @@ func TestAccScalewayLbLb_WithIP(t *testing.T) {
331325
release_ip = false
332326
private_network {
333327
private_network_id = scaleway_vpc_private_network.pnLB01.id
334-
static_config = ["172.16.0.100", "172.16.0.101"]
328+
static_config = ["172.16.0.100"]
335329
}
336330
337331
private_network {
338332
private_network_id = scaleway_vpc_private_network.pnLB02.id
339-
static_config = ["172.16.0.105", "172.16.0.107"]
333+
static_config = ["172.16.0.107"]
340334
}
341335
}
342336
`,
@@ -346,11 +340,7 @@ func TestAccScalewayLbLb_WithIP(t *testing.T) {
346340
resource.TestCheckResourceAttr("scaleway_lb.lb01",
347341
"private_network.0.static_config.0", "172.16.0.100"),
348342
resource.TestCheckResourceAttr("scaleway_lb.lb01",
349-
"private_network.0.static_config.1", "172.16.0.101"),
350-
resource.TestCheckResourceAttr("scaleway_lb.lb01",
351-
"private_network.1.static_config.0", "172.16.0.105"),
352-
resource.TestCheckResourceAttr("scaleway_lb.lb01",
353-
"private_network.1.static_config.1", "172.16.0.107"),
343+
"private_network.1.static_config.0", "172.16.0.107"),
354344
),
355345
},
356346
{
@@ -373,7 +363,7 @@ func TestAccScalewayLbLb_WithIP(t *testing.T) {
373363
release_ip = false
374364
private_network {
375365
private_network_id = scaleway_vpc_private_network.pnLB01.id
376-
static_config = ["172.16.0.100", "172.16.0.101"]
366+
static_config = ["172.16.0.100"]
377367
}
378368
}
379369
`,
@@ -382,7 +372,6 @@ func TestAccScalewayLbLb_WithIP(t *testing.T) {
382372
resource.TestCheckResourceAttrSet("scaleway_vpc_private_network.pnLB02", "name"),
383373
resource.TestCheckResourceAttr("scaleway_lb.lb01", "private_network.#", "1"),
384374
resource.TestCheckResourceAttr("scaleway_lb.lb01", "private_network.0.static_config.0", "172.16.0.100"),
385-
resource.TestCheckResourceAttr("scaleway_lb.lb01", "private_network.0.static_config.1", "172.16.0.101"),
386375
),
387376
},
388377
{

0 commit comments

Comments
 (0)