Check for previous/existing GitHub issues
Issue Type?
Feature Request
(Optional) Module Version
0.20.0
(Optional) Correlation Id
No response
Description
Summary
The module does not currently expose delete_option for the OS disk or network interfaces. Both are configurable in the underlying azurerm_windows_virtual_machine resource and the Azure REST API, but there is no way to set them through the module's input variables.
Missing Properties
OS Disk
The os_disk variable object does not include a delete_option field, which maps to storageProfile.osDisk.deleteOption in the Azure ARM API.
Network Interfaces
The network_interfaces map object does not include a delete_option field per NIC, which maps to networkProfile.networkInterfaces[].deleteOption in the Azure ARM API.
Expected Behavior
Both os_disk and network_interfaces should accept an optional delete_option value of either "Delete" or "Detach", defaulting to "Delete" to align with current Azure portal default behavior for new VMs.
Current Behavior
Both default to Detach, meaning when a VM is destroyed the OS disk and NIC are left behind as orphaned resources requiring manual cleanup.
Use Case
When deploying VMs via Terraform and later running terraform destroy, orphaned disks and NICs remain in the resource group. This requires manual cleanup and can result in unexpected storage costs. The Azure portal now defaults new VMs to Delete for both resources, and matching that behavior in the module would be consistent with current Azure guidance.
Module Version
0.20.0
Provider Version
azurerm >= 3.116, < 5.0
Check for previous/existing GitHub issues
Issue Type?
Feature Request
(Optional) Module Version
0.20.0
(Optional) Correlation Id
No response
Description
Summary
The module does not currently expose
delete_optionfor the OS disk or network interfaces. Both are configurable in the underlyingazurerm_windows_virtual_machineresource and the Azure REST API, but there is no way to set them through the module's input variables.Missing Properties
OS Disk
The
os_diskvariable object does not include adelete_optionfield, which maps tostorageProfile.osDisk.deleteOptionin the Azure ARM API.Network Interfaces
The
network_interfacesmap object does not include adelete_optionfield per NIC, which maps tonetworkProfile.networkInterfaces[].deleteOptionin the Azure ARM API.Expected Behavior
Both
os_diskandnetwork_interfacesshould accept an optionaldelete_optionvalue of either"Delete"or"Detach", defaulting to"Delete"to align with current Azure portal default behavior for new VMs.Current Behavior
Both default to
Detach, meaning when a VM is destroyed the OS disk and NIC are left behind as orphaned resources requiring manual cleanup.Use Case
When deploying VMs via Terraform and later running
terraform destroy, orphaned disks and NICs remain in the resource group. This requires manual cleanup and can result in unexpected storage costs. The Azure portal now defaults new VMs toDeletefor both resources, and matching that behavior in the module would be consistent with current Azure guidance.Module Version
0.20.0
Provider Version
azurerm >= 3.116, < 5.0