fix: never restore over or destroy an operator-pinned aurora cname - #249
Merged
Merged
Conversation
An aurora-restore deploy only skipped restore while its status was BUILT or READY. Any other status (a superseded run left QUEUED, a failed rollout, a teardown) fell through to a tag lookup and full restore that replaced a hand-set cname with a new cluster endpoint. A cname that is not an RDS endpoint can only have been set by an operator, since Lifecycle stores only endpoints returned by AWS. Such pinned cnames now skip restore regardless of status, and both targeted teardown and full build deletion skip the CLI destroy for them.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
aurora-restoredeploy only skipped restore while its status wasBUILTorREADY. Any other status (a superseded run leftQUEUED, a failed rollout, a teardown) fell through to the tag lookup and, finding nothing, ran a full restore. That replaced a hand-setcnamewith the endpoint of a brand-new cluster.cnamethat isn't an RDS endpoint is now treated as pinned by an operator: Lifecycle only ever stores endpoints returned by AWS, so anything else was set by hand. Pinned cnames skip restore regardless of status, and are never overwritten.cname, or an RDS endpointcname, behave exactly as before.Verifying Changes
jestfull suite andeslinton the changed files: both green.tscreports no new errors in the touched files.QUEUED/DEPLOY_FAILED/ERROR/TORN_DOWN, and teardown and build deletion leaving a pinned database in place while still destroying a Lifecycle-restored one.Notes
*.rds.amazonaws.comendpoint set by hand is not protected and keeps today's behavior. The workaround is to front it with a DNS name. An explicit pin flag is a possible follow-up if pinning raw endpoints turns out to be common.