I am using aws cognito for user auth, but would like a dynamodb user table to store more application specific user attributes that cognito isn't designed for.
I want to link cognito & dynamobd together via a unique id. Cognito sets a "sub" value as a unique id once a user is confirmed (done with a pre-signup trigger) but I am not sure how to capture this value in a post confirmation lambda trigger to add to dynamobd. It appears to only be provided in an Auth token payload. Am I best requesting an auth token in my post confirmation lambda trigger? Im not sure if this can be done using Python. I'm very new to it all.
What I am trying to do in one swoop is:
- User Registers - request to cognito
- Pre lambda trigger sets Confirmed = True
- User added to Cognito
- Post confirmed lambda trigger adds user to dynamodb with the "sub" uuid as primary key.
Thanks.