I have Lambda setup locally using Docker and Sam. I can hit an endpoint and run the Lambda method locally, but if i want to test the below code, I have to actually deploy the Lambda since I'm not sure how to get the aws-sdk to work in a local environment.
const payload = JSON.stringify({
"bucket": process.env.AWS_S3_ENV_BUCKET,
"region": process.env.AWS_REGION,
"folder": 'somePath/',
"files": ['somefile.jpg', 'anotherfile.jpg'],
"zipFileName": 'zipZippedFile.zip'
})
const params = {
FunctionName: 'zippidyDoDah',
Payload: payload
}
global.Lambda.invoke(params, function (error, data) {
console.log('error: ', error)
console.log('data: ', data)
})
Does anyone have any insight on this?