Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS::CloudWatch::Alarm.Period >= 60 for metrics in the AWS/ namespace #1059

Closed
irvingpop opened this issue Jul 29, 2019 · 1 comment
Closed
Labels
good first issue Good for newcomers new rule New rule p0 High Priority v1 v1.X

Comments

@irvingpop
Copy link

irvingpop commented Jul 29, 2019

cfn-lint version: (cfn-lint --version)

cfn-lint 0.22.3

Description of issue.

AWS won't let you set AWS::CloudWatch::Alarm.Period less than 60, it would be neat if cfn-lint flagged that.

Please provide as much information as possible:

The following resource should get flagged because the Period property is invalid, but doesn't:

  ELB5XXExceeded:
    Type: AWS::CloudWatch::Alarm
    Properties:
      AlarmName: !Sub AppELB_5XX_Exceeded-${AWS::StackName}
      AlarmDescription: Alarms when an 5xx requests exceed a specified threshold.
      AlarmActions: [!Ref AlertNotificationTopic]
      MetricName: HTTPCode_ELB_5XX_Count
      Namespace: AWS/ApplicationELB
      ComparisonOperator: GreaterThanOrEqualToThreshold
      EvaluationPeriods: 2
      Period: 30
      Statistic: Sum
      Threshold: 10
      Dimensions:
        - Name: LoadBalancer
          Value: !GetAtt ChefALB.LoadBalancerFullName

Cfn-lint uses the CloudFormation Resource Specifications as the base to do validation. These files are included as part of the application version. Please update to the latest version of cfn-lint or update the spec files manually (cfn-lint -u)

@kddejong kddejong added the new rule New rule label Aug 2, 2019
@PatMyron
Copy link
Contributor

PatMyron commented Sep 12, 2019

Good catch, reproduced:

Period (30) not supported for namespaces with the following prefix: AWS/ (Service: AmazonCloudWatch; Status Code: 400; Error Code: ValidationError; Request ID: )

Resources:
  Alarm:
    Type: AWS::CloudWatch::Alarm
    Properties:
      ComparisonOperator: GreaterThanOrEqualToThreshold
      EvaluationPeriods: 2
      Period: 30
      MetricName: HTTPCode_ELB_5XX_Count
      Namespace: AWS/ApplicationELB

Wondering if that limitation is specific to the AWS/ prefix from that error message and if it lines up with any of our existing concise constraint formats

@PatMyron PatMyron added the good first issue Good for newcomers label Aug 28, 2020
@PatMyron PatMyron changed the title Feature Request: AWS::CloudWatch::Alarm Only a period greater than 60s is supported for metrics in the "AWS/" namespaces AWS::CloudWatch::Alarm.Period >= 60 for metrics in the AWS/ namespace Aug 28, 2020
@kddejong kddejong added the p0 High Priority label Apr 6, 2023
@kddejong kddejong added the v1 v1.X label Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers new rule New rule p0 High Priority v1 v1.X
Projects
None yet
Development

No branches or pull requests

3 participants