Open xiaoqiaomm opened 5 years ago
Yeah, the same was happening to me.
I was passing:
FunctionName: myservice-mystage-myfunction
The plugin is expecting just the name of the function:
FunctionName: myfunction
Anyway, you can check it in the code, put some logs around this part:
const funOptions = funOptionsCache[functionName];
if (!funOptions) {
return reply().code(404);
}
const handler = functionHelper.createHandler(funOptions, this.options);
if (!handler) {
return reply().code(404);
}
const { payload } = req;
Hope it helps
Thanks for the feedback @sergueyarellano, I'll take a look on it today.
Duplicate of #8
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); }