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

AVM Module for Azure Machine learning workspaces.
MIT License
9 stars 8 forks source link

Azure Machine Learning Workspace Module

Overview

This is an Azure Verified Module that provisions an Azure Machine Learning Workspace, which is a core resource for developing, training, and deploying machine learning models on Azure. Additionally, by setting the kind variable to Hub, this module can also provision an Azure AI Studio, which is an enhanced experience built on top of the Azure Machine Learning Workspace specifically for Generative AI use cases. Finally, if the kind variable is set to Project, this module can provision a AI Studio Project for a Hub workspace.

Functionality

Example Usage

module "ml_workspace" {
  source  = "Azure/avm-res-machinelearningservices-workspace/azurerm"
  version = "x.x.x"

  resource_group_name = "<resource_group_name>"

  location = "<your_location>"
  kind     = "Default" # Omitting this parameter will result in the same outcome
}

This will create an Azure Machine Learning Workspace.

Requirements

The following requirements are needed 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: The name of the this resource.

Type: string

resource_group_name

Description: The resource group where the resources will be deployed.

Type: string

Optional Inputs

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

ai_studio_hub_id

Description: The AI Studio Hub ID for which to create a Project

Type: string

Default: null

aiservices

Description: An object describing the AI Services resource to create or reference. This includes the following properties:

Type:

object({
    create_new                = optional(bool, false)
    analysis_services_sku     = optional(string, "S0")
    name                      = optional(string, null)
    resource_group_id         = optional(string, null)
    tags                      = optional(map(string), null)
    create_service_connection = optional(bool, false)
  })

Default:

{
  "create_new": false
}

application_insights

Description: An object describing the Application Insights resource to create or use for monitoring inference endpoints. This includes the following properties:

Type:

object({
    resource_id = optional(string, null)
    create_new  = bool
    tags        = optional(map(string), null)
    log_analytics_workspace = optional(object({
      resource_id = optional(string, null)
      create_new  = bool
      tags        = optional(map(string), null)
      }), {
      create_new = false
    })
  })

Default:

{
  "create_new": false
}

container_registry

Description: An object describing the Container Registry. This includes the following properties:

Type:

object({
    resource_id = optional(string, null)
    create_new  = bool
    private_endpoints = optional(map(object({
      name                            = optional(string, null)
      subnet_resource_id              = optional(string, null)
      private_dns_zone_resource_ids   = optional(set(string), [])
      private_service_connection_name = optional(string, null)
      network_interface_name          = optional(string, null)
      inherit_lock                    = optional(bool, false)
    })), {})
    tags           = optional(map(string), null)
    zone_redundant = optional(bool, false)
  })

Default:

{
  "create_new": false
}

create_compute_instance

Description: Specifies whether a compute instance should be created for the workspace to provision the managed vnet.

Type: bool

Default: false

customer_managed_key

Description: A map describing customer-managed keys to associate with the resource. This includes the following properties:

Type:

object({
    key_vault_resource_id = string
    key_name              = string
    key_version           = optional(string, null)
    user_assigned_identity = optional(object({
      resource_id = string
    }), null)
  })

Default: null

diagnostic_settings

Description: A map of diagnostic settings to create on the Azure Machine Learning Workspace. 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

hbi_workspace

Description: Specifies if the resource is a High Business Impact (HBI) workspace.

Type: bool

Default: false

is_private

Description: Specifies if every provisioned resource should be private and inaccessible from the Internet.

Type: bool

Default: false

key_vault

Description: An object describing the Key Vault to create the private endpoint connection to. This includes the following properties:

Type:

object({
    resource_id = optional(string, null)
    create_new  = bool
    private_endpoints = optional(map(object({
      name                            = optional(string, null)
      subnet_resource_id              = optional(string, null)
      private_dns_zone_resource_ids   = optional(set(string), [])
      private_service_connection_name = optional(string, null)
      network_interface_name          = optional(string, null)
      inherit_lock                    = optional(bool, false)
    })), {})
    tags = optional(map(string), null)
  })

Default:

{
  "create_new": true
}

kind

Description: The kind of the resource. This is used to determine the type of the resource. If not specified, the resource will be created as a standard resource.
Possible values are:

Type: string

Default: "Default"

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_identities

Description: Controls the Managed Identity configuration on this resource. The following properties can be specified:

Type:

object({
    system_assigned            = optional(bool, false)
    user_assigned_resource_ids = optional(set(string), [])
  })

Default: {}

outbound_rules

Description: A map of private endpoints toutbound rules for the managed network.

Type:

map(object({
    resource_id         = string
    sub_resource_target = string
  }))

Default: {}

private_endpoints

Description: A map of private endpoints to create on this resource. 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
    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: {}

role_assignments

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

Note: only set skip_service_principal_aad_check to true if you are assigning a role to a service principal.

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: {}

storage_access_type

Description: The auth mode used for accessing the system datastores of the workspace - accessKey or identity.

Type: string

Default: "identity"

storage_account

Description: An object describing the Storage Account. This includes the following properties:

Type:

object({
    resource_id = optional(string, null)
    create_new  = bool
    private_endpoints = optional(map(object({
      name                            = optional(string, null)
      subnet_resource_id              = optional(string, null)
      subresource_name                = string
      private_dns_zone_resource_ids   = optional(set(string), [])
      private_service_connection_name = optional(string, null)
      network_interface_name          = optional(string, null)
      inherit_lock                    = optional(bool, false)
    })), {})
    tags = optional(map(string), null)
  })

Default:

{
  "create_new": true
}

tags

Description: (Optional) Tags of the resource.

Type: map(string)

Default: null

workspace_description

Description: The description of this workspace.

Type: string

Default: ""

workspace_friendly_name

Description: The friendly name for this workspace. This value in mutable.

Type: string

Default: "Workspace"

workspace_managed_network

Description: Specifies properties of the workspace's managed virtual network.

Possible values for isolation_mode are:

spark_ready determines whether spark jobs will be run on the network. This value can be updated in the future.

Type:

object({
    isolation_mode = string
    spark_ready    = optional(bool, true)
  })

Default:

{
  "isolation_mode": "Disabled",
  "spark_ready": true
}

Outputs

The following outputs are exported:

application_insights

Description: The ID of the application insights.

container_registry

Description: The container registry resource.

key_vault

Description: The key vault resource.

private_endpoints

Description: A map of the private endpoints created.

resource

Description: The machine learning workspace.

resource_id

Description: The ID of the machine learning workspace.

storage_account

Description: The storage account resource.

Modules

The following Modules are called:

avm_res_containerregistry_registry

Source: Azure/avm-res-containerregistry-registry/azurerm

Version: ~> 0.1

avm_res_insights_component

Source: Azure/avm-res-insights-component/azurerm

Version: ~> 0.1

avm_res_keyvault_vault

Source: Azure/avm-res-keyvault-vault/azurerm

Version: ~> 0.9.1

avm_res_log_analytics_workspace

Source: Azure/avm-res-operationalinsights-workspace/azurerm

Version: 0.3.3

avm_res_storage_storageaccount

Source: Azure/avm-res-storage-storageaccount/azurerm

Version: ~> 0.1

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.