Copy newly-confirmed users from Cognito to DynamoDB
Author: Vladimir Budilov Find me on Medium or LinkedIn and YouTube
This AWS Lambda function automates the backup of newly-confirmed Amazon Cognito users to Amazon DynamoDB. This can be useful in many scenarios, especially when trying to tie in user-specific data to the actual users. For example, if you're using AWS AppSync you can query for user events and automatically retrieve the user info without calling an external service.
myRegion: us-east-1
myDDB: Users
myPool: my-userpool-name
'userId': {S: event.request.userAttributes.sub},
'sortKey': {S: "user"},
Run the following command to deploy the function:
serverless deploy
You're all set!