Josimar Zimermann
10/22/2021, 1:56 PMexport function handler (event: any) {
return myAsyncFunction(event)
}
But, when working with a synchronous function (that does not return a Promise) is necessary to use something like that:
import { Callback, Context } from 'aws-lambda';
export function handler (event: any, context: Context, callback: Callback) {
const output = mySyncFunction(event)
callback(null, output)
}
If you try to return the result directly, you will get a null input in the next step.thdxr
10/22/2021, 1:57 PMasync
and you should just be able to return output
thdxr
10/22/2021, 1:57 PMexport async function handler
Josimar Zimermann
10/22/2021, 1:58 PMRoss Coundon
10/22/2021, 2:22 PM