-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aws_rds: DatabaseCluster is not accepting token in monitoringInterval after CDK 2.171.0 #33504
Comments
Looks like the validation was added in PR #32157 (commit 01f2dcd). Perhaps, the validation and places where @jani-flaaming-rebase Are you sure you are getting the mentioned error since using your code, we would get error Thanks, |
I agree that adding this condition to the validation should fix the issue. I double-checked the scenario. I checked out the previous commit without the workaround and I got the described error message. The mentioned CDK code is inside Service Catalog product.
Passing a String to Duration.seconds hasn't been an issue previously. We have previously used CDK version 2.158.0 without issues. Is this information enough or do you need have other things to consider? |
…k with token (#33516) ### Issue # (if applicable) Closes #33504. ### Reason for this change `monitoringInterval` prop in `DatabaseClusterProps` should accept a token. ### Description of changes Skip validations if `monitoringInterval` is a token. ### Describe any new or updated permissions being added N/A ### Description of how you validated changes Added a unit test. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Comments on closed issues and PRs are hard for our team to see. |
Describe the bug
This pull request (introduced in CDK 2.171.0) is adding validation to RDS DatabaseCluster Construct Monitoring Interval field: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_rds.DatabaseCluster.html#monitoringinterval
#32157
Regression Issue
Last Known Working CDK Version
2.170.0
Expected Behavior
Token should be an acceptable value for monitoring interval
Current Behavior
Only number is accepted for monitoring interval field.
Error: 'monitoringInterval' must be one of 0, 1, 5, 10, 15, 30, or 60 seconds, got: ${Token[TOKEN.4704]} seconds.
at new DatabaseClusterNew (../node_modules/aws-cdk-lib/aws-rds/lib/cluster.js:1:8607)
at new DatabaseCluster (../node_modules/aws-cdk-lib/aws-rds/lib/cluster.js:5:4525)
Reproduction Steps
Create CfnParameter and try to use CfnParameter field in RDS DatabaseCluster construct
this.monitoringInterval = new CfnParameter(this, 'MonitoringInterval', {
type: 'String',
description:
'The interval, in seconds, between points when Amazon RDS collects enhanced monitoring metrics for the DB instance',
constraintDescription: 'Must be one of these: 1, 5, 10, 15, 30, or 60',
default: '60',
allowedValues: ['1', '5', '10', '15', '30', '60']
})
...
new DatabaseCluster(
...
monitoringInterval: Duration.seconds(this.monitoringInterval.valueAsString),
...
)
Possible Solution
Allow monitoringInterval to be a token or a number instead of only number.
Additional Information/Context
As a workaround, property override can be used to bypass this issue.
CDK CLI Version
2.179.0
Framework Version
No response
Node.js Version
22.13.1
OS
Ubuntu 24.04
Language
TypeScript
Language Version
TypeScript 5.7.3
Other information
The text was updated successfully, but these errors were encountered: