Skip to content

Instantly share code, notes, and snippets.

@kevsersrca
Created November 21, 2019 10:42
Show Gist options
  • Save kevsersrca/56ab282a70567a777884cbd786aacdf1 to your computer and use it in GitHub Desktop.
Save kevsersrca/56ab282a70567a777884cbd786aacdf1 to your computer and use it in GitHub Desktop.
upload s3 in lambda for node8.10
const AWS = require('aws-sdk');
AWS.config.update({
accessKeyId: "",
secretAccessKey: "",
region : ""
});
function uploadReport(dest, file, report)
{
var params = {Bucket: dest, Key: file, Body: report};
var s3bucket = new AWS.S3();
s3bucket.putObject(params, function(err, data) {
if (err) {
console.log("Error uploading data: " + err);
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment