What is Terraform?
Terraform is a free and open source Infrastructure as code software tool created by HashiCorp. A declarative coding tool, Terraform enables developers to use a high-level configuration language called HCL(HashiCorp Configuration Language) to describe the "end-state" cloud or on-premises infrastructure for running application.
One of the biggest advantage of Terraform is it's ability to deploy infrastructure across multiple platforms including private and public cloud, such as on-premise vSphere cluster or cloud solutions such as AWS, GCP or Azure, these are just a few of the many resources that Terraform can manage. Terraform supports lots of providers, hence can work with almost every infrastructure platform.
You can download the respective binary from the following download link.
All infrastructure resources can be defined within configuration files that has a .tf file extension. The configuration syntax is easy to read, write and pick up for a beginner. Below is the sample code used to create a new EC2 instance on AWS cloud.
Terraform generates an execution plan describing what it will do to reach the desired state, and then execute it to build the described infrastructure. As and when configuration changes, Terraform is able to determine what changed and create incremental execution plans which can be applied. How does Terraform do that?
Terraform works in three phases Init, Plan and Apply. During the Init Phase, Terraform initializes the project and identifies the providers to be used for the target environment. In the Plan phase, it drafts a plan to get to the target state, and in the Apply phase, it makes the necessary changes required on the target environment to bring it to the desired state.
Every object that Terraform manages is called a resource. A resource can be a low level components such as compute instance and storage, as well as high level components such as DNS entries, SasS features etc. Terraform can ensure that the entire infrastructure is always in the defined state at all times. It can also read attributes of existing infrastructure components by configuring data sources.
That's basic high level overview of Terraform.
Happy Programming...!!!

Comments
Post a Comment