I'm working on updating an old AWS Amplify application that was last updated around 4–5 years ago. The app originally had two branches with their own backends: prod and dev.
Recently, I attempted to deploy a small change to dev, but the deployment failed. This led to a rollback failure loop because it attempted to revert to unsupported versions (e.g., Lambda using Node.js 12.x). To resolve this, I created a brand-new branch and incrementally updated it to modern versions. Now, this new branch is stable and up to date.
I want to bring these updates into production without breaking the existing prod environment or causing rollback issues if something goes wrong.
Potential Approaches I'm Considering:
- (If possible) Reconfigure the new stable environment to use the existing production backend, then re-route DNS.
- Migrate production resources (S3, DynamoDB, Cognito) to the new environment and then re-route DNS.
- Merge the changes into prod and hope it does not get stuck rolling back (which I know isn't ideal). Before proceeding, I'd like to know:
What is the best practice for deploying these updates safely? Are there better approaches to avoid downtime and rollback issues? Thanks in advance for any insights!