Re:Serverless: slower and more expensive
by matthewbauer on Monday September 23, 2019 @10:48AM
(#21049396)
But how do you test lamba_handler then? Without a way to run lambdas locally, this sounds like a big black hole in your infrastructure.
Re:Serverless: slower and more expensive
by scarface74 on Monday September 23, 2019 @10:56AM
(#21049473)
You call it just like you call any other function. Your handler takes in either a JSON payload and a context object or a deserialized object depending on the language. You call it from a separate console app, your test harness etc.
Re:Serverless: slower and more expensive
by mywittyname on Monday September 23, 2019 @01:39PM
(#21051307)
Yup. You can log into the AWS console and generate an example test message. Copy that into your unit/integration test and bob's your uncle.
I'll typically write all the core functionality first, test it, then write the lambda_handler function.