Skip to content

Commit bf15a75

Browse files
committed
add doc and cassette
1 parent bdebb1b commit bf15a75

File tree

3 files changed

+1943
-2
lines changed

3 files changed

+1943
-2
lines changed
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
---
2+
subcategory: "Load Balancers"
3+
page_title: "Scaleway: scaleway_lb_private_network"
4+
---
5+
6+
# Resource: scaleway_lb_private_network
7+
8+
Creates and manages Scaleway Load Balancer Private Network attachments.
9+
10+
For more information, see the [main documentation](https://www.scaleway.com/en/docs/load-balancer/how-to/use-with-private-network/).
11+
12+
## Example Usage
13+
14+
### Basic
15+
16+
```terraform
17+
resource "scaleway_vpc" "vpc01" {
18+
name = "my vpc"
19+
}
20+
21+
resource "scaleway_vpc_private_network" "pn01" {
22+
vpc_id = scaleway_vpc.vpc01.id
23+
ipv4_subnet {
24+
subnet = "172.16.32.0/22"
25+
}
26+
}
27+
28+
resource "scaleway_ipam_ip" "ip01" {
29+
address = "172.16.32.7"
30+
source {
31+
private_network_id = scaleway_vpc_private_network.pn01.id
32+
}
33+
}
34+
35+
resource "scaleway_lb" "lb01" {
36+
name = "test-lb-private-network"
37+
type = "LB-S"
38+
}
39+
40+
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]
44+
}
45+
```
46+
47+
## Argument Reference
48+
49+
The following arguments are supported:
50+
51+
- `zone` - (Defaults to [provider](../index.md#zone) `zone`) The [zone](../guides/regions_and_zones.md#zones) in which the Private Network should be attached.
52+
- `project_id` - (Defaults to [provider](../index.md#project_id) `project_id`) The ID of the Project the Private Network attachment is associated with.
53+
- `lb_id` - (Required) The load-balancer ID to attach the private network to.
54+
- `private_network_id` - (Required) The private network ID to attach.
55+
- `ipam_ip_ids` - (Required) The IPAM ID of a pre-reserved IP address to assign to the Load Balancer on this Private Network.
56+
57+
## Attributes Reference
58+
59+
In addition to all arguments above, the following attributes are exported:
60+
61+
- `id` - The ID of the Private Network attachment, which is of the form `{zone}/{lb-id}/{private-network-id}` e.g. `fr-par-1/11111111-1111-1111-1111-111111111111/11111111-1111-1111-1111-111111111111`
62+
- `status` - The status of the Private Network attachment.
63+
- `created_at` - The date and time of the creation of the Private Network attachment (RFC 3339 format).
64+
- `updated_at` - The date and time of the last update of the Private Network attachment (RFC 3339 format).
65+
66+
## Import
67+
68+
Private Network attachments can be imported using `{zone}/{lb-id}/{private-network-id}`, e.g.
69+
70+
```bash
71+
terraform import scaleway_lb_private_network.lbpn01 fr-par-1/11111111-1111-1111-1111-111111111111/11111111-1111-1111-1111-111111111111
72+
```

internal/services/lb/private_network_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ func TestAccLBPrivateNetwork_Basic(t *testing.T) {
4242
}
4343
4444
resource "scaleway_lb_private_network" "lbpn01" {
45-
lb_id = scaleway_lb.lb01.id
46-
private_network_id = scaleway_vpc_private_network.pn01.id
45+
lb_id = scaleway_lb.lb01.id
46+
private_network_id = scaleway_vpc_private_network.pn01.id
4747
ipam_ip_ids = [scaleway_ipam_ip.ip01.id]
4848
}
4949
`,

0 commit comments

Comments
 (0)