project catalogue
Cloud Architecture2026Completed

URL Shortener

A serverless link shortener on API Gateway, Lambda and DynamoDB, built entirely in Terraform with least-privilege IAM and zero idle cost.

scroll
Type
Cloud Architecture
Role
Solo Project
Status
Completed
Year
2026
The Backstory
ThisonestartedasachallengeIsetformyself:aftermonthsofAWScourseworkandlabs,IwantedtofindoutifIcouldactuallyshipsomethingreal.AURLshortenerisaboutasbasicasitgets,Iknow.ButIgavemyselfonerule:everyresourcehadtobeprovisionedwithTerraform,noclickingaroundintheconsole.Thatconstraintiswhatturnedasimpleweekendprojectintoanactuallessonincloudengineeringandinfrastructure.
Thearchitectureisfullyserverless.APIGatewayreceivestherequest,aLambdafunctiongeneratestheshortcode(orlooksitupandhandlestheredirect),andDynamoDBkeepsthemappings.There'snoidlecompute,soitscalestozeroandcostsclosetonothingtokeepalive.Honestly,ThepartIspentthemosttimeonwasn'ttheapplicationlogic,itwasIAM.Ifollowedleastprivilegethroughout,scopingeveryroledowntoexactlytheactionsandresourcesitneeded,nothingbroader.Lookingback,thatwasthemostvaluablepartofthebuild.
Whatstayedwithmeisn'ttheshorteneritself,it'stheworkflow.Definetheinfrastructureincode,versionit,tearitdown,rebuilditfromscratchinminutes.Onceyou'veworkedthatway,clickingaroundacloudconsolefeelslikeastepbackwards.

— walid, 2026

Under the Hood
  1. Serverless end to end

    API Gateway takes the request, Lambda resolves it, DynamoDB stores the mappings. There is no server to patch, and the whole thing scales to zero when idle.

  2. IaC : Infrastructure as code

    Every resource is provisionned in Terraform. The entire stack can be destroyed and rebuilt from scratch with Terraform commands.

  3. Least-privilege IAM

    Each component gets exactly the permissions it needs, and nothing more. That's the point of least privilege. A compromised Lambda can't touch resources it was never scoped to reach in the first place. It takes more upfront work than attaching a broad managed policy, but it shrinks the blast radius if anything ever goes wrong.

  4. Built to cost nothing at rest

    The whole stack is serverless and billed pay-per-request, so it idles for free. Lambda only spins up when a link is actually resolved, runs for a few milliseconds, and then shuts back down. No servers sitting around waiting for traffic.

In the Wild
URL Shortener home page

Home page of the URL Shortener.

Inserting link to shorten

Inserting a link to shorten —> the Lambda generates a short code and stores it in DynamoDB.

Generated URL and redirect

The generated short URL and the redirect behavior.

AWS architecture diagram of the URL Shortener

AWS architecture diagram of the URL Shortener, showing CloudFront, API Gateway, Lambda, DynamoDB and S3 (for the static assets).

swipe →

Applied Technologies
See It Yourself

The code is public. If you'd rather see it running, request a demo and it lands straight in my inbox.

View Repository

end of case study — URL Shortener

Like what you saw?
Let's build something together.

I'm open to opportunities, collaborations, and conversations

if this project sparked an idea, my inbox is the shortest path to it.

browse the full catalogue