Skip to content

Commit ba3ce65

Browse files
committed
fix
1 parent 3deee58 commit ba3ce65

File tree

3 files changed

+18
-15
lines changed

3 files changed

+18
-15
lines changed

internal/services/lb/private_network_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package lb_test
33
import (
44
"testing"
55

6-
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
6+
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
77
"github.com/scaleway/terraform-provider-scaleway/v2/internal/acctest"
88
)
99

@@ -13,6 +13,7 @@ func TestAccLBPrivateNetwork_Basic(t *testing.T) {
1313
resource.ParallelTest(t, resource.TestCase{
1414
PreCheck: func() { acctest.PreCheck(t) },
1515
ProviderFactories: tt.ProviderFactories,
16+
CheckDestroy: isLbDestroyed(tt),
1617
Steps: []resource.TestStep{
1718
{
1819
Config: `

templates/resources/lb.md.tmpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ The following arguments are supported:
109109
- `private_network_id` - (Required) The ID of the Private Network to attach to.
110110
- ~> **Important:** Updates to `private_network` will recreate the attachment.
111111
- `ipam_ids` - (Optional) IPAM ID of a pre-reserved IP address to assign to the Load Balancer on this Private Network.
112+
- `external_private_networks` - (Defaults to `false`) A boolean to specify whether to use [lb_private_network](../resources/lb_private_network.md).
113+
If `external_private_networks` is set to `true`, `private_network` can not be set directly in the Load Balancer.
112114
- `ssl_compatibility_level` - (Optional) Enforces minimal SSL version (in SSL/TLS offloading context). Please check [possible values](https://www.scaleway.com/en/developers/api/load-balancer/zoned-api/#path-load-balancer-create-a-load-balancer).
113115
- `zone` - (Defaults to [provider](../index.md#zone) `zone`) The [zone](../guides/regions_and_zones.md#zones) of the Load Balancer.
114116
- `project_id` - (Defaults to [provider](../index.md#project_id) `project_id`) The ID of the Project the Load Balancer is associated with.

templates/resources/lb_private_network.md.tmpl

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,32 +15,32 @@ For more information, see the [main documentation](https://www.scaleway.com/en/d
1515

1616
```terraform
1717
resource "scaleway_vpc" "vpc01" {
18-
name = "my vpc"
18+
name = "my vpc"
1919
}
2020

2121
resource "scaleway_vpc_private_network" "pn01" {
22-
vpc_id = scaleway_vpc.vpc01.id
23-
ipv4_subnet {
24-
subnet = "172.16.32.0/22"
25-
}
22+
vpc_id = scaleway_vpc.vpc01.id
23+
ipv4_subnet {
24+
subnet = "172.16.32.0/22"
25+
}
2626
}
2727

2828
resource "scaleway_ipam_ip" "ip01" {
29-
address = "172.16.32.7"
30-
source {
31-
private_network_id = scaleway_vpc_private_network.pn01.id
32-
}
29+
address = "172.16.32.7"
30+
source {
31+
private_network_id = scaleway_vpc_private_network.pn01.id
32+
}
3333
}
3434

3535
resource "scaleway_lb" "lb01" {
36-
name = "test-lb-private-network"
37-
type = "LB-S"
36+
name = "test-lb-private-network"
37+
type = "LB-S"
3838
}
3939

4040
resource "scaleway_lb_private_network" "lbpn01" {
41-
lb_id = scaleway_lb.lb01.id
42-
private_network_id = scaleway_vpc_private_network.pn01.id
43-
ipam_ip_ids = [scaleway_ipam_ip.ip01.id]
41+
lb_id = scaleway_lb.lb01.id
42+
private_network_id = scaleway_vpc_private_network.pn01.id
43+
ipam_ip_ids = [scaleway_ipam_ip.ip01.id]
4444
}
4545
```
4646

0 commit comments

Comments
 (0)