At the start of the year I decided it was time to move my company's app from Heroku to AWS. Main reason was that our clients were on South America, where Heroku does not have a datacenter. At the time I did not find a guide on how to do this, so I had to spend an entire week (~40 hours), learning about AWS and Ansible, and feeling like I was continuously banging my head against a wall. Fast forward a few months, and we have an entire repository of playbooks that can, with a single command, do most of the things that Heroku did for us.So I decided it might be worth to open source the entire thing, if only to save others some of the frustration I felt. I named the project "Railway"and here's what you get:1 - Create a custom AMI with everything a Rails app need;
2 - Create a staging environment with webservers, workers, cache and job redis instances, postgres database and support for up to 9 branches of your app at the same time;
3 - Create a production environment with load balanced webservers, workers, cache and job redis instances, postgres database with a read replica;
4 - Deploy to staging;
5 - Deploy to production using rolling restarts;
6 - Update production servers to get the latest security updates;
7 - Upgrade production servers to a new AMI with zero downtime;
8 - Compile ImageMagick and Libvips from source in order to get more up to date versions than what is available in Ubuntu's repositories.As you can imagine this is not an easy project to use. That’s why I included guides for instaling, running everything for the first time, customizing for your own app and the day to day workflow.I hope this is useful for people who have considered moving from a PaaS to a IaaS before, but didn’t know where to start.Link: 