Step Snap 1 [Why Terraform?]:
We see people like to build their platform in cloud or on-permise. But it would be easily messed up the configuration or forgot something. Then how could we deal with that?
Here is why we need the Terraform, as Data Slinger said, it has four beneficials. Here, we expand it to see what exactly they are meaning for:
- Simplicity in keeping track of infrastructure
- Imagine building with blocks - if you manually create resources in the cloud, it's like randomly stacking blocks and potentially forgetting where you put them
- Using Terraform is like having a detailed building instruction manual that clearly records the position and purpose of each block
- For example, you can see at a glance in your code: "Ah, this project uses 2 servers, 1 database, and 3 storage buckets"
- Easier collaboration
- It's like multiple people writing a recipe book. Without Terraform, if Tom adds a server today and Sarah adds a database tomorrow, nobody knows what others have done
- With Terraform, it's like having a shared recipe book where everyone's changes are clearly recorded in code: "Tom added server configuration here, Sarah added database parameters there"
- Reproducibility
- Think of it like LEGO - following the same instruction manual, you can build identical structures in different places
- For example, you can use the exact same Terraform code to rebuild a system in production that you've tested in your development environment, ensuring both are identical
- Ensure resources are removed
- Imagine playing with toys and having to clean up afterwards. Manual cleanup might miss some toys
- Using Terraform is like having a checklist of everything that needs to be cleaned up. When you're clearing an environment, Terraform will ensure every created resource is properly removed according to the list
- This prevents forgotten resources from continuing to generate costs
These features make infrastructure management more standardized and controllable, like adding an "operations manual" to cloud resource management, making team collaboration and environment management much easier.