DEV Community

Cover image for Terraform Discussion
Paul Micheli
Paul Micheli

Posted on

Terraform Discussion

How agnostic is Terraform?

I am heavily AWS focused in my role, and use Cloudformation for my Infrastructure as code.

Most DevOps Engineers I talk to are confused why I use Cloudformation over Terraform as Terraform is cloud-agnostic, they are of the opinion I should be using Terraform as I can then point to a new cloud provider and click, and POOF! your stack has appeared.

Terraform use cases

Multi-Cloud Deployment

It's often attractive to spread infrastructure across multiple clouds to increase fault-tolerance. By using only a single region or cloud provider, fault tolerance is limited by the availability of that provider. Having a multi-cloud deployment allows for more graceful recovery of the loss of a region or entire provider.

Realizing multi-cloud deployments can be very challenging as many existing tools for infrastructure management are cloud-specific. Terraform is cloud-agnostic and allows a single configuration to be used to manage multiple providers, and to even handle cross-cloud dependencies. This simplifies management and orchestration, helping operators build large-scale multi-cloud infrastructures.

How agnostic is Terraform? How much work is needed to deploy a stack with some compute, network & Storage from one cloud provider to another? How true is the above statement? One file point to AWS, Azure, Google and it builds?

Top comments (9)

Collapse
 
simov profile image
simo

I think there is a little misunderstanding here. Terraform supports multi-cloud deployments because you can use a single configuration language to manage multiple cloud providers simultaneously, but that doesn't mean that you can use the exact same configuration across different cloud providers.

Collapse
 
paulmicheli profile image
Paul Micheli

This was my understanding, the only benefit was a single language (a good one), I got the impression I was wrong tho 😂.

Collapse
 
winstonpuckett profile image
Winston Puckett

Echoing what simo said, Terraform can deploy to multiple clouds in the same deployment. If you're deploying a sql database to Azure, and then deploying a sql database to AWS, you're going to have to change more than the provider (AWS or Azure)

Here's how you do it on Azure:
terraform.io/docs/providers/azurer...

Here's how you do it on AWS:
registry.terraform.io/providers/ha...

So it's multicloud in that you can deploy to multiple clouds, but it's not the multicloud in that you can use the same step to deploy the same resources to multiple clouds.

Collapse
 
paulmicheli profile image
Paul Micheli

So the understanding I thought I had was correct, the impression I was getting from people was wrong.

Terraform Azure looks a lot easier than there Native ARM tho.

Collapse
 
winstonpuckett profile image
Winston Puckett

Yeah... I don't think anyone wants to use ARM templates anymore. Except for the people that got used to them before Terraform was good at Azure.

Collapse
 
csgeek profile image
csgeek

I think you'll need some customization. The ability to create a database service in GCP vs AWS is a different syntax, but you still have the ability to re-use components. There is likely going to be things you need to do in both GCP and AWS that are similar... and can be reused, others will need to be specialized for each cloud Infra.

What I really like about terraform and what i want to use it for is to spin up/tear down entire environments and have everything live in source control.

Just my 2 cents. I'm going to be more heavily using terraform soon, but from all i've seen it's a pretty awesome tool.

Collapse
 
paulmicheli profile image
Paul Micheli

The native tools also allow spin up and tear down of environments and infrastructure as code in any shape or form can be in source control.

I have a repo that contains all of my cloud formation and it is written in such a way that it is also reusable.

Collapse
 
csgeek profile image
csgeek

I guess what I was getting at is that the reusable code can be applied to multiple cloud environments which would be the appeal.

Though at the end of the day use whichever tool you like as long as it works for you.

Collapse
 
sahil_k25 profile image
Sahil Kamboj

I recently deployed my running infra(aws) with terraform which contains all the basic things like rds, ec2 ,vpc , k8, etc. and found some facts :

  1. Its simple and easy to define resources.
  2. Sometimes you may get confused over 3rd party module and basic terraform resources. I personally suggest going for terraform official modules.
  3. terraform is not that mature and in heavy development. You may face some weird errors. it takes me 6 attempts to complete the basics of the whole infra, 1 attempt = creating and destroying whole infra.
  4. YES ,terraform is multi-cloud friendly but remember point 3.
  5. there is lot of help available on internet and slack networks.
  6. you need some credits to burn for practicing terraform on big cloud like aws.