Philipp
Philipp

Reputation: 807

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?

Upvotes: 6

Views: 2418

Answers (1)

chris2187
chris2187

Reputation: 51

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.

Upvotes: 1

Related Questions