aws-cdk: [aws-cloudwatch] Missing ThresholdMetricId
When creating Cloudwatch Alarm that makes use of anomaly detection the following error is raised at deploy time:
ComparisonOperators for ranges require ThresholdMetricId to be set (Service: AmazonCloudWatch; Status Code: 400; Error Code: ValidationError; Request ID: xxx; Proxy: null)
Reproduction Steps
aws_cloudwatch.Alarm(
self,
"my_alarm",
evaluation_periods=1,
metric=sqs_queue.metric_number_of_messages_sent(),
threshold=2,
statistic="Average",
comparison_operator=aws_cloudwatch.ComparisonOperator.LESS_THAN_LOWER_OR_GREATER_THAN_UPPER_THRESHOLD,
)
The Alarm construct works great for any of the other ComparisonOperators that do not rely on anomaly detection i.e. GreaterThanThreshold.
Environment
- CLI Version : 1.62.0
- Framework Version: 1.64.0
- Node.js Version: v12.14.1
- OS : MacOS Catalina
- Language (Version): Python 3.7
This is š Bug Report
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 12
- Comments: 21 (10 by maintainers)
Commits related to this issue
- feat(cloudwatch) create AnomalyDetectionAlarm L2 construct Allows customers to create Alarms with anomaly detection enabled. Supports both direct metrics and math expressions. Closes #10540 — committed to brandondahler/aws-cdk by deleted user 5 years ago
- feat(cloudwatch) create AnomalyDetectionAlarm L2 construct Allows customers to create Alarms with anomaly detection enabled. Supports both direct metrics and math expressions. Closes #10540 — committed to brandondahler/aws-cdk by deleted user 5 years ago
- feat(cloudwatch) create AnomalyDetectionAlarm L2 construct Allows customers to create Alarms with anomaly detection enabled. Supports both direct metrics and math expressions. Closes #10540 — committed to brandondahler/aws-cdk by deleted user 5 years ago
- feat(cloudwatch) create AnomalyDetectionAlarm L2 construct Allows customers to create Alarms with anomaly detection enabled. Supports both direct metrics and math expressions. Closes #10540 — committed to brandondahler/aws-cdk by deleted user 5 years ago
- feat(cloudwatch) create AnomalyDetectionAlarm L2 construct Allows customers to create Alarms with anomaly detection enabled. Supports both direct metrics and math expressions. Closes #10540 — committed to brandondahler/aws-cdk by deleted user 5 years ago
- feat(cloudwatch) create AnomalyDetectionAlarm L2 construct Allows customers to create Alarms with anomaly detection enabled. Supports both direct metrics and math expressions. Closes #10540 — committed to brandondahler/aws-cdk by deleted user 5 years ago
- feat(cloudwatch) create AnomalyDetectionAlarm L2 construct Allows customers to create Alarms with anomaly detection enabled. Supports both direct metrics and math expressions. Closes #10540 — committed to brandondahler/aws-cdk by deleted user 5 years ago
- feat(cloudwatch) create AnomalyDetectionAlarm L2 construct Allows customers to create Alarms with anomaly detection enabled. Supports both direct metrics and math expressions. Closes #10540 — committed to brandondahler/aws-cdk by deleted user 5 years ago
- feat(cloudwatch) create AnomalyDetectionAlarm L2 construct Allows customers to create Alarms with anomaly detection enabled. Supports both direct metrics and math expressions. Closes #10540 — committed to brandondahler/aws-cdk by deleted user 5 years ago
- feat(cloudwatch) create AnomalyDetectionAlarm L2 construct Allows customers to create Alarms with anomaly detection enabled. Supports both direct metrics and math expressions. Closes #10540 — committed to brandondahler/aws-cdk by deleted user 5 years ago
- feat(cloudwatch) create AnomalyDetectionAlarm L2 construct Allows customers to create Alarms with anomaly detection enabled. Supports both direct metrics and math expressions. Closes #10540 — committed to brandondahler/aws-cdk by deleted user 5 years ago
- feat(cloudwatch) create AnomalyDetectionAlarm L2 construct Allows customers to create Alarms with anomaly detection enabled. Supports both direct metrics and math expressions. Closes #10540 — committed to brandondahler/aws-cdk by deleted user 5 years ago
- Simplify anomaly detection alarm API This commit further simplifies the anomaly detection alarm API by: 1. Removing thresholdMetricId from public API: - Remove thresholdMetricId from AlarmProps a... — committed to scorbiere/aws-cdk by scorbiere 2 years ago
- feat(cloudwatch): anomaly detection alarms (#31232) ### Issue #10540 Closes #10540. ### Reason for this change This change adds proper support for creating CloudWatch anomaly detection alarms, fix... — committed to fidelity-contributions/aws-aws-cdk by scorbiere 2 years ago
Is there any hope for this?
In the meantime, If you really need this feature you can configure it using escape hatch:
š A status update on this would be highly appreciated!
any update so far?
Hello, Iām working on a fix for this now, a PR should be open shortly.
š
Any update on this?
Is this being worked upon?