Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support aws_appautoscaling_policy for ECS Service #2896

Open
mattthaber opened this issue Feb 22, 2024 · 0 comments
Open

Support aws_appautoscaling_policy for ECS Service #2896

mattthaber opened this issue Feb 22, 2024 · 0 comments
Labels
aws Issue relates to AWS new resources New cloud resources to be added

Comments

@mattthaber
Copy link

Description

From what it looks like, ecs_service costs are solely calculated by Usage Hours* desired_count, however typically when using ecs with autoscaling, one will setup the resource to be

resource "aws_appautoscaling_target" "service" {
  max_capacity       = var.max_count
  min_capacity       = var.min_count
  resource_id        = "service/cluster/${aws_ecs_service.service.name}"
  scalable_dimension = "ecs:service:DesiredCount"
  service_namespace  = "ecs"
}

resource "aws_ecs_service" "service" {
  desired_count = # whatever

  lifecycle {
    ignore_changes = [ desired_count ]
  }
}

in which you ignore the desired_count completely, and just have variables for min/max.

It would be nice to support aws_appautoscaling_target for ecs in the usage file like other services with aws_appautoscaling_*

I do know one easy workaround is just set desired_count = var.max_count but because you typically lifecycle ignore desired_count, it is very easy to not setup services as such.

@mattthaber mattthaber changed the title Support aws_appautoscaling_policy for ECS Support aws_appautoscaling_policy for ECS Service Feb 22, 2024
@aliscott aliscott added new resources New cloud resources to be added aws Issue relates to AWS labels Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aws Issue relates to AWS new resources New cloud resources to be added
Projects
None yet
Development

No branches or pull requests

2 participants