-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
databricks.tf
72 lines (67 loc) · 3.38 KB
/
databricks.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
resource "azurerm_databricks_workspace" "databricks" {
name = "${local.prefix}-cnsmptn-dbw001"
location = var.location
resource_group_name = azurerm_resource_group.consumption_rg.name
tags = var.tags
infrastructure_encryption_enabled = true
managed_resource_group_name = "${local.prefix}-cnsmptn-dbw001-rg"
network_security_group_rules_required = "NoAzureDatabricksRules"
public_network_access_enabled = false
sku = "premium"
custom_parameters {
no_public_ip = true
virtual_network_id = data.azurerm_virtual_network.virtual_network.id
private_subnet_name = azapi_resource.databricks_private_subnet.name
private_subnet_network_security_group_association_id = azapi_resource.databricks_private_subnet.id
public_subnet_name = azapi_resource.databricks_public_subnet.name
public_subnet_network_security_group_association_id = azapi_resource.databricks_private_subnet.id
storage_account_name = replace("${local.prefix}-cnsmptn-dbw001", "-", "")
storage_account_sku_name = "Standard_LRS"
}
}
resource "azurerm_private_endpoint" "databricks_private_endpoint_ui" {
name = "${azurerm_databricks_workspace.databricks.name}-uiapi-pe"
location = var.location
resource_group_name = azurerm_databricks_workspace.databricks.resource_group_name
tags = var.tags
custom_network_interface_name = "${azurerm_databricks_workspace.databricks.name}-uiapi-nic"
private_service_connection {
name = "${azurerm_databricks_workspace.databricks.name}-uiapi-pe"
is_manual_connection = false
private_connection_resource_id = azurerm_databricks_workspace.databricks.id
subresource_names = ["databricks_ui_api"]
}
subnet_id = azapi_resource.private_endpoint_subnet.id
dynamic "private_dns_zone_group" {
for_each = var.private_dns_zone_id_databricks == "" ? [] : [1]
content {
name = "${azurerm_databricks_workspace.databricks.name}-uiapi-arecord"
private_dns_zone_ids = [
var.private_dns_zone_id_databricks
]
}
}
}
resource "azurerm_private_endpoint" "databricks_private_endpoint_web" {
name = "${azurerm_databricks_workspace.databricks.name}-web-pe"
location = var.location
resource_group_name = azurerm_databricks_workspace.databricks.resource_group_name
tags = var.tags
custom_network_interface_name = "${azurerm_databricks_workspace.databricks.name}-web-nic"
private_service_connection {
name = "${azurerm_databricks_workspace.databricks.name}-web-pe"
is_manual_connection = false
private_connection_resource_id = azurerm_databricks_workspace.databricks.id
subresource_names = ["browser_authentication"]
}
subnet_id = azapi_resource.private_endpoint_subnet.id
dynamic "private_dns_zone_group" {
for_each = var.private_dns_zone_id_databricks == "" ? [] : [1]
content {
name = "${azurerm_databricks_workspace.databricks.name}-web-arecord"
private_dns_zone_ids = [
var.private_dns_zone_id_databricks
]
}
}
}