diff --git a/hetzner/network-lb.tf b/hetzner/network-lb.tf index 19ba690..ad42600 100644 --- a/hetzner/network-lb.tf +++ b/hetzner/network-lb.tf @@ -19,9 +19,9 @@ resource "hcloud_floating_ip" "api" { } resource "hcloud_floating_ip_assignment" "api" { - count = local.lb_enable && length(local.controlplanes) > 0 ? 0 : 1 + count = local.lb_enable ? 0 : (length(local.controlplanes) > 0 ? 1 : 0) floating_ip_id = hcloud_floating_ip.api[0].id - server_id = hcloud_server.controlplane[keys(local.controlplanes)[0]].id + server_id = length(local.controlplanes) > 0 ? hcloud_server.controlplane[keys(local.controlplanes)[0]].id : 0 lifecycle { ignore_changes = [ diff --git a/hetzner/variables.tf b/hetzner/variables.tf index 9a9ab93..a9734cd 100644 --- a/hetzner/variables.tf +++ b/hetzner/variables.tf @@ -69,7 +69,7 @@ variable "controlplane" { type = "cax21", }, "fsn1" = { - count = 1, + count = 0, type = "cax21", }, "hel1" = {