In previous articles, we’ve discussed Azure Bicep and ARM (JSON) templates for deploying resources to Azure. However, we have not yet discussed Terraform until now.
What is Terraform?
Terraform is a tool created by HashiCorp that allows users to define infrastructure as code (IaC) and use it for various Cloud providers, including Azure, AWS, and Google. It can also be used to provision infrastructure on-premises or in other environments. Terraform uses the HashiCorp Configuration Language (HCL), which describes the infrastructure you want to create.
Terraform is open-source software and is freely available for anyone to use. The source code is available on GitHub. Of course, you have to pay for the resources that you deploy. Additionally, while the open-source version of Terraform is free, HashiCorp also offers a paid enterprise version called Terraform Enterprise (TFE) that includes additional features and support options.
I’ll cover Terraform in this article by deploying an example resource to Azure. We will go into more depth in later articles.
What do we need?
- An Azure subscription — In this example we will deploy a virtual machine to Azure, so we need access to an Azure Subscription. Of course, you can sign up using a free trial
- Terraform installed on your local machine — You will need to have Terraform installed on your local device to run Terraform command and create resources in Azure
- Azure CLI installed on your local machine — The Azure CLI is required to configure the Azure provider in Terraform and to authenticate to Azure
- Access to Azure– Access Azure using an Azure service principal or authenticate using a username/password
- Terraform configuration file — A Terraform configuration file defines the resources you want to create. You will need to create a new Terraform configuration file and specify the virtual machine, storage, and network resources that you want to create
Read this article to know more…