Skip to content
Kendrick's Website Kendrick's GitHub Kendrick's Youtube Kendrick's Travel blog

[Book Review] Getting Started with IaC using Terraform

4 min read
Cover

Getting Started with IaC using Terraform

About 6 years ago, when initially building company infrastructure, we reviewed various tools like Ansible, Puppet, and Chef for IaC (Infrastructure as Code). Terraform was also one of the candidates, but we ultimately chose Ansible. For that reason, I haven't had the chance to use Terraform deeply until now, but this time I got the opportunity to review a Terraform-related book through 'I am a Reviewer', so I was able to explore it more intensively.

Unlike existing infrastructure or DevOps books, this book focuses comprehensively on Terraform. It guides you to understand Terraform's basic philosophy and principles, starting with Chapter 1 by clearly addressing Terraform's purpose. Through this process, you come to understand how systematically and efficiently Terraform can help with infrastructure management.

Part 1. First Meeting with Terraform

The first part of the book introduces basic concepts of Terraform and is structured to learn major commands and configuration methods through practice. Memories of using Vagrant for VMs about 6 years ago came flooding back. While Docker became my main tool reducing Vagrant usage frequency, I learned for the first time that Terraform was Vagrant's predecessor. This was very interesting and beneficial to understand how Terraform has evolved.

Chapter 1 comprehensively covers Terraform's basic environment setup and major features. Chapters 2 and 3 include hands-on practice of Terraform's basic setup and major commands, allowing you to become familiar with Terraform's core syntax and structure step by step. Particularly, there were many good examples and explanations for learning HCL (HashiCorp Configuration Language), which is HashiCorp's DSL used by Terraform, naturally helping you grasp HCL syntax.

The book includes many code examples and plenty of illustrations, making it easy to follow along.

Part 2. Terraform Workflow from Construction to Operation

While all parts are important, I personally think Part 2 is the core. One of infrastructure's biggest roles is creating an environment for collaboration. Using Terraform, anyone can consistently deploy infrastructure environments through the same code, maximizing collaboration effectiveness. Part 2 focuses on setting up and managing such collaborative environments.

Also, Part 2 covers Terraform's State management and Modularization, teaching how to design infrastructure code more efficiently and reusably. The part about tracking current infrastructure state through State files and managing them to reflect desired changes was an important concept for using Terraform. Through this, complex infrastructure configurations can be maintained stably, and development and operations teams can easily share environments.

The final chapter's section on integrating generative AI with Terraform was very interesting. It covers examples of using LLM (Large Language Models) to increase productivity and methods for using simple Terraform code generators implemented with Streamlit. When I saw Pulumi, another IaC service, introduce AI features, I was impressed, so it was welcome to see similar attempts being made in Terraform. While optimization is still needed, I thought it could be quite useful for shortening code writing time and reducing error possibilities.

Conclusion

This book is not easy content overall. Since it requires understanding of basic network and cloud environments, as well as overall development flow and testing cycles, I think it's good to study related DevOps or infrastructure beforehand. I can recommend this book to those interested in infrastructure and Terraform.

Terraform doesn't stop at simply writing code but helps manage infrastructure stably through collaboration and automation. By following the examples provided in the book, you can gain experience beyond just writing code. Through this book that deeply covers Terraform's core features, you should be able to take one step closer to infrastructure management.

"This review was written after receiving the book for Hanbit Media's <I am a Reviewer> activity."