Skip to content

Azure Machine Learning Compute Cluster Minimum Nodes is not set to 0

Description

Setting the minimum number of nodes for your Azure Machine Learning Compute Clusters to 0 can help reduce the cost of running the cluster when it is not in use. When the minimum number of nodes is set to 0, the cluster is scaled down to 0 nodes when it is not in use, and no resources are consumed. By setting the minimum number of nodes to 0, you can ensure that the cluster is not consuming resources when it is not in use, which can help reduce your costs. This can be especially useful if you only need to use the cluster occasionally or on an as-needed basis.

Code Example

go
resource "azurerm_machine_learning_compute_cluster" "ckv_unittest_pass" {
    name                          = "example"
    location                      = "West Europe"
    vm_priority                   = "LowPriority"
    vm_size                       = "Standard_DS2_v2"
    machine_learning_workspace_id = azurerm_machine_learning_workspace.example.id
    subnet_resource_id            = azurerm_subnet.example.id

    scale_settings {
        min_node_count                       = 0
        max_node_count                       = 1
        scale_down_nodes_after_idle_duration = "PT30S" # 30 seconds
    }
}

Remediation

Terraform

  • Resource: azurerm_machine_learning_compute_cluster
  • Arguments: scale_settings.min_node_count

Rule Details

FieldValue
IDIAC-0657
SeverityLOW
IaC TypeTerraform
FrameworksTerraform
Checkov IDCKV_AZURE_150

References