Skip to content

Commit f13f873

Browse files
committed
Fixed DNA naming for VMSS and Jumpbox VM
1 parent 8e9fd86 commit f13f873

File tree

1 file changed

+9
-4
lines changed
  • quickstart/201-vmss-packer-jumpbox

1 file changed

+9
-4
lines changed

quickstart/201-vmss-packer-jumpbox/main.tf

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,21 @@ provider "azurerm" {
1414
resource "azurerm_resource_group" "vmss" {
1515
name = var.resource_group_name
1616
location = var.location
17-
1817
tags = var.tags
1918
}
2019

20+
resource "random_string" "fqdn" {
21+
length = 6
22+
special = false
23+
upper = false
24+
number = false
25+
}
26+
2127
resource "azurerm_virtual_network" "vmss" {
2228
name = "vmss-vnet"
2329
address_space = ["10.0.0.0/16"]
2430
location = var.location
2531
resource_group_name = azurerm_resource_group.vmss.name
26-
2732
tags = var.tags
2833
}
2934

@@ -39,7 +44,7 @@ resource "azurerm_public_ip" "vmss" {
3944
location = var.location
4045
resource_group_name = azurerm_resource_group.vmss.name
4146
allocation_method = "Static"
42-
47+
domain_name_label = random_string.fqdn.result
4348
tags = var.tags
4449
}
4550

@@ -154,7 +159,7 @@ resource "azurerm_public_ip" "jumpbox" {
154159
location = var.location
155160
resource_group_name = azurerm_resource_group.vmss.name
156161
allocation_method = "Static"
157-
162+
domain_name_label = "${random_string.fqdn.result}-ssh"
158163
tags = var.tags
159164
}
160165

0 commit comments

Comments
 (0)