published on Monday, Mar 9, 2026 by Pulumi
published on Monday, Mar 9, 2026 by Pulumi
Installs a library on databricks_cluster. Each different type of library has a slightly different syntax. It’s possible to set only one type of library within one resource. Otherwise, the plan will fail with an error.
Note
databricks.Libraryresource would always start the associated cluster if it’s not running, so make sure to have auto-termination configured. It’s not possible to atomically change the version of the same library without cluster restart. Libraries are fully removed from the cluster only after restart.
Java/Scala JAR
import * as pulumi from "@pulumi/pulumi";
import * as databricks from "@pulumi/databricks";
const appDbfsFile = new databricks.DbfsFile("appDbfsFile", {
source: `${path.module}/app-0.0.1.jar`,
path: "/FileStore/app-0.0.1.jar",
});
const appLibrary = new databricks.Library("appLibrary", {
clusterId: databricks_cluster["this"].id,
jar: appDbfsFile.dbfsPath,
});
import pulumi
import pulumi_databricks as databricks
app_dbfs_file = databricks.DbfsFile("appDbfsFile",
source=f"{path['module']}/app-0.0.1.jar",
path="/FileStore/app-0.0.1.jar")
app_library = databricks.Library("appLibrary",
cluster_id=databricks_cluster["this"]["id"],
jar=app_dbfs_file.dbfs_path)
using Pulumi;
using Databricks = Pulumi.Databricks;
class MyStack : Stack
{
public MyStack()
{
var appDbfsFile = new Databricks.DbfsFile("appDbfsFile", new Databricks.DbfsFileArgs
{
Source = $"{path.Module}/app-0.0.1.jar",
Path = "/FileStore/app-0.0.1.jar",
});
var appLibrary = new Databricks.Library("appLibrary", new Databricks.LibraryArgs
{
ClusterId = databricks_cluster.This.Id,
Jar = appDbfsFile.DbfsPath,
});
}
}
package main
import (
"fmt"
"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 {
appDbfsFile, err := databricks.NewDbfsFile(ctx, "appDbfsFile", &databricks.DbfsFileArgs{
Source: pulumi.String(fmt.Sprintf("%v%v", path.Module, "/app-0.0.1.jar")),
Path: pulumi.String("/FileStore/app-0.0.1.jar"),
})
if err != nil {
return err
}
_, err = databricks.NewLibrary(ctx, "appLibrary", &databricks.LibraryArgs{
ClusterId: pulumi.Any(databricks_cluster.This.Id),
Jar: appDbfsFile.DbfsPath,
})
if err != nil {
return err
}
return nil
})
}
Java/Scala Maven
Installing artifacts from Maven repository. You can also optionally specify a repo parameter for custom Maven-style repository, that should be accessible without any authentication. Maven libraries are resolved in Databricks Control Plane, so repo should be accessible from it. It can even be properly configured maven s3 wagon, AWS CodeArtifact or Azure Artifacts.
import * as pulumi from "@pulumi/pulumi";
import * as databricks from "@pulumi/databricks";
const deequ = new databricks.Library("deequ", {
clusterId: databricks_cluster["this"].id,
maven: {
coordinates: "com.amazon.deequ:deequ:1.0.4",
exclusions: ["org.apache.avro:avro"],
},
});
import pulumi
import pulumi_databricks as databricks
deequ = databricks.Library("deequ",
cluster_id=databricks_cluster["this"]["id"],
maven=databricks.LibraryMavenArgs(
coordinates="com.amazon.deequ:deequ:1.0.4",
exclusions=["org.apache.avro:avro"],
))
using Pulumi;
using Databricks = Pulumi.Databricks;
class MyStack : Stack
{
public MyStack()
{
var deequ = new Databricks.Library("deequ", new Databricks.LibraryArgs
{
ClusterId = databricks_cluster.This.Id,
Maven = new Databricks.Inputs.LibraryMavenArgs
{
Coordinates = "com.amazon.deequ:deequ:1.0.4",
Exclusions =
{
"org.apache.avro:avro",
},
},
});
}
}
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 {
_, err := databricks.NewLibrary(ctx, "deequ", &databricks.LibraryArgs{
ClusterId: pulumi.Any(databricks_cluster.This.Id),
Maven: &LibraryMavenArgs{
Coordinates: pulumi.String("com.amazon.deequ:deequ:1.0.4"),
Exclusions: pulumi.StringArray{
pulumi.String("org.apache.avro:avro"),
},
},
})
if err != nil {
return err
}
return nil
})
}
Python Wheel
import * as pulumi from "@pulumi/pulumi";
import * as databricks from "@pulumi/databricks";
const appDbfsFile = new databricks.DbfsFile("appDbfsFile", {
source: `${path.module}/baz.whl`,
path: "/FileStore/baz.whl",
});
const appLibrary = new databricks.Library("appLibrary", {
clusterId: databricks_cluster["this"].id,
whl: appDbfsFile.dbfsPath,
});
import pulumi
import pulumi_databricks as databricks
app_dbfs_file = databricks.DbfsFile("appDbfsFile",
source=f"{path['module']}/baz.whl",
path="/FileStore/baz.whl")
app_library = databricks.Library("appLibrary",
cluster_id=databricks_cluster["this"]["id"],
whl=app_dbfs_file.dbfs_path)
using Pulumi;
using Databricks = Pulumi.Databricks;
class MyStack : Stack
{
public MyStack()
{
var appDbfsFile = new Databricks.DbfsFile("appDbfsFile", new Databricks.DbfsFileArgs
{
Source = $"{path.Module}/baz.whl",
Path = "/FileStore/baz.whl",
});
var appLibrary = new Databricks.Library("appLibrary", new Databricks.LibraryArgs
{
ClusterId = databricks_cluster.This.Id,
Whl = appDbfsFile.DbfsPath,
});
}
}
package main
import (
"fmt"
"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 {
appDbfsFile, err := databricks.NewDbfsFile(ctx, "appDbfsFile", &databricks.DbfsFileArgs{
Source: pulumi.String(fmt.Sprintf("%v%v", path.Module, "/baz.whl")),
Path: pulumi.String("/FileStore/baz.whl"),
})
if err != nil {
return err
}
_, err = databricks.NewLibrary(ctx, "appLibrary", &databricks.LibraryArgs{
ClusterId: pulumi.Any(databricks_cluster.This.Id),
Whl: appDbfsFile.DbfsPath,
})
if err != nil {
return err
}
return nil
})
}
Python PyPI
Installing Python PyPI artifacts. You can optionally also specify the repo parameter for custom PyPI mirror, which should be accessible without any authentication for the network that cluster runs in.
Note
repohost should be accessible from Internet by Databricks control plane. If connectivity to custom PyPI repositories is required, please modify cluster-node/etc/pip.confthrough databricks_global_init_script.
import * as pulumi from "@pulumi/pulumi";
import * as databricks from "@pulumi/databricks";
const fbprophet = new databricks.Library("fbprophet", {
clusterId: databricks_cluster["this"].id,
pypi: {
"package": "fbprophet==0.6",
},
});
import pulumi
import pulumi_databricks as databricks
fbprophet = databricks.Library("fbprophet",
cluster_id=databricks_cluster["this"]["id"],
pypi=databricks.LibraryPypiArgs(
package="fbprophet==0.6",
))
using Pulumi;
using Databricks = Pulumi.Databricks;
class MyStack : Stack
{
public MyStack()
{
var fbprophet = new Databricks.Library("fbprophet", new Databricks.LibraryArgs
{
ClusterId = databricks_cluster.This.Id,
Pypi = new Databricks.Inputs.LibraryPypiArgs
{
Package = "fbprophet==0.6",
},
});
}
}
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 {
_, err := databricks.NewLibrary(ctx, "fbprophet", &databricks.LibraryArgs{
ClusterId: pulumi.Any(databricks_cluster.This.Id),
Pypi: &LibraryPypiArgs{
Package: pulumi.String("fbprophet==0.6"),
},
})
if err != nil {
return err
}
return nil
})
}
Python EGG
import * as pulumi from "@pulumi/pulumi";
import * as databricks from "@pulumi/databricks";
const appDbfsFile = new databricks.DbfsFile("appDbfsFile", {
source: `${path.module}/foo.egg`,
path: "/FileStore/foo.egg",
});
const appLibrary = new databricks.Library("appLibrary", {
clusterId: databricks_cluster["this"].id,
egg: appDbfsFile.dbfsPath,
});
import pulumi
import pulumi_databricks as databricks
app_dbfs_file = databricks.DbfsFile("appDbfsFile",
source=f"{path['module']}/foo.egg",
path="/FileStore/foo.egg")
app_library = databricks.Library("appLibrary",
cluster_id=databricks_cluster["this"]["id"],
egg=app_dbfs_file.dbfs_path)
using Pulumi;
using Databricks = Pulumi.Databricks;
class MyStack : Stack
{
public MyStack()
{
var appDbfsFile = new Databricks.DbfsFile("appDbfsFile", new Databricks.DbfsFileArgs
{
Source = $"{path.Module}/foo.egg",
Path = "/FileStore/foo.egg",
});
var appLibrary = new Databricks.Library("appLibrary", new Databricks.LibraryArgs
{
ClusterId = databricks_cluster.This.Id,
Egg = appDbfsFile.DbfsPath,
});
}
}
package main
import (
"fmt"
"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 {
appDbfsFile, err := databricks.NewDbfsFile(ctx, "appDbfsFile", &databricks.DbfsFileArgs{
Source: pulumi.String(fmt.Sprintf("%v%v", path.Module, "/foo.egg")),
Path: pulumi.String("/FileStore/foo.egg"),
})
if err != nil {
return err
}
_, err = databricks.NewLibrary(ctx, "appLibrary", &databricks.LibraryArgs{
ClusterId: pulumi.Any(databricks_cluster.This.Id),
Egg: appDbfsFile.DbfsPath,
})
if err != nil {
return err
}
return nil
})
}
R CRan
Installing artifacts from CRan. You can also optionally specify a repo parameter for a custom cran mirror.
import * as pulumi from "@pulumi/pulumi";
import * as databricks from "@pulumi/databricks";
const rkeops = new databricks.Library("rkeops", {
clusterId: databricks_cluster["this"].id,
cran: {
"package": "rkeops",
},
});
import pulumi
import pulumi_databricks as databricks
rkeops = databricks.Library("rkeops",
cluster_id=databricks_cluster["this"]["id"],
cran=databricks.LibraryCranArgs(
package="rkeops",
))
using Pulumi;
using Databricks = Pulumi.Databricks;
class MyStack : Stack
{
public MyStack()
{
var rkeops = new Databricks.Library("rkeops", new Databricks.LibraryArgs
{
ClusterId = databricks_cluster.This.Id,
Cran = new Databricks.Inputs.LibraryCranArgs
{
Package = "rkeops",
},
});
}
}
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 {
_, err := databricks.NewLibrary(ctx, "rkeops", &databricks.LibraryArgs{
ClusterId: pulumi.Any(databricks_cluster.This.Id),
Cran: &LibraryCranArgs{
Package: pulumi.String("rkeops"),
},
})
if err != nil {
return err
}
return nil
})
}
Related Resources
The following resources are often used in the same context:
- End to end workspace management guide.
- databricks.getClusters data to retrieve a list of databricks.Cluster ids.
- databricks.Cluster to create Databricks Clusters.
- databricks.ClusterPolicy to create a databricks.Cluster policy, which limits the ability to create clusters based on a set of rules.
- databricks.DbfsFile data to get file content from Databricks File System (DBFS).
- databricks.getDbfsFilePaths data to get list of file names from get file content from Databricks File System (DBFS).
- databricks.DbfsFile to manage relatively small files on Databricks File System (DBFS).
- databricks.GlobalInitScript to manage global init scripts, which are run on all databricks.Cluster and databricks_job.
- databricks.Job to manage Databricks Jobs to run non-interactive code in a databricks_cluster.
- databricks.Mount to mount your cloud storage on
dbfs:/mnt/name. - databricks.Pipeline to deploy Delta Live Tables.
- databricks.Repo to manage Databricks Repos.
Create Library Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Library(name: string, args: LibraryArgs, opts?: CustomResourceOptions);@overload
def Library(resource_name: str,
args: LibraryArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Library(resource_name: str,
opts: Optional[ResourceOptions] = None,
cluster_id: Optional[str] = None,
cran: Optional[LibraryCranArgs] = None,
egg: Optional[str] = None,
jar: Optional[str] = None,
maven: Optional[LibraryMavenArgs] = None,
pypi: Optional[LibraryPypiArgs] = None,
whl: Optional[str] = None)func NewLibrary(ctx *Context, name string, args LibraryArgs, opts ...ResourceOption) (*Library, error)public Library(string name, LibraryArgs args, CustomResourceOptions? opts = null)
public Library(String name, LibraryArgs args)
public Library(String name, LibraryArgs args, CustomResourceOptions options)
type: databricks:Library
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args LibraryArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args LibraryArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args LibraryArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args LibraryArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args LibraryArgs
- 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 libraryResource = new Databricks.Library("libraryResource", new()
{
ClusterId = "string",
Cran = new Databricks.Inputs.LibraryCranArgs
{
Package = "string",
Repo = "string",
},
Egg = "string",
Jar = "string",
Maven = new Databricks.Inputs.LibraryMavenArgs
{
Coordinates = "string",
Exclusions = new[]
{
"string",
},
Repo = "string",
},
Pypi = new Databricks.Inputs.LibraryPypiArgs
{
Package = "string",
Repo = "string",
},
Whl = "string",
});
example, err := databricks.NewLibrary(ctx, "libraryResource", &databricks.LibraryArgs{
ClusterId: pulumi.String("string"),
Cran: &databricks.LibraryCranArgs{
Package: pulumi.String("string"),
Repo: pulumi.String("string"),
},
Egg: pulumi.String("string"),
Jar: pulumi.String("string"),
Maven: &databricks.LibraryMavenArgs{
Coordinates: pulumi.String("string"),
Exclusions: pulumi.StringArray{
pulumi.String("string"),
},
Repo: pulumi.String("string"),
},
Pypi: &databricks.LibraryPypiArgs{
Package: pulumi.String("string"),
Repo: pulumi.String("string"),
},
Whl: pulumi.String("string"),
})
var libraryResource = new Library("libraryResource", LibraryArgs.builder()
.clusterId("string")
.cran(LibraryCranArgs.builder()
.package_("string")
.repo("string")
.build())
.egg("string")
.jar("string")
.maven(LibraryMavenArgs.builder()
.coordinates("string")
.exclusions("string")
.repo("string")
.build())
.pypi(LibraryPypiArgs.builder()
.package_("string")
.repo("string")
.build())
.whl("string")
.build());
library_resource = databricks.Library("libraryResource",
cluster_id="string",
cran={
"package": "string",
"repo": "string",
},
egg="string",
jar="string",
maven={
"coordinates": "string",
"exclusions": ["string"],
"repo": "string",
},
pypi={
"package": "string",
"repo": "string",
},
whl="string")
const libraryResource = new databricks.Library("libraryResource", {
clusterId: "string",
cran: {
"package": "string",
repo: "string",
},
egg: "string",
jar: "string",
maven: {
coordinates: "string",
exclusions: ["string"],
repo: "string",
},
pypi: {
"package": "string",
repo: "string",
},
whl: "string",
});
type: databricks:Library
properties:
clusterId: string
cran:
package: string
repo: string
egg: string
jar: string
maven:
coordinates: string
exclusions:
- string
repo: string
pypi:
package: string
repo: string
whl: string
Library 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 Library resource accepts the following input properties:
- Cluster
Id string - Cran
Library
Cran - Egg string
- Jar string
- Maven
Library
Maven - Pypi
Library
Pypi - Whl string
- Cluster
Id string - Cran
Library
Cran Args - Egg string
- Jar string
- Maven
Library
Maven Args - Pypi
Library
Pypi Args - Whl string
- cluster
Id String - cran
Library
Cran - egg String
- jar String
- maven
Library
Maven - pypi
Library
Pypi - whl String
- cluster
Id string - cran
Library
Cran - egg string
- jar string
- maven
Library
Maven - pypi
Library
Pypi - whl string
- cluster
Id String - cran Property Map
- egg String
- jar String
- maven Property Map
- pypi Property Map
- whl String
Outputs
All input properties are implicitly available as output properties. Additionally, the Library 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 Library Resource
Get an existing Library 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?: LibraryState, opts?: CustomResourceOptions): Library@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
cluster_id: Optional[str] = None,
cran: Optional[LibraryCranArgs] = None,
egg: Optional[str] = None,
jar: Optional[str] = None,
maven: Optional[LibraryMavenArgs] = None,
pypi: Optional[LibraryPypiArgs] = None,
whl: Optional[str] = None) -> Libraryfunc GetLibrary(ctx *Context, name string, id IDInput, state *LibraryState, opts ...ResourceOption) (*Library, error)public static Library Get(string name, Input<string> id, LibraryState? state, CustomResourceOptions? opts = null)public static Library get(String name, Output<String> id, LibraryState state, CustomResourceOptions options)resources: _: type: databricks:Library get: id: ${id}- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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.
- Cluster
Id string - Cran
Library
Cran - Egg string
- Jar string
- Maven
Library
Maven - Pypi
Library
Pypi - Whl string
- Cluster
Id string - Cran
Library
Cran Args - Egg string
- Jar string
- Maven
Library
Maven Args - Pypi
Library
Pypi Args - Whl string
- cluster
Id String - cran
Library
Cran - egg String
- jar String
- maven
Library
Maven - pypi
Library
Pypi - whl String
- cluster
Id string - cran
Library
Cran - egg string
- jar string
- maven
Library
Maven - pypi
Library
Pypi - whl string
- cluster
Id String - cran Property Map
- egg String
- jar String
- maven Property Map
- pypi Property Map
- whl String
Supporting Types
LibraryCran, LibraryCranArgs
LibraryMaven, LibraryMavenArgs
- Coordinates string
- Exclusions List<string>
- Repo string
- Coordinates string
- Exclusions []string
- Repo string
- coordinates String
- exclusions List<String>
- repo String
- coordinates string
- exclusions string[]
- repo string
- coordinates str
- exclusions Sequence[str]
- repo str
- coordinates String
- exclusions List<String>
- repo String
LibraryPypi, LibraryPypiArgs
Import
-> Note Importing this resource is not currently supported.
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
databricksTerraform Provider.
published on Monday, Mar 9, 2026 by Pulumi
