I have configured a CloudWatch alarm in order to trigger auto scaling for an ECS service. The alarm is configured to trigger auto scaling when there's a certain number of scheduled activities in a step function.
But when testing with 1000+ scheduled activities in the step function, the alarm is raised, but the number of scheduled activities showed in CloudWatch metrics is much lower than the number scheduled activities I see in the step function itself. Therefore either no scale up occurs, or a much lower number of machines is
This is the alarm configuration:
{
"Type": "AWS::CloudWatch::Alarm",
"Properties": {
"AlarmName": "thumbnails-generator-scaling-alarm",
"ActionsEnabled": true,
"OKActions": [],
"AlarmActions": [
"arn:aws:autoscaling:us-west-2:111111111111:scalingPolicy:8694a867-85ee-4740-ba70-7b439c3e5fb3:resource/ecs/service/prod/thumbnails-generator:policyName/thumbnails-generator-scaling-policy"
],
"InsufficientDataActions": [],
"MetricName": "ActivitiesScheduled",
"Namespace": "AWS/States",
"Statistic": "SampleCount",
"Dimensions": [
{
"Name": "ActivityArn",
"Value": "arn:aws:states:us-west-2:111111111111:activity:thumbnails-generator-activity-prod"
}
],
"Period": 300,
"EvaluationPeriods": 1,
"DatapointsToAlarm": 1,
"Threshold": 0,
"ComparisonOperator": "GreaterThanOrEqualToThreshold",
"TreatMissingData": "missing"
}
}
This is the auto scale configuration:
Please advise what can I do in order to make the auto scale work properly.