From a5a40b65e484eb9d66751871496051c12449ce98 Mon Sep 17 00:00:00 2001 From: Nathan Knox Date: Wed, 8 Mar 2023 12:39:09 -0500 Subject: [PATCH] updated for some testing and minor edits --- .../.terraform.lock.hcl | 3 +++ .../test_azure_uc_data_exfiltration_protection/README.md | 2 ++ .../test_azure_uc_data_exfiltration_protection/main.tf | 2 -- modules/azure_uc/main.tf | 8 +++++++- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/examples/test_azure_uc_data_exfiltration_protection/.terraform.lock.hcl b/examples/test_azure_uc_data_exfiltration_protection/.terraform.lock.hcl index 18635c7..0dae1d4 100644 --- a/examples/test_azure_uc_data_exfiltration_protection/.terraform.lock.hcl +++ b/examples/test_azure_uc_data_exfiltration_protection/.terraform.lock.hcl @@ -5,6 +5,7 @@ provider "registry.terraform.io/databricks/databricks" { version = "1.9.2" constraints = ">= 1.9.2" hashes = [ + "h1:8c7Q+o47wbvg7pzFEuYY8QmT791dq24NqEE9SgplLok=", "h1:nFvHH92ID3dgaUyTgbbl1hFWuQJ/fEK1Q8UhF+zZmaY=", "zh:28d4ae6d2175aeaa03544433fe96649a5f4ae060b72a2275bb2cd9df7ae415b2", "zh:717f2906f943f6f64b5ce4450fc004d99da5743c1c215cc215a67d1e532b224e", @@ -24,6 +25,7 @@ provider "registry.terraform.io/hashicorp/azurerm" { constraints = ">= 3.43.0, ~> 3.43.0" hashes = [ "h1:Oc/do6RovvNcKddQglsUeX1gWDeA1F7Fet+ajqWYb8M=", + "h1:zf15PjCXucKHP9MhpB1EgXKqqUWh/NJf7Hf1PoQChUE=", "zh:1a6d3553a8b9c85193d8334e8678aae305d14ec1d69b0d45799c322145d41475", "zh:1cb9ecd6531060c8f52d4f70863754ef18d3c297dee2aa173ce6dbd6f3c62621", "zh:21effe14cf1f5bace7aa172198ee2aa6ffc78324e4648af9b8df8b29995fa711", @@ -43,6 +45,7 @@ provider "registry.terraform.io/hashicorp/random" { version = "3.4.3" hashes = [ "h1:saZR+mhthL0OZl4SyHXZraxyaBNVMxiZzks78nWcZ2o=", + "h1:tL3katm68lX+4lAncjQA9AXL4GR/VM+RPwqYf4D2X8Q=", "zh:41c53ba47085d8261590990f8633c8906696fa0a3c4b384ff6a7ecbf84339752", "zh:59d98081c4475f2ad77d881c4412c5129c56214892f490adf11c7e7a5a47de9b", "zh:686ad1ee40b812b9e016317e7f34c0d63ef837e084dea4a1f578f64a6314ad53", diff --git a/examples/test_azure_uc_data_exfiltration_protection/README.md b/examples/test_azure_uc_data_exfiltration_protection/README.md index 74d52c9..b15d8aa 100644 --- a/examples/test_azure_uc_data_exfiltration_protection/README.md +++ b/examples/test_azure_uc_data_exfiltration_protection/README.md @@ -9,6 +9,8 @@ This Terraform configuration is an implementation of the above blog post. Note: the firewall rules deviate slightly in that outbound traffic from the firewall is allowed to Databricks resources instead of specifying Databricks worker subnets. This is to simplify outbound routing in the event that multiple `spoke`s are desired. +Additionally, note that Unity Catalog has been included in this template in order to help modernize the architecture to current standards. + This guide is provided as-is and you can use this guide as the basis for your custom Terraform module. It uses the following variables in configurations: diff --git a/examples/test_azure_uc_data_exfiltration_protection/main.tf b/examples/test_azure_uc_data_exfiltration_protection/main.tf index 130f8b6..66f50a9 100644 --- a/examples/test_azure_uc_data_exfiltration_protection/main.tf +++ b/examples/test_azure_uc_data_exfiltration_protection/main.tf @@ -11,8 +11,6 @@ resource "azurerm_virtual_network" "this" { } module "spoke_vnet" { - # TODO: Get rid of redundant variables - source them from `id`s or something - # TODO: Add Routes for service tags to the route table source = "../../modules/azure_spoke_vnet" project_name = var.project_name location = azurerm_virtual_network.this.location diff --git a/modules/azure_uc/main.tf b/modules/azure_uc/main.tf index 8df52af..701a528 100644 --- a/modules/azure_uc/main.tf +++ b/modules/azure_uc/main.tf @@ -3,7 +3,13 @@ locals { subscription_id = regex(local.resource_regex, var.resource_group_id)[0] resource_group = regex(local.resource_regex, var.resource_group_id)[1] tenant_id = data.azurerm_client_config.current.tenant_id - prefix = replace(replace(lower(data.azurerm_resource_group.this.name), "rg", ""), "-", "") + prefix = replace(replace(lower("${data.azurerm_resource_group.this.name}${random_string.naming.result}"), "rg", ""), "-", "") +} + +resource "random_string" "naming" { + special = false + upper = false + length = 6 } data "azurerm_resource_group" "this" {