I get that I can call a lambda from a another via Nodejs - Invoke an AWS.Lambda function from within another lambda function
What I need to do is call a specific function in another lambda.
So if Lambda_B looks like this:
module.exports = {
doStuffFunction: async (inputData) => {
*do stuff with inputData*
return { outputData }
}
}
in Lambda_A I want to call doStuffFunction(myData)
.
How do I do this?
If they were in the same folder structure, I could do this with a const { doStuffFunction } = require('../Lambda_B')
inside Lambda_A
... but they aren't.
Is creating a layer for utility functions the only way to share those functions?