Using Fabric and Boto to manage EC2 infrastructure
Graham works for Mocality.com which provides listings and online business tools to small businesses in Kenya and Nigeria. He develops and administers back-end services for Mocality, and uses Fabric to deploy these services to Amazon EC2.
This talk will show how to use the Fabric deployment and system administration tool with the Boto client library for Amazon Web Services APIs turn infrastructure into readable code, while avoiding pitfalls and working around Fabric's weaker areas. It includes methods for provisioning EC2 instances and configuring AWS services, structuring and reusing tasks, and managing multiple server roles across multiple environments.
Fabric provides a library and command-line tool for deployment and sysadmin tasks - notable as the basis of Instagram's deploy system - while Boto provides a Python client for Amazon Web Services APIs. Used together, Fabric+Boto provide an option for realising the "Infrastructure as Code" principle on AWS-compatible clouds, and the readability of Python turns fabfiles into natural documentation for how to build and manage your infrastructure. It's easy to get started and automate tasks incrementally, but there are pitfalls when handling errors, structuring and reusing tasks, and in managing configuration, as it takes special care to keep machine state and AWS service configurations consistent with the fabfile descriptions. By applying a few principles, Fabric proves a reasonable approach to deploying and administering cloud systems.