Created
November 21, 2019 10:42
-
-
Save kevsersrca/56ab282a70567a777884cbd786aacdf1 to your computer and use it in GitHub Desktop.
upload s3 in lambda for node8.10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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