databricks_workspace_file Resource

This resource allows you to manage Databricks Workspace Files.

Example Usage

You can declare Terraform-managed workspace file by specifying source attribute of corresponding local file.

data "databricks_current_user" "me" {
}

resource "databricks_workspace_file" "module" {
  source = "${path.module}/module.py"
  path   = "${data.databricks_current_user.me.home}/AA/BB/CC"
}

You can also create a managed workspace file with inline sources through content_base64 attribute.

resource "databricks_workspace_file" "init_script" {
  content_base64 = base64encode(<<-EOT
    #!/bin/bash
    echo "Hello World"
    EOT
  )
  path = "/Shared/init-script.sh"
}

Argument Reference

The size of a workspace file source code must not exceed a few megabytes. The following arguments are supported:

Attribute Reference

In addition to all arguments above, the following attributes are exported:

Access Control

Import

The workspace file resource can be imported using workspace file path

terraform import databricks_workspace_file.this /path/to/file

The following resources are often used in the same context: