File tree 2 files changed +30
-0
lines changed
2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -115,3 +115,14 @@ resource "databricks_cluster_policy" "this" {
115
115
name = each. key
116
116
definition = jsonencode (each. value )
117
117
}
118
+
119
+ resource "databricks_cluster_policy" "overrides" {
120
+ for_each = {
121
+ for param in var . default_cluster_policies_override : (param. name ) => param
122
+ if param . definition != null
123
+ }
124
+
125
+ policy_family_id = each. value . family_id
126
+ policy_family_definition_overrides = jsonencode (each. value . definition )
127
+ name = each. key
128
+ }
Original file line number Diff line number Diff line change @@ -245,3 +245,22 @@ variable "system_schemas_enabled" {
245
245
description = " System Schemas only works with assigned Unity Catalog Metastore. Boolean flag to enabled this feature"
246
246
default = false
247
247
}
248
+
249
+ variable "default_cluster_policies_override" {
250
+ type = list (object ({
251
+ name = string
252
+ family_id = string
253
+ definition = any
254
+ }))
255
+ description = <<- EOT
256
+ Provides an ability to override default cluster policy
257
+ name - name of cluster policy to override
258
+ family_id - family id of corresponding policy
259
+ definition - JSON document expressed in Databricks Policy Definition Language. No need to call 'jsonencode()' function on it when providing a value;
260
+ EOT
261
+ default = [{
262
+ name = null
263
+ family_id = null
264
+ definition = null
265
+ }]
266
+ }
You can’t perform that action at this time.
0 commit comments