What Is Terraform Used For? The 3 Main Use Cases.
Tags: devops, cloud, terraform
Published: 2020-11-27 02:57:20

---
title: What Is Terraform Used For? The 3 Main Use Cases.
published: true
date: 2020-11-27 02:57:00 UTC
tags: devops, cloud, terraform
canonical_url: https://www.thedevcoach.co.uk/what-is-terraform-used-for/
---

So I’m guessing you’ve heard about Terraform. And maybe you’re now wondering what Terraform is really used for and why it’s so popular?

**What is Terraform used for? The main use of Terraform is for writing infrastructure as code to manage public cloud resources such as AWS, GCP and Azure. Terraform is also commonly used to manage other cloud infrastructure such as Stripe and Auth0. **

Terraform is a powerful tool for writing infrastructure as code, and it has some unique benefits over it’s competition. Let’s look in more detail at some of the main three uses of Terraform.

## What is Terraform?

Terraform is an open-source infrastructure as code tool, mostly used for managing public cloud infrastructure such as AWS, GCP and Azure. Terraform is distributed as a CLI and is used for writing declarative infrastructure as code.

Let’s start our discussion the main three use cases of Terraform with the first and most prominent use case, provisioning public cloud.

## 1. Public Cloud Provisioning

![Terraform Providers](https://i2.wp.com/www.thedevcoach.co.uk/wp-content/uploads/2020/10/Screenshot-2020-10-22-at-06.24.46.png?resize=760%2C432&ssl=1)

One of the main tasks that customers of Terraform us it for is for public cloud provisioning on one of the main cloud providers. Infrastructure as code for these main cloud providers has always been the main focus of Terraform.

Terraform allows use of these public clouds through what’s called a [provider](https://www.terraform.io/docs/providers/index.html). A provider in Terraform can be thought of like a plugin which wraps an existing companies API’s to create declarative Terraform syntax.

The providers which cover the main public clouds are all open source and are closely managed by Hashicorp (the company behind Terraform). As a result, the providers receive frequent updates to match updates from the cloud providers.

This fact that Terraform is used mainly for public cloud is further re-inforced jut by looking at Terraform’s [providers registry page](https://registry.terraform.io/browse/providers) where all of the cloud providers are on display prominently above the rest.

## 2. For Doing MultiCloud Deployments

![Cloud Vendor Logos](https://i1.wp.com/www.thedevcoach.co.uk/wp-content/uploads/2020/01/cloudvendorlogos.png?resize=760%2C456&ssl=1)

The second main use for Terraform is performing multi-cloud deployments.

One of the main appeals of Terraform is how it works across all the cloud providers at the same time, unlike many of Terraform’s direct competitors like [CloudFormation](https://aws.amazon.com/cloudformation/), which work primarily with a single cloud provider only.

Being able to deploy resources into multiple cloud providers is useful because software engineers can then use the same syntax and toolchain, without needing to familiarise themselves with multiple tools and technologies.

But there are also strategic advantages to multi-cloud. Multi-cloud support allows companies to leverage unique services that may only be available in one cloud provider, it helps reduce risks of having all cloud assets dependent on a single company, and also can help in the negotiation of contracts.

## 3. Bespoke Infrastructure As Code

![Terraform In HCL](https://i2.wp.com/www.thedevcoach.co.uk/wp-content/uploads/2020/07/carbon-51.png?resize=760%2C283&ssl=1)

The final important use of Terraform is its use with custom providers.

As we mentioned before, a provider is a way in Terraform to wrap an existing API and convert it to the Terraform declarative syntax.

The process of creating providers is not just for open source use cases, though. Providers can also be written for internal company use cases where a company wants to convert existing tools or API’s into Terraform.

Any API which supports CRUD (create, read, update, delete) actions can be wrapped in Terraform style declarative code, which gives Terraform lots of flexibility to support many different infrastructure setups.

## The Many Uses Of Terraform

And that concludes our look at the main uses of Terraform. Terraform is a very powerful for writing infrastructure as code, and as you can see has many perks in it’s features such a multi-cloud deployment and custom providers. Hopefully that helped clear things up for you about what Terraform is and how it’s used.

For more on Terraform and infrastructure as code, I recommend taking a look at: [Infrastructure As Code: An Ultimate Guide](https://www.thedevcoach.co.uk/infrastructure-as-code-ultimate-guide/)

---

The post [What Is Terraform Used For? The 3 Main Use Cases.](https://www.thedevcoach.co.uk/what-is-terraform-used-for/) appeared first on [The Dev Coach](https://www.thedevcoach.co.uk).

If you’re interested in Cloud I write a monthly [newsletter for Cloud Software Engineers](https://newsletter.thedevcoach.co.uk). I spend the month digging around the internet for the best cloud engineering content and provide a monthly summary. I read every article I share, and I focus on fundamentals as much as possible.