AWS Builder Center
Weekend Creative Challenge: Bousbi’s Tiny Tale Machine

Weekend Creative Challenge: Bousbi’s Tiny Tale Machine

A personal bedtime-story generator built with AWS Lambda, Terraform, and GitHub Pages—combining motherhood, creativity, and serverless learning.

A Creative Challenge at Exactly the Right Time

This is the first AWS Builder Center challenge I have attempted, and I wanted to build something small enough to complete over a weekend but personal enough to feel meaningful.
I recently became a mother, and bedtime stories are beginning to become part of everyday life with my daughter, Anastasia—affectionately known in our family as “Bousbi.” That new chapter of my life became the inspiration for Bousbi’s Tiny Tale Machine, a small serverless application that creates personalised bedtime adventures for children.
My goal was not to build a large platform or add features simply for the sake of complexity. I wanted to create one focused experience that could make a parent and child smile while giving me an opportunity to practise AWS Lambda, Terraform, frontend-to-backend communication, and deployment.
Even if I do not win the AWS Builder Jacket, this project has already made the challenge worthwhile. It encouraged me to turn an idea into a complete application, document the process, and learn by building rather than only reading.

What Bousbi’s Tiny Tale Machine Does

The application asks the user to select a few simple “story ingredients”:
  • The child’s name
  • A favourite animal
  • A magical destination
  • A story mood: magical, calming, funny, or adventurous
After the user selects the ingredients and presses Create my tiny tale, the frontend sends them to an AWS Lambda function. The function safely processes the input and combines different openings, adventures, challenges, solutions, and endings to produce a personalised bedtime story.
For example, Anastasia might travel with a tiny blue elephant to the Castle Above the Clouds, help the stars remember how to shine, and return home on a silver cloud just in time for bed.
The user can then copy the story or generate another one with different ingredients. No accounts are required, and neither the submitted information nor the generated story is stored.
The application deliberately does not use a generative AI model. Instead, its Python backend uses curated narrative building blocks and randomized combinations. This keeps the project simple, predictable, child-friendly, and extremely inexpensive to run while still generating many different stories.

How I Built It

I divided the application into three small layers: the browser interface, the serverless story generator, and the infrastructure definition.

The Frontend

The frontend uses plain HTML, CSS, and JavaScript. I chose not to introduce a JavaScript framework because the application only needs one form and one result view. Removing a build framework reduced the number of dependencies, made the code easier to understand, and allowed the static site to be hosted directly with GitHub Pages.
The interface uses a soft storybook-inspired design with pastel colours, a moon, stars, and cloud details. It is responsive so that parents can use it from a phone as easily as from a laptop. I also added accessible form labels, visible loading and error states, keyboard-friendly controls, and support for reduced-motion preferences.
When the user submits the form, JavaScript sends a JSON request to the Lambda Function URL. The returned story is separated into readable paragraphs and displayed on the same page.

The Story Generator

The backend is a small Python function running on AWS Lambda. It contains separate collections of:
  • Story openings for each mood
  • Ways to introduce the selected animal and location
  • Magical, calming, funny, and adventurous challenges
  • Positive solutions centred on bravery, kindness, imagination, and teamwork
  • Mood-specific endings
The Lambda randomly selects one item from each relevant collection and combines them with the child’s chosen ingredients. It also limits and cleans incoming text before using it. Expected input errors return a clear  400  response, while unexpected errors return a generic  500  response without exposing internal details.
I added Python unit tests to confirm that the function produces a personalised story and correctly rejects invalid JSON. These tests passed locally before packaging the project.

Infrastructure as Code

I used Terraform to define the AWS infrastructure instead of creating resources manually in the console. The configuration provisions:
  • An AWS Lambda function using Python 3.13 on Arm architecture
  • A dedicated IAM execution role
  • The AWS-managed basic Lambda logging policy
  • A CloudWatch log group with seven-day retention
  • A public Lambda Function URL
  • CORS configuration for the browser frontend
The Lambda uses only 128 MB of memory and has a five-second timeout. There is no API Gateway, database, storage bucket, or provisioned concurrency.
Terraform also packages the Python source into the ZIP file expected by Lambda. After deployment, it prints the Function URL as an output. That URL is then added to the frontend configuration so the GitHub Pages site can communicate with AWS.

Architecture Overview


The request flow is intentionally short:
  1. The user chooses the story ingredients in the browser.
  1. The frontend sends a  POST  request to the Lambda Function URL.
  1. Lambda validates the input and constructs a story.
  1. The JSON response returns directly to the browser.
  1. CloudWatch records the function’s operational logs.
This design was enough to meet the needs of the application without introducing additional services that would increase cost or operational work.

Challenges and Decisions

Keeping the Project Within Free Usage Levels

One of my first decisions was to avoid services that the application did not genuinely need. Amazon Bedrock could have generated more open-ended stories, but it would also have introduced model access, variable output, additional cost considerations, and more work to keep the content suitable for young children.
For this version, the curated-story approach was a better fit. AWS Lambda includes a generous monthly free allowance, IAM has no additional charge, the Function URL does not add a separate endpoint charge, and the application generates only a tiny amount of CloudWatch log data during normal use.

Connecting a Static Website to AWS

The frontend is hosted on a different origin from the backend, so CORS had to be configured correctly. I defined the allowed methods and headers in Terraform as part of the Lambda Function URL resource. During the initial deployment, the origin can be opened temporarily for testing; after the final GitHub Pages URL is known, it can be restricted to that origin.

Making the Deployment Reproducible

It would have been faster to click through the AWS Console once, but I wanted the repository to explain and reproduce the complete project. Terraform makes every AWS resource visible in code and provides a controlled cleanup path with  terraform destroy  after the challenge.
The frontend deployment is automated separately through GitHub Actions. When the frontend changes on the main branch, the workflow publishes the contents of the frontend directory to GitHub Pages.

Protecting a Simple Public Endpoint

The Function URL is public because anonymous visitors must be able to create stories. To keep the risk proportional to a weekend demo, the function has no access to a database, secrets, personal information, or other application resources. Its role is limited to basic execution logging, inputs are constrained, and the function has small memory and timeout settings.
For a larger production application, I would add stronger rate limiting, monitoring, a more restrictive origin policy, and potentially an authenticated or managed API layer.

What I Learned

The most useful lesson from this project was that serverless architecture does not need to be complicated to be valuable. A static frontend, one Lambda function, and a direct HTTPS endpoint were sufficient to turn a small creative idea into a working application.
I also gained practical experience with Lambda Function URLs. For a focused application that does not require API Gateway features, a Function URL provides a very direct way to expose Lambda over HTTPS. Configuring it through Terraform helped me understand how the endpoint, permissions, and CORS settings fit together.
Another important lesson was to choose services based on the actual problem rather than on how many AWS services I could include. The simplest architecture gave me more time to focus on the user experience, testing, documentation, and the story itself.
Finally, this challenge reminded me that completing a small project can teach more than leaving a much larger idea unfinished. As a first-year AWS Community Builder in the Serverless category—and as a new mother—finding time to build is not always predictable. Keeping the scope focused made it possible to keep learning and contributing.

Deployment Results

The application is now deployed and publicly accessible. The AWS backend was created through Terraform, and the frontend was published through the GitHub Pages workflow. After connecting the Lambda Function URL to the frontend, I tested the complete request flow from the public site.
For one live test, I selected Luna, a curious little fox, the Moonlight Garden, and a funny mood. The browser sent the request to AWS Lambda and received a complete five-part story, including the selected name, animal, location, and the expected humorous tone. I also confirmed that the result view and the option to create another tale worked as expected. The public application produced the story without exposing an application error.
This final test confirmed the complete path: GitHub Pages frontend → Lambda Function URL → AWS Lambda story generator → response displayed in the browser.

Try It Yourself

The repository contains the frontend, Python Lambda function, unit tests, Terraform configuration, GitHub Pages workflow, architecture description, deployment instructions, and cleanup steps.

Final Thoughts

Bousbi’s Tiny Tale Machine is intentionally tiny, but it connects something personal with something technical: bedtime stories with serverless infrastructure.
This was my first AWS Builder Center challenge. Whether or not it earns a jacket, it has already given me exactly what I hoped for—a reason to build, a practical serverless learning experience, and a small application that began with my daughter and can now create a little story for any child.
Sometimes the best way to keep learning is to start with one small idea and give it a place to grow. ☁️✨
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article