Andreas John’s Post

Every Python dev on AWS runs into this at some point: Three Lambda functions, all sharing the same Pydantic models. You copy-paste once. Then twice. Then you spend a Tuesday figuring out why one function is missing a field. Google it, and every article from 2019 gives the same answer: "Just use Lambda Layers!" But Lambda Layers are not a package manager. Yan Cui said it well back in 2021: "Lambda Layer is a poor substitute for existing package managers." No IDE autocomplete, no proper versioning, and if someone deletes a layer version, your deploys break until you fix the ARN. There is a cleaner way: uv workspaces with local packages, bundled into self-contained ZIPs by CDK. Each function gets only what it needs. Normal Python packaging, no AWS-specific workarounds. Full blog post with the CDK construct (Demo GitHub Repository Link included): 👉 https://lnkd.in/d2A8AqAv PS: One thing I want to mention regarding my blog posts in general: I don't want to write another "Hello World with AWS Lambda" tutorial. There are enough of those. What I find interesting are the edge cases - things that are barely documented but matter a lot once you run real workloads in production. #AWS #Python #Serverless #CDK

Marius Oprea

AWS Architect | Blockchain & Web3 Enthusiast

1w

Do you know if the same approach can be applied using Poetry instead of UV?

To view or add a comment, sign in

Explore content categories