-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
DatabaseCluster: MonitoringRole not created by default when using readers and writers #25941
Comments
I think that you can use the Regards to the monitoring role - it appears that one is not automatically created when using the new API. In the modern
To contrast, in the legacy code the role gets created if not passed in
Thanks for reporting! |
I could clarify that when we first deployed the database with cdk before using writers and readers, the application created a default Monitoring role, with the new implementation it tries to destroy it. |
Please let me know if this issue is fixed and if it is implemented in the "Bug Fix" version of aws-cdk, because I saw something that looks like a bug in the Pull Request. |
…s and writers (#26006) The [`_createInstances`](https://github.com/aws/aws-cdk/blob/4c9016a264c2fec9c0e0e3fae1d7c4216c964b31/packages/aws-cdk-lib/aws-rds/lib/cluster.ts#L635) function was not providing a default `monitoringRole` value with enabled monitoring. This fix creates a default role as done by the [legacy code](https://github.com/aws/aws-cdk/blob/4c9016a264c2fec9c0e0e3fae1d7c4216c964b31/packages/aws-cdk-lib/aws-rds/lib/cluster.ts#L1228). Closes #25941. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
Describe the bug
I've a Typescript app where I developed a library to create an Aurora Mysql database, this library was created with aws-cdk v2.68, we used this to create a database in production using azure DevOps and cloudFormation (we've a functional database), we used the InstanceProps property, and then we saw a message that this element is deprecated in a new version.
Then we updated to aws-cdk v2.82, and I replaced instanceProps according to the migration recommendations just changing the location of the properties as the code below: (https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_rds-readme.html#migrating-from-instanceprops)
Although no other change was made, there is no way to preserve the Instance IDs when we migrated to using "Writer and Reader" elements and also use the monitoringInterval element.
` Code :
Then we compiled the code, and when we tried to deploy the infrastructure we got several differences with the infra deployed before, and there shouldn't be any differences, in the photo below you can see the differences show, I consider that the one that causes the problem is the first element, the MonitoringRole element which will be destroyed, even though this element was never uses in the code, which means that the application must re-create the instance when deploying and, as a result, deestroy our functional implementation.
aws diff results:
Expected Behavior
aws diff shows zero differences when I upgrade to Writer and Reader elements
Current Behavior
aws diff show theses differences :
Reproduction Steps
Possible Solution
Check why aws-cdk finds differences in the MonitoringRole element when we update these elements and we use monitoringInterval. The problem isn't version 2.82 itself, because I did a test with this version without changing the InstanceProps element and the deployment works fine, the error doesn't show up until I change the element to Writer.
Additional Information/Context
No response
CDK CLI Version
2.82.0 (build 3a8648a)
Framework Version
No response
Node.js Version
npm: '9.3.1', node: '18.14.0',
OS
Windows 10 Entreprise 21H2
Language
Typescript
Language Version
Version 5.0.4
Other information
No response
The text was updated successfully, but these errors were encountered: