-
Notifications
You must be signed in to change notification settings - Fork 10
Description
I would like to use this plugin to invoke a lambda from within another lambda. Below is my lambda function which will invoke another lambda locally and when I run "serverless invoke local --function local-lambda" it throws a 404 exception. Does it mean the function it's invoking is not deployed into localhost:4000?
export async function localLambda(event) {
const lambda = new AWS.Lambda({
region: 'us-east-1',
endpoint: 'http://localhost:4000',
});
let response;
const lambdaInvokeParameters = {
FunctionName: 'my-function-local',
InvocationType: 'Event',
LogType: 'Tail',
Payload: JSON.stringify({
"body": {"tableName":"my_table"}
}),
}
try {
response = await lambda.invoke(lambdaInvokeParameters).promise();
} catch (err) {
return (err);
}
console.log("response: ", response);
}