njglen
New Contributor III

I've searched and there is no such resource as `databricks_workspace_cluster_policy`

Rather this should work:

resource "databricks_cluster_policy" "audit_logs_policy" {
  name = "Audit Logs Policy"
  definition = jsonencode({
    "audit_logs": {
      "audit_enabled": true,
      "audit_logs_level": "ALL"
      "log_all_clusters": true,
      "log_all_users": true,      
    }
  })
}
 
output "audit_policy_id" {
  value = databricks_cluster_policy.audit_logs_policy.id
}

This cluster policy will need to be applied to the cluster created inside the workspace.

View solution in original post