From a0fb5ac4fdd7c3ca66529860dede26be415d21b1 Mon Sep 17 00:00:00 2001 From: Serge Logvinov Date: Thu, 15 Aug 2024 17:24:28 +0300 Subject: [PATCH] scale down fixes --- hetzner/network-lb.tf | 4 ++-- hetzner/variables.tf | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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" = {