From 3ade138c3b602b3d82ca815be2f3a3688b8e0f85 Mon Sep 17 00:00:00 2001 From: lmasson Date: Tue, 27 Feb 2024 16:10:36 +0100 Subject: [PATCH] fix(lb):clean up documentation --- docs/resources/lb.md | 67 ++++++++++++++++++++------------------------ 1 file changed, 31 insertions(+), 36 deletions(-) diff --git a/docs/resources/lb.md b/docs/resources/lb.md index 9e831a6d0..4d517d02f 100644 --- a/docs/resources/lb.md +++ b/docs/resources/lb.md @@ -92,46 +92,48 @@ resource "scaleway_vpc_private_network" "main" { resource "scaleway_vpc_private_network" "second" { name = "private network with DHCP config" } +``` + +## Private Network with static config + +```terraform +resource "scaleway_lb_ip" "main" { +} + +resource "scaleway_vpc_private_network" "main" { + name = "MyTest" +} -### Scaleway Load Balancer with multiple private_network resource "scaleway_lb" "main" { ip_id = scaleway_lb_ip.main.id name = "MyTest" type = "LB-S" - private_network { private_network_id = scaleway_vpc_private_network.main.id static_config = ["172.16.0.100"] } - - private_network { - private_network_id = scaleway_vpc_private_network.second.id - dhcp_config = true - } - - depends_on = [scaleway_vpc_public_gateway.main] } ``` -## Private Network with static config +### Scaleway Load Balancer with multiple private_network ```terraform -resource "scaleway_lb_ip" "main" { -} - -resource "scaleway_vpc_private_network" "main" { - name = "MyTest" -} - resource "scaleway_lb" "main" { ip_id = scaleway_lb_ip.main.id name = "MyTest" type = "LB-S" - release_ip = false + private_network { private_network_id = scaleway_vpc_private_network.main.id static_config = ["172.16.0.100"] } + + private_network { + private_network_id = scaleway_vpc_private_network.second.id + dhcp_config = true + } + + depends_on = [scaleway_vpc_public_gateway.main] } ``` @@ -149,7 +151,14 @@ The following arguments are supported: - `name` - (Optional) The name of the load-balancer. -- `private_network` - (Optional) List of private network to connect with your load balancer. Private Network documented below. +- `private_network` - (Optional) List of private network to connect with your load balancer. + + ~> **Important:** Updates to `private_network` will recreate the attachment. + - `private_network_id` - (Required) The ID of the Private Network to associate. + - `static_config` - (Optional) Define a local ip address of your choice for the load balancer instance. See + - `dhcp_config` - (Optional) Set to true if you want to let DHCP assign IP addresses. + +~> **Important:** Only one of static_config and dhcp_config may be set. - `project_id` - (Defaults to [provider](../index.md#project_id) `project_id`) The ID of the project the load-balancer is associated with. @@ -166,17 +175,7 @@ The following arguments are supported: ### Argument documentation for private_network block -- `private_network_id` - (Required) The ID of the Private Network to associate. -- ~> **Important:** Updates to `private_network` will recreate the attachment. - -- `static_config` - (Optional) Define a local ip address of your choice for the load balancer instance. See below. - -- `dhcp_config` - (Optional) Set to true if you want to let DHCP assign IP addresses. See below. - -~> **Important:** Only one of static_config and dhcp_config may be set. - -- `zone` - (Defaults to [provider](../index.md#zone) `zone`) The [zone](../guides/regions_and_zones.md#zones) in which the private network was created. ## Attributes Reference @@ -190,17 +189,13 @@ In addition to all arguments above, the following attributes are exported: - `organization_id` - The organization ID the load-balancer is associated with. -- `private_network` - List of private network to connect with your load balancer. Private Network documented below. +- `private_network` - List of private network to connect with your load balancer. + - `status` - The status of the private network connection. + - `zone` - (Defaults to [provider](../index.md#zone) `zone`) The [zone](../guides/regions_and_zones.md#zones) in which the private network was created. ~> **Important:** `release_ip` will not be supported. This prevents the destruction of the IP from releasing a LBs. The `resource_lb_ip` will be the only resource that handles those IPs. -### Attributes documentation for private_network block - -- `status` - The status of the private network connection. - -- `zone` - (Defaults to [provider](../index.md#zone) `zone`) The [zone](../guides/regions_and_zones.md#zones) in which the private network was created. - ## Migration In order to migrate to other types you can check the migration up or down via our CLI `scw lb lb-types list`.