Skip to content

Update adb-with-private-links-exfiltration-protection to use azurerm v4 #154

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

Merged
merged 1 commit into from
Nov 23, 2024
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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 2 additions & 28 deletions examples/adb-with-private-links-exfiltration-protection/main.tf
Original file line number Diff line number Diff line change
@@ -1,36 +1,10 @@
/**
* Azure Databricks workspace in custom VNet
*
* Module creates:
* * Resource group with random prefix
* * Tags, including `Owner`, which is taken from `az account show --query user`
* * VNet with public and private subnet
* * Databricks workspace
*/

module "adb_with_private_links_exfiltration_protection" {
source = "github.com/databricks/terraform-databricks-examples/modules/adb-with-private-links-exfiltration-protection"
source = "../../modules/adb-with-private-links-exfiltration-protection"
hubcidr = var.hubcidr
spokecidr = var.spokecidr
rglocation = var.rglocation
metastoreip = var.metastoreip
dbfs_prefix = var.dbfs_prefix
workspace_prefix = var.workspace_prefix
firewallfqdn = var.firewallfqdn
}

output "workspace_url" {
value = module.adb_with_private_links_exfiltration_protection.workspace_url
}

output "workspace_azure_resource_id" {
value = module.adb_with_private_links_exfiltration_protection.databricks_azure_workspace_resource_id
}

output "test_vm_public_ip" {
value = module.adb_with_private_links_exfiltration_protection.test_vm_public_ip
}

output "resource_group" {
value = module.adb_with_private_links_exfiltration_protection.resource_group
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
output "azure_resource_group_id" {
description = "ID of the created Azure resource group"
value = module.adb_with_private_links_exfiltration_protection.azure_resource_group_id
}

output "workspace_id" {
description = "The Databricks workspace ID"
value = module.adb_with_private_links_exfiltration_protection.workspace_id
}

output "workspace_url" {
description = "The Databricks workspace URL"
value = module.adb_with_private_links_exfiltration_protection.workspace_url
}

output "test_vm_public_ip" {
description = "Public IP of the Azure VM created for testing"
value = module.adb_with_private_links_exfiltration_protection.test_vm_public_ip
}

output "workspace_azure_resource_id" {
description = "***Depricated***. Use workspace_id"
value = module.adb_with_private_links_exfiltration_protection.databricks_azure_workspace_resource_id
}

output "resource_group" {
description = "***Depricated***. Use azure_resource_group_id instead"
value = module.adb_with_private_links_exfiltration_protection.resource_group
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# versions.tf
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~>3.104.0"
version = ">=4.0.0"
}
random = {
source = "hashicorp/random"
Expand All @@ -12,5 +11,6 @@ terraform {
}

provider "azurerm" {
subscription_id = var.subscription_id
features {}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
subscription_id = "<your Azure Subscription ID here>"
hubcidr = "10.178.0.0/20"
spokecidr = "10.179.0.0/20"
rglocation = "southeastasia"
rglocation = "northeurope"
metastoreip = "40.78.233.2"
dbfs_prefix = "dbfs"
workspace_prefix = "adb"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
variable "subscription_id" {
type = string
description = "Azure Subscription ID to deploy the workspace into"
}

variable "hubcidr" {
type = string
default = "10.178.0.0/20"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
output "arm_client_id" {
value = data.azurerm_client_config.current.client_id
description = "Client ID for current user/service principal"
description = "***Depricated***. Client ID for current user/service principal"
}

output "arm_subscription_id" {
value = data.azurerm_client_config.current.subscription_id
description = "Azure Subscription ID for current user/service principal"
description = "***Depricated***. Azure Subscription ID for current user/service principal"
}

output "arm_tenant_id" {
value = data.azurerm_client_config.current.tenant_id
description = "Azure Tenant ID for current user/service principal"
description = "***Depricated***. Azure Tenant ID for current user/service principal"
}

output "azure_region" {
value = local.location
description = "Geo location of created resources"
description = "***Depricated***. Geo location of created resources"
}

output "resource_group" {
Expand All @@ -25,7 +25,7 @@ output "resource_group" {

output "my_ip_addr" {
value = local.ifconfig_co_json.ip
description = "IP address of caller"
description = "***Depricated***. IP address of caller"
}

output "test_vm_public_ip" {
Expand All @@ -34,11 +34,21 @@ output "test_vm_public_ip" {
}

output "databricks_azure_workspace_resource_id" {
description = "The ID of the Databricks Workspace in the Azure management plane."
description = "***Depricated***. The ID of the Databricks Workspace in the Azure management plane."
value = azurerm_databricks_workspace.this.id
}

output "workspace_url" {
value = "https://${azurerm_databricks_workspace.this.workspace_url}/"
description = "The workspace URL which is of the format 'adb-{workspaceId}.{random}.azuredatabricks.net'"
}

output "azure_resource_group_id" {
description = "ID of the created Azure resource group"
value = azurerm_resource_group.this.id
}

output "workspace_id" {
description = "The Databricks workspace ID"
value = azurerm_databricks_workspace.this.workspace_id
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = ">= 3.104.0"
}
random = {
source = "hashicorp/random"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ resource "azurerm_databricks_workspace" "this" {
public_network_access_enabled = false //use private endpoint
network_security_group_rules_required = "NoAzureDatabricksRules" //use private endpoint
customer_managed_key_enabled = true
//infrastructure_encryption_enabled = true
custom_parameters {
no_public_ip = true
virtual_network_id = azurerm_virtual_network.this.id
private_subnet_name = azurerm_subnet.private.name
public_subnet_name = azurerm_subnet.public.name
Expand Down