From 48f08572a659138f43ffe386c270df8d78aa0199 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asbj=C3=B8rn=20Clemmensen?= Date: Thu, 19 Sep 2024 15:01:30 +0200 Subject: [PATCH] Fix empty alarm actions (#38) --- main.tf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.tf b/main.tf index 0272eb5..c2c8871 100644 --- a/main.tf +++ b/main.tf @@ -14,10 +14,10 @@ resource "aws_cloudwatch_metric_alarm" "cpu_high" { ClusterName = var.ecs_cluster_name ServiceName = var.ecs_service_name } - alarm_actions = [ + alarm_actions = compact([ aws_appautoscaling_policy.scale_up_policy.arn, var.sns_topic_arn != "" ? var.sns_topic_arn : "" - ] + ]) tags = var.tags } @@ -37,10 +37,10 @@ resource "aws_cloudwatch_metric_alarm" "cpu_low" { ClusterName = var.ecs_cluster_name ServiceName = var.ecs_service_name } - alarm_actions = [ + alarm_actions = compact([ aws_appautoscaling_policy.scale_down_policy.arn, var.sns_topic_arn != "" ? var.sns_topic_arn : "" - ] + ]) tags = var.tags }