mirror of
https://github.com/oscarhermoso/terraform-provider-binarylane
synced 2026-10-21 22:09:15 +11:00
96 lines
3.8 KiB
Markdown
96 lines
3.8 KiB
Markdown
---
|
|
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
|
page_title: "binarylane_load_balancer Resource - terraform-provider-binarylane"
|
|
subcategory: ""
|
|
description: |-
|
|
Provides a BinaryLane Load Balancer resource. This can be used to create, update, and delete load balancers. See the docs https://support.binarylane.com.au/support/solutions/articles/1000025661-load-balancer for more information.
|
|
---
|
|
|
|
# binarylane_load_balancer (Resource)
|
|
|
|
Provides a BinaryLane Load Balancer resource. This can be used to create, update, and delete load balancers. See [the docs](https://support.binarylane.com.au/support/solutions/articles/1000025661-load-balancer) for more information.
|
|
|
|
## Example Usage
|
|
|
|
```terraform
|
|
resource "binarylane_server" "example" {
|
|
count = 2
|
|
# ...
|
|
}
|
|
|
|
resource "binarylane_load_balancer" "example" {
|
|
name = "tf-example-lb"
|
|
forwarding_rules = [{ entry_protocol = "https" }]
|
|
server_ids = [
|
|
binarylane_server.example.0.id,
|
|
binarylane_server.example.1.id
|
|
]
|
|
}
|
|
```
|
|
|
|
<!-- schema generated by tfplugindocs -->
|
|
## Schema
|
|
|
|
### Required
|
|
|
|
- `name` (String) The hostname of the load balancer.
|
|
|
|
### Optional
|
|
|
|
- `forwarding_rules` (Attributes List) The rules that control which traffic the load balancer will forward to servers in the pool. Leave null to accept a default "HTTP" only forwarding rule. (see [below for nested schema](#nestedatt--forwarding_rules))
|
|
- `health_check` (Attributes) The rules that determine which servers are considered 'healthy' and in the server pool for the load balancer. Leave this null to accept appropriate defaults based on the forwarding_rules. (see [below for nested schema](#nestedatt--health_check))
|
|
- `region` (String) Leave null to create an anycast load balancer.
|
|
- `server_ids` (Set of Number) A list of server IDs to assign to this load balancer.
|
|
- `timeouts` (Attributes) (see [below for nested schema](#nestedatt--timeouts))
|
|
|
|
### Read-Only
|
|
|
|
- `id` (Number) The ID of the load balancer to fetch.
|
|
- `ip` (String) The IPv4 address of the load balancer.
|
|
|
|
<a id="nestedatt--forwarding_rules"></a>
|
|
### Nested Schema for `forwarding_rules`
|
|
|
|
Required:
|
|
|
|
- `entry_protocol` (String) The protocol that traffic must match for this load balancer to forward traffic according to this rule.
|
|
|
|
| Value | Description |
|
|
| ----- | ----------- |
|
|
| http | The load balancer will forward HTTP traffic that matches this rule. |
|
|
| https | The load balancer will forward HTTPS traffic that matches this rule. |
|
|
|
|
|
|
<a id="nestedatt--health_check"></a>
|
|
### Nested Schema for `health_check`
|
|
|
|
Optional:
|
|
|
|
- `path` (String) Leave null to accept the default '/' path.
|
|
- `protocol` (String) Leave null to accept the default HTTP protocol.
|
|
|
|
| Value | Description |
|
|
| ----- | ----------- |
|
|
| http | The health check will be performed via HTTP. |
|
|
| https | The health check will be performed via HTTPS. |
|
|
| both | The health check will be performed via both HTTP and HTTPS. Failing a health check on one protocol will remove the server from the pool of servers only for that protocol. |
|
|
|
|
|
|
<a id="nestedatt--timeouts"></a>
|
|
### Nested Schema for `timeouts`
|
|
|
|
Optional:
|
|
|
|
- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
|
|
- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
|
|
|
|
## Import
|
|
|
|
Import is supported using the following syntax:
|
|
|
|
The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example:
|
|
|
|
```shell
|
|
terraform import binarylane_load_balancer.example "<name or id>"
|
|
```
|