Skip to content
SHC Docs

Example: hetzner-wan-mesh0

terraform/examples/hetzner-wan-mesh0 has no private network. The nodes talk over their public addresses through mesh0, the kernel WireGuard plane on UDP 4244. This is the shape of a cluster spread across places that share no network.

  • networking = { private = false } creates no network, and nic_name names the public interface, eth0 on Hetzner’s Debian images.
  • With a public plane, firewall.inter_node derives to plane: one firewall admits only the cluster plane’s ports, from the cluster’s own node addresses. The example opens UDP 4244 to everyone on top, for mesh0.
  • topology.kind = "wan" says so to the platform; it creates no further resource.
networking = { private = false }
nic_name = var.public_nic
firewall = {
public_ports = [{ port = "4244", protocol = "udp" }]
}
topology = {
kind = "wan"
}

As hetzner-lan, with the same key, the same two environment values and the same licence.

~/learn/shc/terraform/examples/hetzner-wan-mesh0/terraform.tfvars
cluster_name = "wan"
shc_version = "0.1.3"
server_type = "cx23"
ssh_private_key_path = "~/.ssh/learn"
license_token_path = "~/shc-license.token"
work
$ tofu -chdir=learn/shc/terraform/examples/hetzner-wan-mesh0 init
...
OpenTofu has been successfully initialized!
...
$ tofu -chdir=learn/shc/terraform/examples/hetzner-wan-mesh0 plan
...
$ tofu -chdir=learn/shc/terraform/examples/hetzner-wan-mesh0 apply -auto-approve
...
$ tofu -chdir=learn/shc/terraform/examples/hetzner-wan-mesh0 output node_names
[
"nodes01.wan",
"nodes02.wan",
"nodes03.wan",
]

The consent, applied, then the destroy.

~/learn/shc/terraform/examples/hetzner-wan-mesh0/terraform.tfvars
cluster_name = "wan"
shc_version = "0.1.3"
server_type = "cx23"
ssh_private_key_path = "~/.ssh/learn"
license_token_path = "~/shc-license.token"
on_destroy = "force"
work
$ tofu -chdir=learn/shc/terraform/examples/hetzner-wan-mesh0 apply -auto-approve
...
$ tofu -chdir=learn/shc/terraform/examples/hetzner-wan-mesh0 destroy -auto-approve
...

Next: Example: mixed-proxmox-hetzner.