Skip to content

Commit 9a72e4e

Browse files
author
dmytro_velychko3
committed
fix: changed uniti cluste
1 parent cd5a9aa commit 9a72e4e

File tree

4 files changed

+0
-87
lines changed

4 files changed

+0
-87
lines changed

README.md

-4
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,6 @@ No modules.
285285
| [databricks_entitlements.this](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/entitlements) | resource |
286286
| [databricks_cluster_policy.this](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/cluster_policy) | resource |
287287
| [databricks_permissions.clusters](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/permissions) | resource |
288-
| [databricks_permissions.unity_cluster](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/permissions) | resource |
289288
| [databricks_permissions.sql_endpoint](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/permissions) | resource |
290289
| [databricks_secret_acl.this](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/secret_acl) | resource |
291290
| [azurerm_key_vault_secret.sp_client_id](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/key_vault_secret) | data |
@@ -304,7 +303,6 @@ No modules.
304303
| [databricks_grants.catalog](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/grants) | resource |
305304
| [databricks_schema.this](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/sql_endpoint) | resource |
306305
| [databricks_grants.schema](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/schema) | resource |
307-
| [databricks_cluster.this](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/cluster) | resource |
308306
| [databricks_mount.adls](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/mount) | resource |
309307
| [databricks_secret_scope.main](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/secret_scope) | resource |
310308
| [databricks_secret_scope.this](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/secret_scope) | resource |
@@ -335,8 +333,6 @@ No modules.
335333
| <a name="input_external_metastore_id"></a> [external\_metastore\_id](#input\_external\_metastore\_id) | Unity Catalog Metastore Id that is located in separate environment. Provide this value to associate Databricks Workspace with target Metastore | `string` | " " | no |
336334
| <a name="input_metastore_grants"></a> [metastore\_grants](#input\_metastore\_grants) | Permissions to give on metastore to group | `map(list(string))` | {} | no |
337335
| <a name="input_secret_scope_object"></a> [secret\_scope\_object](#input\_secret\_scope\_object) | List of objects, where 'scope_name' param is a Secret scope name and 'acl' are list of objects with 'principals' and one of allowed 'permission' ('READ', 'WRITE' or 'MANAGE') | <pre>list(object({<br> scope_name = string<br> acl = list(object({<br> principal = string<br> permission = string<br> }))<br>}))</pre> | <pre>[{<br> scope_name = null<br> acl = null<br>}]</pre> | no |
338-
| <a name="input_unity_cluster_enabled"></a> [unity\_cluster\_enabled](#input\_unity\_cluster\_enabled) | Boolean flag for creating databricks claster | `bool` | false | no |
339-
| <a name="input_unity_cluster_config"></a> [unity\_unity\_cluster\_config](#input\_unity\_cluster\_config) | Specifies the databricks unity cluster configuration | <pre>object({ <br> cluster_name = optional(string)<br> spark_version = optional(string)<br> spark_conf = optional(map(any))<br> spark_env_vars = optional(map(any))<br> data_security_mode = optional(string)<br> node_type_id = optional(string)<br> autotermination_minutes = optional(number)<br> min_workers = optional(number)<br> max_workers = optional(number)<br> availability = optional(string)<br> first_on_demand = optional(number)<br> spot_bid_max_price = optional(number)<br> cluster_log_conf_destination = optional(string, null)<br> permissions = optional(set(object({<br> group_name = string<br> permission_level = string<br> })))<br>})<br></pre> | <pre>object({ <br> cluster_name = optional("Unity Catalog")<br> spark_version = optional("11.3.x-scala2.12")<br> spark_conf = optional({})<br> spark_env_vars = optional({})<br> data_security_mode = optional("USER_ISOLATION")<br> node_type_id = optional("Standard_D3_v2")<br> autotermination_minutes = optional(30)<br> min_workers = optional(1)<br> max_workers = optional(2)<br> availability = optional("ON_DEMAND_AZURE")<br> first_on_demand = optional(0)<br> spot_bid_max_price = optional(1)<br> cluster_log_conf_destination = optional(string, null)<br> permissions = optional(set(object({<br> group_name = string<br> permission_level = string<br> })),null)<br>})<br></pre> | no |
340336
| <a name="input_sp_client_id_secret_name"></a> [sp\_client\_id\_secret\_name](#input\_sp\_client\_id\_secret\_name) | The name of Azure Key Vault secret that contains ClientID of Service Principal to access in Azure Key Vault | `string` | n/a | yes |
341337
| <a name="input_sp_key_secret_name"></a> [sp\_key\_secret\_name](#input\_sp\_key\_secret\_name) | The name of Azure Key Vault secret that contains client secret of Service Principal to access in Azure Key Vault | `string` | n/a | yes |
342338
| <a name="input_secret_scope"></a> [secret\_scope](#input\_secret\_scope) | Provides an ability to create custom Secret Scope, store secrets in it and assigning ACL for access management | <pre>list(object({<br> scope_name = string<br> acl = optional(list(object({<br> principal = string<br> permission = string<br> })))<br> secrets = optional(list(object({<br> key = string<br> string_value = string<br> })))<br>}))<br></pre> | <pre>default = [{<br> scope_name = null<br> acl = null<br> secrets = null<br>}]<br></pre> | yes |

permissions.tf

-14
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,6 @@ resource "databricks_permissions" "clusters" {
3333
}
3434
}
3535

36-
resource "databricks_permissions" "unity_cluster" {
37-
count = length(var.unity_cluster_config.permissions) != 0 && var.unity_cluster_enabled ? 1 : 0
38-
39-
cluster_id = databricks_cluster.this[0].id
40-
41-
dynamic "access_control" {
42-
for_each = var.unity_cluster_config.permissions
43-
content {
44-
group_name = databricks_group.this[access_control.value.group_name].display_name
45-
permission_level = access_control.value.permission_level
46-
}
47-
}
48-
}
49-
5036
resource "databricks_permissions" "sql_endpoint" {
5137
for_each = {
5238
for endpoint in var.sql_endpoint : (endpoint.name) => endpoint

unity.tf

-38
Original file line numberDiff line numberDiff line change
@@ -133,41 +133,3 @@ resource "databricks_grants" "schema" {
133133
privileges = each.value.permission
134134
}
135135
}
136-
137-
resource "databricks_cluster" "this" {
138-
count = var.unity_cluster_enabled ? 1 : 0
139-
140-
cluster_name = var.unity_cluster_config.cluster_name
141-
spark_version = var.unity_cluster_config.spark_version
142-
spark_conf = var.unity_cluster_config.spark_conf
143-
spark_env_vars = var.unity_cluster_config.spark_env_vars
144-
data_security_mode = var.unity_cluster_config.data_security_mode
145-
node_type_id = var.unity_cluster_config.node_type_id
146-
autotermination_minutes = var.unity_cluster_config.autotermination_minutes
147-
148-
autoscale {
149-
min_workers = var.unity_cluster_config.min_workers
150-
max_workers = var.unity_cluster_config.max_workers
151-
}
152-
153-
azure_attributes {
154-
availability = var.unity_cluster_config.availability
155-
first_on_demand = var.unity_cluster_config.first_on_demand
156-
spot_bid_max_price = var.unity_cluster_config.spot_bid_max_price
157-
}
158-
159-
dynamic "cluster_log_conf" {
160-
for_each = var.unity_cluster_config.cluster_log_conf_destination != null ? [var.unity_cluster_config.cluster_log_conf_destination] : []
161-
content {
162-
dbfs {
163-
destination = cluster_log_conf.value
164-
}
165-
}
166-
}
167-
168-
lifecycle {
169-
ignore_changes = [
170-
state
171-
]
172-
}
173-
}

variables.tf

-31
Original file line numberDiff line numberDiff line change
@@ -166,37 +166,6 @@ variable "secret_scope_object" {
166166
}]
167167
}
168168

169-
variable "unity_cluster_enabled" {
170-
type = bool
171-
description = "Boolean flag for creating databricks claster"
172-
default = false
173-
}
174-
175-
variable "unity_cluster_config" {
176-
type = object({
177-
cluster_name = optional(string, "Unity Catalog")
178-
spark_version = optional(string, "11.3.x-scala2.12")
179-
spark_conf = optional(map(any), null)
180-
spark_env_vars = optional(map(any), null)
181-
data_security_mode = optional(string, "USER_ISOLATION")
182-
node_type_id = optional(string, "Standard_D3_v2")
183-
autotermination_minutes = optional(number, 30)
184-
min_workers = optional(number, 1)
185-
max_workers = optional(number, 2)
186-
availability = optional(string, "ON_DEMAND_AZURE")
187-
first_on_demand = optional(number, 0)
188-
spot_bid_max_price = optional(number, 1)
189-
cluster_log_conf_destination = optional(string, null)
190-
permissions = optional(set(object({
191-
group_name = string
192-
permission_level = string
193-
})), null)
194-
})
195-
description = "Specifies the databricks unity cluster configuration"
196-
default = {}
197-
}
198-
199-
######
200169
variable "sp_client_id_secret_name" {
201170
type = string
202171
description = "The name of Azure Key Vault secret that contains ClientID of Service Principal to access in Azure Key Vault"

0 commit comments

Comments
 (0)