Many companies continue to manually create and manage their cloud infrastructure via web consoles. Documenting these procedures is challenging, especially since the interfaces are always evolving. Reviewing the changes is also difficult and often involves having a coworker watching over your shoulder. Rolling back a bad change requires deleting your current work and attempting to manually recreate the old infrastructure from memory. (Scaling or deploying the infrastructure to new environments also often involves manually recreating it.)
Nathan Handler shows you how to transition your company from manually making changes in a web console to managing your infrastructure as version-controlled, reviewable code and explains how Yelp has gone about managing all of its infrastructure using Hashicorp’s Terraform. Hashicorp’s Terraform allows for the management of infrastructure as code. While a growing number of groups have started to utilize this tool, most are only just beginning to scratch the surface of its potential. Yes, Terraform can be used to create and manage resources in AWS and other cloud providers. However, thanks to an ever-growing number of providers, it can manage resources in many other popular cloud services.
Yelp uses Terraform to manage its AWS resources, DNS records in NS1, CDN configuration in Fastly and Cloudflare, and charts and dashboards in SignalFx. This setup provides the company with the ability to maintain its infrastructure as code in a version control system that can be put through standard code review flows. If an issue is discovered, the company can revert to an older, working commit and restore its infrastructure to that point in time. Documentation can include code snippets that can be easily copied and pasted error free. Finally, resources managed by one Terraform provider can benefit from and utilize information from resources managed by another provider. This means that launching a new AWS EC2 instance can automatically update the necessary DNS records in NS1 and then create a dashboard filled with customized charts designed to monitor the instance.
Nathan Handler is a site reliability engineer on the operations team at Yelp. Nathan has been contributing to the open source community for nearly 10 years, primarily through his roles as an Ubuntu and Debian developer.
©2018, O'Reilly Media, Inc. • (800) 889-8969 or (707) 827-7019 • Monday-Friday 7:30am-5pm PT • All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners. • firstname.lastname@example.org