Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 201-machine-learning-moderately-secure #281

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion quickstart/201-machine-learning-moderately-secure/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ terraform {
}

provider "azurerm" {
features {}
features {
resource_group {
prevent_deletion_if_contains_resources = false
}
}
}

data "azurerm_client_config" "current" {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
variable "name" {
type = string
description = "Name of the deployment"
default = "examplehost"
}

variable "environment" {
Expand Down Expand Up @@ -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
}
}
18 changes: 16 additions & 2 deletions quickstart/201-machine-learning-moderately-secure/workspace.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down