Why Do We need Terraform (Infra Provisioning)
Hypothetical application (Tomato – clone of zomato)
-
We are trying to build a food delivery application with the following architecture
- Infrastructure (Servers, Network, storage etc) is required to run your application.
- Possible ways of Getting Infra
- On-premises:
- Physical Servers
- Virtual Machines
- Cloud
- Virtual Machines
- Networking
- Storage
- Databases
- Kubernetes
- ..
- On-premises:
- If your organization is using physical servers directly, only way to create infra is manual in nature. But if the infrastrucutre is virtual (On-premises/Cloud) we can automate infra creation an updates
- On-Premise Hypervisor Providers
| Hypervisor | Type | Key Strengths | Typical Use Case |
|---|---|---|---|
| VMware ESXi / vSphere | Type 1 | High stability and performance; advanced features like vMotion, Fault Tolerance; strong security; wide guest OS support | Large enterprises, data centers |
| Microsoft Hyper-V | Type 1 | Seamless Microsoft ecosystem integration; cost-effective for Windows; scalable and secure | Microsoft-centric organizations |
| KVM (Kernel-based Virtual Machine) | Type 1 | Open-source and customizable; excellent performance and scalability; broad Linux support | Linux environments, cloud infrastructure |
| Citrix XenServer / Xen | Type 1 | Strong isolation and security; supports paravirtualization and hardware virtualization; live migration | Enterprises using Citrix products, cloud providers |
| Red Hat Virtualization (RHEV) | Type 1 | Enterprise support; integration with Red Hat products; advanced management and automation | Red Hat-based enterprise environments |
| Nutanix Acropolis Hypervisor (AHV) | Type 1 | Tight integration with Nutanix HCI; simple and user-friendly management | Nutanix hyperconverged infrastructure deployments |

- Since we have lot of different providers with their own tools/sdks to automate, Learning all options is not sensible.
- This is where Terraform By HashiCorp comes to our rescue, Use any provider but automate infra using Terraform
- Terraform offers declarative approach in infra creation
- Terraform has its own language called as HCL (Hashicorp Configuration lanaguage)
- New Trend: Tools like terraform, cloud have started offering CDKs where you can use any programming language for declarative approaches.
