Hacker News new | ask | show | jobs
by nickjj 2084 days ago
> At least AWS SAM supports local debugging and testing.

I'm still new to SAM but coming from a more regular style of web development it still feels brutally inefficient.

Changing 1 line of code requires waiting multiple seconds to build + run your new lambda so you can see the changes even with a local invoke of it.

That and if you really want to keep things local you need to mock out all calls to other AWS resources that you might be using in the lambda. Although you'd run into this same problem with a regular style app too.

I'm so glad I don't have to do serverless development full time. Just so happens I'm doing a small service for contract work but yeah, it's like taking 100 steps backwards for development friendliness IMO.

1 comments

I've tried using LocalStack for mocking AWS services locally, but it's never worked quite the way I want it to. At this point I just set up "local" versions of the resources I need in a non-prod account and set up the service to use those when I'm developing.
Right, I do that too.

The real problem is the development lifecycle for a lambda. It's a constant loop of changing the code, building it and then invoking it. This process takes a bunch of seconds even for the smallest change in a tiny code base.

It's much slower than writing code and immediately going to a browser to reload to see the changes which is something a lot of dev environments were able to pull off since about 1998.

If you edit the .aws-build folder directly you will get instant results without having to build. I am sure it is not a best practice.