What this book covers
Chapter 1, Setting Up the Terraform Environment, details the different ways of installing Terraform manually, with scripts, or by using a Docker container, and it also details the Terraform migration configuration process.
Chapter 2, Writing Terraform Configurations, concerns the writing of Terraform configurations for a provider, variables, outputs, built-in functions, condition expressions, YAML file manipulation, and pre-and post-conditions.
Chapter 3, Scaling Your Infrastructure with Terraform, shows you how to build dynamic environments by going further with Terraform configuration writing using loops, maps, and collections.
Chapter 4, Using Terraform with External Data, explores how to use Terraform with external data and local files, and how to execute local programs and scripts with Terraform.
Chapter 5, Managing Terraform State, explains Terraform state management, including reading, moving, deleting, and importing resources into the Terraform state.
Chapter 6, Applying a Basic Terraform Workflow, explains the use of Terraform’s CLI to validate the configuration, use outputs, destroy resources provisioned by Terraform, use workspaces, generate dependency graphs, and debug the execution of Terraform.
Chapter 7, Sharing Terraform Configuration with Modules, covers the creation, use, and sharing of Terraform modules, and shows testing module practices.
Chapter 8, Provisioning Azure Infrastructure with Terraform, illustrates the use of Terraform in a practical scenario with the cloud service provider Azure. It covers topics such as authentication, remote backends, ARM templates, Azure CLI execution, and Terraform configuration generation for an existing infrastructure.
Chapter 9, Getting Starting to Provisioning AWS and GCP Infrastructure Using Terraform, provides a starting point for provisioning AWS and GCP infrastructure using Terraform, and includes details on these providers, authentication, and remote backend storage.
Chapter 10, Using Terraform for Docker and Kubernetes Deployment, explains how to use Terraform to create Docker containers and deploy Kubernetes resources.
Chapter 11, Running Test and Compliance Security on Terraform Configuration, details Terraform configuration testing practices using several tools, including Tfsec, OPA, terraform-compliance
, and Pester.
Chapter 12, Deep-Diving into Terraform, discusses topics that go further with Terraform, such as the execution of Terraform configuration tests, zero-downtime deployment, Terraform wrappers with Terragrunt, checking configuration using Git-Hook, and using the Terraform CDK as a developer.
Chapter 13, Automating Terraform Execution in a CI/CD Pipeline, explores local Terraform automation processes and implementing a CI/CD pipeline to apply Terraform configuration automatically.
Chapter 14, Using Terraform Cloud to Improve Team Collaboration, explains how to use Terraform Cloud to run Terraform in a team with the sharing of Terraform modules in a private registry, the use of remote backends for Terraform state, migrating Terraform state, running Terraform remotely, and integrating cost estimation.
Chapter 15, Troubleshooting Terraform Errors, lists several Terraform errors and explains how to resolve them.
The Appendix A and B, contains a Terraform CLI cheat sheet and Terraform resources list.