diff --git a/autoscaling.py b/autoscaling.py index 8315d20..73e6a82 100644 --- a/autoscaling.py +++ b/autoscaling.py @@ -272,7 +272,7 @@ def put_scaling_policies(autoscaling_client, asg_arn): PolicyType='SimpleScaling', AdjustmentType='ChangeInCapacity', ScalingAdjustment=1, - Cooldown=90 + Cooldown=60 ) print(f"Scale policy created with ARN: {up['PolicyARN']}") @@ -284,7 +284,7 @@ def put_scaling_policies(autoscaling_client, asg_arn): PolicyType='SimpleScaling', AdjustmentType='ChangeInCapacity', ScalingAdjustment=-1, - Cooldown=90 + Cooldown=60 ) print(f"Scale policy created with ARN: {down['PolicyARN']}") @@ -296,7 +296,7 @@ def create_cloudwatch_alarms(cloudwatch_client, sp_up, sp_down): AlarmName=f"{PREFIX}-scale-alarm", ComparisonOperator='GreaterThanThreshold', EvaluationPeriods=1, - MetricName='RequestCount', + MetricName='RequestCountPerTarget', Namespace='AWS/ApplicationELB', Period=60, Statistic='Sum', @@ -318,7 +318,7 @@ def create_cloudwatch_alarms(cloudwatch_client, sp_up, sp_down): AlarmName=f"{PREFIX}-scale-down-alarm", ComparisonOperator='LessThanThreshold', EvaluationPeriods=1, - MetricName='RequestCount', + MetricName='RequestCountPerTarget', Namespace='AWS/ApplicationELB', Period=60, Statistic='Average',