Skip to content

Commit

Permalink
fix example
Browse files Browse the repository at this point in the history
  • Loading branch information
lonegunmanb committed Oct 4, 2024
1 parent a4f3724 commit 177f2a6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
11 changes: 10 additions & 1 deletion quickstart/301-machine-learning-hub-spoke-secure/dsvm.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ resource "azurerm_network_interface" "dsvm" {
}
}

resource "random_password" "dsvm_host_password" {
count = var.dsvm_host_password == null ? 1 : 0
length = 20
}

locals {
dsvm_host_password = try(random_password.dsvm_host_password[0].result, var.dsvm_host_password)
}

resource "azurerm_windows_virtual_machine" "dsvm" {
name = var.dsvm_name
location = azurerm_resource_group.default.location
Expand Down Expand Up @@ -37,7 +46,7 @@ resource "azurerm_windows_virtual_machine" "dsvm" {
}
computer_name = var.dsvm_name
admin_username = var.dsvm_admin_username
admin_password = var.dsvm_host_password
admin_password = local.dsvm_host_password

provision_vm_agent = true

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,5 @@ variable "dsvm_host_password" {
type = string
description = "Password for the admin username of the Data Science VM"
sensitive = true
default = null
}

0 comments on commit 177f2a6

Please sign in to comment.