The question is: how to design NET 6 (Lambda functions) which is uses AWS Cognito. I develop a NET 6 Lambda -> RDS PGSQL. I need to use AWS Cognito to sign in users.
For example, use a Client Application to log in using Amazon Cognito. Once logged in, the client should display data from a Lambda function (.NET 6 Lambda->RDS).
What should be done in the client app and what should be implemented in NET Lambda? For example, the client app should do sign-up, sign-in and then to pass JWT to the Lamda service? My responsibility - NET Lambda. I'd like to use the best practice design.
There is a new doc that shows how to implement a very similiar use case and it can provide some guidance for your questions. There are a few differences however. The Lambda functions are written using the Java Lambda runtime API and the client app is React. The AWS CDK is used to create the AWS Resources too. You can look at the CDK code if interested (it's linked at the end of the doc).
In this example, a user logs in from the Client App using Cognito. Once the user logs in, they see the following data returned from the Lambda functions. The data is retrieved from an Amazon DynamoDB table (as shown in the previous illustration).
All AWS Service interaction (the services shown in the illustration) is done via the Lambda functions using the AWS SDK. For your question - what should be done in the client. You can use logic to sign in the user from your client app using Cognito and display the data returned from Lambda functions via API Gateway (as shown in this example).
Creating a photo asset management application using the AWS SDK for Java
(At some point - it will be ported to other AWS SDKs such as .NET).