Skip to content

libre-devops/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 = each.value.rg_name
  location            = each.value.location
  tags                = each.value.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     = try(each.value.managed_disk_cmk_key_vault_key_id, null)
  #   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
      vnet_address_prefix                                  = custom_parameters.value.vnet_address_prefix
    }
  }

  dynamic "enhanced_security_compliance" {
    for_each = each.value.enhanced_security_compliance != null ? [each.value.enhanced_security_compliance] : []
    content {
      compliance_security_profile_enabled   = enhanced_security_compliance.value.compliance_security_profile_enabled
      automatic_cluster_update_enabled      = enhanced_security_compliance.value.automatic_cluster_update_enabled
      compliance_security_profile_standards = enhanced_security_compliance.value.compliance_security_profile_standards
      enhanced_security_monitoring_enabled  = enhanced_security_compliance.value.enhanced_security_monitoring_enabled
    }
  }
}

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
rg_name = string
location = optional(string, "uksouth")
tags = map(string)
load_balancer_backend_address_pool_id = optional(string, null)
managed_services_cmk_key_vault_key_id = optional(string, null)
managed_disk_cmk_key_vault_key_id = optional(string, null)
managed_disk_cmk_rotation_to_latest_version_enabled = optional(bool, false)
customer_managed_key_enabled = optional(bool, false)
infrastructure_encryption_enabled = optional(bool, false)
public_network_access_enabled = optional(bool, false)
network_security_group_rules_required = optional(string, "NoAzureDatabricksRules")
enhanced_security_compliance = optional(object({
automatic_cluster_update_enabled = optional(bool, false)
compliance_security_profile_enabled = optional(bool, false)
compliance_security_profile_standards = optional(list(string))
enhanced_security_monitoring_enabled = optional(bool, false)
}))
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

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

Languages

  • PowerShell 82.1%
  • HCL 17.9%