I have added the following code to the lambda function to get a part of a zip file uploaded to my s3 bucket.
const AWS = require("aws-sdk");
const s3 = new AWS.S3();
const file = require('fs').createWriteStream('part1');
exports.handler = (event, context, callback) => {
const params = {
Bucket: 'myBucketName',
Key: 'myFolder/testZip.zip',
Range: 'bytes=0-3652539'
};
s3.getObject(params).createReadStream().pipe(file);
};
The response to the lambda is throwing an error as follows.
Response:
{
"errorMessage": "RequestId: c1e4d549-b4f5-47b7-bcde-bc9a31faf731 Error: Runtime exited with error: exit status 129",
"errorType": "Runtime.ExitError"
}
Please Help me to download the chunk i have mentioned from lambda.