Skip to content

404 Error When Invoking Lambdas Locally #13

Description

@xiaoqiaomm

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);
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions