From d33460b27b46b4693ecf499b87397787a8abad54 Mon Sep 17 00:00:00 2001 From: Keir Badger Date: Tue, 9 Apr 2024 08:56:08 +0000 Subject: [PATCH] add in the capcity providers --- main.tf | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/main.tf b/main.tf index 313a614..122fa5b 100644 --- a/main.tf +++ b/main.tf @@ -15,17 +15,17 @@ module "ecs_update_monitor" { } locals { - # capacity_providers = var.image_build_details["buildx"] == "true" && strcontains(var.image_build_details["platforms"], "arm64") ? [ - # { - # capacity_provider = "${var.ecs_cluster}-native-scaling-graviton" - # weight = 1 - # }, - # ] : [ - # { - # capacity_provider = "${var.ecs_cluster}-native-scaling" - # weight = 1 - # }, - # ] + capacity_providers = var.image_build_details["buildx"] == "true" && can(regexall("^arm64", var.image_build_details["platforms"])) ? [ + { + capacity_provider = "${var.ecs_cluster}-native-scaling" + weight = 1 + }, + ] : [ + { + capacity_provider = "${var.ecs_cluster}-native-scaling" + weight = 1 + }, + ] } module "service" { @@ -46,7 +46,7 @@ module "service" { network_configuration_security_groups = var.network_configuration_security_groups pack_and_distinct = var.pack_and_distinct health_check_grace_period_seconds = var.health_check_grace_period_seconds - # capacity_providers = local.capacity_providers + capacity_providers = local.capacity_providers } module "taskdef" {