fix: add pre-flight check for existing aurora databases before restore #63
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes duplicate database creation errors during static environment redeployment by checking AWS for existing RDS instances before attempting to create them.
Problem
When redeploying a static environment, the Aurora restore deploy (
npc-db) attempts to recreate an already-existing RDS database, causing an error. This happens because:DeploymentManagerresets all deploy statuses toQUEUEDbefore deploymentdeployAurora()failscli.cliDeploy()tries to recreate the existing databaseSolution
Added a pre-flight check in
deployAurora()that queries AWS to verify if the RDS database already exists before attempting to create it.Changes
findExistingAuroraDatabase(buildUuid, serviceName)- Generic, reusable function that queries AWS for existing RDS instances by tagscli.cliDeploy(), check if database exists in AWS. If found, skip creation and use existing endpointBenefits
Test Plan