Skip to content

doytsujin/terraform-azurerm-windows-vm

 
 

Repository files navigation

Windows Azure Module

A Terraform module to create a new virtual network and a publicly accessible Windows virtual machine into existing resource group in Azure.

  • By default create a single Windows 10, version 1903 IT Pro
  • Generate password and store secret in key vault
  • Allow only one source IP address to access remotely
  • Auto-shutdown virtual machine by default

The simplest example how to use this module

module "windows" {
  source              = "yusmadi/windows-vm/azurerm"
  prefix              = "example"
  domain_name_label   = "mywindows"
  resource_group_name = "existing-rg"
  vnet_name           = "existing-vnet"
  subnet_name         = "default"
}

Full example how to use this module

module "windows" {
  source               = "ayusmadi/windows-vm/azurerm"
  prefix               = "mywindows"
  domain_name_label    = "mywindows"
  resource_group_name  = "existing-rg"
  allowed_ip_addresses = ["13.15.17.19/32"]
  vm_size              = "Standard_DS1_v2"
  publisher            = "MicrosoftWindowsDesktop"
  offer                = "Windows-10"
  sku                  = "19h1-pro"
  image_version        = "latest"
  delete_disks_on_termination = true
}

Providers

Name Version
azurerm ~> 1.43.0
random n/a

Inputs

Name Description Type Default Required
allowed_ip_addresses Public IP address to allow remote access list(string)
[
"1.2.3.4/32"
]
no
autoShutdownStatus The status of the schedule (i.e. Enabled, Disabled). - Enabled or Disabled string "Enabled" no
autoShutdownTime The time of day the schedule will occur. string "00:00" no
autoShutdownTimeZone The time zone ID (e.g. Pacific Standard time). string "UTC" no
delete_disks_on_termination Delete all disks when virtual machine is deleted bool false no
domain_name_label Label for the Domain Name. Will be used to make up the FQDN. If a domain name label is specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system. any n/a yes
image_version Specifies the version of the image used to create the virtual machine. Changing this forces a new resource to be created. string "latest" no
offer Specifies the offer of the image used to create the virtual machine. Changing this forces a new resource to be created. string "Windows-10" no
prefix Prefix to be used by resources and attributes. Windows computer name cannot be more than 15 characters long, be entirely numeric string "myserver" no
publisher Specifies the publisher of the image used to create the virtual machine. Changing this forces a new resource to be created. string "MicrosoftWindowsDesktop" no
resource_group_name Specifies the name of the existing resource group. any n/a yes
sku Specifies the SKU of the image used to create the virtual machine. Changing this forces a new resource to be created. string "19h1-pro" no
subnet_name Specifies the name of the existing Subnet. any n/a yes
vm_size Specifies the size of the Virtual Machine. string "Standard_DS1_v2" no
vnet_name Specifies the name of the existing Virtual Network. any n/a yes

Outputs

Name Description
fqdn Fully qualified domain name of the A DNS record associated with the public IP. domain_name_label must be specified to get the fqdn. This is the concatenation of the domain_name_label and the regionalized DNS zone
password Username to access the Windows virtual machine
username Username to access the Windows virtual machine
vm_id The ID of the Virtual Machine.

Reference

About

Terraform module to deploy a virtual network and a Windows virtual machine into existing resource group.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HCL 100.0%