Last active
June 10, 2019 15:06
-
-
Save lvthillo/b6f3ac5b29af546ed6ea6ccdf8ffe6ef to your computer and use it in GitHub Desktop.
Scaling Policy and Alarms
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ScaleUpPolicy: | |
| Type: AWS::AutoScaling::ScalingPolicy | |
| Properties: | |
| AdjustmentType: ChangeInCapacity | |
| AutoScalingGroupName: !Ref ASG | |
| Cooldown: '1' | |
| ScalingAdjustment: 1 | |
| ScaleDownPolicy: | |
| Type: AWS::AutoScaling::ScalingPolicy | |
| Properties: | |
| AdjustmentType: ChangeInCapacity | |
| AutoScalingGroupName: !Ref ASG | |
| Cooldown: '1' | |
| ScalingAdjustment: -1 | |
| MemoryAlarmHigh: | |
| Type: AWS::CloudWatch::Alarm | |
| Properties: | |
| EvaluationPeriods: 1 | |
| Statistic: Average | |
| Threshold: 70 | |
| AlarmDescription: Go in Alarm is memory is higher than 70% for 60 seconds | |
| Period: 60 | |
| AlarmActions: | |
| - Ref: ScaleUpPolicy | |
| Namespace: CWAgent | |
| Dimensions: | |
| - Name: AutoScalingGroupName | |
| Value: !Ref ASG | |
| ComparisonOperator: GreaterThanThreshold | |
| MetricName: mem_used_percent | |
| MemoryAlarmLow: | |
| Type: AWS::CloudWatch::Alarm | |
| Properties: | |
| EvaluationPeriods: 1 | |
| Statistic: Average | |
| Threshold: 30 | |
| AlarmDescription: Go in Alarm is memory is lower than 30% for 60 seconds | |
| Period: 60 | |
| AlarmActions: | |
| - Ref: ScaleDownPolicy | |
| Namespace: CWAgent | |
| Dimensions: | |
| - Name: AutoScalingGroupName | |
| Value: !Ref ASG | |
| ComparisonOperator: LessThanOrEqualToThreshold | |
| MetricName: mem_used_percent |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment