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 ElastiCache for data storage of global leaderboards, using the Redis engine and Sorted Sets to store your leaderboards.
- 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 account.
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 a AddUserScore endpoint to record a score for a user.
Fourth, you use the FetchUserScores endpoint to retrieve the top scores for a particular user.
Finally, you use the FetchTopScores endpoint to retrieve the global top scores for the current day and month as well as the top scores of all time.
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. 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 recording some new scores for the user. Fourth, you retrieved the top scores for a single user. Finally, you retrieved the top scores around the globe.
In the next module, you clean up the resources you created.