Skip to content
SHC Docs

Example: hetzner-lan-lb

terraform/examples/hetzner-lan-lb is hetzner-lan with the SHC-managed edge on top: one Hetzner connection drives DNS, the load balancer and block volumes, all through the module’s topology block.

  • The public firewall opens 80, 443 and the node port range, because the load balancer and its health checks reach the nodes directly.
  • bootstrap.acme seeds Let’s Encrypt and bootstrap.host names the cluster’s public host.
  • topology.kind = "lb" with dns.type = "hetzner". credentials carries the token and the location; volume_provider and volume_secrets make Hetzner volumes the cluster’s storage backend.
firewall = {
public_ports = [
{ port = "80", protocol = "tcp" },
{ port = "443", protocol = "tcp" },
{ port = "30000-32767", protocol = "tcp" },
{ port = "30000-32767", protocol = "udp" },
]
}
topology = {
kind = "lb"
dns = {
name = "hetzner"
type = "hetzner"
zones = [var.dns_zone]
credentials = { token = var.hcloud_token, location = var.region }
}
volume_provider = {
provider = "hcloud"
config = { location = var.region }
}
volume_secrets = { token = var.hcloud_token }
}

As hetzner-lan, plus TF_VAR_hcloud_token (the same token) and, in the tfvars, dns_zone, shc_host and acme_email.

Terminal window
cp learn/shc/terraform/examples/hetzner-lan-lb/terraform.tfvars.example learn/shc/terraform/examples/hetzner-lan-lb/terraform.tfvars
tofu -chdir=learn/shc/terraform/examples/hetzner-lan-lb init
tofu -chdir=learn/shc/terraform/examples/hetzner-lan-lb apply
tofu -chdir=learn/shc/terraform/examples/hetzner-lan-lb destroy

This page was not walked: the lb topology needs a DNS zone at Hetzner, and the learning project has none.

Next: Example: hetzner-wan-mesh0.