Skip to content

Commit

Permalink
fix logic in calc
Browse files Browse the repository at this point in the history
  • Loading branch information
marciogoda committed May 2, 2024
1 parent 6a406d5 commit 6bcb53e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down

0 comments on commit 6bcb53e

Please sign in to comment.