1. Packages
  2. Databricks Provider
  3. API Docs
  4. WorkspaceBinding
Databricks v1.65.0 published on Wednesday, Apr 9, 2025 by Pulumi

databricks.WorkspaceBinding

Explore with Pulumi AI

This resource can only be used with a workspace-level provider!

If you use workspaces to isolate user data access, you may want to limit access to catalog, external locations or storage credentials from specific workspaces in your account, also known as workspace binding

By default, Databricks assigns the securable to all workspaces attached to the current metastore. By using databricks.WorkspaceBinding, the securable will be unassigned from all workspaces and only assigned explicitly using this resource.

To use this resource the securable must have its isolation mode set to ISOLATED (for databricks_catalog) or ISOLATION_MODE_ISOLATED (for (for databricks_external_location, databricks.StorageCredential or databricks_credential) for the isolation_mode attribute. Alternatively, the isolation mode can be set using the UI or API by following this guide, this guide or this guide.

If the securable’s isolation mode was set to ISOLATED using Pulumi then the securable will have been automatically bound to the workspace it was created from.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as databricks from "@pulumi/databricks";

const sandbox = new databricks.Catalog("sandbox", {
    name: "sandbox",
    isolationMode: "ISOLATED",
});
const sandboxWorkspaceBinding = new databricks.WorkspaceBinding("sandbox", {
    securableName: sandbox.name,
    workspaceId: other.workspaceId,
});
Copy
import pulumi
import pulumi_databricks as databricks

sandbox = databricks.Catalog("sandbox",
    name="sandbox",
    isolation_mode="ISOLATED")
sandbox_workspace_binding = databricks.WorkspaceBinding("sandbox",
    securable_name=sandbox.name,
    workspace_id=other["workspaceId"])
Copy
package main

import (
	"github.com/pulumi/pulumi-databricks/sdk/go/databricks"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		sandbox, err := databricks.NewCatalog(ctx, "sandbox", &databricks.CatalogArgs{
			Name:          pulumi.String("sandbox"),
			IsolationMode: pulumi.String("ISOLATED"),
		})
		if err != nil {
			return err
		}
		_, err = databricks.NewWorkspaceBinding(ctx, "sandbox", &databricks.WorkspaceBindingArgs{
			SecurableName: sandbox.Name,
			WorkspaceId:   pulumi.Any(other.WorkspaceId),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Databricks = Pulumi.Databricks;

return await Deployment.RunAsync(() => 
{
    var sandbox = new Databricks.Catalog("sandbox", new()
    {
        Name = "sandbox",
        IsolationMode = "ISOLATED",
    });

    var sandboxWorkspaceBinding = new Databricks.WorkspaceBinding("sandbox", new()
    {
        SecurableName = sandbox.Name,
        WorkspaceId = other.WorkspaceId,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.databricks.Catalog;
import com.pulumi.databricks.CatalogArgs;
import com.pulumi.databricks.WorkspaceBinding;
import com.pulumi.databricks.WorkspaceBindingArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var sandbox = new Catalog("sandbox", CatalogArgs.builder()
            .name("sandbox")
            .isolationMode("ISOLATED")
            .build());

        var sandboxWorkspaceBinding = new WorkspaceBinding("sandboxWorkspaceBinding", WorkspaceBindingArgs.builder()
            .securableName(sandbox.name())
            .workspaceId(other.workspaceId())
            .build());

    }
}
Copy
resources:
  sandbox:
    type: databricks:Catalog
    properties:
      name: sandbox
      isolationMode: ISOLATED
  sandboxWorkspaceBinding:
    type: databricks:WorkspaceBinding
    name: sandbox
    properties:
      securableName: ${sandbox.name}
      workspaceId: ${other.workspaceId}
Copy

Create WorkspaceBinding Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new WorkspaceBinding(name: string, args?: WorkspaceBindingArgs, opts?: CustomResourceOptions);
@overload
def WorkspaceBinding(resource_name: str,
                     args: Optional[WorkspaceBindingArgs] = None,
                     opts: Optional[ResourceOptions] = None)

@overload
def WorkspaceBinding(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     binding_type: Optional[str] = None,
                     catalog_name: Optional[str] = None,
                     securable_name: Optional[str] = None,
                     securable_type: Optional[str] = None,
                     workspace_id: Optional[str] = None)
func NewWorkspaceBinding(ctx *Context, name string, args *WorkspaceBindingArgs, opts ...ResourceOption) (*WorkspaceBinding, error)
public WorkspaceBinding(string name, WorkspaceBindingArgs? args = null, CustomResourceOptions? opts = null)
public WorkspaceBinding(String name, WorkspaceBindingArgs args)
public WorkspaceBinding(String name, WorkspaceBindingArgs args, CustomResourceOptions options)
type: databricks:WorkspaceBinding
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args WorkspaceBindingArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args WorkspaceBindingArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args WorkspaceBindingArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args WorkspaceBindingArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. WorkspaceBindingArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var workspaceBindingResource = new Databricks.WorkspaceBinding("workspaceBindingResource", new()
{
    BindingType = "string",
    SecurableName = "string",
    SecurableType = "string",
    WorkspaceId = "string",
});
Copy
example, err := databricks.NewWorkspaceBinding(ctx, "workspaceBindingResource", &databricks.WorkspaceBindingArgs{
	BindingType:   pulumi.String("string"),
	SecurableName: pulumi.String("string"),
	SecurableType: pulumi.String("string"),
	WorkspaceId:   pulumi.String("string"),
})
Copy
var workspaceBindingResource = new WorkspaceBinding("workspaceBindingResource", WorkspaceBindingArgs.builder()
    .bindingType("string")
    .securableName("string")
    .securableType("string")
    .workspaceId("string")
    .build());
Copy
workspace_binding_resource = databricks.WorkspaceBinding("workspaceBindingResource",
    binding_type="string",
    securable_name="string",
    securable_type="string",
    workspace_id="string")
Copy
const workspaceBindingResource = new databricks.WorkspaceBinding("workspaceBindingResource", {
    bindingType: "string",
    securableName: "string",
    securableType: "string",
    workspaceId: "string",
});
Copy
type: databricks:WorkspaceBinding
properties:
    bindingType: string
    securableName: string
    securableType: string
    workspaceId: string
Copy

WorkspaceBinding Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The WorkspaceBinding resource accepts the following input properties:

BindingType Changes to this property will trigger replacement. string
Binding mode. Default to BINDING_TYPE_READ_WRITE. Possible values are BINDING_TYPE_READ_ONLY, BINDING_TYPE_READ_WRITE.
CatalogName Changes to this property will trigger replacement. string

Deprecated: Please use 'securable_name' and 'securable_type instead.

SecurableName string
Name of securable. Change forces creation of a new resource.
SecurableType Changes to this property will trigger replacement. string
Type of securable. Can be catalog, external_location, storage_credential or credential. Default to catalog. Change forces creation of a new resource.
WorkspaceId Changes to this property will trigger replacement. string
ID of the workspace. Change forces creation of a new resource.
BindingType Changes to this property will trigger replacement. string
Binding mode. Default to BINDING_TYPE_READ_WRITE. Possible values are BINDING_TYPE_READ_ONLY, BINDING_TYPE_READ_WRITE.
CatalogName Changes to this property will trigger replacement. string

Deprecated: Please use 'securable_name' and 'securable_type instead.

SecurableName string
Name of securable. Change forces creation of a new resource.
SecurableType Changes to this property will trigger replacement. string
Type of securable. Can be catalog, external_location, storage_credential or credential. Default to catalog. Change forces creation of a new resource.
WorkspaceId Changes to this property will trigger replacement. string
ID of the workspace. Change forces creation of a new resource.
bindingType Changes to this property will trigger replacement. String
Binding mode. Default to BINDING_TYPE_READ_WRITE. Possible values are BINDING_TYPE_READ_ONLY, BINDING_TYPE_READ_WRITE.
catalogName Changes to this property will trigger replacement. String

Deprecated: Please use 'securable_name' and 'securable_type instead.

securableName String
Name of securable. Change forces creation of a new resource.
securableType Changes to this property will trigger replacement. String
Type of securable. Can be catalog, external_location, storage_credential or credential. Default to catalog. Change forces creation of a new resource.
workspaceId Changes to this property will trigger replacement. String
ID of the workspace. Change forces creation of a new resource.
bindingType Changes to this property will trigger replacement. string
Binding mode. Default to BINDING_TYPE_READ_WRITE. Possible values are BINDING_TYPE_READ_ONLY, BINDING_TYPE_READ_WRITE.
catalogName Changes to this property will trigger replacement. string

Deprecated: Please use 'securable_name' and 'securable_type instead.

securableName string
Name of securable. Change forces creation of a new resource.
securableType Changes to this property will trigger replacement. string
Type of securable. Can be catalog, external_location, storage_credential or credential. Default to catalog. Change forces creation of a new resource.
workspaceId Changes to this property will trigger replacement. string
ID of the workspace. Change forces creation of a new resource.
binding_type Changes to this property will trigger replacement. str
Binding mode. Default to BINDING_TYPE_READ_WRITE. Possible values are BINDING_TYPE_READ_ONLY, BINDING_TYPE_READ_WRITE.
catalog_name Changes to this property will trigger replacement. str

Deprecated: Please use 'securable_name' and 'securable_type instead.

securable_name str
Name of securable. Change forces creation of a new resource.
securable_type Changes to this property will trigger replacement. str
Type of securable. Can be catalog, external_location, storage_credential or credential. Default to catalog. Change forces creation of a new resource.
workspace_id Changes to this property will trigger replacement. str
ID of the workspace. Change forces creation of a new resource.
bindingType Changes to this property will trigger replacement. String
Binding mode. Default to BINDING_TYPE_READ_WRITE. Possible values are BINDING_TYPE_READ_ONLY, BINDING_TYPE_READ_WRITE.
catalogName Changes to this property will trigger replacement. String

Deprecated: Please use 'securable_name' and 'securable_type instead.

securableName String
Name of securable. Change forces creation of a new resource.
securableType Changes to this property will trigger replacement. String
Type of securable. Can be catalog, external_location, storage_credential or credential. Default to catalog. Change forces creation of a new resource.
workspaceId Changes to this property will trigger replacement. String
ID of the workspace. Change forces creation of a new resource.

Outputs

All input properties are implicitly available as output properties. Additionally, the WorkspaceBinding resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing WorkspaceBinding Resource

Get an existing WorkspaceBinding resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: WorkspaceBindingState, opts?: CustomResourceOptions): WorkspaceBinding
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        binding_type: Optional[str] = None,
        catalog_name: Optional[str] = None,
        securable_name: Optional[str] = None,
        securable_type: Optional[str] = None,
        workspace_id: Optional[str] = None) -> WorkspaceBinding
func GetWorkspaceBinding(ctx *Context, name string, id IDInput, state *WorkspaceBindingState, opts ...ResourceOption) (*WorkspaceBinding, error)
public static WorkspaceBinding Get(string name, Input<string> id, WorkspaceBindingState? state, CustomResourceOptions? opts = null)
public static WorkspaceBinding get(String name, Output<String> id, WorkspaceBindingState state, CustomResourceOptions options)
resources:  _:    type: databricks:WorkspaceBinding    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
BindingType Changes to this property will trigger replacement. string
Binding mode. Default to BINDING_TYPE_READ_WRITE. Possible values are BINDING_TYPE_READ_ONLY, BINDING_TYPE_READ_WRITE.
CatalogName Changes to this property will trigger replacement. string

Deprecated: Please use 'securable_name' and 'securable_type instead.

SecurableName string
Name of securable. Change forces creation of a new resource.
SecurableType Changes to this property will trigger replacement. string
Type of securable. Can be catalog, external_location, storage_credential or credential. Default to catalog. Change forces creation of a new resource.
WorkspaceId Changes to this property will trigger replacement. string
ID of the workspace. Change forces creation of a new resource.
BindingType Changes to this property will trigger replacement. string
Binding mode. Default to BINDING_TYPE_READ_WRITE. Possible values are BINDING_TYPE_READ_ONLY, BINDING_TYPE_READ_WRITE.
CatalogName Changes to this property will trigger replacement. string

Deprecated: Please use 'securable_name' and 'securable_type instead.

SecurableName string
Name of securable. Change forces creation of a new resource.
SecurableType Changes to this property will trigger replacement. string
Type of securable. Can be catalog, external_location, storage_credential or credential. Default to catalog. Change forces creation of a new resource.
WorkspaceId Changes to this property will trigger replacement. string
ID of the workspace. Change forces creation of a new resource.
bindingType Changes to this property will trigger replacement. String
Binding mode. Default to BINDING_TYPE_READ_WRITE. Possible values are BINDING_TYPE_READ_ONLY, BINDING_TYPE_READ_WRITE.
catalogName Changes to this property will trigger replacement. String

Deprecated: Please use 'securable_name' and 'securable_type instead.

securableName String
Name of securable. Change forces creation of a new resource.
securableType Changes to this property will trigger replacement. String
Type of securable. Can be catalog, external_location, storage_credential or credential. Default to catalog. Change forces creation of a new resource.
workspaceId Changes to this property will trigger replacement. String
ID of the workspace. Change forces creation of a new resource.
bindingType Changes to this property will trigger replacement. string
Binding mode. Default to BINDING_TYPE_READ_WRITE. Possible values are BINDING_TYPE_READ_ONLY, BINDING_TYPE_READ_WRITE.
catalogName Changes to this property will trigger replacement. string

Deprecated: Please use 'securable_name' and 'securable_type instead.

securableName string
Name of securable. Change forces creation of a new resource.
securableType Changes to this property will trigger replacement. string
Type of securable. Can be catalog, external_location, storage_credential or credential. Default to catalog. Change forces creation of a new resource.
workspaceId Changes to this property will trigger replacement. string
ID of the workspace. Change forces creation of a new resource.
binding_type Changes to this property will trigger replacement. str
Binding mode. Default to BINDING_TYPE_READ_WRITE. Possible values are BINDING_TYPE_READ_ONLY, BINDING_TYPE_READ_WRITE.
catalog_name Changes to this property will trigger replacement. str

Deprecated: Please use 'securable_name' and 'securable_type instead.

securable_name str
Name of securable. Change forces creation of a new resource.
securable_type Changes to this property will trigger replacement. str
Type of securable. Can be catalog, external_location, storage_credential or credential. Default to catalog. Change forces creation of a new resource.
workspace_id Changes to this property will trigger replacement. str
ID of the workspace. Change forces creation of a new resource.
bindingType Changes to this property will trigger replacement. String
Binding mode. Default to BINDING_TYPE_READ_WRITE. Possible values are BINDING_TYPE_READ_ONLY, BINDING_TYPE_READ_WRITE.
catalogName Changes to this property will trigger replacement. String

Deprecated: Please use 'securable_name' and 'securable_type instead.

securableName String
Name of securable. Change forces creation of a new resource.
securableType Changes to this property will trigger replacement. String
Type of securable. Can be catalog, external_location, storage_credential or credential. Default to catalog. Change forces creation of a new resource.
workspaceId Changes to this property will trigger replacement. String
ID of the workspace. Change forces creation of a new resource.

Import

This resource can be imported by using combination of workspace ID, securable type and name:

$ pulumi import databricks:index/workspaceBinding:WorkspaceBinding this "<workspace_id>|<securable_type>|<securable_name>"
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
databricks pulumi/pulumi-databricks
License
Apache-2.0
Notes
This Pulumi package is based on the databricks Terraform Provider.