In Azure, I'm trying to create a Windows VM using Terraform. I have done this through Powershell previously using Template.json file. Now I have to do with terraform, which I'm completely new to. So I have searched for some Sample scripts which creates VM in Azure and found this.
In this link, there is a sample Terraform script to spin a Linux VM. But I need to spin a windows VM from an Image. Where should I give the Image details. My complete requirement is:
- Create a Windows VM from an Image (have resource Id)
- I already have Resource group, Virtual network, Subnet created. I just need to pass those values and create them.
- We have already defined the Subnet address prefix, Vnet address space from the portal itself. So do I have to give again in the script or can I skip it.
- The business requirement is that no VMs should have public IP and DNS name, So if I remove "# Create public IPs" section, will that not create public IP?
The script for creating a Linux machine is here, which I'm taking it as reference.