node.js - NodeJS uploading Object to S3 using IAM Roles -


folks, trying nodejs upload s3 object. trying use iam roles instead of hard-coding creds. i've created bucket policies link instance launched via role, there should no issues....

code:

function uploadtos3 (callback) {             var newfile = '/dev/shm/uploads/'+req.query.mid;             var s3 = new aws.s3();             var params = {                 acl: 'public-read',                 bucket: 'foobucket',                 key: req.query.mid             }             s3.putobject(params, function (err, data) {                 if (err) {                     console.log(err, err.stack);                     callback(err);                 } else {                     callback();                 }             })         }, 

anything potentially missing?

user error, had incorrect arn in s3 bucket policy.


Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -