Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Link AWS Cognito ID to AWS RDS Instance

I'm pretty new to AWS and I try to design a first API. I tend to use the following elements of AWS: Cognito (for user auth), Lambda (for REST API) and RDS (for postgres). I've developed an entity relationship model, which includes a user entity. This entity will have an id, email, password, name (and some other stuff).

  1. Question: Can this entity be stored/handled in/by Cognito?

That entity should have an id, which will be used as a foreign key in other parts of the erm diagram.

What I want: The user entity will be completely handled by Cognito, but the id of the user can be used in my RDS.

  1. Question: Is this possible?

Afaik Cognito only supports Facebook, Google and Amazon accounts. But I can also add my own authentification method . So I have to go for this path.

  1. Question: Where will those entities be stored? Can this be handled by Cognito or do I have to store the user entity in my RDS? If so, why would I need Cognito?
like image 798
Philipp Avatar asked Jan 18 '18 08:01

Philipp


People also ask

How do I connect to an RDS database?

Sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/ . In the navigation pane, choose Databases to display a list of your DB instances. Choose the name of the DB instance to display its details. On the Connectivity & security tab, copy the endpoint.


1 Answers

When you first create a user pool, you can specify what attributes to associate with your account. You can also add custom attributes. How you get at those depends on the context. There is a javascript sdk https://github.com/aws/amazon-cognito-identity-js

Check out the use cases for how to access the attributes. If you want to do it from the command line, install the AWS command line tools and cognito-idp

This can be a bit cumbersome so it would help to know the specific context. There's also one for Java, etc.

like image 64
chris2187 Avatar answered Sep 29 '22 20:09

chris2187