There's a specific kind of frustration that comes from iterating on Lambda code. You change one line. You run cdk deploy. You watch the CloudFormation stack crawl through its update. You wait. You test it. You realize the response shape was slightly off. You do it all over again.
Each cycle is 5 to 10 minutes. Over a full day of feature work, that's not a minor inconvenience. It's a significant chunk of your day spent watching a progress bar.
I started looking for a way out. I tried the obvious tools, found out why they fall short for CDK specifically, and eventually built something that actually solved the problem for me.
AWS SAM is the official answer to this problem. sam local start-api spins up a local API Gateway + Lambda environment. On paper, it sounds perfect.
The catch? SAM requires you to maintain a template.yaml. If you're using CDK, that means maintaining two infrastructure definitions in parallel: your CDK stack and a SAM template. That felt like the wrong direction entirely. The whole point of CDK is that the infrastructure is code, colocated with my app. Introducing a second template that needs to stay in sync is exactly the kind of drift that leads to "works locally, breaks in prod."






