Cluster Policies

Package: databricks.bundles.cluster_policies

Classes

class ClusterPolicy
definition: Any | None = None

Policy definition document expressed in Databricks Cluster Policy Definition Language.

description: str | None = None

Additional human-readable description of the cluster policy.

libraries: list[Library]

A list of libraries to be installed on the next cluster restart that uses this policy. The maximum number of libraries is 500.

lifecycle: Lifecycle | None = None
max_clusters_per_user: int | None = None

Max number of clusters per user that can be active using this policy. If not present, there is no max limit.

name: str | None = None

Cluster Policy name requested by the user. This has to be unique. Length must be between 1 and 100 characters.

permissions: list[ClusterPolicyPermission]

The permissions to apply to this resource.

policy_family_definition_overrides: Any | None = None

Policy definition JSON document expressed in Databricks Policy Definition Language. The JSON document must be passed as a string and cannot be embedded in the requests.

You can use this to customize the policy definition inherited from the policy family. Policy rules specified here are merged into the inherited policy definition.

policy_family_id: str | None = None

ID of the policy family. The cluster policy’s policy definition inherits the policy family’s policy definition.

Cannot be used with definition. Use policy_family_definition_overrides instead to customize the policy definition.

classmethod from_dict(
value: dict,
) → Self
as_dict(
self,
) → dict
class ClusterPolicyPermission
level: ClusterPolicyPermissionLevel

The permission level to apply. Cluster policies only support CAN_USE.

group_name: str | None = None

The name of the group granted the permission level.

service_principal_name: str | None = None

The name of the service principal granted the permission level.

user_name: str | None = None

The name of the user granted the permission level.

classmethod from_dict(
value: dict,
) → Self
as_dict(
self,
) → dict
class ClusterPolicyPermissionLevel

Permission level

CAN_USE = 'CAN_USE'
class Library
cran: RCranLibrary | None = None

Specification of a CRAN library to be installed as part of the library

egg: str | None = None

[DEPRECATED] Deprecated. URI of the egg library to install. Installing Python egg files is deprecated and is not supported in Databricks Runtime 14.0 and above.

jar: str | None = None

URI of the JAR library to install. Supported URIs include Workspace paths, Unity Catalog Volumes paths, and S3 URIs. For example: { “jar”: “/Workspace/path/to/library.jar” }, { “jar” : “/Volumes/path/to/library.jar” } or { “jar”: “s3://my-bucket/library.jar” }. If S3 is used, please make sure the cluster has read access on the library. You may need to launch the cluster with an IAM role to access the S3 URI.

maven: MavenLibrary | None = None

Specification of a maven library to be installed. For example: { “coordinates”: “org.jsoup:jsoup:1.7.2” }

pypi: PythonPyPiLibrary | None = None

Specification of a PyPi library to be installed. For example: { “package”: “simplejson” }

requirements: str | None = None

URI of the requirements.txt file to install. Only Workspace paths and Unity Catalog Volumes paths are supported. For example: { “requirements”: “/Workspace/path/to/requirements.txt” } or { “requirements” : “/Volumes/path/to/requirements.txt” }

whl: str | None = None

URI of the wheel library to install. Supported URIs include Workspace paths, Unity Catalog Volumes paths, and S3 URIs. For example: { “whl”: “/Workspace/path/to/library.whl” }, { “whl” : “/Volumes/path/to/library.whl” } or { “whl”: “s3://my-bucket/library.whl” }. If S3 is used, please make sure the cluster has read access on the library. You may need to launch the cluster with an IAM role to access the S3 URI.

classmethod from_dict(
value: dict,
) → Self
as_dict(
self,
) → dict
class Lifecycle
prevent_destroy: bool | None = None

Lifecycle setting to prevent the resource from being destroyed.

classmethod from_dict(
value: dict,
) → Self
as_dict(
self,
) → dict
class MavenLibrary
coordinates: str

Gradle-style maven coordinates. For example: “org.jsoup:jsoup:1.7.2”.

exclusions: list[str]

List of dependences to exclude. For example: [“slf4j:slf4j”, “*:hadoop-client”].

Maven dependency exclusions: https://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html.

repo: str | None = None

Maven repo to install the Maven package from. If omitted, both Maven Central Repository and Spark Packages are searched.

classmethod from_dict(
value: dict,
) → Self
as_dict(
self,
) → dict
class PythonPyPiLibrary
package: str

The name of the pypi package to install. An optional exact version specification is also supported. Examples: “simplejson” and “simplejson==3.8.0”.

repo: str | None = None

The repository where the package can be found. If not specified, the default pip index is used.

classmethod from_dict(
value: dict,
) → Self
as_dict(
self,
) → dict
class RCranLibrary
package: str

The name of the CRAN package to install.

repo: str | None = None

The repository where the package can be found. If not specified, the default CRAN repo is used.

classmethod from_dict(
value: dict,
) → Self
as_dict(
self,
) → dict