I'm trying to use fakes3 as an endpoint for some simple S3 code I've written. I can't get beyond the connection stage though.
The current error is: NetworkingError: getaddrinfo ENOTFOUND
.
I've got configuration setup:
"aws": {
"accessKeyId": "123",
"secretAccessKey": "abc",
"region": "",
"endpoint": "http://localhost:8081",
"sslEnabled": false
}
var AWS = require('aws-sdk');
// loaded the config into an object called `config`:
AWS.config.update(config.aws);
s3 = new AWS.S3();
// also tried creating an `EndPoint`:
s3.endpoint = new AWS.Endpoint(config.aws.endpoint);
When I try simple code like:
s3.putObject({ Bucket: 'logging', Key: "logging123", Body: "started" },
function(err, data) {
if (err) {
console.log(err);
}
});
The error mentioned above occurs. When I leave out directly setting the endPoint
, the request is made to the East AWS region (and ignores the endpoint
value I've passed in via configuration).
And, I'm running fakes3
using the command line:
fakes3 -r c:\temp\_fakes3 -p 8081
Loading FakeS3 with c:/temp/_fakes3 on port 8081 with hostname s3.amazonaws.com
[2013-11-30 14:20:22] INFO WEBrick 1.3.1
[2013-11-30 14:20:22] INFO ruby 2.0.0 (2013-06-27) [x64-mingw32]
[2013-11-30 14:20:22] INFO WEBrick::HTTPServer#start: pid=11800 port=8081
In the AWS SDK docs there is the following option:
s3ForcePathStyle (boolean)
I've tested it works with this config: