Allow to delete data disk on termination
This commit is contained in:
Родитель
ed66005651
Коммит
84600bb831
2
main.tf
2
main.tf
|
@ -21,6 +21,7 @@ resource "azurerm_virtual_machine" "vm-linux" {
|
|||
availability_set_id = "${azurerm_availability_set.vm.id}"
|
||||
vm_size = "${var.vm_size}"
|
||||
network_interface_ids = ["${element(azurerm_network_interface.vm.*.id, count.index)}"]
|
||||
delete_os_disk_on_termination = "${var.delete_os_disk_on_termination}"
|
||||
|
||||
storage_image_reference {
|
||||
id = "${var.vm_os_id}"
|
||||
|
@ -62,6 +63,7 @@ resource "azurerm_virtual_machine" "vm-windows" {
|
|||
availability_set_id = "${azurerm_availability_set.vm.id}"
|
||||
vm_size = "${var.vm_size}"
|
||||
network_interface_ids = ["${element(azurerm_network_interface.vm.*.id, count.index)}"]
|
||||
delete_os_disk_on_termination = "${var.delete_os_disk_on_termination}"
|
||||
|
||||
storage_image_reference {
|
||||
id = "${var.vm_os_id}"
|
||||
|
|
|
@ -97,3 +97,8 @@ variable "public_ip_address_allocation" {
|
|||
description = "Defines how an IP address is assigned. Options are Static or Dynamic."
|
||||
default = "static"
|
||||
}
|
||||
|
||||
variable "delete_os_disk_on_termination" {
|
||||
description = "Delete datadisk when machine is terminated"
|
||||
default = "false"
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче