Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/hegerdes/terraform-hcloud-hetzner-node-pool

A terraform module to quicly generate multiple hetzner hcloud vm servers and supporting services 🚀
https://github.com/hegerdes/terraform-hcloud-hetzner-node-pool

hcl hcloud hetzner iac terraform terraform-module

Last synced: about 17 hours ago
JSON representation

A terraform module to quicly generate multiple hetzner hcloud vm servers and supporting services 🚀

Awesome Lists containing this project

README

        

# terraform-hcloud-hetzner-node-pool terraform module

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

## Usage

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

```hcl
module "hetzner_node_pool" {
source = "hegerdes/terraform-hcloud-hetzner-node-pool/"

size = 1
name = "example"
location = "fsn1"
tags = {cloud = "true"}
}
```
*NOTE:* Due to an [issue](https://github.com/hetznercloud/terraform-provider-hcloud/issues/911) in the hetzner terraform provider, it is currently not possible to set firewall ids via labels and via the `firewall_ids` input. Users have to decide for one of these methods.

## Examples

Examples codified under the [`examples`](https://github.com/hegerdes/terraform-hcloud-hetzner-node-pool/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-node-pool/tree/main/examples/complete)

## Requirements

| Name | Version |
|------|---------|
| [terraform](#requirement\_terraform) | >= 1.5 |
| [hcloud](#requirement\_hcloud) | >=1.40 |
| [random](#requirement\_random) | >=3.0 |

## Providers

| Name | Version |
|------|---------|
| [hcloud](#provider\_hcloud) | >=1.40 |
| [random](#provider\_random) | >=3.0 |

## Modules

No modules.

## Resources

| Name | Type |
|------|------|
| [hcloud_placement_group.this](https://registry.terraform.io/providers/hetznercloud/hcloud/latest/docs/resources/placement_group) | resource |
| [hcloud_server.this](https://registry.terraform.io/providers/hetznercloud/hcloud/latest/docs/resources/server) | resource |
| [hcloud_ssh_key.this](https://registry.terraform.io/providers/hetznercloud/hcloud/latest/docs/resources/ssh_key) | resource |
| [hcloud_volume.this](https://registry.terraform.io/providers/hetznercloud/hcloud/latest/docs/resources/volume) | resource |
| [random_string.this](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/string) | resource |
| [hcloud_image.this](https://registry.terraform.io/providers/hetznercloud/hcloud/latest/docs/data-sources/image) | data source |
| [hcloud_network.this](https://registry.terraform.io/providers/hetznercloud/hcloud/latest/docs/data-sources/network) | data source |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [backups](#input\_backups) | Backups enabled | `bool` | `false` | no |
| [create\_ssh\_keys](#input\_create\_ssh\_keys) | Hetzner allows create a ssh key only once. By default you have to create them before. If you set this flag the module will create them. | `bool` | `false` | no |
| [firewall\_ids](#input\_firewall\_ids) | Ids of firewall attacted to the server | `list(string)` | `null` | no |
| [fixed\_disk\_size](#input\_fixed\_disk\_size) | Whether the disk size should also be upgraded when scaling up. If true, downgrades may not be possible anymore. | `bool` | `false` | no |
| [image](#input\_image) | Node image name. | `string` | `"debian-12"` | no |
| [instance\_type](#input\_instance\_type) | Node instance type. | `string` | `"cx22"` | no |
| [location](#input\_location) | Node location. | `string` | n/a | yes |
| [name](#input\_name) | Node name prefix. | `string` | n/a | yes |
| [network\_name](#input\_network\_name) | Node network name | `string` | `null` | no |
| [private\_ip\_addresses](#input\_private\_ip\_addresses) | Node private ips. Network name must be set for this. | `list(string)` | `[]` | no |
| [public\_ipv4](#input\_public\_ipv4) | Node public ipv4 ip | `bool` | `true` | no |
| [public\_ipv6](#input\_public\_ipv6) | Node public ipv6 ip | `bool` | `true` | no |
| [shutdown\_before\_deletion](#input\_shutdown\_before\_deletion) | Will issue a shutdown command before deleting the server. | `bool` | `false` | no |
| [size](#input\_size) | Number of nodes to create. Will only be used if vm\_names is empty. | `number` | `1` | no |
| [snapshot\_image](#input\_snapshot\_image) | Node image is snapshot | `bool` | `false` | no |
| [ssh\_keys](#input\_ssh\_keys) | Nodes public ssh keys ids or names or the key itself. If its the key you have to set create\_ssh\_keys. | `list(string)` | `[]` | no |
| [tags](#input\_tags) | Node tags/labels | `any` | `{}` | no |
| [user\_data](#input\_user\_data) | Node user data (cloud-init) | `string` | `null` | no |
| [vm\_names](#input\_vm\_names) | List of names for the VMs. to create | `list(string)` | `[]` | no |
| [volumes](#input\_volumes) | Extra Hetzer volumes added to each server. |

list(object({
name = string
size = number
format = optional(string, "ext4")
}))
| `[]` | no |

## Outputs

| Name | Description |
|------|-------------|
| [name](#output\_name) | The name of the node pool. |
| [vm\_ids](#output\_vm\_ids) | List of all ids for every created server. |
| [vm\_ips](#output\_vm\_ips) | List of all public ips of every created server. Includes IPv4 & IPv6. |
| [vm\_names](#output\_vm\_names) | List of all names for every created server. |
| [vm\_volumes](#output\_vm\_volumes) | List of all additional disks for every created server. |
| [vms](#output\_vms) | Object of vm data based on name. |
| [vms\_raw](#output\_vms\_raw) | Raw object of hcloud server objects. |

## License

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