cancel
Showing results for 
Search instead for 
Did you mean: 
Administration & Architecture
cancel
Showing results for 
Search instead for 
Did you mean: 

Override default Personal Compute policy using terraform / disable Personal Compute policy

ossinova
Contributor II

I want to programmatically do some adjustments to the default personal compute resource or preferably create my own custom one based on the same configuration or policy family (in which all users can gain access to) when deploying a new workspace using terraform. I know an account admin can enable Manage the Personal Compute policy - Azure Databricks | Microsoft Learn at an account level although I am uncertain if this can be applied for other policies too (for instance the custom one) so that the default is disabled and the custom one takes over. 

Is there a way to override the defualt personal compute policy? I need the following to be overridden:

"autotermination_minutes": {
"type": "fixed",
"value": 30
}

 

This auto termination should be the default for all personal compute clusters in the workspace. Is there a way to make this work without having to manually adjust it post-deployment?

3 REPLIES 3

feiyun0112
Contributor III

use api to create new cluster, set autotermination_minutes parameter

https://docs.databricks.com/api/workspace/clusters/create#autotermination_minutes 

I am aware of the API. However, that is out of scope of the question as I want to configure a policy upon workspace creation using Terraform as opposed to creating a cluster. The policy should override the default configuration of the current default one shipped with databricks. 

jsimonovic
New Contributor II

Hi, I think this doc might be useful: Override default Personal Compute policy using ter... - Databricks - 61695, basically is an override process by creating a databricks_cluster_policy resource:

 

locals {
  personal_vm_override = {
    "autotermination_minutes" : {
      "type" : "fixed",
      "value" : 220,
      "hidden" : true
    },
    "custom_tags.Team" : {
      "type" : "fixed",
      "value" : var.team
    }
  }
}

resource "databricks_cluster_policy" "personal_vm" {
  policy_family_id                   = "personal-vm"
  policy_family_definition_overrides = jsonencode(personal_vm_override)
  name                               = "Personal Compute"
}