AWS Builder Center
Quote Forge: Shipping a Real Serverless App on Two AWS Services

Quote Forge: Shipping a Real Serverless App on Two AWS Services

A weekend experiment in minimalism: a working serverless web app that serves random developer quotes and tracks live views, built on just two AWS services and deployed with one CloudFormation command.

Founder & Director @ OmniAi Global Solutions | AWS UG Kolkata Leader, AWS Community Builder

TL;DR / Key Takeaways

  • I built and shipped Quote Forge, a serverless web app that serves a random developer quote and tracks a live view counter — using exactly two AWS services.
  • The entire stack is one Lambda function (arm64, 128 MB) behind a Lambda Function URL, plus an on-demand DynamoDB table. No API Gateway, no S3, no CloudFront.
  • Everything is defined in a single CloudFormation template with the Lambda code inline, so deploy and teardown are one command each.
  • It runs comfortably inside the AWS Free Tier, and the design is a deliberate exercise in doing the most with the fewest moving parts.



Introduction

Most "serverless starter" tutorials reach for a stack of five or six services before they have served a single request: API Gateway in front, S3 and CloudFront for the frontend, a database, a build pipeline, and a pile of IAM to wire it together. That is a lot of surface area for an app whose whole job is to show a quote on a page. For this weekend challenge I wanted to go the other way: pick the smallest honest architecture that still does something real, and ship it end to end on CloudFormation.
The result is Quote Forge. It is small on purpose, and that constraint shaped every decision in it.



Table of Contents

  1. Vision & What It Does
  1. Why I Built This
  1. How I Built It (Architecture & Challenges)
  1. AWS Services Used
  1. Key Decisions & Challenges
  1. What I Learned
  1. Screenshots
  1. FAQ
  1. Conclusion
  1. Call to Action



Vision & What It Does

Quote Forge is a single-page serverless app. Open the public URL and you get a dark, card-styled page with a random programming quote, its author, and a "New quote" button. A counter at the bottom shows how many quotes have been served in total across all visitors. Hit the same URL with  /api  appended and you get the same data as JSON — quote, author, running view count, and a UTC timestamp.
That is the whole product. There is no sign-up, no dashboard, no admin panel. But under the hood it exercises the two things most real apps actually need: a public HTTP endpoint that returns dynamic content, and durable shared state that survives across invocations. Quote Forge proves you can have both on two services.



Why I Built This

I keep seeing the same pattern: a beginner wants to deploy "a backend," follows a guide, and ends up managing API Gateway stages, CloudFront invalidations, and an S3 bucket policy for what is functionally a hello-world. Each of those services is reasonable on its own, but together they bury the actual logic under infrastructure.
I wanted a reference point for the opposite philosophy — minimum viable AWS. If I only allowed myself the services strictly required to serve dynamic HTML and persist a number, what would that look like? The answer turned out to be genuinely small, and small is a feature: fewer services means fewer IAM policies, fewer things to misconfigure, a lower bill, and an app I can reason about in one sitting.



How I Built It (Architecture & Challenges)

The architecture is two boxes and one arrow:
Browser ──▶ Lambda Function URL (public, AuthType NONE)
│
▼
Lambda: quote-forge (arm64, 128 MB, python3.12)
"/" -> HTML page
"/api" -> JSON quote
│ UpdateItem (ADD count :1)
▼
DynamoDB: quote-forge-stats (PAY_PER_REQUEST, pk = "views")

The Lambda Function URL is the trick that removes API Gateway entirely. A Function URL is a built-in HTTPS endpoint attached directly to the function, with its own auth model. For a public app I set AuthType: NONE and added an explicit lambda:InvokeFunctionUrl permission for the * principal so anyone can reach it. That one resource replaces an entire API Gateway REST or HTTP API, with its stages, deployments, and integrations.
The single Lambda handles routing itself. It reads rawPath from the event: if the path ends in /api it returns JSON, otherwise it returns the HTML page. The HTML is a template string inside the function, and the page's own JavaScript calls ./api to fetch a fresh quote on load and on every button click. So the same function is both the "frontend host" and the "backend API" — there is no separate static hosting layer because the function simply emits the markup.
State lives in DynamoDB. On every request the function runs a single UpdateItem with an atomic ADD #c :one on the item whose primary key is "views". Atomic counters mean I never read-modify-write, so concurrent visitors can't clobber each other's increments. The table is PAY_PER_REQUEST (on-demand), so there is zero provisioned capacity to size or pay for when it is idle.
The whole thing is one CloudFormation template, template.yaml, with the Lambda source embedded as an inline ZipFile. That keeps the project to a single deployable artifact — no build step, no packaging, no S3 bucket to stage code in. aws cloudformation deploy creates everything; delete-stack removes it all.



AWS Services Used

  • AWS Lambda — runs the app. arm64 architecture (cheaper and efficient), 128 MB memory (the floor), 10-second timeout, Python 3.12.
  • Lambda Function URL — the public HTTPS endpoint, no API Gateway.
  • Amazon DynamoDB — a single on-demand table holding one counter item.
  • Amazon CloudWatch Logs — function logs, with a 7-day retention policy set explicitly so logs don't accumulate forever.
  • AWS IAM — a tightly scoped execution role that can write logs and call  UpdateItem / GetItem  on exactly one table ARN.
Five AWS resource types, but only two services do the real work.



Key Decisions & Challenges

Function URL over API Gateway. The biggest decision. API Gateway is powerful but overkill here; a Function URL gives me HTTPS, a stable public address, and nothing to configure. The tradeoff is fewer features (no request validation, custom domains, or usage plans without extra work) — none of which this app needs.
Lambda-served HTML over S3 + CloudFront. Serving the page from the function means one fewer bucket, one fewer distribution, and no cache-invalidation dance on deploy. For a page this small the cold-start cost is negligible and the simplicity is worth it.
Least-privilege IAM. The role grants  dynamodb:UpdateItem  and  GetItem  scoped to the single table ARN via  !GetAtt , plus the managed basic-execution policy for logs. Nothing broader.
The main challenge was resisting scope creep. Every time I thought "I could add caching / a second table / a nicer API," I asked whether the app needed it to work. It didn't. The discipline of staying at two services was the real exercise.



What I Learned

  • A Lambda Function URL eliminates an entire tier of infrastructure for simple public endpoints, and it is the single highest-leverage simplification available on AWS right now.
  • DynamoDB atomic counters ( ADD ) are the correct primitive for shared counters under concurrency — no locks, no race conditions.
  • Embedding Lambda code inline in CloudFormation keeps a small project to one file and one deploy command, which is a huge quality-of-life win for demos.
  • "Minimum services" is not a limitation to apologize for — it is a design posture that pays off in cost, clarity, and operability.



Screenshots

Screenshot of deployment commands

Screenshot of App UI

The page served directly by the Lambda: a random quote, its author, a "New quote" button that fetches  /api , and the cumulative view count read from DynamoDB.



FAQ

Does this really stay in the Free Tier? Yes. Lambda's free tier is 1M requests and 400,000 GB-seconds per month; at 128 MB a request would need to run for a long time to matter. DynamoDB on-demand includes 25 GB and plenty of read/write units, and CloudWatch Logs includes 5 GB. A hobby-traffic app costs effectively nothing.
Why arm64? Graviton-based arm64 Lambdas are cheaper per millisecond and generally faster for this kind of workload, with no code changes needed for pure Python.
Can I add more quotes? Yes — they live in a list inside the function, so edit the  QUOTES  array and redeploy.
How do I remove everything?  aws cloudformation delete-stack  tears down every resource; there is no orphaned bucket or table to clean up manually.



Conclusion

Quote Forge is proof that a "real" serverless app — dynamic content, a public HTTPS endpoint, durable shared state — fits comfortably on two AWS services and a single CloudFormation file. The constraint of using the fewest possible services didn't make the app worse; it made it clearer, cheaper, and easier to operate. The next time I reach for API Gateway and S3 out of habit, I'll ask first whether a Function URL and a Lambda-served page would do. More often than I expected, the answer is yes.
👉 Link to the App/Repo: Check out the source code and CloudFormation template in my repository:  https://github.com/ImSaMPro/AWS-CB-Race-to-100 



Call to Action

If you're learning AWS, try the minimum-services exercise yourself: take any idea and ask what the smallest set of services is that makes it genuinely work. Deploy it with one CloudFormation template, tear it down when you're done, and you'll understand each service far better than you would behind a scaffolding generator. Clone the template, change the quotes, and ship your own in an afternoon.
Author Bio: Soumyadeep is a cloud enthusiast and builder who loves turning coffee into serverless architecture.
Follow me: 👉  X (Twitter)   |   LinkedIn   |  GitHub  


Related Reading:
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