feat(cloudwatch): support alarm mute rules#37504
Conversation
|
|
||||||||||||||
|
|
||||||||||||||
badmintoncryer
left a comment
There was a problem hiding this comment.
Thank you for your nice contribution! I've added two minor comments.
| private renderMuteTargets(): CfnAlarmMuteRule.MuteTargetsProperty | undefined { | ||
| if (this.alarms.length === 0) { | ||
| return undefined; | ||
| } |
There was a problem hiding this comment.
How about adding a validation that verifies the maximum length of the alarms?
https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MuteTargets.html
I noticed that there is a difference between these two documents. I think AWS API restriction (100 APIs) is correct but I want you to confirm actual behavior.
| } | ||
|
|
||
| this.alarmMuteRule = new CfnAlarmMuteRule(this, 'Resource', { | ||
| name: props.alarmMuteRuleName, |
There was a problem hiding this comment.
Could you please add a maximum and minimum length validation?
Issue # (if applicable)
Closes #37502.
Reason for this change
CloudWatch introduced Alarm Mute Rules, enabling us to temporarily mute alarm notifications during planned maintenance downtime, etc.
https://aws.amazon.com/about-aws/whats-new/2026/02/amazon-cloudwatch-alarm-muting-rules/
For details
https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/alarm-mute-rules.html
Description of changes
This PR includes:
cloudwatch.AlarmMuteRuleand prop interface.cloudwatch.ScheduleExpressionto generate alarm mute rule's schedule expression, inspired byscheduler.ScheduleExpression.cloudwatch.Alarm.addAlarmMuteRule().Basic Usage
Describe any new or updated permissions being added
No permissions.
Description of how you validated changes
Added unit tests and an integ test.
The integ test has no assertions because assertion cannot verify that nothing happens.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license