Cloud & Infrastructure
Bug Report
Users randomly could not log in: our Cognito post-authentication Lambda exceeded the 5-second limit
A few percent of logins failed with a generic error after we added a Cognito post-authentication trigger that recorded login events in our database. The Lambda ran in a VPC, opened a database connection on cold start, and sometimes exceeded Cognito's 5-second trigger timeout. How we moved the work off the login path.