AWS Builder Center
Weekend Creative Challenge: Inkwell

Weekend Creative Challenge: Inkwell

A tiny serverless writing desk built on Amazon Bedrock and Nova Micro. Give it a theme and it writes you a poem, a story, three haiku, or five six-word stories.

Vision & what the app does Inkwell is a tiny writing desk that lives on the internet. You give it a theme — "a lighthouse that forgot the sea", "a vending machine at 3am" — pick a form, and it writes you something small and strange.
There are four forms:
Poem — 8–14 lines of free verse Story — a 150–200 word whimsical short story with one small surprise Haiku — three linked haiku in 5-7-5 6-Word — five six-word stories, Hemingway-style Every piece comes back with its own generated title, typed out letter by letter onto a card that looks like a page torn from a notebook. There's a "Surprise me" die that fills in a hand-picked theme when you're out of ideas, and a copy button so you can keep the good ones.
The goal was deliberately narrow: one creative thing, done properly. I didn't want a chatbot with a text box. I wanted something with a point of view — a machine that only writes short literary forms, and looks like it enjoys doing it. The design leans into that: aged-paper background, ruled lines, a serif face for the writing, a wax-red accent, and a different accent colour for each form so the four modes feel like four different pens.
How I built it The whole thing is one Lambda function, one HTML file, and no build step. That was a choice, not a limitation — with a three-day window, every piece of tooling I didn't add was time I got to spend on the actual writing quality.
The prompt work mattered more than the code. My first version returned text that opened with "Sure! Here's a poem about…" every single time. I fixed this with a system prompt that tells the model to output the piece itself, with no preamble and no markdown fences. I also asked it to emit a title on the first line prefixed with TITLE: , which the Lambda strips off with a regex and returns as a separate JSON field. That one trick is why every card has a real title instead of a generic heading — the model names its own work.
Each mode has its own prompt and its own token budget. Haiku and six-word stories get 250 tokens; a story gets 600. Temperature sits at 0.9, because a poetry generator that returns the same poem twice isn't much fun.
The challenge I hit. I originally deployed with a Lambda Function URL — the simplest possible public endpoint, no API Gateway needed. It returned 403 Forbidden on every request. I checked the resource policy, and it was correct: Principal: "*", action lambda:InvokeFunctionUrl, auth type NONE. Everything looked right and nothing worked.
The cause was an account-level guardrail blocking public Function URLs, which isn't visible in the function's own policy. Rather than fight a permission boundary I didn't control, I put an API Gateway HTTP API in front of the same Lambda. That took about two minutes and worked on the first request. The lesson I'll keep: when a policy reads correctly but still denies, stop re-reading the policy and start suspecting something above it.
CORS was the other small trap. I set the headers in the Lambda response and configured CORS on the HTTP API — belt and braces, because a browser CORS failure gives you almost no useful information to debug with.
AWS services used / architecture overview Browser │ POST { theme, mode } ▼ Amazon S3 ── static website hosting (index.html, no build step) │ ▼ Amazon API Gateway ── HTTP API, CORS, $default route │ ▼ AWS Lambda ── Python 3.12, 256 MB, 30s timeout │ prompt selection, title parsing, error shaping ▼ Amazon Bedrock ── Converse API → Amazon Nova Micro │ ▼ Amazon CloudWatch Logs ── invocation logs & errors Five services, each doing one job:
Service Role Amazon Bedrock Text generation via the Converse API Amazon Nova Micro The model — fast and cheap enough for free-tier play AWS Lambda Prompt construction, title parsing, error handling Amazon API Gateway Public HTTPS endpoint + CORS Amazon S3 Static website hosting for the frontend AWS IAM Execution role scoped to bedrock:InvokeModel / Converse Bedrock's Converse API was the right call over InvokeModel — it gives a single normalised request shape with a proper system block, so swapping Nova Micro for Nova Lite is a one-line environment variable change.
What I learned Nova Micro is faster than I expected. Sub-400ms for a full poem. For short creative text there's no reason to reach for a bigger model — the cost and latency difference is real and the quality is genuinely good.
A system prompt is a product decision. The difference between "AI demo" and "a thing with a personality" was about six lines of system prompt. Constraining the model — no preamble, always a title, always this form — did more for the finished feel than any amount of CSS.
Serverless suits weekend projects. No servers, no containers, nothing running when nobody's using it. Total cost so far is a few cents of Bedrock tokens.
Read errors literally. I lost half an hour to that 403 because I assumed the problem was in the code I'd written. It wasn't. When the thing you control looks correct, check the thing you don't.
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