Skip to content

Commit 949313a

Browse files
author
oleh_mykolaishyn
committed
feat: network connectivity config
1 parent f3bed51 commit 949313a

File tree

4 files changed

+50
-0
lines changed

4 files changed

+50
-0
lines changed

main.tf

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
locals {
2+
ncc_config_mapped = {
3+
for object in flatten([for sa in var.storage_accounts : [for kind in ["blob", "dfs"] : {
4+
name = "${sa.name}-${kind}"
5+
kind = kind
6+
id = sa.id
7+
}]]) : object.name => object }
8+
}
9+
10+
resource "databricks_mws_ncc_binding" "this" {
11+
network_connectivity_config_id = var.network_connectivity_config_id
12+
workspace_id = var.databricks_workspace_id
13+
}
14+
15+
resource "databricks_mws_ncc_private_endpoint_rule" "this" {
16+
for_each = local.ncc_config_mapped
17+
18+
network_connectivity_config_id = var.network_connectivity_config_id
19+
resource_id = each.value.id
20+
group_id = each.value.kind
21+
22+
depends_on = [databricks_mws_ncc_binding.this]
23+
}

outputs.tf

Whitespace-only changes.

variables.tf

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
variable "databricks_workspace_id" {
2+
type = string
3+
description = "Target Databricks Workspace id"
4+
}
5+
6+
variable "network_connectivity_config_id" {
7+
type = string
8+
description = "Existing Network Connectivity Config ID in Databricks Account"
9+
}
10+
11+
variable "storage_accounts" {
12+
type = list(object({
13+
name = string
14+
id = string
15+
}))
16+
description = "List of object with parameters to configure NCC for Storage Account. Both blob and dfs private endpoints would be provisioned"
17+
}

versions.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
terraform {
2+
required_version = ">=1.0.0"
3+
4+
required_providers {
5+
databricks = {
6+
source = "databricks/databricks"
7+
version = ">=1.44.0"
8+
}
9+
}
10+
}

0 commit comments

Comments
 (0)