Reputation: 51
I am just trying to invoke one lambda function from another lambda function, and i am sending a payload into that lambda function. If I paas a payload of size upto 1 mb, then i don't get this error, this error arises when the payload size is greater than 1 mb only.
import * as AWS from "aws-sdk";
const lambda = new AWS.Lambda({
region: "us-east-1",
endpoint: "http://localhost:3002",
});
const params = {
FunctionName: "myFunction", // the lambda function we are going to invoke
InvocationType: "RequestResponse",
LogType: "Tail",
Payload: JSON.stringify(data),
};
const lambdaResult = await lambda.invoke(params).promise();
Upvotes: 3
Views: 1405
Reputation: 238289
Lambda invocation has limits on payload (6MB).
If you want to send larger data then that, you have to save it first, for example to S3, and then have second function read it from S3. This way you just send S3 url to the second function, instead of the entire data file.
Upvotes: 1