Just FWIW, lazy man's multiple lambdas from single project


#1

My skill has two lambdas backing it up. One’s the Jovo application logic, and the other is a database update triggered by an EventBridge chron schedule.

I wanted to keep all the code in a single Git package. And some (the database layer) is shared between them.

Quick and dirty solution: in addition to src\index.ts, I now have src\update_index.ts, which is a second lambda entry point. I can upload the same jarfile to both lambdas, and just change the runtime settings of the second to say update_index.handler rather than index.handler.

Yes, this means the update handler is carrying a lot of code it will never use. But since it’s going to run only a few times of day, and runs outside the users’ view, I honestly don’t care a lot about its efficiency right now. It’s not as if Amazon is going to lower the cost from “free” if I tune it better.

Yeah, someday I should polish it. For now: “Make it work, make it good, make it great.” In that order.