From 6bcb53e547910d8959988408a02bcf6d60736f7e Mon Sep 17 00:00:00 2001 From: Marcio Goda Date: Thu, 2 May 2024 13:09:53 +0100 Subject: [PATCH] fix logic in calc --- main.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.tf b/main.tf index 1edfbfa..36aa034 100644 --- a/main.tf +++ b/main.tf @@ -4,8 +4,8 @@ locals { p = var.spot_capacity_percentage <= 50 ? var.spot_capacity_percentage : 100 - var.spot_capacity_percentage lower_weight = ceil((local.p / 100)) higher_weight = local.lower_weight == 0 ? 1 : ceil(local.lower_weight / (local.p / 100)) - 1 - spot_weight = local.p <= 50 || local.p == 100 ? local.lower_weight : local.higher_weight - ondemand_weight = local.p <= 50 || local.p == 100 ? local.higher_weight : local.lower_weight + spot_weight = var.spot_capacity_percentage <= 50 ? local.lower_weight : local.higher_weight + ondemand_weight = var.spot_capacity_percentage <= 50 ? local.higher_weight : local.lower_weight } module "ecs_update_monitor" {