From f39b29288eea649700ece5144f933594520fee2a Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 31 Dec 2025 12:13:02 -0500 Subject: [PATCH] feat: attach lb to network --- terraform/network.tf | 7 +++++++ terraform/variables.tf | 1 + 2 files changed, 8 insertions(+) diff --git a/terraform/network.tf b/terraform/network.tf index c571ab6..ed26083 100644 --- a/terraform/network.tf +++ b/terraform/network.tf @@ -12,6 +12,13 @@ resource "hcloud_network_subnet" "subnet" { ip_range = local.subnet-cidr } +// Attach the load balancer to the compute subnet. +resource "hcloud_load_balancer_network" "attachment" { + load_balancer_id = hcloud_load_balancer.lb.id + subnet_id = hcloud_network_subnet.subnet.id + ip = local.lb-private-ip +} + // Provide internet to the private servers, by sending all internet traffic to // the NAT. resource "hcloud_network_route" "gateway" { diff --git a/terraform/variables.tf b/terraform/variables.tf index 9082cba..80f564d 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -3,6 +3,7 @@ locals { subnet-cidr = "10.0.2.0/24" nat-private-ip = "10.0.2.8" + lb-private-ip = "10.0.2.128" servers = { control = "10.0.2.11" node-a = "10.0.2.9"