Azure Machine Learning Compute Cluster
This page shows how to write Terraform and Azure Resource Manager for Machine Learning Compute Cluster and write them securely.
azurerm_machine_learning_compute_cluster (Terraform)
The Compute Cluster in Machine Learning can be configured in Terraform with the resource name azurerm_machine_learning_compute_cluster
. The following sections describe 2 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "azurerm_machine_learning_compute_cluster" "test" {
name = var.cluster_name
location = var.location
vm_priority = var.vm_priority
vm_size = var.vm_size
machine_learning_workspace_id = azurerm_machine_learning_workspace.this.id
resource "azurerm_machine_learning_compute_cluster" "example" {
name = "example"
location = "Southeast Asia"
vm_priority = "LowPriority"
vm_size = "Standard_NV6"
machine_learning_workspace_id = azurerm_machine_learning_workspace.example.id
Parameters
The following arguments are supported:
name
- (Required) The name which should be used for this Machine Learning Compute Cluster. Changing this forces a new Machine Learning Compute Cluster to be created.machine_learning_workspace_id
- (Required) The ID of the Machine Learning Workspace. Changing this forces a new Machine Learning Compute Cluster to be created.location
- (Required) The Azure Region where the Machine Learning Compute Cluster should exist. Changing this forces a new Machine Learning Compute Cluster to be created.vm_priority
- (Required) The priority of the VM. Changing this forces a new Machine Learning Compute Cluster to be created. Accepted values areDedicated
andLowPriority
.vm_size
- (Required) The size of the VM. Changing this forces a new Machine Learning Compute Cluster to be created.scale_settings
- (Required) Ascale_settings
block as defined below. Changing this forces a new Machine Learning Compute Cluster to be created.
ssh
- (Optional) Credentials for an administrator user account that will be created on each compute node. Assh
block as defined below. Changing this forces a new Machine Learning Compute Cluster to be created.description
- (Optional) The description of the Machine Learning compute. Changing this forces a new Machine Learning Compute Cluster to be created.identity
- (Optional) Anidentity
block as defined below. Changing this forces a new Machine Learning Compute Cluster to be created.local_auth_enabled
- (Optional) Whether local authentication methods is enabled. Defaults totrue
. Changing this forces a new Machine Learning Compute Cluster to be created.ssh_public_access_enabled
- (Optional) A boolean value indicating whether enable the public SSH port. Changing this forces a new Machine Learning Compute Cluster to be created.subnet_resource_id
- (Optional) The ID of the Subnet that the Compute Cluster should reside in. Changing this forces a new Machine Learning Compute Cluster to be created.tags
- (Optional) A mapping of tags which should be assigned to the Machine Learning Compute Cluster. Changing this forces a new Machine Learning Compute Cluster to be created.
A identity
block supports the following:
type
- (Required) The Type of Identity which should be used for this Machine Learning Compute Cluster. Possible values areSystemAssigned
,UserAssigned
andSystemAssigned,UserAssigned
. Changing this forces a new Machine Learning Compute Cluster to be created.identity_ids
- (Optional) A list of User Managed Identity ID's which should be assigned to the Machine Learning Compute Cluster. Changing this forces a new Machine Learning Compute Cluster to be created.
A ssh
block supports the following:
admin_username
- (Required) Name of the administrator user account which can be used to SSH to nodes. Changing this forces a new Machine Learning Compute Cluster to be created.admin_password
- (Optional) Password of the administrator user account. Changing this forces a new Machine Learning Compute Cluster to be created.key_value
- (Optional) SSH public key of the administrator user account. Changing this forces a new Machine Learning Compute Cluster to be created.
A scale_settings
block supports the following:
max_node_count
- (Required) Maximum node count. Changing this forces a new Machine Learning Compute Cluster to be created.min_node_count
- (Required) Minimal node count. Changing this forces a new Machine Learning Compute Cluster to be created.scale_down_nodes_after_idle_duration
- (Required) Node Idle Time Before Scale Down: defines the time until the compute is shutdown when it has gone into Idle state. Is defined according to W3C XML schema standard for duration. Changing this forces a new Machine Learning Compute Cluster to be created.
In addition to the Arguments listed above - the following Attributes are exported:
id
- The ID of the Machine Learning Compute Cluster.identity
- Anidentity
block as defined below, which contains the Managed Service Identity information for this Machine Learning Compute Cluster.
A identity
block exports the following:
principal_id
- The Principal ID for the Service Principal associated with the Managed Service Identity of this Machine Learning Compute Cluster.tenant_id
- The Tenant ID for the Service Principal associated with the Managed Service Identity of this Machine Learning Compute Cluster.
Explanation in Terraform Registry
Manages a Machine Learning Compute Cluster. NOTE: At this point in time the resource cannot be updated (not supported by the backend Azure Go SDK). Therefore it can only be created and deleted, not updated. At the moment, there is also no possibility to specify ssh User Account Credentials to ssh into the compute cluster.
Microsoft.MachineLearningServices/workspaces/computes (Azure Resource Manager)
The workspaces/computes in Microsoft.MachineLearningServices can be configured in Azure Resource Manager with the resource name Microsoft.MachineLearningServices/workspaces/computes
. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
An example could not be found in GitHub.
Parameters
apiVersion
required - stringidentity
optionaltype
optional - stringThe identity type.
userAssignedIdentities
optional - undefineddictionary containing all the user assigned identities, with resourceId of the UAI as key.
location
optional - stringSpecifies the location of the resource.
name
required - stringName of the Azure Machine Learning compute.
properties
requiredcomputeLocation
optional - stringLocation for the underlying compute
description
optional - stringThe description of the Machine Learning compute.
disableLocalAuth
optional - booleanOpt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication.
resourceId
optional - stringARM resource id of the underlying compute
sku
optionalname
optional - stringName of the sku
tier
optional - stringTier of the sku like Basic or Enterprise
systemData
optionalcreatedAt
optional - stringThe timestamp of resource creation (UTC).
createdBy
optional - stringThe identity that created the resource.
createdByType
optional - stringThe type of identity that created the resource.
lastModifiedAt
optional - stringThe timestamp of resource last modification (UTC)
lastModifiedBy
optional - stringThe identity that last modified the resource.
lastModifiedByType
optional - stringThe type of identity that last modified the resource.
tags
optional - stringContains resource tags defined as key/value pairs.
type
required - string
Frequently asked questions
What is Azure Machine Learning Compute Cluster?
Azure Machine Learning Compute Cluster is a resource for Machine Learning of Microsoft Azure. Settings can be wrote in Terraform.
Where can I find the example code for the Azure Machine Learning Compute Cluster?
For Terraform, the SSC-DSAI/terraform-modules and toby-htx/nus-devops-course source code examples are useful. See the Terraform Example section for further details.