diff --git a/workspace-setup/terraform-examples/azure/azure-vnet-injection/README.md b/workspace-setup/terraform-examples/azure/azure-vnet-injection/README.md index 7bee186..7ff1eca 100644 --- a/workspace-setup/terraform-examples/azure/azure-vnet-injection/README.md +++ b/workspace-setup/terraform-examples/azure/azure-vnet-injection/README.md @@ -129,6 +129,8 @@ You can use the `terraform.tfvars.example` file as a base for your variables. Le - The CIDR address of the first subnet - subnet_private_cidr - The CIDR address of the second subnet +- managed_resource_group_name + - The name of the managed resource group ## Deploy diff --git a/workspace-setup/terraform-examples/azure/azure-vnet-injection/tf/databricks.tf b/workspace-setup/terraform-examples/azure/azure-vnet-injection/tf/databricks.tf index 15064d9..389b4ec 100644 --- a/workspace-setup/terraform-examples/azure/azure-vnet-injection/tf/databricks.tf +++ b/workspace-setup/terraform-examples/azure/azure-vnet-injection/tf/databricks.tf @@ -4,6 +4,7 @@ resource "azurerm_databricks_workspace" "this" { location = azurerm_resource_group.this.location sku = "premium" tags = var.tags + managed_resource_group_name = var.managed_resource_group_name custom_parameters { virtual_network_id = local.vnet.id @@ -72,4 +73,4 @@ resource "databricks_metastore_assignment" "this" { provider = databricks.accounts workspace_id = azurerm_databricks_workspace.this.workspace_id metastore_id = var.existing_metastore_id == "" ? databricks_metastore.this[0].id : var.existing_metastore_id -} \ No newline at end of file +} diff --git a/workspace-setup/terraform-examples/azure/azure-vnet-injection/tf/terraform.tfvars.example b/workspace-setup/terraform-examples/azure/azure-vnet-injection/tf/terraform.tfvars.example index eef93ae..ea40450 100644 --- a/workspace-setup/terraform-examples/azure/azure-vnet-injection/tf/terraform.tfvars.example +++ b/workspace-setup/terraform-examples/azure/azure-vnet-injection/tf/terraform.tfvars.example @@ -20,6 +20,7 @@ location = "westeurope" databricks_account_id = "xxx-xxx" existing_metastore_id = "xxx-xxx" new_metastore_name = "" +managed_resource_group_name = null #optional. if no name is provided, azure will generate one on it's own # ============================================================================= # Network Configuration diff --git a/workspace-setup/terraform-examples/azure/azure-vnet-injection/tf/variables.tf b/workspace-setup/terraform-examples/azure/azure-vnet-injection/tf/variables.tf index 6dbec57..f36d5e4 100644 --- a/workspace-setup/terraform-examples/azure/azure-vnet-injection/tf/variables.tf +++ b/workspace-setup/terraform-examples/azure/azure-vnet-injection/tf/variables.tf @@ -17,6 +17,16 @@ variable "resource_group_name" { type = string } +variable "managed_resource_group_name" { + description = "The name of managed resource group. This is optional field" + type = string + default = null + validation { + condition = var.managed_resource_group_name != var.resource_group_name + error_message = "Managed resource group name should not be same as resource group name" + } +} + variable "tags" { description = "A map of tags to assign to the resources" type = map(string)