Skip to content

Instantly share code, notes, and snippets.

@li0nel
Created December 10, 2017 17:02
Show Gist options
  • Save li0nel/403c973b2c1355af082e650f6102cb1d to your computer and use it in GitHub Desktop.
Save li0nel/403c973b2c1355af082e650f6102cb1d to your computer and use it in GitHub Desktop.
ScaleUpPolicy:
Type: AWS::AutoScaling::ScalingPolicy
Properties:
AdjustmentType: ChangeInCapacity
AutoScalingGroupName:
Ref: asGroup
Cooldown: '1'
ScalingAdjustment: '1'
CPUAlarmHigh:
Type: AWS::CloudWatch::Alarm
Properties:
EvaluationPeriods: '1'
Statistic: Average
Threshold: '10'
AlarmDescription: Alarm if CPU too high or metric disappears indicating instance is down
Period: '60'
AlarmActions:
- Ref: ScaleUpPolicy
Namespace: AWS/EC2
Dimensions:
- Name: AutoScalingGroupName
Value:
Ref: asGroup
ComparisonOperator: GreaterThanThreshold
MetricName: CPUUtilization
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment