Skip to content

feat(cloudwatch): add L2 construct for AlarmMuteRule - #37297

Open
kawaaaas wants to merge 7 commits into
aws:mainfrom
kawaaaas:feat/cloudwatch-alarm-mute-rule
Open

feat(cloudwatch): add L2 construct for AlarmMuteRule#37297
kawaaaas wants to merge 7 commits into
aws:mainfrom
kawaaaas:feat/cloudwatch-alarm-mute-rule

Conversation

@kawaaaas

Copy link
Copy Markdown
Contributor

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 CfnAlarmMuteRule is already available, but there is no L2 construct to provide a higher-level, CDK-idiomatic experience.

Description of changes

Added an L2 construct AlarmMuteRule for AWS::CloudWatch::AlarmMuteRule with the following

  • AlarmMuteRule class extending Resource, supporting creation and import (fromAlarmMuteRuleArn, fromAlarmMuteRuleName)
  • MuteSchedule class with cron(), at(), and expression() static methods for defining mute schedules
  • MuteDateTimeOptions interface for specifying start/expire dates with minute-level precision
  • addAlarm() method for adding mute targets after construction
  • Validation for duration bounds (1 minute to 15 days), date ordering, alarm count limits (max 100), and cron minute warning
  • Updated README.md with usage examples covering recurring mutes, one-time mutes, timezone, start/expire dates, and import
  • Exported from index.ts

Design decisions on date/time handling

  • MuteDateTimeOptions is a custom type with individual year, month, day, hour, minute fields instead of using Date or ISO 8601 strings. This is because the AlarmMuteRule API interprets dates in the timezone specified by the timezone property (defaulting to UTC), so using JavaScript Date objects (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.
  • The seconds component is intentionally omitted from the formatted output (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

@github-actions github-actions Bot added p2 beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK labels Mar 20, 2026
@aws-cdk-automation
aws-cdk-automation requested a review from a team March 20, 2026 18:15
@aws-cdk-automation

Copy link
Copy Markdown
Collaborator

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:

  • Resume work on the PR
  • OR request an exemption by adding a comment containing 'Exemption Request' with justification e.x "Exemption Request: "
  • OR request clarification by adding a comment containing 'Clarification Request' with a question e.x "Clarification Request: "

This PR will automatically close in 14 days if no action is taken.

@aws-cdk-automation

Copy link
Copy Markdown
Collaborator

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.

@aws-cdk-automation

Copy link
Copy Markdown
Collaborator

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
@aws-cdk-automation

Copy link
Copy Markdown
Collaborator

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.

@aws-cdk-automation

Copy link
Copy Markdown
Collaborator

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.

@aws-cdk-automation

Copy link
Copy Markdown
Collaborator

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
@aws-cdk-automation

Copy link
Copy Markdown
Collaborator

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.

@aws-cdk-automation

Copy link
Copy Markdown
Collaborator

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.

@aws-cdk-automation

Copy link
Copy Markdown
Collaborator

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.

@aws-cdk-automation

Copy link
Copy Markdown
Collaborator

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.

@aws-cdk-automation

Copy link
Copy Markdown
Collaborator

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.

@aws-cdk-automation

Copy link
Copy Markdown
Collaborator

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.

@aws-cdk-automation

Copy link
Copy Markdown
Collaborator

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:

  • Resume work on the PR
  • OR request an exemption by adding a comment containing 'Exemption Request' with justification e.x "Exemption Request: "
  • OR request clarification by adding a comment containing 'Clarification Request' with a question e.x "Clarification Request: "

This PR will automatically close in 14 days if no action is taken.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK p2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants