diff --git a/main.tf b/main.tf index 8254f1c..b78a41d 100644 --- a/main.tf +++ b/main.tf @@ -18,12 +18,22 @@ resource "hcloud_network" "k3s" { ip_range = var.network_ipv4_range } +# This is the default subnet to be used by the load balancer. +resource "hcloud_network_subnet" "default" { + network_id = hcloud_network.k3s.id + type = "cloud" + network_zone = var.network_region + ip_range = "10.0.0.0/16" +} + resource "hcloud_network_subnet" "subnet" { for_each = var.network_ipv4_subnets network_id = hcloud_network.k3s.id type = "cloud" network_zone = var.network_region ip_range = each.value + + depends_on = [hcloud_network_subnet.default] } resource "hcloud_firewall" "k3s" {