From 906322a0952c581fd07667a9025b55c2fb5873b9 Mon Sep 17 00:00:00 2001 From: Zek Chak Date: Sat, 30 Dec 2023 06:51:01 +0800 Subject: [PATCH] fix autoscaling resource_id --- main.tf | 2 +- variables.tf | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 36d9d05..9af341e 100644 --- a/main.tf +++ b/main.tf @@ -253,7 +253,7 @@ resource "aws_appautoscaling_target" "ecs" { max_capacity = lookup(var.appautoscaling_settings, "max_capacity", var.desired_count) min_capacity = lookup(var.appautoscaling_settings, "min_capacity", var.desired_count) - resource_id = "service/${var.cluster_id}/${aws_ecs_service.this.name}" + resource_id = "service/${var.cluster_name}/${aws_ecs_service.this.name}" scalable_dimension = "ecs:service:DesiredCount" service_namespace = "ecs" } diff --git a/variables.tf b/variables.tf index e0e8a03..6e2548c 100644 --- a/variables.tf +++ b/variables.tf @@ -8,6 +8,10 @@ variable "cluster_id" { type = string } +variable "cluster_name" { + description = "The ECS cluster name" +} + variable "container_port" { description = "The port used by the app within the container." type = number