Encountered unsupported property ComparisonOperator

472 views Asked by At

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

Any help would be appreciated :)

"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"
                        }
                    }
                ]
            }
        },
2

There are 2 answers

0
Pat Myron On BEST ANSWER

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

1
Dejan Peretin On

Maybe it's case sensitive. Try GreaterThanOrEqualToThreshold.