(rds): instanceUpdateBehaviour is broken with writers
/readers
configuration
#27694
Labels
@aws-cdk/aws-rds
Related to Amazon Relational Database
bug
This issue is a bug.
effort/medium
Medium work item – several days of effort
p2
Describe the bug
According to the documentation, I should be able to use the
instanceUpdateBehaviour
setting with the newwriters
/readers
(e.g., notinstanceProps
) configuration:However, my
cdk diff
shows that even though the setting is still set, the dependency is removed (effectively undoing theROLLING
update setting):Looking at the source code,
instanceUpdateBehaviour
is only paid attention to in thelegacyCreateInstances
method, called when usinginstanceProps
aws-cdk/packages/aws-cdk-lib/aws-rds/lib/cluster.ts
Line 1233 in 22a3234
aws-cdk/packages/aws-cdk-lib/aws-rds/lib/cluster.ts
Lines 1330 to 1335 in 22a3234
When using
writers
/readers
, this parameter is ignoredaws-cdk/packages/aws-cdk-lib/aws-rds/lib/cluster.ts
Line 634 in 22a3234
Expected Behavior
I expected the
instanceUpdateBehaviour
to work still as I transitioned frominstanceProps
to the new API. The property is not marked as@deprecated
and the documentation explicitly shows an example of it working withwriters
/readers
.Current Behavior
The CloudFormation dependency is marked for removal in the
cdk diff
when I transition frominstanceProps
to the newwriters
/readers
API:Reproduction Steps
To show this issue, you can
cdk synth
with theinstanceBehaviour
specified and not specified. The CFN produced is exactly the same.Given,
Create this stack in a new CDK repo:
Produce a template and save it off
Update the stack to not set
instanceUpdateBehaviour
:Produce another template
Diff the two templates:
Note that the
instanceUpdateBehaviour
property has no effect on the resulting template.Possible Solution
_createInstances
method used by thewriters
/readers
API.instanceUpdateBehaviour
does not make sense with the new API, mark it as deprecated and remove the example (linked above) from the documentation.Additional Information/Context
No response
CDK CLI Version
2.103.0 (build d0d7547)
Framework Version
No response
Node.js Version
18.18.2
OS
MacOS
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: