An open API service indexing awesome lists of open source software.

https://github.com/hegerdes/terraform-hcloud-hetzner-loadbalancer

A terraform module to quicly generate hetzner hcloud loadbalancers and supporting services 🚀
https://github.com/hegerdes/terraform-hcloud-hetzner-loadbalancer

hcl hcloud hetzner iac terraform terraform-module

Last synced: 4 months ago
JSON representation

A terraform module to quicly generate hetzner hcloud loadbalancers and supporting services 🚀

Awesome Lists containing this project

README

          

# terraform-hcloud-hetzner-loadbalancer terraform module

Terraform module which creates terraform-hcloud-hetzner-loadbalancer resources. The module can be found on the [terraform.io registry](https://registry.terraform.io/modules/hegerdes/hetzner-loadbalancer/hcloud/latest) or on [github](https://github.com/hegerdes/terraform-hcloud-hetzner-loadbalancer).

## Usage

See [`examples`](https://github.com/hegerdes/terraform-hcloud-hetzner-loadbalancer/tree/main/examples) directory for working examples to reference:

```hcl
module "hetzner_loadbalancer" {
source = "hegerdes/terraform-hcloud-hetzner-loadbalancer/"

location = local.location
network_id = hcloud_network.example.id
name = "minimal"
}
```

## Examples

Examples codified under the [`examples`](https://github.com/hegerdes/terraform-hcloud-hetzner-loadbalancer/tree/main/examples) are intended to give users references for how to use the module(s) as well as testing/validating changes to the source code of the module. If contributing to the project, please be sure to make any appropriate updates to the relevant examples to allow maintainers to test your changes and to keep the examples up to date for users. Thank you!

- [Complete](https://github.com/hegerdes/terraform-hcloud-hetzner-loadbalancer/tree/main/examples/complete)

## Requirements

| Name | Version |
|------|---------|
| [terraform](#requirement\_terraform) | >= 1.5 |
| [hcloud](#requirement\_hcloud) | >=1.45.0 |

## Providers

| Name | Version |
|------|---------|
| [hcloud](#provider\_hcloud) | >=1.45.0 |

## Modules

No modules.

## Resources

| Name | Type |
|------|------|
| [hcloud_load_balancer.this](https://registry.terraform.io/providers/hetznercloud/hcloud/latest/docs/resources/load_balancer) | resource |
| [hcloud_load_balancer_network.this](https://registry.terraform.io/providers/hetznercloud/hcloud/latest/docs/resources/load_balancer_network) | resource |
| [hcloud_load_balancer_service.this](https://registry.terraform.io/providers/hetznercloud/hcloud/latest/docs/resources/load_balancer_service) | resource |
| [hcloud_load_balancer_target.this](https://registry.terraform.io/providers/hetznercloud/hcloud/latest/docs/resources/load_balancer_target) | resource |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [location](#input\_location) | Loadbalancer location | `string` | n/a | yes |
| [name](#input\_name) | Loadbalancer Name | `string` | n/a | yes |
| [network\_id](#input\_network\_id) | Loadbalancer network id. | `string` | n/a | yes |
| [private\_ip](#input\_private\_ip) | The private ip of the loadbalancer. Auto assinged if not specified. | `string` | `null` | no |
| [public](#input\_public) | Loadbalancer internet facing | `bool` | `true` | no |
| [services](#input\_services) | Array of objects describing the loadbalancer target configuration. |

list(object({
name = string
protocol = string
proxy_protocol = optional(bool, false)
source_port = optional(number, 80)
target_port = optional(number, 80)
}))
| `[]` | no |
| [tags](#input\_tags) | Loadbalancer tags/labels | `any` | `{}` | no |
| [targets](#input\_targets) | Array of objects describing the loadbalancer listener (service) configuration. |
list(object({
name = string
type = string
target = string
}))
| `[]` | no |
| [type](#input\_type) | Loadbalancer sku size. | `string` | `"lb11"` | no |

## Outputs

| Name | Description |
|------|-------------|
| [lb\_id](#output\_lb\_id) | The ID of the created loadbalancer. |
| [lb\_ipv4](#output\_lb\_ipv4) | The public IP (ipv4) of the created loadbalancer. |
| [lb\_ipv6](#output\_lb\_ipv6) | The public IP (ipv6) of the created loadbalancer. |
| [services](#output\_services) | Map of the target loadbalancer services. |
| [targets](#output\_targets) | Map of the target loadbalancer targets. |

## License

Apache-2.0 Licensed. See [LICENSE](https://github.com/hegerdes/terraform-hcloud-hetzner-loadbalancer/main/LICENSE).