I have created an autoscaling target and a policy which is attached to it.
AutoScalingPolicy:
Type: AWS::ApplicationAutoScaling::ScalingPolicy
Properties:
PolicyName: !Join ['', [!Ref ServiceName, auto-scaling-policy]]
PolicyType: TargetTrackingScaling
ScalingTargetId: !Ref AutoScalingTarget
TargetTrackingScalingPolicyConfiguration:
PredefinedMetricSpecification:
PredefinedMetricType: ECSServiceAverageCPUUtilization
ScaleInCooldown: 10
ScaleOutCooldown: 10
# Keep things at or lower than 50% CPU utilization, for example
TargetValue: !Ref AutoScalingTargetValue
This is creating cloudwatch alarms as:
High: 3 datapoints within 3 minutes
Low: 15 datapoints within 15 minutes
I want to customize this to:
High: 1 datapoint within 1 minute
Low: 1 datapoint within 1 minute
I am able to do this manually from AWS console. However, struggling to find a way to do the same using cloudformation template.