From 03b1cd2d818bb17e3167e06f92c2debd0fdd33e5 Mon Sep 17 00:00:00 2001 From: Marcio Goda Date: Thu, 2 May 2024 12:45:31 +0100 Subject: [PATCH] fix 100% issue --- main.tf | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/main.tf b/main.tf index 4465b65..465f524 100644 --- a/main.tf +++ b/main.tf @@ -1,10 +1,11 @@ locals { service_name = "${var.env}-${var.release["component"]}" full_service_name = "${local.service_name}${var.name_suffix}" - lower_weight = ceil((var.spot_capacity_percentage / 100)) - higher_weight = local.lower_weight == 0 ? 1 : ceil(local.lower_weight / (var.spot_capacity_percentage / 100)) - 1 - 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 + p = 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 } module "ecs_update_monitor" {