From the course: AWS Quick Tips for Developers

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Cognito user pool triggers

Cognito user pool triggers

- [Instructor] Many services in AWS allow you to create triggers to kick off a Lambda function at certain points and at certain actions. That includes Cognito user pools. I can click on Triggers on the left and see a variety of actions that can kick of triggers when they occur. I have a Lambda assigned to my pre-authentication. This is invoked when a user submits their information to be authenticated. This happens when a user tries to log in. I have my trigger associated with my maryhadalittle Lambda. If we look at that Lambda, we see that it's very simple. It just takes the event, logs it out, and returns the event. As long as I return the event, even if I've made changes, the user will be able to log in. So now when I log in with this user, they're able to log in. But if I change my Lambda to return something else or raise an exception, the user won't be able to log in. I'll be given a notification that…

Contents