Feat: Adds parallel and async process to calls and ocr
This commit is contained in:
@@ -331,6 +331,45 @@ resource "aws_ecs_service" "app" {
|
||||
Name = "${var.app_name}-service"
|
||||
}
|
||||
}
|
||||
# Autoscaling
|
||||
resource "aws_appautoscaling_target" "ecs" {
|
||||
max_capacity = 3
|
||||
min_capacity = 1
|
||||
resource_id = "service/${aws_ecs_cluster.main.name}/${aws_ecs_service.app.name}"
|
||||
scalable_dimension = "ecs:service:DesiredCount"
|
||||
service_namespace = "ecs"
|
||||
}
|
||||
|
||||
resource "aws_appautoscaling_policy" "cpu" {
|
||||
name = "${var.app_name}-cpu-autoscaling"
|
||||
policy_type = "TargetTrackingScaling"
|
||||
resource_id = aws_appautoscaling_target.ecs.resource_id
|
||||
scalable_dimension = aws_appautoscaling_target.ecs.scalable_dimension
|
||||
service_namespace = aws_appautoscaling_target.ecs.service_namespace
|
||||
|
||||
target_tracking_scaling_policy_configuration {
|
||||
predefined_metric_specification {
|
||||
predefined_metric_type = "ECSServiceAverageCPUUtilization"
|
||||
}
|
||||
target_value = 70.0
|
||||
}
|
||||
}
|
||||
|
||||
resource "aws_appautoscaling_policy" "memory" {
|
||||
name = "${var.app_name}-memory-autoscaling"
|
||||
policy_type = "TargetTrackingScaling"
|
||||
resource_id = aws_appautoscaling_target.ecs.resource_id
|
||||
scalable_dimension = aws_appautoscaling_target.ecs.scalable_dimension
|
||||
service_namespace = aws_appautoscaling_target.ecs.service_namespace
|
||||
|
||||
target_tracking_scaling_policy_configuration {
|
||||
predefined_metric_specification {
|
||||
predefined_metric_type = "ECSServiceAverageMemoryUtilization"
|
||||
}
|
||||
target_value = 80.0
|
||||
}
|
||||
}
|
||||
|
||||
#ECS Task Role (for application to call AWS services)
|
||||
resource "aws_iam_role" "ecs_task_role" {
|
||||
name = "${var.app_name}-ecs-task-role"
|
||||
|
||||
Reference in New Issue
Block a user