Skip to content

cyber-scot/terraform-azurerm-databricks-workspace

Repository files navigation

resource "azurerm_databricks_workspace" "this" {
  for_each = { for k, v in var.databricks_workspaces : k => v }


  name                = each.value.name
  resource_group_name = var.rg_name
  location            = var.location
  tags                = var.tags
  sku                 = lower(each.value.sku)

  load_balancer_backend_address_pool_id               = each.value.load_balancer_backend_address_pool_id
  managed_services_cmk_key_vault_key_id               = each.value.managed_services_cmk_key_vault_key_id
  managed_disk_cmk_key_vault_key_id                   = each.value.managed_disk_cmk_key_vault_key_id
  managed_disk_cmk_rotation_to_latest_version_enabled = each.value.managed_disk_cmk_rotation_to_latest_version_enabled
  customer_managed_key_enabled                        = each.value.customer_managed_key_enabled
  infrastructure_encryption_enabled                   = lower(each.value.sku) == "premium" ? each.value.infrastructure_encryption_enabled : false
  public_network_access_enabled                       = each.value.public_network_access_enabled
  network_security_group_rules_required               = each.value.network_security_group_rules_required

  dynamic "custom_parameters" {
    for_each = each.value.custom_parameters != null ? [each.value.custom_parameters] : []
    content {
      machine_learning_workspace_id                        = custom_parameters.value.machine_learning_workspace_id
      nat_gateway_name                                     = custom_parameters.value.nat_gateway_name
      public_ip_name                                       = custom_parameters.value.public_ip_name
      no_public_ip                                         = custom_parameters.value.no_public_ip
      public_subnet_name                                   = custom_parameters.value.public_subnet_name
      public_subnet_network_security_group_association_id  = custom_parameters.value.public_subnet_network_security_group_association_id
      private_subnet_name                                  = custom_parameters.value.private_subnet_name
      private_subnet_network_security_group_association_id = custom_parameters.value.private_subnet_network_security_group_association_id
      storage_account_name                                 = custom_parameters.value.storage_account_name
      storage_account_sku_name                             = custom_parameters.value.storage_account_sku_name
      virtual_network_id                                   = custom_parameters.value.virtual_network_id
    }
  }
}

Requirements

No requirements.

Providers

Name Version
azurerm n/a

Modules

No modules.

Resources

Name Type
azurerm_databricks_workspace.this resource

Inputs

Name Description Type Default Required
databricks_workspaces The databricks workspaces to create
list(object({
name = string
sku = string
load_balancer_backend_address_pool_id = optional(string)
managed_services_cmk_key_vault_key_id = optional(string)
managed_disk_cmk_key_vault_key_id = optional(string)
managed_disk_cmk_rotation_to_latest_version_enabled = optional(bool)
customer_managed_key_enabled = optional(bool)
infrastructure_encryption_enabled = optional(bool)
public_network_access_enabled = optional(bool, false)
network_security_group_rules_required = optional(string)
custom_parameters = optional(object({
machine_learning_workspace_id = optional(string)
nat_gateway_name = optional(string)
public_ip_name = optional(string)
no_public_ip = optional(bool)
public_subnet_name = optional(string)
public_subnet_network_security_group_association_id = optional(string)
private_subnet_name = optional(string)
private_subnet_network_security_group_association_id = optional(string)
storage_account_name = optional(string)
storage_account_sku_name = optional(string)
virtual_network_id = optional(string)
vnet_address_prefix = optional(string)
}))
}))
n/a yes
location The location for this resource to be put in string n/a yes
rg_name The name of the resource group, this module does not create a resource group, it is expecting the value of a resource group already exists string n/a yes
tags A map of the tags to use on the resources that are deployed with this module. map(string) n/a yes

Outputs

Name Description
databricks_workspace_details n/a

About

A module used to deploy databricks and various resources 🧱📁

Resources

License

Stars

Watchers

Forks

Packages

No packages published