From 7455a69cb99f55b9e9cf4570819bf5ac3cfd4876 Mon Sep 17 00:00:00 2001 From: Marcio Goda Date: Wed, 19 Jun 2024 14:56:28 +0100 Subject: [PATCH] fix garviton logic --- main.tf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.tf b/main.tf index a136d7c..864d3f6 100644 --- a/main.tf +++ b/main.tf @@ -27,8 +27,9 @@ locals { higher_weight = local.lower_weight == 0 ? 1 : (floor(local.lower_weight / (local.p / 100)) - 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 + use_graviton = try (var.image_build_details["buildx"] == "true" && regexall("arm64", var.image_build_details["platforms"]), false) - capacity_providers = var.image_build_details["buildx"] == "true" && can(regexall("arm64", var.image_build_details["platforms"])) ? [ + capacity_providers = use_graviton ? [ { capacity_provider = "${var.ecs_cluster}-native-scaling-graviton" weight = local.ondemand_weight