This terraform script prepared to create multiple azure VM in single terraform apply. We need to provide the count variable based on number of VM needs to create. The script is created using service principle for Azure authentication.
- Create a service place in azure subscription.
- vnet.tf will create 3 virtual networks in East US location(default location)
- nic.tf will create 3 network interfaces with static private ip address assiged to it.
- storageaccount.tf - will create storage account to store vhd files for virtual machine. if we want to provision server with unmanaged disk.
- virtualmachine.tf - will create 3 VM as per provided names in "vm_name" variable in terraform.tfvars with unmanaged disk data disks.
- oms_worspace.tf - this will create log analytics workspace for cetralized log monitoring.
- omsextension.tf - will install oms extension on server with above workspace id.
- vmextension_domainjoin.tf - will join all the servers to domain.