In all of the previous recipes in this book, we've discussed Terraform configuration, CLI execution, and its benefits for IaC.
Now, in this recipe, we will discuss how we will integrate this Terraform workflow into a CI/CD pipeline in Azure Pipelines using the Terraform extension for Azure DevOps and Pipelines YAML.
Getting ready
Before automating Terraform in any CI/CD pipeline, it is recommended to read HashiCorp's automation guides with recommendations for Terraform. These guides are available here:
- https://learn.hashicorp.com/terraform/development/running-terraform-in-automation
- https://www.terraform.io/docs/cloud/guides/recommended-practices/part3.html
The purpose of this recipe is not to explain in detail how Azure Pipelines works, but just to focus on the execution of Terraform in Azure Pipelines. To learn more about Azure Pipelines, I suggest you look at the official documentation at https...