You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow to override built-in databricks_cluster_policy resources (#2941)
* Allow to override built-in `databricks_cluster_policy` resources
Databricks is shipped with a number of built-in cluster policies that are inherited from
the cluster policy families. For built-in cluster policies we need to provide an
override, not the `definition`. We also need to handle deletes for them differently -
just remove the overrides because we can't remove built-in policies. We also need to
distinguish cases when we override built-in policy from cases when we create a new policy
based on the cluster policy family.
This PR makes following changes:
* Discovers a list of cluster policies families dynamically instead of relying on
hardcoded list of policies
* When creating a new `databricks_cluster_policy`, check if it's built-in policy or not,
and if it's built-in, then update it with policy override instead of trying to create.
* When deleting a created `databricks_cluster_policy`, check if it's built-in policy or
not, and if it's built-in, then reset policy overrides to empty string to return back to
the original state.
This fixes#2935
* Add integration test for policy overrides
You can override built-in cluster policies by creating a `databricks_cluster_policy` resource with following attributes:
106
+
107
+
*`name` - the name of the built-in cluster policy.
108
+
*`policy_family_id` - the ID of the cluster policy family used for built-in cluster policy.
109
+
*`policy_family_definition_overrides` - settings to override in the built-in cluster policy.
110
+
111
+
You can obtain the list of defined cluster policies families using the `databricks policy-families list` command of the new [Databricks CLI](https://docs.databricks.com/en/dev-tools/cli/index.html), or via [list policy families](https://docs.databricks.com/api/workspace/policyfamilies/list) REST API.
0 commit comments