I have a lambda function trying to place an mp3 file into an S3 bucket, however I am not seeing my file uploaded and more strangely do not see any logging/response from the callback.
My lambda/s3 bucket are all on the same AWS account and the bucket name is definitely correct.
Is there something I'm missing here? Or any explanation why my callback is not being fired?
exports.handler = async (event, context, callback) => {
// prior setup
console.log('about to putObject on s3');
const s3BucketData = {
Bucket: 'media-files',
Key: fileName,
Body: fileDataBuffer,
ContentType: 'audio/mp3'
};
await s3.putObject(s3BucketData, (err, data) => {
console.log('putObject callback executing');
if (err) {
console.log('err occurred storing to s3: ', err)
} else{
console.log(`${fileName} succuessfully uploaded`);
}
context.done();
});
};