question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Spec Bug "AWS::CloudWatch::Alarm" "MetricName" (required) ?

See original GitHub issue

According to the Documentation and the Spec files the AWS::CloudWatch::Alarm MetricName is not required: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cw-alarm.html#cfn-cloudwatch-alarms-metricname

But deploying an Allarm without MetricName results in an error: image

Used resource:

  CloudWatchAlarm:
    Type: "AWS::CloudWatch::Alarm"
    Properties:
      ComparisonOperator: "GreaterThanOrEqualToThreshold"
      EvaluationPeriods: 1
      Statistic: "SampleCount"
      Threshold: 0.0
      TreatMissingData: "notBreaching"
      Unit: "Terabits/Second"

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
cmmeyercommented, Feb 1, 2019

Ok, clarification on an internal list.

You can define a Metrics complex parameter -or- any of:

  • MetricName
  • Dimensions
  • Period
  • Namespace
  • Statistic
  • ExtendedStatistic

So, each of those properties has an OnlyOne relationship with Metrics. Additionally, ExtendedStatistic and Statistic are OnlyOne with one or the other required… unless you’ve supplied Metrics in which case you can’t use either. Oh, this is a fun one!

0reactions
kddejongcommented, Mar 30, 2019

I think we can close this one. I just submitted pull request https://github.com/aws-cloudformation/cfn-python-lint/pull/771 to clean some of this up. From my testing Metrics or MetricName had to be specified. The list that @chuckmeyer has for attributes that can’t be defined when Metrics are defined also looks accurate.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spec Bug "AWS::CloudWatch::Alarm" "MetricName" (required ...
According to the Documentation and the Spec files the AWS::CloudWatch::Alarm MetricName is not required:
Read more >
MetricAlarm - Amazon CloudWatch - AWS Documentation
Indicates whether actions should be executed during any changes to the alarm state. Type: Boolean. Required: No. AlarmActions.member.N. The actions to execute ...
Read more >
Explain AWS Cloud Watch Alarm | InterviewDOT - YouTube
AWS CLOUDWATCH ALARM | Explain AWS Cloud Watch Alarm | InterviewDOT ... you need a unified operational overview, real-time granular data, ...
Read more >
Explain AWS Cloud Watch Alarm | InterviewDOT - YouTube
AWS CLOUDWATCH ALARM | Explain AWS Cloud Watch Alarm | InterviewDOT. Watch later ... An error occurred while retrieving sharing information.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found