feat(rds): enhanced monitoring configuration at the cluster level#32157
feat(rds): enhanced monitoring configuration at the cluster level#32157mergify[bot] merged 15 commits intoaws:mainfrom
Conversation
aws-cdk-automation
left a comment
There was a problem hiding this comment.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #32157 +/- ##
=======================================
Coverage 77.17% 77.17%
=======================================
Files 105 105
Lines 7169 7169
Branches 1315 1315
=======================================
Hits 5533 5533
Misses 1455 1455
Partials 181 181
Flags with carried forward coverage won't be shown. Click here to find out more.
|
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
GavinZZ
left a comment
There was a problem hiding this comment.
Left some feedback, thanks for the contribution!
| new rds.DatabaseCluster(this, 'Cluster', { | ||
| engine: rds.DatabaseClusterEngine.auroraPostgres({ version: rds.AuroraPostgresEngineVersion.VER_16_1 }), | ||
| writer: rds.ClusterInstance.serverlessV2('writerInstance'), | ||
| vpc, | ||
| monitoringInterval: Duration.seconds(5), | ||
| }); |
There was a problem hiding this comment.
I didn't see enableClusterLevelEnhancedMonitoring property set in this codeblock?
There was a problem hiding this comment.
This code block is an example of configuring enhanced monitoring at the instance level.
// Enable Enhanced Monitoring at instance level to all instances in the cluster
new rds.DatabaseCluster(this, 'Cluster', {
engine: rds.DatabaseClusterEngine.auroraPostgres({ version: rds.AuroraPostgresEngineVersion.VER_16_1 }),
writer: rds.ClusterInstance.serverlessV2('writerInstance'),
vpc,
monitoringInterval: Duration.seconds(5),
});
// Enable Enhanced Monitoring at the cluster level
new rds.DatabaseCluster(this, 'Cluster', {
engine: rds.DatabaseClusterEngine.auroraPostgres({ version: rds.AuroraPostgresEngineVersion.VER_16_1 }),
writer: rds.ClusterInstance.serverlessV2('writerInstance'),
vpc,
monitoringInterval: Duration.seconds(5),
enableClusterLevelEnhancedMonitoring: true,
});There was a problem hiding this comment.
I see! The text above got me confused If you want to enable enhanced monitoring at the cluster level and I didn't notice the comment you. Looks good.
There was a problem hiding this comment.
No problem! Thank you for your confirmation!
| monitoringInterval: props.enableClusterLevelEnhancedMonitoring ? undefined : props.monitoringInterval, | ||
| monitoringRole: props.enableClusterLevelEnhancedMonitoring ? undefined : this.monitoringRole, |
There was a problem hiding this comment.
Would be nice to have a comment to explain that when enableClusterLevelEnhancedMonitoring is enabled, we already set interval and role at cluster level so no need to re-set it in instance level.
There was a problem hiding this comment.
I have added such explanations to all the sections where instance-level enhanced monitoring settings are applied.
| { | ||
| "Resources": { | ||
| "Vpc8378EB38": { | ||
| "Type": "AWS::EC2::VPC", | ||
| "Properties": { | ||
| "CidrBlock": "10.0.0.0/16", | ||
| "EnableDnsHostnames": true, | ||
| "EnableDnsSupport": true, | ||
| "InstanceTenancy": "default", | ||
| "Tags": [ | ||
| { | ||
| "Key": "Name", | ||
| "Value": "EnhancedMonitoringClusterTestStack/Vpc" | ||
| } | ||
| ] |
There was a problem hiding this comment.
what is this integ.temp.js test? I don't see any integration testss attach to it.
There was a problem hiding this comment.
I'm sorry.. I've removed it.
Co-authored-by: GZ <hz351086153@gmail.com>
Pull request has been modified.
Co-authored-by: GZ <hz351086153@gmail.com>
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
|
Comments on closed issues and PRs are hard for our team to see. |
Issue # (if applicable)
None
Reason for this change
AWS RDS now supports the configuration of advanced monitoring at the cluster level.
https://aws.amazon.com/about-aws/whats-new/2024/09/amazon-rds-performance-insights-supports-aurora-cluster-level-configuration/?nc1=h_ls
This feature is essential for creating limitless database cluster. (#32151)
Description of changes
I added
enableClusterLevelEnhancedMonitoringprop toClusterProps.If this prop enabled,
monitoringIntervalandmonitoringRoleis applied to not the instances but the cluster.Enhanced monitoring configuration for the cluster and instances has some restrictions.
monitoringRoleArnfor both the cluster and instances, the values must be identical.monitoringIntervalfor both the cluster and instances, the values must be identical.monitoringIntervalormonitoringRoleArnis set at the cluster level, enhanced monitoring will be enabled even if the same values are not specified for the instances.Based on the above, I decided to add a flag (
enableClusterLevelEnhancedMonitoring) to switch the application ofmonitoringIntervalandmonitoringRolebetween the instance level and the cluster level to avoid breaking changes to the existing props.Verification Results Memo
The value of the Enhanced Monitoring configuration must be the same for both the cluster level and the instance level.
The monitoring role arn must be the same for both cluster and instance level.
Resource handler returned message: "MonitoringRoleArn conflicts with cluster level parameter. (Service: Rds, Status Code: 400, Request ID: 761a867d-409e-4208-a08e-5591607d0ed0)" (RequestToken: fb691324-f37c-405d-e5bd-447911f7664f, HandlerErrorCode: InvalidRequest)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