diff --git a/quickstart/101-devtest-labs/main.tf b/quickstart/101-devtest-labs/main.tf index ee3cf910..58c18576 100644 --- a/quickstart/101-devtest-labs/main.tf +++ b/quickstart/101-devtest-labs/main.tf @@ -2,6 +2,13 @@ resource "random_pet" "rg_name" { prefix = var.resource_group_name_prefix } +resource "random_string" "vm_suffix" { + length = 5 + upper = false + special = false + numeric = false +} + resource "azurerm_resource_group" "rg" { name = random_pet.rg_name.id location = var.resource_group_location @@ -34,7 +41,7 @@ resource "azurerm_dev_test_virtual_network" "vnet" { } resource "azurerm_dev_test_windows_virtual_machine" "vm" { - name = var.vm_name + name = "ExampleVM-${random_string.vm_suffix.result}" lab_name = azurerm_dev_test_lab.lab.name lab_subnet_name = "Dtl${var.lab_name}Subnet" resource_group_name = azurerm_resource_group.rg.name diff --git a/quickstart/101-devtest-labs/readme.md b/quickstart/101-devtest-labs/readme.md index bedbeba6..1d2bb47a 100644 --- a/quickstart/101-devtest-labs/readme.md +++ b/quickstart/101-devtest-labs/readme.md @@ -17,7 +17,6 @@ This template deploys a Windows virtual machine within an Azure DevTest Lab. | `resource_group_name_prefix` | Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription. | rg | | `resource_group_location` | Location of the resource group. | eastus | | `lab_name` | The name of the new lab instance to be created. | | -| `vm_name` | The name of the VM to be created. | | | `vm_size` | The size of the VM to be created. | Standard_D4_v3 | | `user_name` | The username for the local account that will be created on the new VM. | | | `password` | The password for the local account that will be created on the new VM. | | diff --git a/quickstart/101-devtest-labs/variables.tf b/quickstart/101-devtest-labs/variables.tf index 7babeda6..ecc01211 100644 --- a/quickstart/101-devtest-labs/variables.tf +++ b/quickstart/101-devtest-labs/variables.tf @@ -16,12 +16,6 @@ variable "lab_name" { default = "ExampleLab" } -variable "vm_name" { - type = string - description = "The name of the vm to be created." - default = "example-vm" -} - variable "vm_size" { type = string description = "The size of the vm to be created."