Azure / terraform-azurerm-avm-res-databricks-workspace

MIT License
6 stars 5 forks source link

terraform-azurerm-res-databricks-workspace

Manages a Databricks Workspace

Requirements

The following requirements are needed by this module:

Providers

The following providers are used by this module:

Resources

The following resources are used by this module:

Required Inputs

The following input variables are required:

location

Description: Azure region where the resource should be deployed.

Type: string

name

Description: Specifies the name of the Databricks Workspace resource. Changing this forces a new resource to be created.

Type: string

resource_group_name

Description: The name of the Resource Group in which the Databricks Workspace should exist. Changing this forces a new resource to be created.

Type: string

sku

Description: The 'sku' value must be one of 'standard', 'premium', or 'trial'.
NOTE: Downgrading to a trial sku from a standard or premium sku will force a new resource to be created.

Type: string

Optional Inputs

The following input variables are optional (have default values):

access_connector

Description:
Configuration options for the Databricks Access Connector resource. This map includes the following attributes:

Type:

map(object({
    name                = string
    resource_group_name = optional(string, null)
    location            = optional(string, null)
    identity = optional(object({
      type         = string
      identity_ids = optional(list(string))
    }))
    tags = optional(map(string))
  }))

Default: {}

custom_parameters

Description: A map of custom parameters for configuring the Databricks Workspace. This object allows for detailed configuration, with each attribute representing a specific setting:

Note: Databricks requires that a network security group is associated with the public and private subnets when a virtual_network_id has been defined.

Type:

object({
    machine_learning_workspace_id                        = optional(string, null)
    nat_gateway_name                                     = optional(string)
    public_ip_name                                       = optional(string)
    no_public_ip                                         = optional(bool, false)
    public_subnet_name                                   = optional(string, null)
    public_subnet_network_security_group_association_id  = optional(string, null)
    private_subnet_name                                  = optional(string, null)
    private_subnet_network_security_group_association_id = optional(string, null)
    storage_account_name                                 = optional(string, null) # Defaults to a randomized name
    storage_account_sku_name                             = optional(string, "Standard_GRS")
    virtual_network_id                                   = optional(string, null)
    vnet_address_prefix                                  = optional(string)
  })

Default: {}

customer_managed_key_enabled

Description: Is the workspace enabled for customer managed key encryption? If true this enables the Managed Identity for the managed storage account.
Possible values are true or false. Defaults to false.
This field is only valid if the Databricks Workspace sku is set to premium.

Type: bool

Default: false

dbfs_root_cmk_key_vault_key_id

Description: The ID of the customer-managed key for DBFS root.
This is required when customer_managed_key_enabled is set to true.

Type: string

Default: null

diagnostic_settings

Description: A map of diagnostic settings to create on the storage account. The map key is deliberately arbitrary to avoid issues where map keys maybe unknown at plan time.

Type:

map(object({
    name                                     = optional(string, null)
    log_categories                           = optional(set(string), [])
    log_groups                               = optional(set(string), ["allLogs"])
    metric_categories                        = optional(set(string), ["AllMetrics"])
    log_analytics_destination_type           = optional(string, "Dedicated")
    workspace_resource_id                    = optional(string, null)
    storage_account_resource_id              = optional(string, null)
    event_hub_authorization_rule_resource_id = optional(string, null)
    event_hub_name                           = optional(string, null)
    marketplace_partner_resource_id          = optional(string, null)
  }))

Default: {}

enable_telemetry

Description: This variable controls whether or not telemetry is enabled for the module.
For more information see https://aka.ms/avm/telemetryinfo.
If it is set to false, then no telemetry will be collected.

Type: bool

Default: true

infrastructure_encryption_enabled

Description: By default, Azure encrypts storage account data at rest. Infrastructure encryption adds a second layer of encryption to your storage account's data
Possible values are true or false. Defaults to false.
This field is only valid if the Databricks Workspace sku is set to premium.
Changing this forces a new resource to be created.

Type: bool

Default: false

load_balancer_backend_address_pool_id

Description: Resource ID of the Outbound Load balancer Backend Address Pool for Secure Cluster Connectivity (No Public IP) workspace. Changing this forces a new resource to be created.

Type: string

Default: null

lock

Description: Controls the Resource Lock configuration for this resource. The following properties can be specified:

Type:

object({
    kind = string
    name = optional(string, null)
  })

Default: null

managed_disk_cmk_key_vault_key_id

Description: Customer managed encryption properties for the Databricks Workspace managed disks.

Once the Databricks Workspace is created, the managed disk encryption set must be added to the key vault access policy, this can be found in the managed resource group under the name 'databricks-encryption-set-'.
This resource ID can be used to create a Key Vault access policy for the managed disk encryption set. RBA role 'Key Vault Crypto Officer' is required to create the access policy.
The Key Vault access policy should be created with the following permissions: 'Get', 'Wrap Key', 'Unwrap Key', 'Sign', 'Verify', 'List'. or Key Vault Crypto User role.

NOTE: Disabling CMK for Disk is currently not supported. If you want to disable Managed Services, you must delete the workspace and create a new one.

Type: string

Default: null

managed_disk_cmk_rotation_to_latest_version_enabled

Description: Whether customer managed keys for disk encryption will automatically be rotated to the latest version. Optional.

Type: bool

Default: false

managed_resource_group_name

Description: The name of the resource group where Azure should place the managed Databricks resources.
Changing this forces a new resource to be created.

NOTE: Make sure that this field is unique if you have multiple Databrick Workspaces deployed in your subscription and choose to not have the managed_resource_group_name auto generated by the Azure Resource Provider. Having multiple Databrick Workspaces deployed in the same subscription with the same manage_resource_group_name may result in some resources that cannot be deleted.

Type: string

Default: null

managed_services_cmk_key_vault_key_id

Description: Databricks Workspace Customer Managed Keys for Managed Services(e.g. Notebooks and Artifacts).

To find the correct Object ID to use for the Key vault access policy for managed services, follow these steps:  
1. Go to portal -> Azure Active Directory.  
2. In the search your tenant bar enter the value 2ff814a6-3304-4ab8-85cb-cd0e6f879c1d.  
3. You will see under Enterprise application results AzureDatabricks, click on the AzureDatabricks search result.  
4. This will open the Enterprise Application overview blade where you will see three values, the name of the application, the application ID, and the object ID.  
5. The value you want is the object ID.  
6. The Key Vault access policy should be created with the following permissions: 'Get', 'Wrap Key', 'Unwrap Key', 'Sign', 'Verify', 'List'. or Key Vault Crypto User role.

NOTE: Disabling Managed Services (aka CMK for Notebook) is currently not supported. If you want to disable Managed Services, you must delete the workspace and create a new one.

Type: string

Default: null

network_security_group_rules_required

Description: Does the data plane (clusters) to control plane communication happen over private link endpoint only or publicly?
Possible values AllRules, NoAzureDatabricksRules or NoAzureServiceRules.
Required when public_network_access_enabled is set to false.

Type: string

Default: null

private_endpoints

Description: A map of private endpoints to create on the Key Vault. The map key is deliberately arbitrary to avoid issues where map keys maybe unknown at plan time.

Type:

map(object({
    name = optional(string, null)
    role_assignments = optional(map(object({
      role_definition_id_or_name             = string
      principal_id                           = string
      description                            = optional(string, null)
      skip_service_principal_aad_check       = optional(bool, false)
      condition                              = optional(string, null)
      condition_version                      = optional(string, null)
      delegated_managed_identity_resource_id = optional(string, null)
      principal_type                         = optional(string, null)
    })), {})
    lock = optional(object({
      kind = string
      name = optional(string, null)
    }), null)
    tags                                    = optional(map(string), null)
    subnet_resource_id                      = string
    subresource_name                        = string # NOTE: `subresource_name` can be excluded if the resource does not support multiple sub resource types (e.g. storage account supports blob, queue, etc)
    private_dns_zone_group_name             = optional(string, "default")
    private_dns_zone_resource_ids           = optional(set(string), [])
    application_security_group_associations = optional(map(string), {})
    private_service_connection_name         = optional(string, null)
    network_interface_name                  = optional(string, null)
    location                                = optional(string, null)
    resource_group_name                     = optional(string, null)
    ip_configurations = optional(map(object({
      name               = string
      private_ip_address = string
    })), {})
  }))

Default: {}

public_network_access_enabled

Description: Allow public access for accessing workspace. Set value to false to access workspace only via private link endpoint.
Possible values include true or false. Defaults to true.
Creation of workspace with PublicNetworkAccess property set to false is only supported for VNet Injected workspace.

Type: bool

Default: true

role_assignments

Description: A map of role assignments to create on the . The map key is deliberately arbitrary to avoid issues where map keys maybe unknown at plan time.

Type:

map(object({
    role_definition_id_or_name             = string
    principal_id                           = string
    description                            = optional(string, null)
    skip_service_principal_aad_check       = optional(bool, false)
    condition                              = optional(string, null)
    condition_version                      = optional(string, null)
    delegated_managed_identity_resource_id = optional(string, null)
    principal_type                         = optional(string, null)
  }))

Default: {}

tags

Description: (Optional) Tags of the resource.

Type: map(string)

Default: null

virtual_network_peering

Description: A map of virtual network peering configurations. The map key is deliberately arbitrary to avoid issues where map keys may be unknown at plan time.

Type:

map(object({
    name                          = optional(string, null)
    resource_group_name           = optional(string, null)
    remote_address_space_prefixes = list(string)
    remote_virtual_network_id     = string
    allow_virtual_network_access  = optional(bool, true)
    allow_forwarded_traffic       = optional(bool, false)
    allow_gateway_transit         = optional(bool, false)
    use_remote_gateways           = optional(bool, false)
  }))

Default: {}

Outputs

The following outputs are exported:

databricks_id

Description: The ID of the Databricks Workspace in the Azure management plane.

databricks_virtual_network_peering_address_space_prefixes

Description: A list of address blocks reserved for this virtual network in CIDR notation.

databricks_virtual_network_peering_id

Description: The IDs of the internal Virtual Networks used by the DataBricks Workspace.

databricks_virtual_network_peering_virtual_network_id

Description: The ID of the internal Virtual Network used by the DataBricks Workspace.

databricks_workspace_disk_encryption_set_id

Description: The ID of Managed Disk Encryption Set created by the Databricks Workspace.

databricks_workspace_id

Description: The unique identifier of the databricks workspace in Databricks control plane.

databricks_workspace_managed_disk_identity

Description: A managed_disk_identity block as documented below

databricks_workspace_managed_resource_group_id

Description: The ID of the Managed Resource Group created by the Databricks Workspace.

databricks_workspace_storage_account_identity

Description: A storage_account_identity block as documented below

databricks_workspace_url

Description: The workspace URL which is of the format 'adb-{workspaceId}.{random}.azuredatabricks.net'.

name

Description: The name of the Databricks Workspace.

private_endpoints

Description: A map of private endpoints. The map key is the supplied input to var.private_endpoints. The map value is the entire azurerm_private_endpoint resource.

resource

Description: This is the full output for the resource.

resource_id

Description: The ID of the Databricks Workspace in the Azure management plane.

Modules

No modules.

Data Collection

The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.