cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Can Terraform be used to set configurations in Admin / workspace settings?

nicole_wong
New Contributor II

I am posting this on behalf of my customer. They are currently working on the deployment & config of their workspace on AWS via Terraform.

Is it possible to set some configs in the Admin/workspace settings via TF? According to the Terraform module, it isnโ€™t.

https://registry.terraform.io/providers/databrickslabs/databricks/latest/docs/resources/workspace_co...

The config settings we would like to automate are:

  • Access Control
    • enable Table access control
  •  Configure Personal Access Tokens to grant all users Can use access
  • Cluster
    • enable Cluster Container Services
    • enable EBS SSD gp3
  • Advanced
    • enable Web terminal
    • enable DBFS file browser

1 ACCEPTED SOLUTION

Accepted Solutions

maiconbaum
New Contributor III

I had the same problem and couldn't find this anywhere, except in the source code for databricks-cli at PowerShell:

https://www.powershellgallery.com/packages/DatabricksPS/1.11.0.8/Content/Public%5CWorkspaceConfig.ps...

Hope this helps someone else too.

View solution in original post

13 REPLIES 13

Kaniz
Community Manager
Community Manager

Hi @ nicole.wong! My name is Kaniz, and I'm the technical moderator here. Great to meet you, and thanks for your question! Let's see if your peers on the community have an answer to your question first. Or else I will follow up with my team and get back to you soon.Thanks.

nicole_wong
New Contributor II

Hi @Kaniz Fatmaโ€‹ ! Following up on this question for my customer. I just recently learned that all of the config settings mentioned above can be accessed via our APIs. I'm not very familiar with Terraform, what additional information would be needed to enable TF to set those configurations via the APIs? Is this possible?

Thanks!

Kaniz
Community Manager
Community Manager

Hi @Nicole Wongโ€‹ ,

Happy to help you.

My team shall get back to you soon with an answer.

Thank you for your patience๐Ÿ˜ .

Ravi
Valued Contributor
Valued Contributor

Hi @Nicole Wongโ€‹ , can you try below options:

resource "databricks_permissions" "token_usage" {
    authorization = "tokens"
 
    access_control {
        group_name = "<groupname>"
        permission_level = "CAN_USE"
    }
}
  • Cluster
    • enable Cluster Container Services can be enabled via "enableDcs" custom_config
    • enable EBS SSD gp3 can be enabled via "enableGp3" custom_config
  • Advanced
    • enable Web terminal can be enabled via "enableWebTerminal" custom_config
    • enable DBFS file browser can be enabled via "enableDbfsFileBrowser" custom_config
resource "databricks_workspace_conf" "this" {
  custom_config = {
    "enableWebTerminal" : true,
    "enableGp3" : true,
    "enableDbfsFileBrowser" : true,
    "enableDcs" : true
  }
}

To achieve the same via API we can use below curl:

curl --location --request PATCH 'https://test.cloud.databricks.com/api/2.0/workspace-conf' \
--header 'Authorization: Bearer REPLACE_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
    "enableWebTerminal": "true",
    "enableGp3": "true",
    "enableDbfsFileBrowser": "true",
    "enableDcs": "true"
}'

Ricardo_Gaspar
New Contributor III

Thanks @Ravirahul Padmanabhanโ€‹ we are going to try it out and come back to you if there are any questions.

jose_gonzalez
Moderator
Moderator

Hi @Ricardo Gasparโ€‹ ,

Did Ravi's fully answered your question, would you be happy to mark their answer as best so that others can quickly find the solution?

@Jose Gonzalezโ€‹  @Ravirahul Padmanabhanโ€‹ 

It doesn't solve all the requested permissions. But this already helps for now.

Would you be able to add that example terraform to the terraform provider documentation? or is there any webpage that lists all the existing customizable configs?

It certainly would be better to be able to control this via Terraform.

Thanks @Ricardo Gasparโ€‹ for the feedback.

Vaaceph
New Contributor II

Any update for "enable Table access control" from TF?

Ravi
Valued Contributor
Valued Contributor

"Table access control" workspace config is not supported via Databricks Terraform provider.

Vaaceph
New Contributor II

okay. that is sad ๐Ÿ˜ž

francly
New Contributor II

Hi, can I get a full list of the latest configurable supported workspace_conf on tf, I can't find the list on tf registry site.

maiconbaum
New Contributor III

I had the same problem and couldn't find this anywhere, except in the source code for databricks-cli at PowerShell:

https://www.powershellgallery.com/packages/DatabricksPS/1.11.0.8/Content/Public%5CWorkspaceConfig.ps...

Hope this helps someone else too.

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.