Skip to content

Conversation

jasdeepbhalla
Copy link

@jasdeepbhalla jasdeepbhalla commented Oct 17, 2025

Issue #35327

Closes #35327.

Reason for this change

Currently, DatabaseClusterFromSnapshot only exposes the metricVolumeReadIOPs() method for monitoring cluster-level I/O metrics. Users cannot easily track instance-level ReadIOPs at the cluster level, which is required for compliance monitoring (e.g., Drata) and simplifies CloudWatch alarm configuration.

Description of changes

  • Added metricReadIOPs(props?: cloudwatch.MetricOptions): cloudwatch.Metric to DatabaseClusterBase.
  • The new method returns a CloudWatch metric for instance-level ReadIOPs aggregated across all instances in the cluster.
  • Available on both DatabaseCluster and DatabaseClusterFromSnapshot by inheritance.
  • Follows the existing pattern used for other metrics such as metricVolumeReadIOPs and metricACUUtilization.
  • Allows users to create alarms or dashboards using the ReadIOPs metric at the cluster level without manually configuring metrics for each instance.

Example usage:

const cluster = DatabaseClusterFromSnapshot.fromSnapshot(...);

const readIOPSMetric = cluster.metricReadIOPs({
  period: cdk.Duration.minutes(5),
  statistic: 'Average'
});

new cloudwatch.Alarm(this, 'ReadIOPsAlarm', {
  metric: readIOPSMetric,
  threshold: 1000,
  evaluationPeriods: 1,
});

Describe any new or updated permissions being added

  • No new IAM permissions are required, as this change only exposes a CloudWatch metric for monitoring purposes.

Description of how you validated changes

  • Updated Integration test to verify that metricReadIOPs returns a CloudWatch Metric with the correct metric name and dimensions.

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 the effort/medium Medium work item – several days of effort label Oct 17, 2025
@aws-cdk-automation aws-cdk-automation requested a review from a team October 17, 2025 22:33
@github-actions github-actions bot added feature-request A feature should be added or improved. p2 beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK labels Oct 17, 2025
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(This review is outdated)

@jasdeepbhalla jasdeepbhalla changed the title feat(aws-rds): add metricReadIOPs method to DatabaseClusterBase feat(rds): add metricReadIOPs method to DatabaseClusterBase Oct 17, 2025
@aws-cdk-automation aws-cdk-automation dismissed their stale review October 18, 2025 00:11

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

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 effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

aws-rds: add metricReadIOPs method to DatabaseClusterFromSnapshot

3 participants