Working with Terraform
Let’s first learn about how Terraform works and then we will walk through using it within Azure Pipelines.
How does Terraform work?
Terraform is a tool that allows you to write IaC and define resources for both cloud and on-premises resources using a domain-specific language. It uses providers as a means to encapsulate the resource definition for supported targets.
The following diagram depicts the high-level architecture of Terraform:
Figure 8.16 – Terraform architecture
It works by way of the following three steps:
- Write: You define the resources in templates to deploy all the resources you need, across the targets required. There could be more than one.
- Plan: Terraform creates an execution plan to determine the changes that need to be made to match the definition, calculating the sequential order of operations and understanding any resource dependencies. This could mean creating resources, updating...