Building CI/CD pipelines to apply Terraform configurations in Azure Pipelines
In all the recipes in this book, we’ve discussed Terraform configuration, CLI execution, and their 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
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://docs.microsoft.com/en-us/azure/devops/pipelines/index?view=azure-devops.
To use Terraform in Azure Pipelines, there are a couple of solutions:
- Use custom scripts (PowerShell and Bash) to execute the Terraform CLI commands.
- Use Terraform extensions for Azure DevOps.
In this recipe, we will learn how...