Skip to content

Instantly share code, notes, and snippets.

@sschrijver
Last active September 22, 2020 05:50
Show Gist options
  • Save sschrijver/d6b1e1c2e3b98417c0e8b80acbcf6668 to your computer and use it in GitHub Desktop.
Save sschrijver/d6b1e1c2e3b98417c0e8b80acbcf6668 to your computer and use it in GitHub Desktop.
resource "aws_appautoscaling_policy" "scale_up_fargate" {
policy_type = "StepScaling"
name = "sqs-scaling-up-${var.service_name}"
resource_id = aws_appautoscaling_target.ecs_target.resource_id
scalable_dimension = aws_appautoscaling_target.ecs_target.scalable_dimension
service_namespace = aws_appautoscaling_target.ecs_target.service_namespace
step_scaling_policy_configuration {
adjustment_type = "ExactCapacity"
metric_aggregation_type = "Average"
step_adjustment {
metric_interval_lower_bound = 0
metric_interval_upper_bound = 500
scaling_adjustment = 1
}
step_adjustment {
metric_interval_lower_bound = 500
metric_interval_upper_bound = 1000
scaling_adjustment = 2
}
step_adjustment {
metric_interval_lower_bound = 1000
scaling_adjustment = 3
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment