Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set the trigger of a lambda function in amplify?

I am using the amplify framework from AWS to build a webapp in Vue.js.

As for now, I am using the cognito service to authenticate users.

I want to trigger a lambda function when the user first create his account. I already created a lambda function using the following command:

amplify function add

I tested my function using this command:

amplify function invoke myLambdaFunction

And now I want to trigger this function when an user create an account.

Any idea how can I do that ?

Thank you, Alexis

like image 869
Alexis Santini Avatar asked Nov 06 '19 17:11

Alexis Santini


1 Answers

You can do it with the cli:

% amplify auth update
What do you want to do? Walkthrough all the auth configurations
...
? Do you want to configure Lambda Triggers for Cognito? Yes 
? Which triggers do you want to enable for Cognito Pre Sign-up
? What functionality do you want to use for Pre Sign-up
Do you want to edit your custom function now? Yes

Then you can add your logic in this newly generated function

like image 53
Engam Avatar answered Sep 23 '22 12:09

Engam