This content originally appeared on DEV Community and was authored by Isaac Addis
Overview
Using the User Migration Lambda Trigger on a new Cognito user pool enables users to sign-in to a new user pool without having to create a new account or reset their password. The User Migration Lambda runs after failed sign-in attempts and attempts to sign in users against the old user pool during a migration. Following an open-source repository, this blog will guide how to migrate users to a new user pool.
Link to the repository
https://github.com/Collaborne/migrate-cognito-user-pool-lambda
Changes I made to the repository
- I made sure the
event.response.userAttributes
object had keys matching the new user pool's signup attributes (with the same exact spelling). - I added
["custom:<attribute name>"]
to theevent.response.userAttributes
response to add custom attributes to a user in the new user pool.
This content originally appeared on DEV Community and was authored by Isaac Addis

Isaac Addis | Sciencx (2025-10-04T12:21:27+00:00) Zero-Downtime AWS Cognito User Pool Migration (User Migration Lambda Trigger). Retrieved from https://www.scien.cx/2025/10/04/zero-downtime-aws-cognito-user-pool-migration-user-migration-lambda-trigger/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.