Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

aws-sdk #12

Closed
ksheurs opened this issue May 18, 2012 · 12 comments
Closed

aws-sdk #12

ksheurs opened this issue May 18, 2012 · 12 comments

Comments

@ksheurs
Copy link

ksheurs commented May 18, 2012

is there anyway to support aws-sdk? with the sdk we do not have access to establish_connection to specify host and port :(

@jubos
Copy link
Owner

jubos commented May 18, 2012

I want to add support for this. It might be easiest by supplying some sort of monkey patch to aws-sdk to allow it, but that is not ideal.

@jubos
Copy link
Owner

jubos commented May 18, 2012

Actually you might be able to do it by overriding their dns hostnames by using dnsmasq or /etc/hosts.

@ksheurs
Copy link
Author

ksheurs commented May 18, 2012

ooh great idea with using /etc/hosts! let me try..

@ksheurs
Copy link
Author

ksheurs commented May 19, 2012

i tried adding a /etc/resolver/s3.amazonaws.com file with nameserver 127.0.0.1 and port 10001 but it seems to just hang when i ping the domain after. any ideas?

this is the method http://pow.cx/ uses to route all 'dev' top level domains to localhost:20560.

@dreamr
Copy link

dreamr commented Aug 21, 2012

I am looking into this. you can pass in s3_endpoint (used to be :server) and :s3_port (was :port) in a config yml.

However, it is timing out for me. I'll report back when I know more.

@kitop
Copy link

kitop commented Sep 10, 2012

It would be nice to see a workaround for this.
s3_endpoint and s3_host is giving me timeout also.

Anyone found something else?

@cjc343
Copy link

cjc343 commented Dec 4, 2012

I added a snippet to the "Supported Clients" page showing how to set this up. The major caveat is DNS entries/redirects.

If you have set your s3_endpoint to myfakes3.local and you wish to push data to a bucket named bucket then the host bucket.myfakes3.local should be defined. For myself, the easiest way to take care of this was to make DNS entries for fakes3.domain.tld and *.fakes3.domain.tld and set my s3_endpoint to fakes3.domain.tld. This lets me use any bucket name without worrying about creating new hosts/resolver entries, but requires some existing infrastructure to set up.

@ddossot
Copy link

ddossot commented Feb 26, 2015

This is documented enough IMO. FWW I have no trouble using fake-s3 with AWS SDK. Consider closing.

@LinusU
Copy link

LinusU commented Feb 26, 2015

This is how I connect to fake-s3 inside a docker container. The thing to take extra note of is s3ForcePathStyle: true which makes specifying an ip in the endpoint okay, since it force the use of http://host:port/bucket-name/... instead of http://bucket-name.host:port/....

return new AWS.S3({
  apiVersion: '2006-03-01',
  sslEnabled: false,
  accessKeyId: 'x',
  secretAccessKey: 'x',
  endpoint: resolveEnv('http://$S3_PORT_4569_TCP_ADDR:$S3_PORT_4569_TCP_PORT'),
  s3ForcePathStyle: true
});

@gabrielle27
Copy link

I was running into the timeout issue as well. I thought it was aws-sdk, but it was a problem in my paperlip config. The paperclip initializer expects s3_host_name instead of s3_endpoint.

@cesarandreu
Copy link

About a month ago I added an example to the wiki, for any future searchers.

@pickhardt
Copy link
Collaborator

Closing because this is being discussed in multiple places, and this particular discussion is old.

For future reference, it should work if you spoof your /etc/hosts to point s3.amazonaws.com to localhost, and make sure you're using the latest versions of Fake S3 and the aws-sdk. If it doesn't, please open a new issue with an example of what you tried.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants