Terraform - An Overview

Terraform - An Overview
Techiio-author
Written by Shuvhojit DebDecember 22, 2021
7 min read
Terraform
1 VIEWS 0 LIKES 0 DISLIKES SHARE
0 LIKES 0 DISLIKES 1 VIEWS SHARE
Techiio-author
Shuvhojit Deb

Full Stack Developer

Today we can briefly know about Terraform.

What is Terraform?

Terraform is a tool for building, changing, and versioning infrastructure safely and efficiently. Terraform can manage popular service providers as well as custom in-house solutions. It is used to define and provision the complete infrastructure using an easy-to-learn declarative language called the HashiCorp Configuration Language (HCL).

Terraform can help with multi-cloud by having one workflow for all clouds. The infrastructure, Terraform manages can be hosted on public clouds like Amazon Web Services, Microsoft Azure, and Google Cloud Platform, or On-prem in private clouds such as VMWare vSphere, OpenStack, or CloudStack. Even if you are only using one cloud, Terraform is a great option and can make it easier to leverage multi-cloud later. Terraform treats infrastructure as code (IaC), so you never have to worry about your infrastructure drifting away from its desired configuration.

blogpost

When to Use Terraform?

Reproducible and Disposable environments:

Infrastructure can be shared and re-used. Using Terraform, the same environment can be created over and over. For example, the production environment can be codified and then shared with Staging, QA, or Dev. These configurations can be used to rapidly spin up new environments to test in, and then be easily disposed of.

Easing collaboration:

Like other kinds of code, infrastructure-as-code belongs in version control, so Terraform Cloud is designed to work directly with your version control system (VCS) provider. Having the code in a version control system like Git allows teams to collaborate on infrastructure. Team members can get specific versions of the code and create their environments for testing or other scenarios.

Multi-cloud deployment:

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.

Multi-tier Applications:

Each tier can be described as a collection of resources, and the dependencies between each tier are handled automatically; Terraform will ensure the database tier is available before the web servers are started and that the load balancers are aware of the web nodes. Each tier can then be scaled easily using Terraform by modifying a single count configuration value. Because the creation and provisioning of a resource are codified and automated, elastically scaling with load becomes trivial.

Advantages of Terraform

  1. Terraform internally uses DAG(direct acyclic graph) algorithm to produce optimal results.
  2. The whole infrastructure is maintained as a code and so incremental changes in resources are not an issue.
  3. Supports multi-regional scripts. For eg we can look up an ami in us-east-1 to create an ec2 instance in us-east-2.
  4. Easily integrated with the build and deploy process.
  5. Terraform supports multiple cloud solutions and switching a provider is not a big headache.
  6. Powerful support for networking. Creating an on-premise data canter may take months, but using Terraform it can be done in a few hours.
  7. Modular design.
  8. State maintenance. All the objects created by Terraform shall be recreated if deleted by any other process.
  9. Allows import of existing resources to bring them to Terraform state.

Disadvantages of Terraform

  1. The issues are more related to (AWS) provider teams of Terraform. For eg currently Terraform AWS quick sight does not support all functionalities.
  2. Still under development. Every month we have some beta release.
  3. A certain configuration like terraform backend cannot be read from var files. So, either provide the details in-situ or write a backend-config block while initializing Terraform.
  4. No way to Rollback. So, we need to destroy everything and re-run if required.
  5. Niche technology. To write loops or if blocks, requires intuition. A lot of hacks are available online nevertheless.
  6. A few items cannot be imported.
  7. Terraform does not allow the creation of Terraform scripts from the state.
  8. Terraform confirms that releases may have bugs.

Conclusion

Terraform is a very powerful tool that helps us to adopt the Infrastructure-as-Code practice in our projects. This power, however, comes with its challenges. In this article, we've provided a quick overview of this tool so we can get a better understanding of its capabilities and its basic concepts.

Terraform
1 VIEWS 0 LIKES 0 DISLIKES SHARE
0 LIKES 0 DISLIKES 1 VIEWS SHARE
Was this blog helpful?
techiio-price-plantechiio-price-plantechiio-price-plantechiio-price-plantechiio-price-plan
You must be Logged in to comment
Code Block
Techiio-logo

Techiio is on the journey to build an ocean of technical knowledge, scouring the emerging stars in process and proffering them to the corporate world.

Follow us on:

Subscribe to get latest updates

You can unsubscribe anytime from getting updates from us
Developed and maintained by Wikiance
Developed and maintained by Wikiance