Skip to content

Commit 9241bba

Browse files
committed
update module for windows vmss name
1 parent 915459f commit 9241bba

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

examples/windows_vm_scale_sets/main.tf

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@ module "vmscaleset" {
33
version = "1.0.0"
44

55
# Resource Group and location, VNet and Subnet detials (Required)
6-
resource_group_name = "rg-hub-demo-internal-shared-westeurope-001"
7-
virtual_network_name = "vnet-default-hub-westeurope"
8-
subnet_name = "snet-management-default-hub-westeurope"
6+
resource_group_name = "rg-demo-westeurope-01" #"rg-hub-demo-internal-shared-westeurope-001"
7+
virtual_network_name = "vnet-demo-westeurope-001"
8+
subnet_name = "management"
99
vmscaleset_name = "testvmss"
10+
vm_computer_name = "webvm"
1011

11-
# (Optional) To enable Azure Monitoring and install log analytics agents
12+
/* # (Optional) To enable Azure Monitoring and install log analytics agents
1213
log_analytics_workspace_name = var.log_analytics_workspace_id
1314
hub_storage_account_name = var.hub_storage_account_id
14-
15+
*/
1516
# This module support multiple Pre-Defined Linux and Windows Distributions.
1617
# These distributions support the Automatic OS image upgrades in virtual machine scale sets
1718
# Linux images: ubuntu1804, ubuntu1604, centos75, coreos

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ resource "azurerm_linux_virtual_machine_scale_set" "linux_vmss" {
278278
resource "azurerm_windows_virtual_machine_scale_set" "winsrv_vmss" {
279279
count = var.os_flavor == "windows" ? 1 : 0
280280
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)
281+
computer_name_prefix = format("%s%s", lower(replace(var.vm_computer_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

variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ variable "vmscaleset_name" {
1818
default = ""
1919
}
2020

21+
variable "vm_computer_name" {
22+
description = "Specifies the name of the virtual machine inside the VM scale set"
23+
default = ""
24+
}
25+
2126
variable "log_analytics_workspace_name" {
2227
description = "The name of log analytics workspace name"
2328
default = null

0 commit comments

Comments
 (0)