Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(lb):clean up lb documentation #2421

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 60 additions & 50 deletions docs/resources/lb.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ resource "scaleway_vpc_public_gateway_ip" "main" {
}

### Scaleway Private Network
resource scaleway_vpc_private_network main {
resource "scaleway_vpc_private_network" "main" {
}

### VPC Public Gateway Network
Expand Down Expand Up @@ -81,27 +81,55 @@ resource "scaleway_instance_server" "main" {
}

### IP for LB IP
resource scaleway_lb_ip main {
resource "scaleway_lb_ip" "main" {
}

### Scaleway Private Network
resource scaleway_vpc_private_network "main" {
resource "scaleway_vpc_private_network" "main" {
name = "private network with static config"
}

### Scaleway Load Balancer
resource scaleway_lb 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"
}

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"]
}
}
```

### Scaleway Load Balancer with multiple private_network

```terraform
resource "scaleway_lb" "main" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you have self contained examples that can be copy and pasted in a stand alone way? You can see a preview of the document here: https://registry.terraform.io/tools/doc-preview

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
}

Expand All @@ -113,27 +141,41 @@ resource scaleway_lb main {

The following arguments are supported:

- `ip_id` - (Optional) The ID of the associated LB IP. See below.
- `assign_flexible_ip` - (Optional) Defines whether to automatically assign a flexible public IP to the load-balancer.

~> **Important:** Updates to `ip_id` will recreate the load-balancer.
- `description` - (Optional) The description of the load-balancer.

- `type` - (Required) The type of the load-balancer. Please check the [migration section](#migration) to upgrade the type.
- `ip_id` - (Optional) The ID of the associated LB IP. See below.

- `assign_flexible_ip` - (Optional) Defines whether to automatically assign a flexible public IP to the load-balancer.
~> **Important:** Updates to `ip_id` will recreate the load-balancer.

- `name` - (Optional) The name of the load-balancer.

- `description` - (Optional) The description of the load-balancer.
- `private_network` - (Optional) List of private network to connect with your load balancer.

- `tags` - (Optional) The tags associated with the load-balancers.
~> **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.

- `release_ip` - (Defaults to false) The release_ip allow release the ip address associated with the load-balancers.

- `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).

- `tags` - (Optional) The tags associated with the load-balancers.

- `type` - (Required) The type of the load-balancer. Please check the [migration section](#migration) to upgrade the type.

- `zone` - (Defaults to [provider](../index.md#zone) `zone`) The [zone](../guides/regions_and_zones.md#zones) of the load-balancer.

- `project_id` - (Defaults to [provider](../index.md#project_id) `project_id`) The ID of the project the load-balancer is associated with.

### Argument documentation for private_network block



## Attributes Reference

Expand All @@ -144,8 +186,13 @@ In addition to all arguments above, the following attributes are exported:
~> **Important:** Load-Balancers' IDs are [zoned](../guides/regions_and_zones.md#resource-ids), which means they are of the form `{zone}/{id}`, e.g. `fr-par-1/11111111-1111-1111-1111-111111111111`

- `ip_address` - The load-balance public IP Address

- `organization_id` - The organization ID the load-balancer is associated with.

- `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.

Expand Down Expand Up @@ -185,43 +232,6 @@ resource "scaleway_lb" "main" {
}
```

## Private Network with static config

```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"]
}
}
```

## Attributes Reference

- `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.


## Import

Load-Balancer can be imported using the `{zone}/{id}`, e.g.
Expand Down
Loading