In this blog post, I’m going to introduce you to Terraform which is a declarative, infrastructure as code developed by HashiCorp. I’ll cover what Terraform is, what it can do, and how you can start using it today. I’ll also have an accompanying webinar where I’ll walk you through getting started with Terraform so be on the lookout for that!
Terraform is a tool for building, changing, and versioning infrastructure safely and efficiently. Terraform can manage existing and popular service providers as well as custom in-house solutions. Terraform uses configuration files to describe what it will do to achieve its goal, and then executes it to build the described infrastructure. Terraform will never do anything that isn’t declared within the configuration files so remember to be as specific as possible. Next, let’s look at what comprises terraform.
Infrastructure is described using a high-level configuration syntax. This allows a blueprint of your datacenter to be versioned and treated as you would any other code. Additionally, infrastructure can be shared and re-used.
Terraform has a “planning” step where it generates an execution plan. The execution plan shows what Terraform will do when you call apply. This lets you avoid any surprises when Terraform manipulates infrastructure.
Terraform builds a graph of all your resources, and parallelizes the creation and modification of any non-dependent resources. Because of this, Terraform builds infrastructure as efficiently as possible, and operators get insight into dependencies in their infrastructure.
Complex changesets can be applied to your infrastructure with minimal human interaction. With the previously mentioned execution plan and resource graph, you know exactly what Terraform will change and in what order, avoiding many possible human errors.
The infrastructure Terraform can manage includes low-level components such as compute instances, storage, and networking, as well as high-level components such as DNS entries, SaaS features and others. Popular use cases include Heroku App Setup, Multi-Tier Applications, Self Service Clusters, Software Demos, Disposable Environments, Software Defined Networking, Resource Schedulers and Multi-Cloud Deployments. If you wish to know more, check out this Use Cases page from HashiCorp to see more in depth overview of each example.
Terraform is changing the way infrastructure is managed, and making it faster and more efficient to execute DevOps projects. It focuses on the automation of the infrastructure itself, which has the effect of allowing teams to execute a DevOps model faster and more efficiently. Terraform also allows teams such as operations and security to work in parallel with developers. Each element in the DevOps process has a specifically designed tool, which means teams can focus on their particular tasks without blocking other teams working on the project. This transforms the DevOps process from a linear and slow waterfall-type project into one where teams can work in parallel.
Now I’m going to quickly walk you through how to use Terraform with Amazon Web Service.
In all, the entire process should take you about an hour or so to complete. In my webinar, I’ll be going over how to get started with Terraform and Apache Cassandra on AWS.
Cassandra.Link is a knowledge base that we created for all things Apache Cassandra. Our goal with Cassandra.Link was to not only fill the gap of Planet Cassandra, but to bring the Cassandra community together. Feel free to reach out if you wish to collaborate with us on this project in any capacity.
We are a technology company that specializes in building business platforms. If you have any questions about the tools discussed in this post or about any of our services, feel free to send us an email!
Photo by Farzad Nazifi on Unsplash