Deep-Diving into Terraform
In this book, we started with recipes for Terraform that concern its installation, writing the Terraform configuration, as well as examining the use of the Terraform CLI commands. Then, we studied sharing the Terraform configuration using modules. Finally, we focused on the use of Terraform to build Azure, GCP, AWS, and Kubernetes infrastructures.
Now, in this chapter, we will discuss recipes that allow us to go further in our usage of Terraform. We will learn how to use the templates in Terraform to generate an Ansible inventory file. We will discuss how to prevent the destruction of resources, how to implement a zero-downtime deployment with Terraform, and how to detect the deletion of resources when Terraform applies changes.
Then, we will discuss the use of Terragrunt to manage the workspace dependency and its use as a wrapper for the Terraform CLI.
Finally, we will talk about the use of Git hooks to check in the Terraform configuration before...