From fcb300a09e5ebc212d7c6ed34d9a5660ecbee286 Mon Sep 17 00:00:00 2001 From: Wictor Zhao Date: Tue, 30 Apr 2024 12:40:04 +0200 Subject: [PATCH] Fix lifecycle precondition for resource label and custom metrics --- main.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.tf b/main.tf index 7fd0acd..0644ab2 100644 --- a/main.tf +++ b/main.tf @@ -588,8 +588,8 @@ resource "aws_appautoscaling_policy" "ecs_service" { lifecycle { precondition { - condition = var.autoscaling_resource_label == "" && length(var.custom_metrics) > 0 - error_message = "Autoscaling resource labels are for predefined metrics only" + condition = !(var.autoscaling_resource_label != "" && length(var.custom_metrics) > 0) + error_message = "Cannot define autoscaling resource label and custom metrics at the same time" } } }