crossRegionReferences: Allow Export Value Changes #30771
Labels
@aws-cdk/aws-rds
Related to Amazon Relational Database
closed-for-staleness
This issue was automatically closed because it hadn't received any attention in a while.
effort/medium
Medium work item – several days of effort
feature-request
A feature should be added or improved.
p2
response-requested
Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Describe the feature
When using
crossRegionReferences
, allow the values to change.Use Case
I am building a CDK project to test a cross-region disaster recovery strategy for an application that relies on an RDS instance in Stack A and a read replica of the RDS in Stack B. The stacks are in different regions. Stack A's RDS is created from a snapshot. Stack A exports the created RDS, which is then passed into Stack B via the crossRegionReferences feature. It is used as the
sourceDatabaseInstance
value in theDatabaseInstanceReadReplica
in Stack B.In a DR event, the read replica is promoted and becomes a primary instance rather than a read replica outside of CDK (this is also something I wish CDK could do). When the DR event is over, Stack A's RDS will need to be recreated from a snapshot of the RDS in Stack B so that any data changes during the DR event are retained when migrating back to the original region. When I update Stack A with a new snapshot ID, the value of the RDS changes, creating a new RDS instance. This ends up causing an
UPDATE_ROLLBACK_FAILED
error with the messageReceived response status [FAILED] from custom resource. Message returned: Error: Some exports have changed!
.In my use case, this is expected and desirable. I want to be able to change my export and then re-run a cdk deploy on Stack B so it creates a new read replica and the infrastructure ends up in the same state it was before the DR event.
Proposed Solution
add an option like crossRegionReferences: {enabled: true/false, allow_changes: true/false}
Other Information
I know this is also an issue for things like ACM certificates where they are referenced cross region. I imagine there are other use cases as well.
Acknowledgements
CDK version used
2.146.0
Environment details (OS name and version, etc.)
macOS
The text was updated successfully, but these errors were encountered: