DEV Community

Discussion on: AWS Amplify CLI, how to automatically add a user to a Cognito User Pool with a Lambda-Trigger

Collapse
 
ale_annini profile image
Alessandro Annini

Hi Michael, thanks for the useful article!

But what if I added something like userPoolGroupName to cognito custom attributes and I want to read it from the event object in lambda function? How can I dynamically assign the group property?

Thanks!

Collapse
 
beavearony profile image
Michael Gustmann

Using Cognito Lambda Triggers got a lot easier with recent releases. See this post for examples:
aws.amazon.com/en/blogs/mobile/amp...

You can also call other functions from the aws-sdk inside the lambda to get your desired information. adminAddUserToGroup is only one of many function you could use.