From d06379e6e262d3478578b9febf693cb2496dfa99 Mon Sep 17 00:00:00 2001 From: neil-yechenwei Date: Tue, 14 Nov 2023 15:44:25 +0800 Subject: [PATCH 1/3] Fix 201-machine-learning-moderately-secure --- .../201-machine-learning-moderately-secure/variables.tf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/quickstart/201-machine-learning-moderately-secure/variables.tf b/quickstart/201-machine-learning-moderately-secure/variables.tf index fb8299d2a..bfedebbfe 100644 --- a/quickstart/201-machine-learning-moderately-secure/variables.tf +++ b/quickstart/201-machine-learning-moderately-secure/variables.tf @@ -1,6 +1,7 @@ variable "name" { type = string description = "Name of the deployment" + default = "examplehost" } variable "environment" { @@ -71,5 +72,6 @@ variable "dsvm_admin_username" { variable "dsvm_host_password" { type = string description = "Password for the admin username of the Data Science VM" + default = "ChangeMe123!" sensitive = true -} \ No newline at end of file +} From 761ff66a938d0d0a24ae22758c2daad2bd62d344 Mon Sep 17 00:00:00 2001 From: neil-yechenwei Date: Thu, 16 Nov 2023 11:10:30 +0800 Subject: [PATCH 2/3] update code --- .../workspace.tf | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/quickstart/201-machine-learning-moderately-secure/workspace.tf b/quickstart/201-machine-learning-moderately-secure/workspace.tf index 7b6ba44af..8e0dc3849 100644 --- a/quickstart/201-machine-learning-moderately-secure/workspace.tf +++ b/quickstart/201-machine-learning-moderately-secure/workspace.tf @@ -6,8 +6,15 @@ resource "azurerm_application_insights" "default" { application_type = "web" } +resource "random_string" "kv_prefix" { + length = 4 + upper = false + special = false + numeric = false +} + resource "azurerm_key_vault" "default" { - name = "kv-${var.name}-${var.environment}" + name = "kv-${random_string.kv_prefix.result}-${var.environment}" location = azurerm_resource_group.default.location resource_group_name = azurerm_resource_group.default.name tenant_id = data.azurerm_client_config.current.tenant_id @@ -20,8 +27,15 @@ resource "azurerm_key_vault" "default" { } } +resource "random_string" "sa_prefix" { + length = 4 + upper = false + special = false + numeric = false +} + resource "azurerm_storage_account" "default" { - name = "st${var.name}${var.environment}" + name = "st${random_string.sa_prefix.result}${var.environment}" location = azurerm_resource_group.default.location resource_group_name = azurerm_resource_group.default.name account_tier = "Standard" From ae21bda78e92386a9face5936d013c745a28d78d Mon Sep 17 00:00:00 2001 From: neil-yechenwei Date: Fri, 5 Jan 2024 14:43:21 +0800 Subject: [PATCH 3/3] update code --- quickstart/201-machine-learning-moderately-secure/main.tf | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/quickstart/201-machine-learning-moderately-secure/main.tf b/quickstart/201-machine-learning-moderately-secure/main.tf index e66e68f67..18e6a0f96 100644 --- a/quickstart/201-machine-learning-moderately-secure/main.tf +++ b/quickstart/201-machine-learning-moderately-secure/main.tf @@ -14,7 +14,11 @@ terraform { } provider "azurerm" { - features {} + features { + resource_group { + prevent_deletion_if_contains_resources = false + } + } } data "azurerm_client_config" "current" {}