File tree Expand file tree Collapse file tree 4 files changed +19
-2
lines changed Expand file tree Collapse file tree 4 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,13 @@ resource "databricks_cluster" "cluster" {
3
3
4
4
cluster_name = each. value . cluster_name
5
5
spark_version = each. value . spark_version
6
- spark_conf = each. value . spark_conf
6
+ spark_conf = each. value . enabled_adls_passthrought ? merge (each. value . spark_conf ,
7
+ {
8
+ " spark.databricks.cluster.profile" : " serverless" ,
9
+ " spark.databricks.repl.allowedLanguages" : " python,sql" ,
10
+ " spark.databricks.passthrough.enabled" : " true" ,
11
+ " spark.databricks.pyspark.enableProcessIsolation" : " true"
12
+ }) : each. value . spark_conf
7
13
spark_env_vars = each. value . spark_env_vars
8
14
data_security_mode = each. value . data_security_mode
9
15
node_type_id = each. value . node_type_id
Original file line number Diff line number Diff line change @@ -3,7 +3,10 @@ resource "databricks_mount" "adls" {
3
3
4
4
name = each. key
5
5
uri = " abfss://${ each . value [" container_name" ]} @${ each . value [" storage_account_name" ]} .dfs.core.windows.net"
6
- extra_configs = {
6
+ extra_configs = var. mount_adls_passthrough ? {
7
+ " fs.azure.account.auth.type" : " CustomAccessToken" ,
8
+ " fs.azure.account.custom.token.provider.class" : " {{sparkconf/spark.databricks.passthrough.adls.gen2.tokenProviderClassName}}"
9
+ } : {
7
10
" fs.azure.account.auth.type" : " OAuth" ,
8
11
" fs.azure.account.oauth.provider.type" : " org.apache.hadoop.fs.azurebfs.oauth2.ClientCredsTokenProvider" ,
9
12
" fs.azure.account.oauth2.client.id" : data.azurerm_key_vault_secret.sp_client_id.value,
Original file line number Diff line number Diff line change @@ -16,4 +16,5 @@ output "metastore_id" {
16
16
output "token" {
17
17
value = databricks_token. pat . token_value
18
18
description = " Databricks Personal Authorization Token"
19
+ sensitive = true
19
20
}
Original file line number Diff line number Diff line change @@ -228,6 +228,7 @@ variable "clusters" {
228
228
cluster_name = string
229
229
spark_version = optional (string , " 11.3.x-scala2.12" )
230
230
spark_conf = optional (map (any ), {})
231
+ enabled_adls_passthrought = optional (bool , false )
231
232
spark_env_vars = optional (map (any ), {})
232
233
data_security_mode = optional (string , " USER_ISOLATION" )
233
234
node_type_id = optional (string , " Standard_D3_v2" )
@@ -252,3 +253,9 @@ variable "pat_token_lifetime_seconds" {
252
253
description = " The lifetime of the token, in seconds. If no lifetime is specified, the token remains valid indefinitely"
253
254
default = 315569520
254
255
}
256
+
257
+ variable "mount_adls_passthrough" {
258
+ type = bool
259
+ description = " Boolean flag for Unity Catalog Metastore current in this environment. One Metastore per region"
260
+ default = false
261
+ }
You can’t perform that action at this time.
0 commit comments