Blog · Articles tagged with "ansible" · show all articles »

How to run Ruby scripts on AWS Lambda using Ansible

AWS Lambda is definitely one of the most fascinating services I have come across in the last years. As a web developer, the prospect of not having to deal with servers and scaling at all anymore, not even in the abstract sense of Heroku's dynos, is exhilarating.

And I'm not even that averse to doing ops stuff like many other developers. For example, I picked up Ansible about two years ago and have been using it to manage my own (DigitalOcean) servers ever since and even replaced Capistrano with a custom Ansible playbook to deploy my Rails apps.

Lambda really reminds me of how Elon Musk talks about reasoning from first principles rather than by analogy. AWS already offered a "traditional" cloud hosting service with EC2, and a managed one with Elastic Beanstalk, but with Lambda they really sat down and said "OK, let's start from scratch. A developers writes some code and wants to run it. We at AWS have all these regions, servers, databases and whatnot. What would be the easiest way we could let developers run their code without caring about any of it?" And the result is Lambda - upload your code in small chunks (functions) and run it, without thinking about servers or scaling at all.

Read on