diff --git a/Dockerfile b/Dockerfile index 5d2a005..bce4590 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Pull the base image with given version. -ARG BUILD_TERRAFORM_VERSION="0.13.5" +ARG BUILD_TERRAFORM_VERSION="0.14.4" FROM mcr.microsoft.com/terraform-test:${BUILD_TERRAFORM_VERSION} ARG MODULE_NAME="terraform-azurerm-compute" diff --git a/main.tf b/main.tf index 5d9c897..c62f424 100644 --- a/main.tf +++ b/main.tf @@ -30,7 +30,7 @@ resource "azurerm_storage_account" "vm-sa" { } resource "azurerm_virtual_machine" "vm-linux" { - count = ! contains(list(var.vm_os_simple, var.vm_os_offer), "WindowsServer") && ! var.is_windows_image ? var.nb_instances : 0 + count = ! contains(tolist([var.vm_os_simple, var.vm_os_offer]), "WindowsServer") && ! var.is_windows_image ? var.nb_instances : 0 name = "${var.vm_hostname}-vmLinux-${count.index}" resource_group_name = data.azurerm_resource_group.vm.name location = coalesce(var.location, data.azurerm_resource_group.vm.location) @@ -139,7 +139,7 @@ resource "azurerm_virtual_machine" "vm-linux" { } resource "azurerm_virtual_machine" "vm-windows" { - count = (var.is_windows_image || contains(list(var.vm_os_simple, var.vm_os_offer), "WindowsServer")) ? var.nb_instances : 0 + count = (var.is_windows_image || contains(tolist([var.vm_os_simple, var.vm_os_offer]), "WindowsServer")) ? var.nb_instances : 0 name = "${var.vm_hostname}-vmWindows-${count.index}" resource_group_name = data.azurerm_resource_group.vm.name location = coalesce(var.location, data.azurerm_resource_group.vm.location) @@ -295,7 +295,7 @@ resource "azurerm_network_interface" "vm" { name = "${var.vm_hostname}-ip-${count.index}" subnet_id = var.vnet_subnet_id private_ip_address_allocation = "Dynamic" - public_ip_address_id = length(azurerm_public_ip.vm.*.id) > 0 ? element(concat(azurerm_public_ip.vm.*.id, list("")), count.index) : "" + public_ip_address_id = length(azurerm_public_ip.vm.*.id) > 0 ? element(concat(azurerm_public_ip.vm.*.id, tolist([""])), count.index) : "" } tags = var.tags