I am using the node AWS SDK to save images to s3. I keep getting the following error despite the fact that the bucket exists and I have the right permissions:
{ [NoSuchBucket: The specified bucket does not exist]
message: 'The specified bucket does not exist',
code: 'NoSuchBucket',
time: Tue Oct 21 2014 12:32:50 GMT-0400 (EDT),
statusCode: 404,
retryable: false }
My nodejs code:
var fs = require('fs');
var AWS = require('aws-sdk'); //AWS library (used to provide temp credectials to a front end user)
AWS.config.loadFromPath('./AWS_credentials.json'); //load aws credentials from the authentication text file
var s3 = new AWS.S3();
fs.readFile(__dirname + '/image.jpg', function(err, data) {
var params = {
Bucket: 'https://s3.amazonaws.com/siv.io',
Key: 'something',
};
s3.putObject(params, function(err, data) {
if (err) {
console.log(err);
} else {
console.log("Successfully uploaded data to myBucket/myKey");
}
});
});
I've also tried siv.io.s3-website-us-east-1.amazonaws.com for the bucket name. Can someone let me know what I'm going wrong? I can provide more info if necessary.