feat(cloudwatch): add L2 construct for AlarmMuteRule - #37297
Conversation
|
This PR has been in the MERGE CONFLICTS state for 3 weeks, and looks abandoned. Note that PRs with failing linting check or builds are not reviewed, please ensure your build is passing To prevent automatic closure:
This PR will automatically close in 14 days if no action is taken. |
|
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
|
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
2 similar comments
|
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
|
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
|
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
6 similar comments
|
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
|
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
|
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
|
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
|
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
|
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
|
This PR has been in the MERGE CONFLICTS state for 3 weeks, and looks abandoned. Note that PRs with failing linting check or builds are not reviewed, please ensure your build is passing To prevent automatic closure:
This PR will automatically close in 14 days if no action is taken. |
Issue # (if applicable)
N/A
Reason for this change
AWS CloudWatch recently introduced Alarm Mute Rules, which allow users to temporarily suppress alarm actions during predefined time windows (e.g., maintenance windows, deployments). The L1 construct
CfnAlarmMuteRuleis already available, but there is no L2 construct to provide a higher-level, CDK-idiomatic experience.Description of changes
Added an L2 construct
AlarmMuteRuleforAWS::CloudWatch::AlarmMuteRulewith the followingAlarmMuteRuleclass extendingResource, supporting creation and import (fromAlarmMuteRuleArn,fromAlarmMuteRuleName)MuteScheduleclass withcron(),at(), andexpression()static methods for defining mute schedulesMuteDateTimeOptionsinterface for specifying start/expire dates with minute-level precisionaddAlarm()method for adding mute targets after constructionREADME.mdwith usage examples covering recurring mutes, one-time mutes, timezone, start/expire dates, and importindex.tsDesign decisions on date/time handling
MuteDateTimeOptionsis a custom type with individualyear,month,day,hour,minutefields instead of usingDateor ISO 8601 strings. This is because the AlarmMuteRule API interprets dates in the timezone specified by thetimezoneproperty (defaulting to UTC), so using JavaScriptDateobjects (which are always UTC-based) would be misleading and error-prone. By using plain numeric fields, users specify the date/time exactly as it will be interpreted in the configured timezone.yyyy-MM-ddTHH:mm) because the AlarmMuteRule API does not accept seconds and will reject requests that include them.Describe any new or updated permissions being added
None
Description of how you validated changes
Add both unit and integ tests
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license