Skip to content

Commit

Permalink
Updating resource_id for autoscaling_target resource (#11)
Browse files Browse the repository at this point in the history
* updating resource id service name ref

* using try to catch false and true situations for service name
  • Loading branch information
Mhart12 authored Apr 29, 2024
1 parent 7c40591 commit e18df36
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion autoscaling.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ resource "aws_appautoscaling_target" "ecs_target" {
count = var.autoscaling_enabled ? 1 : 0
max_capacity = var.autoscaling.max_capacity
min_capacity = var.autoscaling.min_capacity
resource_id = "service/${local.cluster_name}/${aws_ecs_service.default[0].name}"
resource_id = "service/${local.cluster_name}/${try(aws_ecs_service.default[0].name, aws_ecs_service.ignore_changes_task_definition[0].name, aws_ecs_service.ignore_changes_desired_count[0].name, aws_ecs_service.ignore_changes_task_definition_and_desired_count[0].name, "")}"
scalable_dimension = "ecs:service:DesiredCount"
service_namespace = "ecs"
}
Expand Down

0 comments on commit e18df36

Please sign in to comment.