Understanding the need for IaC
IaC automates infrastructure deployment and updates with software. It enables agile development and DevOps. Terraform is an open source engine that processes IaC written in HashiCorp Configuration Language (HCL).
So, let's take a look at why you need IaC. Developers or DevOps engineers use a fast and reusable process to deploy and update an infrastructure. Thus, it is clear that infrastructure should be automatically provisioned and managed from code, not manually. That's why you use IaC.
In IaC, you define the end state of an infrastructure and let tools manage it for you. IaC is literally a self-documenting infrastructure, which is consistent and achieves repeatable results. It increases efficiency while reducing risk. Here, you can see a high-level diagram of how you can write code to define the end state of an infrastructure and let a tool such as Terraform handle that for you: