1

I have the below Auto Scaling Policy which should add instance when the CPU reservation goes beyond 75%. I am not seeing any Alarm triggered for this setup

Policy type:
Simple scaling
Execute policy when:
ECS-CPUHighAlarm
breaches the alarm threshold: CPUReservation > 75 for 5 consecutive periods 
of 60 seconds for the metric dimensions AutoScalingGroupName = ECS-
ECSAutoScalingGroup
Take the action:
Add 1 instances And then wait: 600 seconds before allowing another scaling 
activity

Below is the CloudFormation Script.

CPUHighAlarm:
Type: 'AWS::CloudWatch::Alarm'
Properties:
  EvaluationPeriods: 5
  Statistic: Average
  Threshold: 75
  AlarmDescription: 'Alarm if CPU reservation is high.'
  Period: 60
  AlarmActions:
  - !Ref 'CPUScalingUpPolicy'
  Namespace: 'AWS/ECS'
  Dimensions:
  - Name: AutoScalingGroupName
    Value: !Ref 'ECSAutoScalingGroup'
  ComparisonOperator: GreaterThanThreshold
  MetricName: CPUReservation

But its not happening based on what I have observed with chart given below. CPU Reservation Chart

Any thoughts on where I am missing the configuration?

John Williams
  • 51
  • 1
  • 6

1 Answers1

2

I think i found the issue. It was in the CloudFormation Template. When using the namespace as AWS/ECS below are valid dimension,

Dimensions:
- Name: ClusterName
  Value: !Ref 'ECSClusterName'

Hence the Alarm was invalid and was stuck as INSUFFICIENT_DATA which I realized only later after reading this,

https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ecs-metricscollected.html

I ran the test and the Alarm is getting triggered and Auto Scaling.

John Williams
  • 51
  • 1
  • 6
  • Why don't you mark it as the answer? It worked for me :) – motizukilucas Jan 06 '22 at 15:03
  • John. I'm here to ask that you accept your own answer. You know it's what's best - you know the feeling of contentment that will wash over you as you watch everything fall into its right place. Please John. Make us whole. – Spooler Dec 28 '22 at 03:36