Skip to content
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

Restructure Databricks Modules #134

Merged
merged 3 commits into from
Jan 23, 2025
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
14 changes: 4 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,21 +168,15 @@ Source: ./modules/dataapplication

Version:

### <a name="module_databricks_account_configuration"></a> [databricks\_account\_configuration](#module\_databricks\_account\_configuration)
### <a name="module_databricks_core"></a> [databricks\_core](#module\_databricks\_core)

Source: ./modules/databricksaccountconfiguration
Source: ./modules/databrickscore

Version:

### <a name="module_databricks_workspace_configuration"></a> [databricks\_workspace\_configuration](#module\_databricks\_workspace\_configuration)
### <a name="module_databricks_data_application"></a> [databricks\_data\_application](#module\_databricks\_data\_application)

Source: ./modules/databricksworkspaceconfiguration

Version:

### <a name="module_databricksworkspaceapplication"></a> [databricksworkspaceapplication](#module\_databricksworkspaceapplication)

Source: ./modules/databricksworkspaceapplication
Source: ./modules/databricksdataapplication

Version:

Expand Down
33 changes: 9 additions & 24 deletions databricksconfiguration.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
module "databricks_account_configuration" {
source = "./modules/databricksaccountconfiguration"
module "databricks_core" {
source = "./modules/databrickscore"

providers = {
databricks = databricks
null = null
databricks = databricks.engineering
databricks.account = databricks
null = null
}

# General variables
Expand All @@ -15,30 +16,14 @@ module "databricks_account_configuration" {
# Service variables
databricks_workspace_details = local.databricks_workspace_details
databricks_private_endpoint_rules = local.databricks_private_endpoint_rules
databricks_ip_access_list_allow = []
databricks_ip_access_list_deny = []
}

module "databricks_workspace_configuration" {
source = "./modules/databricksworkspaceconfiguration"

providers = {
databricks = databricks.engineering
}

# General variables
location = var.location
environment = var.environment
prefix = var.prefix
tags = var.tags

# Service variables
databricks_ip_access_list_allow = []
databricks_ip_access_list_deny = []
}

module "databricksworkspaceapplication" {
module "databricks_data_application" {
for_each = local.data_application_definitions

source = "./modules/databricksworkspaceapplication"
source = "./modules/databricksdataapplication"

providers = {
databricks = databricks.engineering
Expand Down
4 changes: 0 additions & 4 deletions modules/databricksaccountconfiguration/locals.tf

This file was deleted.

12 changes: 0 additions & 12 deletions modules/databricksaccountconfiguration/terraform.tf

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
resource "databricks_mws_network_connectivity_config" "network_connectivity_config" {
provider = databricks.account

name = "${local.prefix}-connectivity"
region = var.location
}

resource "databricks_mws_ncc_private_endpoint_rule" "ncc_private_endpoint_rule" {
provider = databricks.account

for_each = var.databricks_private_endpoint_rules

network_connectivity_config_id = databricks_mws_network_connectivity_config.network_connectivity_config.network_connectivity_config_id
Expand All @@ -13,6 +17,8 @@ resource "databricks_mws_ncc_private_endpoint_rule" "ncc_private_endpoint_rule"
}

resource "databricks_mws_ncc_binding" "ncc_binding" {
provider = databricks.account

for_each = var.databricks_workspace_details

network_connectivity_config_id = databricks_mws_network_connectivity_config.network_connectivity_config.network_connectivity_config_id
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
locals {
# General locals
prefix = "${lower(var.prefix)}-core-${var.environment}"
system_schema_names = [
"access",
"billing",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,17 @@ variable "databricks_private_endpoint_rules" {
nullable = false
default = {}
}

variable "databricks_ip_access_list_allow" {
description = "Specifies the ip access allow-list for the databricks workspace."
type = list(string)
sensitive = false
default = []
}

variable "databricks_ip_access_list_deny" {
description = "Specifies the ip access deny-list for the databricks workspace."
type = list(string)
sensitive = false
default = []
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ terraform {
databricks = {
source = "databricks/databricks"
version = "~> 1.59"
configuration_aliases = [
databricks.account
]
}
}
}
49 changes: 0 additions & 49 deletions modules/databricksworkspaceconfiguration/variables.tf

This file was deleted.

2 changes: 1 addition & 1 deletion output.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ output "databricks_account_id" {

output "databricks_network_connectivity_config_id" {
description = "Specifies the id of the network connectivity config."
value = module.databricks_account_configuration.databricks_network_connectivity_config_id
value = module.databricks_core.databricks_network_connectivity_config_id
sensitive = false
}
Loading