question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AWS Cognito User Pool triggers support

See original GitHub issue

This is a Feature Proposal

Description

I’d like to be able to create functions that hook into a User Pool for various use-cases such as preSignup, customMessage etc. (which are defined here).

Currently I deploy the functions then manually attach them via AWS Console (although this can probably be automated using the AWS SDK).

I am aware that Lambda event sources are different from Lambda triggers (at least conceptually), but in practice they both seem to be only fired when an event occurs. Therefore, it would be lovely if I could define them in serverless.yml with something as follows:

functions:
  preSignup:
    handler: handler.preSignup
    events:
      - cognito-user-pool:
          pool: <POOL-ID>
          trigger: PreSignUp

Similar or dependent issues:

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:6
  • Comments:20 (20 by maintainers)

github_iconTop GitHub Comments

3reactions
horike37commented, May 17, 2017

Thank you for the greate proposal @hassankhan 😍 That could be super helpful and really useful! I often use Cognito UserPool too, and face the same problem 😅

As you say, those triggers are a little different from Lambda event sources, so it may be better to change the syntax to distinguish events from Lambda triggers.

For example

functions:
  preSignup:
    handler: handler.preSignup
    aws-triggers:
      - cognitoUserPool:
          pool: <POOL-ID>
          target: preSignUp

What do you think? @pmuens @eahefnawy

2reactions
pmuenscommented, May 22, 2017

Awesome!!! 💯 Thank you very much @hassankhan for working on this one! 🥇 And thank you @horike37 for helping out! 💪

Already added the PR to the review list! 🎉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Customizing user pool workflows with Lambda triggers
Adding a user pool Lambda trigger · Use the Lambda console to create a Lambda function . · Go to the Amazon Cognito...
Read more >
Post authentication Lambda trigger - Amazon Cognito
Amazon Cognito passes event information to your Lambda function. The function then returns the same event object to Amazon Cognito, with any changes...
Read more >
Cognito user pool triggers - Amazon Web Services Tutorial
Cognito user pool triggers ... - [Instructor] Many services in AWS allow you to create triggers to kick off a Lambda function at...
Read more >
AWS Lambda Events - Cognito User Pool
Serverless supports all Cognito User Pool Triggers as specified here. Use this guide to understand the event objects that will be passed to...
Read more >
Using Lambda + AWS Cognito Triggers to Only Allow Auto ...
If you are using AWS Cognito for your authentication source for your site, it can be easily configured to require verification of emails ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found