Allow to delete data disk on termination

This commit is contained in:
Jeremy MARMOL 2017-10-03 11:31:23 +02:00
Родитель ed66005651
Коммит 84600bb831
2 изменённых файлов: 7 добавлений и 0 удалений

Просмотреть файл

@ -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"
}