Provisioning and configuring an Azure VM with Terraform
In this recipe, we will study a typical use case of Terraform in Azure in which we will provision and configure a VM in Azure using Terraform.
Getting ready
For this recipe, we don’t need any special prerequisites. We will start the Terraform configuration from scratch. This recipe will only involve writing the Terraform configuration. We will explore the process of writing the Terraform configuration in different stages as we proceed with this recipe. As for the architecture in Azure, we have already built a network beforehand, which will contain this VM and which is made up of the following resources:
- A virtual network (VNet) called
VNET-DEMO
. - Inside this VNet, a subnet named
Subnet1
is registered.
In addition, the VM that will be provisioned will have a public IP address so that it can be accessed publicly.
Note that, for this recipe, we will expose the VM with a public IP...