Skip to content

Commit 915459f

Browse files
committed
update module
1 parent b435e35 commit 915459f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

main.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ resource "azurerm_public_ip" "pip" {
7070
resource_group_name = data.azurerm_resource_group.rg.name
7171
allocation_method = "Static"
7272
sku = "Standard"
73-
domain_name_label = format("vm-%s-pip-0${count.index + 1}", lower(replace(var.vmscaleset_name, "/[[:^alnum:]]/", "")))
73+
domain_name_label = format("vm%spip0${count.index + 1}", lower(replace(var.vmscaleset_name, "/[[:^alnum:]]/", "")))
7474
tags = merge({ "ResourceName" = lower("pip-vm-${var.vmscaleset_name}-${data.azurerm_resource_group.rg.location}-0${count.index + 1}") }, var.tags, )
7575
}
7676

@@ -277,8 +277,8 @@ resource "azurerm_linux_virtual_machine_scale_set" "linux_vmss" {
277277
#---------------------------------------
278278
resource "azurerm_windows_virtual_machine_scale_set" "winsrv_vmss" {
279279
count = var.os_flavor == "windows" ? 1 : 0
280-
name = format("vm%s%s", lower(replace(var.vmscaleset_name, "/[[:^alnum:]]/", "")), count.index + 1)
281-
computer_name_prefix = format("%s-vmss", "win") # not more than 9 characters
280+
name = format("%s", lower(replace(var.vmscaleset_name, "/[[:^alnum:]]/", "")))
281+
computer_name_prefix = format("%s%s", lower(replace(var.vmscaleset_name, "/[[:^alnum:]]/", "")), count.index + 1)
282282
resource_group_name = data.azurerm_resource_group.rg.name
283283
location = data.azurerm_resource_group.rg.location
284284
overprovision = var.overprovision
@@ -289,7 +289,7 @@ resource "azurerm_windows_virtual_machine_scale_set" "winsrv_vmss" {
289289
single_placement_group = var.single_placement_group
290290
admin_username = var.admin_username
291291
admin_password = var.admin_password == null ? random_password.passwd[count.index].result : var.admin_password
292-
tags = merge({ "ResourceName" = format("vm%s%s", lower(replace(var.vmscaleset_name, "/[[:^alnum:]]/", "")), count.index + 1) }, var.tags, )
292+
tags = merge({ "ResourceName" = format("%s", lower(replace(var.vmscaleset_name, "/[[:^alnum:]]/", ""))) }, var.tags, )
293293
source_image_id = var.source_image_id != null ? var.source_image_id : null
294294
upgrade_mode = var.os_upgrade_mode
295295
health_probe_id = var.enable_load_balancer ? azurerm_lb_probe.lbp[0].id : null

0 commit comments

Comments
 (0)