Home

Fake S3

Fake S3 is a gem designed to run a small server on localhost that will correctly handle AWS/S3 GETs and PUTs (among others) while using the local filesystem as the storage backend. This has a number of benefits for anyone working on an application with AWS integration.

Probably the biggest benefit is offline development. There’s also a lower configuration burden as there’s no longer special bucket names or keys the manage, the development environment just expects localhost to work. Finally, there’s a very real cost savings. Originally, we paid for two buckets per developer just to support the sample data for dev and test. Now we need none.

Install

$ gem install fakes3

Run

$ fakes3 -r /mnt/s3 -p 4567

Configure

For example:

Assuming you’ve got some rake tasks which load up S3 with sample data, just go ahead and run them, you’ll find files created directly under /mnt/s3/development and the requests your local instance makes will just return that data.

All with no cloud-access needed.

Init script

In case you didn’t notice, the fakes3 command is a bit verbose, which may be OK, but if you’re like me and just want to run this as a background service, the following (naive) init script should do the job:

23 Oct 2012, tagged with ruby