At 2:17 AM, I leaned back in my chair and let out the deep sigh of someone who has just won a tiny war. My API was deployed. Three test requests, three perfect 200 responses. The Lambda logs were clean. The endpoint URL sat in my terminal like a trophy.
I was building a simple feedback form for our department — maybe 30 classmates would ever see it. No one else even knew the project existed. I shut my laptop, the screen's glow fading in my hostel room, and fell asleep feeling like I'd levelled up.
At 10:03 AM, I checked the AWS console while brushing my teeth. The toothbrush froze mid-motion.
10,421 invocations. In eight hours. My free tier wasn't dead yet, but it was bleeding. And here's the part that made my stomach drop: I hadn't shared the URL. Not with a friend, not with a professor, not with anyone. The endpoint was a secret I was proud of — and it had been absolutely hammered while I slept.
I scrambled. Maybe a recursive bug. Maybe my code had spawned a loop that called itself. I pulled up CloudWatch logs, expecting to see my own IP, my own mistake. Instead I saw a parade of strangers. IPs from Singapore, Germany, somewhere in the US. User agents I didn't recognise. One request was completely empty. Another was trying to POST to /wp-admin . WordPress? My little Flask app didn't even have a login page. I wasn't debugging a bug — I was watching someone's automated scanner kick the tires of my unprotected API.
That's when my brain did what it always does: it lunged for a code fix. I opened my Lambda handler and started typing an IP whitelist. if request.remote_addr not in ALLOWED: return 403 . My fingers paused halfway through. Wait. The function would still be invoked. Every blocked request would still burn a tick of compute, still show up in CloudWatch, still cost me. I was about to build a bouncer who stood inside the club, checking IDs after the guests had already stepped through the door. That wasn't the fix. That was surrender dressed up as effort.
I closed the code editor and opened the API Gateway console — and that's where the story turned. Throttling. Usage plans. A rate-based WAF rule that blocks an IP after 100 requests in five minutes. I'd skimmed those terms in documentation and assumed they were for "real" applications, not a department feedback form. But my app was already being treated as real by the internet. It didn't matter that the audience was 30 classmates; the endpoint was public, and crawlers don't check credentials.
I set the burst limit low. I wrote a rule that said: you get 100 chances, and then you're out. I deployed the changes with the same sweaty fingers I'd once used to SSH into my first EC2 instance. Then I watched the invocations graph. The spike flattened. Silence. The bot moved on to someone else's open door.
I sat there, heart still thudding, and realised something I haven't forgotten since: serverless doesn't mean carefree. It means you stop worrying about the server and start worrying about the door. And the doors are everywhere.
The next morning, I stuck a note above my monitor: Who can reach this? What if a bot finds it? What's the damage if I'm wrong? It's a tiny checklist, but it's the difference between sleeping like a student and waking up like a sysadmin with a crisis.
I still have that feedback form. It's now behind an API key, throttled, and watched over by rules I understand. Not because it's a critical app — but because the internet is always knocking, and some nights it knocks 10,000 times before breakfast.
Loading article