A Terraform module to create and manage servers within Hetzner Cloud using cloud-init
.
module "hetzner_server_apache" {
source = "terraform-hetzner-modules/cloud/server"
...
}
Name | Version |
---|---|
cloudinit | ~> 2.3 |
hcloud | ~> 1.49 |
Name | Source | Version |
---|---|---|
placement_group | ./modules/placement-group | n/a |
Name | Description | Type | Default | Required |
---|---|---|---|---|
allow_deprecated_images | Enable the use of deprecated images. NOTE: Deprecated images will be removed after three months. | bool |
false |
no |
backups | Whether or not to enable Hetzner's automatic backups. | bool |
false |
no |
cloud_init | The cloud_init configuration to render the template with. | object({ gzip = bool base64_encode = bool config = any }) |
{ "base64_encode": true, "config": {}, "gzip": true } |
no |
create_server | Whether or not to create a Server. This is true by default of course. | bool |
true |
no |
enable_protection | Enable Hetzner's 'rebuild' and 'delete' protection. | bool |
false |
no |
firewall_ids | A list of firewall IDs that should be attached to the server on creation. | list(string) |
[] |
no |
ignore_remote_firewall_ids | Ignore any updates to the firewall_ids argument. | bool |
false |
no |
image | The OS image to use for the new server. | string |
n/a | yes |
iso | The name or ID of an ISO image to mount into the machine on creation. | string |
null |
no |
keep_disk | Whether or not the disk should be kept when scaling servers. This allows for downgrades later down the line. | bool |
false |
no |
labels | A map of label to attach to the server on creation. | map(string) |
{} |
no |
location | The data center location to create the new machine in. Can be one of the following: 'nbg1', 'fsn1', 'hel1', 'ash' or 'hil'. Default is 'fsn1'. | string |
"fsn1" |
no |
name | The name given to the new server. Must be unique per Hetzner project and a valid hostname in accordance with RFC 1123. | string |
n/a | yes |
networking | The networking settings to apply to the instance. Like whether IPv6 is enabled or not. By default both IPv4 and IPv6 are enabled. The IPv4 address may be manually or automatically assigned via Hetzner. | any |
{} |
no |
placement_group | Configuration for a placement group to be attached to the server. | object({ enabled = bool name = optional(string) type = optional(string) labels = optional(map(string)) }) |
{ "enabled": false } |
no |
private_network | The private network to attach the server to on creation. | any |
{} |
no |
rescue | If specified the system will boot into the given rescue system to allow for easy installation of custom operating systems. | string |
null |
no |
shutdown_before_deletion | Shutdown the server gracefully before deleting it. | bool |
true |
no |
ssh_keys | A list of SSH key names or IDs, which should be injected into the server at creation. None are injected by default. | list(string) |
[] |
no |
type | The type of server to create. See the output of Hetzner's CLI hcloud command 'server-type list' for reference. | string |
n/a | yes |
Name | Description |
---|---|
backups | The new server's automatic backup setting (boolean). |
datacenter | The datacenter the new Hetzner Cloud server is provisioned in. |
delete_protection | Whether or not deletion protection is enabled for the server. |
firewall_ids | The firewall IDs the server is attached to. |
id | The internal Hetzner ID for the server. |
image | The image used to create the Hetzner Cloud server. |
ipv4_address | The IPv4 address the server is configured with. |
ipv6_address | The IPv6 address the server is configured with. |
ipv6_network | The IPv6 network the server is configured in. |
iso | The ID or name of the mounted ISO image. |
labels | The labels attached to the new Hetzner Cloud server. |
location | The location of the Hetzner Cloud server. |
name | The name of the Hetzner Cloud server. |
network | The network the Hetzner Cloud server should be attached to. |
placement_group_id | The placement group's ID for the new server. |
rebuild_protection | Whether or not rebuild protection is enabled for the server. |
server_type | The type of Hetzner Cloud server that was created. |
status | The current server status. |
Refer to our documentation for contributors for contributing guidelines, commit message formats and versioning tips.
This project is owned and maintained by FMJ Studios refer to the AUTHORS
or CODEOWNERS
for more information. You may also use the linked contact details to reach out directly.
- Assets provided by: HashiCorp
- Sources provided by: FMJ Studios under the MIT License