Is it appropriate to combine Cognito
identity management with Dynamo DB
?
I would like to authenticate users with Facebook, which I can do with Cognito
and then store user related data in a DynamoDB
table.
What information would I use from Cognito
as a primary key for my table to guarantee unicity? Or should I simply use the facebookId that I can get with the graph API?
Go to the DynamoDB Console and click Create Table. The Create Table wizard appears. Specify your table name, primary key type (Hash), and hash attribute name (“Id”) as shown below, and then click Continue: Leave the edit fields in the next screen empty and click Continue.
Create an IAM Role for your Lambda Function Access your IAM Management console and select Roles from the left menu. Click Create role and select the AWS Service Lambda role. Once both are highlighted, click Next: Permissions. Name your role whatever you want, as long as it's recognizable to you, and click Create role.
Q: Which public identity providers can I use with Amazon Cognito Identity? You can use Amazon, Facebook, Twitter, Google and any other OpenID Connect compatible identity provider.
You can use the cognito identity ID as the hash key for your DynamoDB table, look at this question for an example IAM policy.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With