Book Image

Getting Started with Terraform

By : Kirill Shirinkin
Book Image

Getting Started with Terraform

By: Kirill Shirinkin

Overview of this book

Terraform is a tool used to efficiently build, configure, and improve production infrastructure. It can manage existing infrastructure as well as create custom in-house solutions. This book shows you when and how to implement infrastructure as a code practices with Terraform. It covers everything necessary to set up complete management of infrastructure with Terraform, starting with the basics of using providers and resources. This book is a comprehensive guide that begins with very small infrastructure templates and takes you all the way to managing complex systems, all using concrete examples that evolve over the course of the book. It finishes with the complete workflow of managing a production infrastructure as code – this is achieved with the help of version control and continuous integration. At the end of this book, you will be familiar with advanced techniques such as multi-provider support and multiple remote modules.
Table of Contents (15 chapters)
Getting Started with Terraform
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

A short overview of Terraform


Terraform is an open source utility, created by a HashiCorp company, the same company that created Vagrant, Packer, Consul, and other popular infrastructure tools. It was initially released in July 2014 and since then has come a long way to become one of the most important tools for infrastructure provisioning and management.

This is how Terraform is described by HashiCorp:

... a tool for safely and efficiently building, combining, and launching infrastructure. From physical servers to containers to SaaS products, Terraform is able to create and compose all the components necessary to run any service or application. (https://www.hashicorp.com/blog/terraform.html)

Terraform easily fits most of the requirements listed here:

  • At the time of writing, it supports over 30 different providers, from a huge ones such as AWS to a smaller ones such as multiple SaaS DNS providers.

  • Terraform provides a special configuration language to declare your infrastructure in simple text templates.

  • Terraform also implements a complex graph logic, which allows you to resolve dependencies intelligibility and reliability.

  • When it comes to servers, Terraform has multiple ways of configuring and wiring them up with existing configuration management tools.

  • Terraform is not platform agnostic in the sense described earlier, but it allows you to use multiple providers in a single template, and there are ways to make it somehow platform agnostic. We will talk about these ways closer to the end of the book.

  • Terraform keeps track of the current state of infrastructure it created and applies delta changes when something needs to be updated, added, or deleted. It also provides a way to import existing resources and target only specific resources.

  • Terraform is easily extendable with plugins, which should be written in Go programming language.

Over the next seven chapters, we will learn how to use Terraform and all of its features.