You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been wrestling with this for a while and have determined that the issue lies with this package. Here's the code I am using in a Lambda Function:
var config = require("config.json");
var AWS = require("aws-sdk");
var gulp = require("gulp");
var gulpS3Upload = require("gulp-s3-upload");
var gulpS3 = gulpS3Upload(config.s3);
var s3 = new AWS.S3(config.s3);
var myBucket = "mycdnbucket";
var myKey = "test/test.txt";
await gulp
.src("config.json")
.pipe(
gulpS3({
Bucket: `${myBucket}/test`,
ACL: "public-read",
}, {
maxRetries: 5
})
)
.on("error", function (err) {
console.log("S3 error", err);
})
.on("end", function () {
console.log(
`Files successfully uploaded to S3 to the path: /${myBucket}/${myKey}`
);
});
return s3.putObject({
Bucket: myBucket,
Key: myKey,
Body: "Hello world!"
},
function (err, data) {
if (err) {
console.log("error!", err);
} else {
console.log(`Successfully uploaded data to ${myBucket}/${myKey}`);
console.log(data);
}
}
);
The above code fails for the gulpS3 code, but succeeds with the aws-sdk code. Any help with determining the actual issue within the code would be appreciated. Here's the error stacktrace I am getting:
S3 error { [Error: S3 putObject Error: AccessDenied: Access Denied
at Request.extractError (/var/task/node_modules/gulp-s3-upload/node_modules/aws-sdk/lib/services/s3.js:580:35)
at Request.callListeners (/var/task/node_modules/gulp-s3-upload/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
at Request.emit (/var/task/node_modules/gulp-s3-upload/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
at Request.emit (/var/task/node_modules/gulp-s3-upload/node_modules/aws-sdk/lib/request.js:683:14)
at Request.transition (/var/task/node_modules/gulp-s3-upload/node_modules/aws-sdk/lib/request.js:22:10)
at AcceptorStateMachine.runTo (/var/task/node_modules/gulp-s3-upload/node_modules/aws-sdk/lib/state_machine.js:14:12)
at /var/task/node_modules/gulp-s3-upload/node_modules/aws-sdk/lib/state_machine.js:26:10
at Request. (/var/task/node_modules/gulp-s3-upload/node_modules/aws-sdk/lib/request.js:38:9)
at Request. (/var/task/node_modules/gulp-s3-upload/node_modules/aws-sdk/lib/request.js:685:12)
at Request.callListeners (/var/task/node_modules/gulp-s3-upload/node_modules/aws-sdk/lib/sequential_executor.js:116:18)]
message: 'S3 putObject Error: AccessDenied: Access Denied\n at Request.extractError (/var/task/node_modules/gulp-s3-upload/node_modules/aws-sdk/lib/services/s3.js:580:35)\n at Request.callListeners (/var/task/node_modules/gulp-s3-upload/node_modules/aws-sdk/lib/sequential_executor.js:106:20)\n at Request.emit (/var/task/node_modules/gulp-s3-upload/node_modules/aws-sdk/lib/sequential_executor.js:78:10)\n at Request.emit (/var/task/node_modules/gulp-s3-upload/node_modules/aws-sdk/lib/request.js:683:14)\n at Request.transition (/var/task/node_modules/gulp-s3-upload/node_modules/aws-sdk/lib/request.js:22:10)\n at AcceptorStateMachine.runTo (/var/task/node_modules/gulp-s3-upload/node_modules/aws-sdk/lib/state_machine.js:14:12)\n at /var/task/node_modules/gulp-s3-upload/node_modules/aws-sdk/lib/state_machine.js:26:10\n at Request. (/var/task/node_modules/gulp-s3-upload/node_modules/aws-sdk/lib/request.js:38:9)\n at Request. (/var/task/node_modules/gulp-s3-upload/node_modules/aws-sdk/lib/request.js:685:12)\n at Request.callListeners (/var/task/node_modules/gulp-s3-upload/node_modules/aws-sdk/lib/sequential_executor.js:116:18)',
The text was updated successfully, but these errors were encountered:
I've been wrestling with this for a while and have determined that the issue lies with this package. Here's the code I am using in a Lambda Function:
The above code fails for the gulpS3 code, but succeeds with the aws-sdk code. Any help with determining the actual issue within the code would be appreciated. Here's the error stacktrace I am getting:
S3 error { [Error: S3 putObject Error: AccessDenied: Access Denied
at Request.extractError (/var/task/node_modules/gulp-s3-upload/node_modules/aws-sdk/lib/services/s3.js:580:35)
at Request.callListeners (/var/task/node_modules/gulp-s3-upload/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
at Request.emit (/var/task/node_modules/gulp-s3-upload/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
at Request.emit (/var/task/node_modules/gulp-s3-upload/node_modules/aws-sdk/lib/request.js:683:14)
at Request.transition (/var/task/node_modules/gulp-s3-upload/node_modules/aws-sdk/lib/request.js:22:10)
at AcceptorStateMachine.runTo (/var/task/node_modules/gulp-s3-upload/node_modules/aws-sdk/lib/state_machine.js:14:12)
at /var/task/node_modules/gulp-s3-upload/node_modules/aws-sdk/lib/state_machine.js:26:10
at Request. (/var/task/node_modules/gulp-s3-upload/node_modules/aws-sdk/lib/request.js:38:9)
at Request. (/var/task/node_modules/gulp-s3-upload/node_modules/aws-sdk/lib/request.js:685:12)
at Request.callListeners (/var/task/node_modules/gulp-s3-upload/node_modules/aws-sdk/lib/sequential_executor.js:116:18)]
message: 'S3 putObject Error: AccessDenied: Access Denied\n at Request.extractError (/var/task/node_modules/gulp-s3-upload/node_modules/aws-sdk/lib/services/s3.js:580:35)\n at Request.callListeners (/var/task/node_modules/gulp-s3-upload/node_modules/aws-sdk/lib/sequential_executor.js:106:20)\n at Request.emit (/var/task/node_modules/gulp-s3-upload/node_modules/aws-sdk/lib/sequential_executor.js:78:10)\n at Request.emit (/var/task/node_modules/gulp-s3-upload/node_modules/aws-sdk/lib/request.js:683:14)\n at Request.transition (/var/task/node_modules/gulp-s3-upload/node_modules/aws-sdk/lib/request.js:22:10)\n at AcceptorStateMachine.runTo (/var/task/node_modules/gulp-s3-upload/node_modules/aws-sdk/lib/state_machine.js:14:12)\n at /var/task/node_modules/gulp-s3-upload/node_modules/aws-sdk/lib/state_machine.js:26:10\n at Request. (/var/task/node_modules/gulp-s3-upload/node_modules/aws-sdk/lib/request.js:38:9)\n at Request. (/var/task/node_modules/gulp-s3-upload/node_modules/aws-sdk/lib/request.js:685:12)\n at Request.callListeners (/var/task/node_modules/gulp-s3-upload/node_modules/aws-sdk/lib/sequential_executor.js:116:18)',
The text was updated successfully, but these errors were encountered: