Azure Compute (hands-on) – Terraform code review in VS Code
In this lesson, we move forward in the multicloud journey by provisioning compute resources in Microsoft Azure.
We work inside the module-02-compute/azure folder of the foggykitchen_multicloud repository.
The goal is to mirror the compute architecture we previously built in OCI β with a bastion VM in the public subnet and a backend VM in the private one.
We begin by reviewing the compute_NEW.tf file, where both virtual machines are defined using azurerm_linux_virtual_machine.
Instead of assigning subnets directly, like in OCI, we reference network interfaces β which are connected to subnets separately in network_UPDATED.tf.
There, we also define a static public IP for the bastion host, along with the two NICs for each VM.
The remote_NEW.tf file sets up a provisioner that uses remote-exec to install and start NGINX on the backend VM β via a jump through the bastion.
SSH keys used during provisioning are generated in tls.tf, and VM sizing is controlled by a single variable defined in variables_UPDATED.tf.
This setup is clean and modular, making it easier to manage and extend later.
With the code now reviewed, weβre ready to move on to deployment using OpenTofu.

