I'm having trouble implementing a post-confirmation lambda function in which I take the user submitted credentials from the sign-up process and write those to a 'Users' DynamoDB table. The specific entries that I'm trying to write to the table are - user name - email - actual name
In order to distinguish users from one another I need the primary key to be the 'sub' value since users can change their usernames and that could cause problems in the future.
The main points of confusion I'm having are the following
1) What roles should I begin my Lambda function with?
When creating a lambda function I need to give it a starting role and I'm not really sure what starter template I should use. I know I'm going to need DynamoDB write access but I don't see a template for that.
2) How do I access the individual fields of the Cognito user?
As far as I'm aware these values should be stored in the 'event' parameter of the handler function, but I can't find any documentation or sample events that show how to access the individual fields for things like 'sub', 'email', etc.