amazon-web-servicesaws-cloudformationamazon-cloudwatchcloudwatch-alarms

Encountered unsupported property ComparisonOperator


Cloudformation stack throws Error "Encountered unsupported property Comparison Operator" , while creating an AWS::CloudWatch::Alarm using cloudformation.

As per AWS documentation ComparisionOperator value GreaterThanOrEqualtoThreshold is valid. I use AWSTemplateFormatVersion as 2010-09-09

"CPUHighAlarm":{
            "Type":"AWS::CloudWatch::Alarm",
            "Properties":{
                "AlarmDescription":"High CPU utilization",
                "MetricName":"CPUUtilization",
                "Namespace":"AWS/EC2",
                "AlarmActions":[{"Ref":"asgScaleOut"}],
                "ComparisionOperator": "GreaterThanOrEqualtoThreshold",
                "EvaluationPeriods": "1",
                "Threshold": "70",
                "Period":"180",
                "Statistic": "Average",
                "Dimensions": [
                    {
                        "Name": "AutoScalingGroupName",
                        "Value": {
                            "Ref": "asg"
                        }
                    }
                ]
            }
        },

Solution

  • Just a typo. Should be ComparisonOperator instead of ComparisionOperator.

    The CloudFormation Linter can help you catch these quicker and the Visual Studio Code extension can help prevent typos with autocompletion:

    E3002: Invalid Property Resources/CPUHighAlarm/Properties/ComparisionOperator