In this module, you use your application that you’ve deployed. Before you do that, let’s do a quick recap of the AWS components you’re using in your application:
- Amazon Aurora Serverless for data storage, including the Data API for HTTP-based database access from your Lambda function.
- AWS Secrets Manager for storing your database credentials when using the Data API.
- Amazon Cognito for user registration and authentication.
- AWS Lambda for compute.
- Amazon API Gateway for HTTP-based access to your Lambda function.
Let’s see how each of these pieces tie together. In the following steps, you walk through your different application endpoints using these components.
First, you start with a Registration endpoint, where a new user signs up and creates their character.
Second, you use a Login endpoint where a user can use a client (such as a web application or a mobile app) to authenticate and receive an ID token.
Third, you use an AddItem endpoint to add a new item to your user’s inventory.
Finally, you use the GetUser endpoint to retrieve your user’s information, including all of the items held in the user’s inventory.
Time to Complete Module: 20 Minutes
In this module, you exercised your working endpoints to see how your components worked together. First, you registered a new user, which involved creating a new user in your Amazon Cognito user pool as well as adding that user to your Amazon Aurora Serverless database. Second, you exercised the login endpoint to fetch an ID token that can be used by the client to authenticate the user. Third, you used this ID token to authorize the user when adding a new item to the user’s inventory. Finally, you fetched your user details to see the new item you added.
In the next module, you clean up the resources you created.