Lurker News
Hey HN,

I've been using AWS lambda a bit recently, mostly as a way to glue together various bits and pieces.
Maybe I'm doing this wrong but does anyone else find the experience to be really frustrating?
I can unit test bits of the code just fine, but at some point I always end up stuck in a slow feedback loop where I deploy the code, do some manual invoking, go and dig through the logs in CloudWatch, add another print statement in my lambda... and so on.
What I want is to run the lambdas locally, ideally more than one, and then exercise them with streams of test events (perhaps captured from a real environment). It would be quite cool if I could define BDD style tests around them too.
Anyone have any suggestions or share my frustrations?
I have heard localstack is quite good although I haven't given it a go yet. Would that work for me? I did try SAM but I was a bit underwhelmed and I don't want to use a separate IaC tool for these.
Alternatively, do other FaaS providers solve this problem?
Thanks for any help.

Comments (278) 96 threads

Earlier comments
PaywallBuster1 reply#
Use serverless framework to deploy your lambdas, use serverless-offline to launch them locally.
rmorey1 reply#
`sls invoke local` is great - do you know if there's a good way to mock dyanmoDB, S3, RDS etcc, with Serverless Framework as well? our python stack is lots of SF services and we are struggling with reliable testing
meursault#
Have you tried the recently added container support? There's a component provided called the Lambda Runtime Interface Emulator that exposes an API for the locally running container. In my experience this is miles better than the original approach.
pier251 reply#
You should check out Vercel.

It uses AWS Lambda underneath but it makes the dev experience just awesome.

tdfirth1 reply#
I thought Vercel was for building static sites/backends, or would it also work for generic AWS glue code? (e.g. run this lambda when the bucket changes).
pier25#
It's a combination of static + cloud functions (AWS Lambda) + CDN.

AFAIK even though it's running AWS Lambda, the cloud functions can't be integrated directly with other AWS services.

Load more comments