Azure Machine Learning Compute Instance
This page shows how to write Terraform and Azure Resource Manager for Machine Learning Compute Instance and write them securely.
azurerm_machine_learning_compute_instance (Terraform)
The Compute Instance in Machine Learning can be configured in Terraform with the resource name azurerm_machine_learning_compute_instance
. The following sections describe 1 example of how to use the resource and its parameters.
Example Usage from GitHub
resource "azurerm_machine_learning_compute_instance" "mlci" {
name = azurecaf_name.mlci.result
location = var.location
machine_learning_workspace_id = var.remote_objects.machine_learning_workspace_id
virtual_machine_size = var.settings.virtual_machine_size
Parameters
The following arguments are supported:
name
- (Required) The name which should be used for this Machine Learning Compute Instance. Changing this forces a new Machine Learning Compute Instance to be created.location
- (Required) The Azure Region where the Machine Learning Compute Instance should exist. Changing this forces a new Machine Learning Compute Instance to be created.machine_learning_workspace_id
- (Required) The ID of the Machine Learning Workspace. Changing this forces a new Machine Learning Compute Instance to be created.virtual_machine_size
- (Required) The Virtual Machine Size. Changing this forces a new Machine Learning Compute Instance to be created.
authorization_type
- (Optional) The Compute Instance Authorization type. Possible values include:personal
. Changing this forces a new Machine Learning Compute Instance to be created.assign_to_user
- (Optional) Aassign_to_user
block as defined below. A user explicitly assigned to a personal compute instance. Changing this forces a new Machine Learning Compute Instance to be created.description
- (Optional) The description of the Machine Learning Compute Instance. Changing this forces a new Machine Learning Compute Instance to be created.identity
- (Optional) Anidentity
block as defined below. Changing this forces a new Machine Learning Compute Instance to be created.local_auth_enabled
- (Optional) Whether local authentication methods is enabled. Defaults totrue
. Changing this forces a new Machine Learning Compute Instance to be created.ssh
- (Optional) Assh
block as defined below. Specifies policy and settings for SSH access. Changing this forces a new Machine Learning Compute Instance to be created.subnet_resource_id
- (Optional) Virtual network subnet resource ID the compute nodes belong to. Changing this forces a new Machine Learning Compute Instance to be created.tags
- (Optional) A mapping of tags which should be assigned to the Machine Learning Compute Instance. Changing this forces a new Machine Learning Compute Instance to be created.
A identity
block supports the following:
type
- (Required) The Type of Identity which should be used for this Machine Learning Compute Instance. Possible values areSystemAssigned
,UserAssigned
andSystemAssigned,UserAssigned
. Changing this forces a new Machine Learning Compute Instance to be created.identity_ids
- (Optional) A list of User Managed Identity ID's which should be assigned to the Machine Learning Compute Instance. Changing this forces a new Machine Learning Compute Instance to be created.
A assign_to_user
block supports the following:
object_id
- (Optional) User’s AAD Object Id.tenant_id
- (Optional) User’s AAD Tenant Id.
A ssh
block supports the following:
public_key
- (Required) Specifies the SSH rsa public key file as a string. Use "ssh-keygen -t rsa -b 2048" to generate your SSH key pairs.
In addition to the Arguments listed above - the following Attributes are exported:
id
- The ID of the Machine Learning Compute Instance.identity
- Anidentity
block as defined below, which contains the Managed Service Identity information for this Machine Learning Compute Instance.ssh
- Anssh
block as defined below, which specifies policy and settings for SSH access for this Machine Learning Compute Instance.
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 Instance.tenant_id
- The Tenant ID for the Service Principal associated with the Managed Service Identity of this Machine Learning Compute Instance.
A ssh
block exports the following:
username
- The admin username of this Machine Learning Compute Instance.port
- Describes the port for connecting through SSH.
Explanation in Terraform Registry
Manages a Machine Learning Compute Instance.
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 Instance?
Azure Machine Learning Compute Instance 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 Instance?
For Terraform, the aztfmod/terraform-azurerm-caf source code example is useful. See the Terraform Example section for further details.