AWS Logo
Menu
The Query Game

The Query Game

How I used Amazon Q to create a challenging game for the AWS Game Builder Challenge.

Published Jan 13, 2025
Last Modified Jan 21, 2025

How it began!

I started by creating a memory game in which you needed to memorize the path. It was a great experience. First, I was making it with Pygame; then I tried to move it to a web-based version, but I wasn't happy because it wasn’t using the AWS services I wanted. I wanted to use Serverless. So, two days before the deadline for the game, I remembered a game I used to play as a child: the Query Game. I tried to create a proof of concept for it, and it took me less than two hours to create using Amazon Q. It was really fast, so I decided to abandon the other project.

The AWS Game Challenge

The challenge was to use the AmazonQ to build a game, and to be honest, it really worked well for writing Python code. However, when it came to writing the front-end code, I faced some challenges. I had some experience with writing scripts and back-end code, but this was the first time creating a front end, so you it might not be perfect.
The other challenge was to use AWS services; this project is built on top of AWS serverless services. I did my best to apply the Cost Optimization pillar from the AWS Well-Architected Framework, but I am open to suggestions. If I had more time, I would probably use CloudFront and AWS WAF on top of the services.

The Architecture

After the code was ready and tested, I began to create the architecture. At first, it was only an S3 bucket and a Lambda function, and I was using a function URL, which was fine for the start. However, as a Solution Architect, I always urged developers to use best practices. Although I had no time left, I decided to add the API Gateway and instead of hosting everything in a single Lambda function, move them to separate ones. Moreover, I added a Lambda layer because, under the hood, all of them were using the same Python packages. In the picture below, you can see the diagram for the architecture.
Architecture
 

What I learned

For this project, I used Lambda layers, which helped me save time, and I only had to change the code without worrying about the Python packages. I used HTTP API Gateway for the first time; so far, I had mostly been working with the REST one. I find much easier to use than the REST API GW. However, one drawback is that it does not support caching.
one key takeaway from this project was learning how to integrate my code with Amazon Bedrock. It was a little bit challenging, primarily working with inference profiles. I am going to write another post on that soon.

What's next for The Query Game

The UI/UX needs to be improved, and some logic in the code also needs attention. If I want to add a first feature to this game, I will create a leaderboard that shows which users could guess the word.
On the DevOps side, I probably need to write the Terraform code for deploying this game.
 

Comments