Welp, we're going to look at some nodejs code for and aws lambda function here, and specifically the code will be invoking a different lambda function. Although there are a few ways to do this, I really wanted to find a way of chaining lambdas such that they don't have to wait for the one one they just called to finish. It's a bit confusing, but maybe with some example you'll understand what I mean. Well then let's dive right in!
This is something that tripped me up a little bit when I was recently playing around with DynamoDB. I was very confused because in the callback function the data argument was just coming back as an empty object. "Surely that can't be right", I thought, but indeed it was right!
Well guys, I learned a cool new thing today! Did you know about the "it.only" syntax in mocha? Can you believe I just discovered it today?! Yep, my life has forever changed for the better now that I'm aware of in.only, and since you're reading this post right now I hope it will change yours too!
Things like this are what make it difficult to argue that AWS isn't still the leader in serverless. When we say, "a Lambda function" then sure, we could just expose one function. With the nodejs package aws-serverless-express you can easily handle lots of different endpoints that may or may not have query parameters as well. To me this makes my lambda functions a lot more logically organized as routes.
This is a quick little tip about sharing local variables across functions in your React components. It's something that a fellow developer, Ben, reminded me of in a pair programming session recently so I decided to write a blog post about it!
The posts on this site are written and maintained by Jim Lynch. About Jim...