Skip to content

Commit

Permalink
Add PE Location Variable for Databricks Workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinbuss committed Nov 19, 2024
1 parent 696e468 commit c9c46bd
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
8 changes: 8 additions & 0 deletions modules/databricksworkspace/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,14 @@ list(object({

Default: `[]`

### <a name="input_location_private_endpoint"></a> [location\_private\_endpoint](#input\_location\_private\_endpoint)

Description: Specifies the location of the private endpoint. Use this variables only if the private endpoint(s) should reside in a different location than the service itself.

Type: `string`

Default: `null`

### <a name="input_private_dns_zone_id_databricks"></a> [private\_dns\_zone\_id\_databricks](#input\_private\_dns\_zone\_id\_databricks)

Description: Specifies the resource ID of the private DNS zone for Azure Databricks. Not required if DNS A-records get created via Azure Policy.
Expand Down
4 changes: 2 additions & 2 deletions modules/databricksworkspace/connectivity.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
resource "azurerm_private_endpoint" "private_endpoint_databricks_workspace_databricks_ui_api" {
name = "${azurerm_databricks_workspace.databricks_workspace.name}-uiapi-pe"
location = var.location
location = var.location_private_endpoint != null ? var.location_private_endpoint : var.location
resource_group_name = azurerm_databricks_workspace.databricks_workspace.resource_group_name
tags = var.tags

Expand Down Expand Up @@ -33,7 +33,7 @@ resource "azurerm_private_endpoint" "private_endpoint_databricks_workspace_brows
count = var.databricks_workspace_browser_authentication_private_endpoint_enabled ? 1 : 0

name = "${azurerm_databricks_workspace.databricks_workspace.name}-auth-pe"
location = var.location
location = var.location_private_endpoint != null ? var.location_private_endpoint : var.location
resource_group_name = azurerm_databricks_workspace.databricks_workspace.resource_group_name
tags = var.tags

Expand Down
1 change: 1 addition & 0 deletions modules/databricksworkspace/tests/test.tftest.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ run "setup" {

variables {
location = var.location
location_private_endpoint = var.location
environment = "int"
prefix = "tfmdladb"
virtual_network_id = var.virtual_network_id
Expand Down
8 changes: 8 additions & 0 deletions modules/databricksworkspace/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ variable "location" {
nullable = false
}

variable "location_private_endpoint" {
description = "Specifies the location of the private endpoint. Use this variables only if the private endpoint(s) should reside in a different location than the service itself."
type = string
sensitive = false
nullable = true
default = null
}

variable "resource_group_name" {
description = "Specifies the resource group name in which all resources will get deployed."
type = string
Expand Down

0 comments on commit c9c46bd

Please sign in to comment.