Skip to content

Commit

Permalink
fix: Local cluster_name error when var.cluster_arn is empty (#218)
Browse files Browse the repository at this point in the history
fix: `cluster_name` error when `var.cluster_arn` is empty
  • Loading branch information
rvaralda authored Aug 7, 2024
1 parent 048acce commit 42f11fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/service/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -1203,7 +1203,7 @@ resource "aws_ecs_task_set" "ignore_task_definition" {
locals {
enable_autoscaling = local.create_service && var.enable_autoscaling && !local.is_daemon

cluster_name = element(split("/", var.cluster_arn), 1)
cluster_name = try(element(split("/", var.cluster_arn), 1), "")
}

resource "aws_appautoscaling_target" "this" {
Expand Down

0 comments on commit 42f11fe

Please sign in to comment.