Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
dwilkie committed Aug 22, 2024
1 parent f082a79 commit 2584fc2
Show file tree
Hide file tree
Showing 58 changed files with 2,170 additions and 2,283 deletions.
25 changes: 25 additions & 0 deletions infrastructure/modules/client_gateway/autoscaling.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
resource "aws_appautoscaling_policy" "policy" {
name = "client_gateway-scale"
service_namespace = aws_appautoscaling_target.scale_target.service_namespace
resource_id = aws_appautoscaling_target.scale_target.resource_id
scalable_dimension = aws_appautoscaling_target.scale_target.scalable_dimension
policy_type = "TargetTrackingScaling"

target_tracking_scaling_policy_configuration {
predefined_metric_specification {
predefined_metric_type = "ECSServiceAverageCPUUtilization"
}

target_value = 30
scale_in_cooldown = 300
scale_out_cooldown = 60
}
}

resource "aws_appautoscaling_target" "scale_target" {
service_namespace = "ecs"
resource_id = "service/${var.ecs_cluster.name}/${aws_ecs_service.this.name}"
scalable_dimension = "ecs:service:DesiredCount"
min_capacity = var.min_tasks
max_capacity = var.max_tasks
}
3 changes: 3 additions & 0 deletions infrastructure/modules/client_gateway/aws.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "aws_ip_ranges" "route53_healthchecks" {
services = ["route53_healthchecks"]
}
Loading

0 comments on commit 2584fc2

Please sign in to comment.