windows-vm

claranet/windows-vm/azurerm

Terraform Module HCL AZURERM

Terraform module composition (feature) for ARM Windows Virtual Machine (VM)

Install
module "windows-vm" {
source = "claranet/windows-vm/azurerm"
version = "8.5.2"
}
⭐ Source on GitHub 📦 Registry page
README

Azure Windows Virtual Machine ![Changelog](CHANGELOG.md) ![Notice](NOTICE) ![Apache V2 License](LICENSE) ![OpenTofu Registry](https://search.opentofu.org/module/claranet/windows-vm/azurerm/) This module creates a Windows Virtual Machine with Windows Remote Management (WinRM) activated. The Windows Virtual Machine comes with: Azure Monitor Agent activated and configured A link to an Azure Monitor Data Collection Rule for logging An optional link to a Load Balancer or Application Gateway A link to the Recovery Vault and one of its policies to back up the Virtual Machine Optional certificates retrieved from Azure Key Vault This code is mostly based on Tom Harvey work: https://github.com/terraform-providers/terraform-provider-azurerm/tree/master/examples/virtual-machines/provisioners/windows F

Inputs (50)
NameTypeDescriptionDefault
vm_sizestringSize (SKU) of the Virtual Machine to create. required
environmentstringProject environment. required
subnetobject({ id = string })ID of the Subnet in which to create the Virtual Machine. required
stackstringProject stack name. required
admin_passwordstringPassword for the Virtual Machine administrator account. required
azure_monitor_data_collection_ruleobject({ id = string })Data Collection Rule ID from Azure Monitor for metrics and logs collection. Used required
backup_policyobject({ id Backup policy parameters from the Recovery Vault to attach the Virtual Machine t required
client_namestringClient name/account used in naming. required
diagnostics_storage_account_namestringName of the Storage Account in which boot diagnostics are stored. required
key_vaultobject({ id = string })ID of the Key Vault to use for Virtual Machine certificate (value to `null` to d required
nic_extra_tagsmap(string)Extra tags to set on the network interface.{}
availability_setobject({ id = string })ID of the Availability Set in which to locate the Virtual Machine.null
key_vault_certificatesobject({ names = opKey Vault certificates object. ``` names = List of Key Vault certificates{}
certificate_validity_in_monthsnumberThe created certificate validity in months.48
zone_idnumberIndex of the Availability Zone which the Virtual Machine should be allocated in.null
disk_controller_typestringSpecifies the Disk Controller Type used for this Virtual Machine. Possible valuenull
spot_instance_max_bid_pricenumberThe maximum price you're willing to pay for this Virtual Machine in US dollars; -1
entra_login_extension_versionstringVirtual Machine extension version for Entra ID (aka AAD) login extension."1.0"
nic_accelerated_networking_enabledboolShould accelerated networking be enabled? Defaults to `true`.true
patching_reboot_settingstringSpecifies the reboot setting for platform scheduled patching. Possible values ar"IfRequired"
public_ip_extra_tagsmap(string)Extra tags to set on the Public IP.{}
os_disk_tagging_enabledboolShould OS disk tagging be enabled? Defaults to `true`.true
spot_instance_eviction_policystringSpecifies what should happen when the Virtual Machine is evicted for price reaso"Deallocate"
storage_data_disk_configmap(object({ name Map of objects to configure storage data disk(s).{}
hotpatching_enabledboolShould the Virtual Machine be patched without requiring a reboot?false
static_private_ipstringStatic private IP address. Dynamic addressing if not set.null
entra_login_enabledboolEnable login with Entra ID (aka AAD).false
entra_login_admin_objects_idslist(string)Entra ID (aka AAD) objects IDs allowed to connect as administrator on the Virtua[]
azure_monitor_agent_auto_upgrade_enabledboolAutomatically update agent when publisher releases a new version of the agent.false
public_ip_custom_namestringCustom name for the Public IP. Generated if not set.null
… and 10 more inputs
Outputs (24)
public_domain_name_label — Public domain name of the Virtual Machine.
winrm_key_vault_certificate_data — RAW Key Vault certificate data represented as a hexadecimal string.
resource_maintenance_configuration_assignment — Maintenance configuration assignment resource object.
admin_password — Administrator password of the Virtual Machine.
public_ip_id — Public IP ID of the Virtual Machine.
public_ip_name — Public IP name of the Virtual Machine.
nic_id — ID of the network interface attached to the Virtual Machine.
terraform_module — Information about this Terraform module.
resource_network_interface — Network interface resource object.
resource_key_vault_certificate — WinRM Key Vault certificate resource object.
id — ID of the Virtual Machine.
name — Name of the Virtual Machine.
nic_name — Name of the network interface attached to the Virtual Machine.
nic_ip_configuration_name — Name of the IP configuration for the network interface attached to the Virtual Machine.
private_ip_address — Private IP address of the Virtual Machine.
resource — Windows Virtual Machine resource object.
resource_public_ip — Public IP resource object.
admin_username — Administrator username of the Virtual Machine.
public_ip_address — Public IP address of the Virtual Machine.
winrm_key_vault_certificate_id — ID of the generated WinRM Key Vault certificate.
winrm_key_vault_certificate_name — Name of the generated WinRM Key Vault certificate.
winrm_key_vault_certificate_thumbprint — X509 thumbprint of the Key Vault certificate represented as a hexadecimal string.
hostname — Hostname of the Virtual Machine.
identity_principal_id — Object ID of the Virtual Machine Managed Service Identity.
Resources (16)
azapi_resource_actionazurerm_backup_protected_vmazurerm_key_vault_access_policyazurerm_key_vault_certificateazurerm_maintenance_assignment_virtual_machineazurerm_managed_diskazurerm_monitor_data_collection_rule_associationazurerm_network_interfaceazurerm_network_interface_application_gateway_backend_address_pool_associationazurerm_network_interface_backend_address_pool_associationazurerm_public_ipazurerm_role_assignmentazurerm_virtual_machine_data_disk_attachmentazurerm_virtual_machine_extensionazurerm_windows_virtual_machineterraform_data
Details
FrameworkTerraform Module
LanguageHCL
Version8.5.2
Cloud AZURERM
★ Stars23
Forks21
Total downloads35.1k
Inputs50
Outputs24
Resources16
Examples1
LicenseApache-2.0
Namespaceclaranet
Updated