From 8bb5943be04678a35118ecee7626e598bf5c9756 Mon Sep 17 00:00:00 2001 From: Andreas Wittig Date: Mon, 6 May 2019 09:38:05 +0200 Subject: [PATCH] [Improvement] ecs/cluster - Avoid scaling deadlock (#306) --- ecs/cluster.yaml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/ecs/cluster.yaml b/ecs/cluster.yaml index a16550939..54fa3f3e9 100644 --- a/ecs/cluster.yaml +++ b/ecs/cluster.yaml @@ -809,6 +809,7 @@ Resources: LaunchConfigurationName: !Ref LaunchConfiguration MinSize: !Ref MinSize MaxSize: !Ref MaxSize + Cooldown: '120' HealthCheckGracePeriod: 300 HealthCheckType: ELB TargetGroupARNs: @@ -937,19 +938,23 @@ Resources: ScaleUpPolicy: Type: 'AWS::AutoScaling::ScalingPolicy' Properties: + AutoScalingGroupName: !Ref AutoScalingGroup + PolicyType: StepScaling AdjustmentType: PercentChangeInCapacity MinAdjustmentMagnitude: 1 - AutoScalingGroupName: !Ref AutoScalingGroup - Cooldown: '600' - ScalingAdjustment: 25 + StepAdjustments: + - MetricIntervalUpperBound: 0.0 + ScalingAdjustment: 25 ScaleDownPolicy: Type: 'AWS::AutoScaling::ScalingPolicy' Properties: + AutoScalingGroupName: !Ref AutoScalingGroup + PolicyType: StepScaling AdjustmentType: PercentChangeInCapacity MinAdjustmentMagnitude: 1 - AutoScalingGroupName: !Ref AutoScalingGroup - Cooldown: '600' - ScalingAdjustment: -25 + StepAdjustments: + - MetricIntervalLowerBound: 0.0 + ScalingAdjustment: -25 ContainerInstancesShortageAlarm: Type: 'AWS::CloudWatch::Alarm' Properties: