diff --git a/custom_script.tf b/custom_script.tf index f2e952f..c28a964 100644 --- a/custom_script.tf +++ b/custom_script.tf @@ -3,7 +3,10 @@ resource "azurerm_virtual_machine_scale_set_extension" "custom_script" { count = (var.install_splunk_uf == true || var.install_nessus_agent == true || var.additional_script_path != null) && var.virtual_machine_type == "vmss" ? 1 : 0 - + depends_on = [azurerm_virtual_machine_scale_set_extension.endpoint_protection] + lifecycle { + prevent_destroy = true + } name = var.custom_script_extension_name virtual_machine_scale_set_id = var.virtual_machine_scale_set_id publisher = lower(var.os_type) == "linux" ? "Microsoft.Azure.Extensions" : lower(var.os_type) == "windows" ? "Microsoft.Compute" : null