
Weekend Creative Challenge: Excuse Generator
Pick a situation, choose your absurdity level, and let Amazon Nova generate the perfect excuse. Hit 'Make It Worse' to escalate the chaos. Built with Lambda, Bedrock, and Amplify.
Vision & what the app does
Excuse Generator is a small, silly, endlessly fun app with one job: give you the perfect excuse for any situation, on demand. You pick what you need to explain away (being late, missing the gym, forgetting a birthday, or something fully custom), then choose how absurd you want it to be, from "plausible" (could actually happen) all the way up to "insane" (completely unhinged). The app generates a short, original excuse written by AI. If that's not ridiculous enough yet, a "Make It Worse" button escalates the same excuse into something even more over-the-top, building on the previous version instead of starting over.
The creative output isn't just text. It's a tiny piece of comedy generated on the fly, tailored to your exact situation and your appetite for chaos. The goal was to make something that gets a smile in under 10 seconds of use, with zero explanation needed.
How I built it
I started with the interface first: a simple HTML/JS/CSS frontend with dropdowns for situation and absurdity level. No framework, kept intentionally light so I could spend my weekend hours on the AI plumbing instead of tooling.
For the AI side, I used Amazon Bedrock with the Amazon Nova Lite model, called through Bedrock's
Converse API from a Python AWS Lambda function. I chose Converse because it standardizes the request/response shape across any Bedrock model, so swapping models later wouldn't require touching my code.A few decisions and roadblocks stood out:
- Lambda Function URLs need real CORS discipline. Exposing the Lambda to the browser without API Gateway was fast (just enable a Function URL), but I hit CORS errors one at a time: missing
Allow-Methods, missingAllow-Headersforcontent-type, and finally a duplicateAccess-Control-Allow-Originheader, because I was setting it manually in my Lambda's response while the Function URL was already adding it too. Removing the duplicate from my code fixed it. The lesson: CORS on Function URLs is really three independent permissions (origin, methods, headers) that all need to agree, and only one layer should own each header.
- Event payload shape changes with the trigger. Testing the Lambda directly in the console uses a plain event object, but a Function URL wraps the real payload inside
event["body"]as a JSON string. An easy trap if you only ever test from the console first.
- Prompting for consistency. The app is meant for an English-speaking audience, but I was originally testing in Portuguese. I moved the language instruction into the system prompt itself ("always respond in English, regardless of the input language") instead of translating strings in code. Much more reliable.
Once the Lambda was solid, connecting the frontend was just a
fetch call to the Function URL, and the whole thing came together end to end.AWS services used / architecture overview
Services used:
- Amazon Bedrock (Amazon Nova Lite model): generates and escalates the excuses
- AWS Lambda (Python): orchestrates the prompt logic and calls Bedrock via the Converse API
- Lambda Function URL: exposes the Lambda directly over HTTPS, no API Gateway needed
- AWS Amplify: hosts the static frontend and serves the public app URL
Architecture:
Browser (HTML/CSS/JS) | | fetch() POST { situation, level } or { current_excuse } vLambda Function URL (HTTPS, CORS-enabled) | vAWS Lambda (Python) | | bedrock.converse(modelId, system, messages) vAmazon Bedrock — Amazon Nova Lite | vGenerated excuse text --> back through Lambda --> back to browserThe frontend is static and served by Amplify. All the "intelligence" lives entirely in the Lambda and Bedrock pair, kept intentionally stateless since nothing needs to persist between requests.
What I learned
This challenge was my first hands-on experience with Amazon Bedrock and the Converse API specifically. It clarified how much simpler serverless AI apps can be compared to what I expected: no model hosting, no GPU management, just an API call with the right IAM permission (
bedrock:InvokeModel ) attached to the Lambda's execution role. I also came away with a much sharper understanding of how CORS actually works layer by layer instead of treating it as a single on/off switch, which will save me time on every frontend project going forward. Finally, debugging systematically, isolating whether a failure was in the DOM, the fetch call, or the server, turned out to be more valuable than any specific AWS feature I learned.Link to app
#creative-expression
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article