Skip to content

Instantly share code, notes, and snippets.

@KyMidd
Created June 20, 2021 19:20
Show Gist options
  • Save KyMidd/9990697e7cccd209c97c4c642ddaf7e0 to your computer and use it in GitHub Desktop.
Save KyMidd/9990697e7cccd209c97c4c642ddaf7e0 to your computer and use it in GitHub Desktop.
resource "aws_appautoscaling_target" "AzureDevOpsBuilderServiceAutoScalingTarget" {
count = var.enable_scaling ? 1 : 0
min_capacity = var.autoscale_task_weekday_scale_down
max_capacity = var.autoscale_task_weekday_scale_up
resource_id = "service/${aws_ecs_cluster.fargate_cluster.name}/${aws_ecs_service.azure_devops_builder_service.name}" # service/(clusterName)/(serviceName)
scalable_dimension = "ecs:service:DesiredCount"
service_namespace = "ecs"
lifecycle {
ignore_changes = [
min_capacity,
max_capacity,
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment