- Provisioning your infra through code
- When you can do that from the Azure console, login to the portal and create, drag, and drop.
- Why take the pain of writing code for drag and drop?

- Let's assume you have to provision the infra to deploy a three-tier application Time taken: 2 hours

it's good for a personal project or when you are learning something
- What if you are working somewhere in a company and let's say you have 4 environments? Time taken: 8 hours no big deal? right

- How about 100s of servers to be deployed? Tricky? That's not it
- To save the cost , decommission every day(not possible) keep running and keep accumulating the cost
- Identical environment, works on my machine
- Automate the provisioning, manage and destroy the infra
- Reliability, efficiency, and security?

- Consistent environment
- Easy to track cost
- Write once, deploy many (single code base)
- Time saving
- Human error
- Cost saving
- Version control, changes are tracked in git
- Automated cleanup/scheduled destruction
- Easy to set and destroy
- The developer can focus on app development
- Easy to create an identical production environment for troubleshooting
IaaC tool that helps do all these tasks

Write your terraform files --> Run terraform commands --> Call the target cloud provider API to provision the infra using Terraform Provider

Phases: init --> validate --> plan --> apply --> destroy
https://developer.hashicorp.com/terraform/install
brew install hashicorp/tap/terraform
Error: No developer tools installed.
Install the Command Line Tools:
xcode-select --install
- Install the code tool for mac --> popup will appear, install using that
terraform -install-autocomplete
alias tf=terraform
terraform -version