Skip to content

InstancePool

laktory.models.resources.databricks.InstancePool ¤

Bases: InstancePoolBase

Databricks instance pool

Examples:

import io

from laktory import models

instance_pool_yaml = '''
instance_pool_name: default
node_type_id: Standard_DS3_v2
min_idle_instances: 0
idle_instance_autotermination_minutes: 10
access_controls:
- group_name: role-engineers
  permission_level: CAN_ATTACH_TO
'''
instance_pool = models.resources.databricks.InstancePool.model_validate_yaml(
    io.StringIO(instance_pool_yaml)
)
References
BASE DESCRIPTION
aws_attributes

TYPE: InstancePoolAwsAttributes | None | VariableType DEFAULT: None

azure_attributes

TYPE: InstancePoolAzureAttributes | None | VariableType DEFAULT: None

custom_tags

(Map) Additional tags for instance pool resources. Databricks tags all pool resources (e.g. AWS & Azure instances and Disk volumes). The tags of the instance pool will propagate to the clusters using the pool (see the official documentation). Attempting to set the same tags in both cluster and instance pool will raise an error. Databricks allows at most 43 custom tags.

TYPE: dict[str, str] | None | VariableType DEFAULT: None

disk_spec

TYPE: InstancePoolDiskSpec | None | VariableType DEFAULT: None

enable_elastic_disk

(Bool) Autoscaling Local Storage: when enabled, the instances in the pool dynamically acquire additional disk space when they are running low on disk space

TYPE: bool | None | VariableType DEFAULT: None

gcp_attributes

TYPE: InstancePoolGcpAttributes | None | VariableType DEFAULT: None

idle_instance_autotermination_minutes

(Integer) The number of minutes that idle instances in excess of the min_idle_instances are maintained by the pool before being terminated. If not specified, excess idle instances are terminated automatically after a default timeout period. If specified, the time must be between 0 and 10000 minutes. If you specify 0, excess idle instances are removed as soon as possible

TYPE: int | VariableType

instance_pool_fleet_attributes

TYPE: InstancePoolInstancePoolFleetAttributes | None | VariableType DEFAULT: None

instance_pool_id

TYPE: str | None | VariableType DEFAULT: None

instance_pool_name

(String) The name of the instance pool. This is required for create and edit operations. It must be unique, non-empty, and less than 100 characters

TYPE: str | VariableType

max_capacity

(Integer) The maximum number of instances the pool can contain, including both idle instances and ones in use by clusters. Once the maximum capacity is reached, you cannot create new clusters from the pool and existing clusters cannot autoscale up until some instances are made idle in the pool via cluster termination or down-scaling. There is no default limit, but as a best practice, this should be set based on anticipated usage

TYPE: int | None | VariableType DEFAULT: None

min_idle_instances

(Integer) The minimum number of idle instances maintained by the pool. This is in addition to any instances in use by active clusters

TYPE: int | None | VariableType DEFAULT: None

node_type_flexibility

a block describing the alternative driver node types if node_type_id isn't available

TYPE: InstancePoolNodeTypeFlexibility | None | VariableType DEFAULT: None

node_type_id

(String) The node type for the instances in the pool. All clusters attached to the pool inherit this node type and the pool's idle instances are allocated based on this type. You can retrieve a list of available node types by using the List Node Types API call

TYPE: str | None | VariableType DEFAULT: None

preloaded_docker_image

TYPE: list[InstancePoolPreloadedDockerImage] | None | VariableType DEFAULT: None

preloaded_spark_versions

(List) A list with at most one runtime version the pool installs on each instance. Pool clusters that use a preloaded runtime version start faster as they do not have to wait for the image to download. You can retrieve them via databricks_spark_version data source or via Runtime Versions API call

TYPE: list[str] | None | VariableType DEFAULT: None

LAKTORY DESCRIPTION
access_controls

List of access controls

TYPE: list[AccessControl | VariableType] | VariableType DEFAULT: []

ATTRIBUTE DESCRIPTION
additional_core_resources
  • permissions

TYPE: list

additional_core_resources property ¤

  • permissions

laktory.models.resources.databricks.instancepool.InstancePoolAwsAttributes ¤

Bases: BaseModel

PARAMETER DESCRIPTION
availability

Availability type used for all nodes. Valid values are SPOT_AZURE and ON_DEMAND_AZURE

TYPE: str | None | VariableType DEFAULT: None

instance_profile_arn

Nodes belonging to the pool will only be placed on AWS instances with this instance profile. Please see databricks_instance_profile resource documentation for extended examples on adding a valid instance profile using Terraform

TYPE: str | None | VariableType DEFAULT: None

spot_bid_price_percent

(Integer) The max price for AWS spot instances, as a percentage of the corresponding instance type's on-demand price. For example, if this field is set to 50, and the instance pool needs a new i3.xlarge spot instance, then the max price is half of the price of on-demand i3.xlarge instances. Similarly, if this field is set to 200, the max price is twice the price of on-demand i3.xlarge instances. If not specified, the default value is 100. When spot instances are requested for this instance pool, only spot instances whose max price percentage matches this field are considered. For safety, this field cannot be greater than 10000.

TYPE: int | None | VariableType DEFAULT: None

zone_id

Identifier for the availability zone/datacenter in which the cluster resides. This string will be of a form like us-central1-a. The provided availability zone must be in the same region as the Databricks workspace

TYPE: str | None | VariableType DEFAULT: None


laktory.models.resources.databricks.instancepool.InstancePoolAzureAttributes ¤

Bases: BaseModel

PARAMETER DESCRIPTION
availability

Availability type used for all nodes. Valid values are SPOT_AZURE and ON_DEMAND_AZURE

TYPE: str | None | VariableType DEFAULT: None

spot_bid_max_price

The max bid price used for Azure spot instances. You can set this to greater than or equal to the current spot price. You can also set this to -1, which specifies that the instance cannot be evicted on the basis of price. The price for the instance will be the current price for spot instances or the price for a standard instance

TYPE: float | None | VariableType DEFAULT: None


laktory.models.resources.databricks.instancepool.InstancePoolDiskSpec ¤

Bases: BaseModel

PARAMETER DESCRIPTION
disk_count

(Integer) The number of disks to attach to each instance. This feature is only enabled for supported node types. Users can choose up to the limit of the disks supported by the node type. For node types with no local disk, at least one disk needs to be specified

TYPE: int | None | VariableType DEFAULT: None

disk_size

(Integer) The size of each disk (in GiB) to attach

TYPE: int | None | VariableType DEFAULT: None

disk_type

TYPE: InstancePoolDiskSpecDiskType | None | VariableType DEFAULT: None


laktory.models.resources.databricks.instancepool.InstancePoolDiskSpecDiskType ¤

Bases: BaseModel

PARAMETER DESCRIPTION
azure_disk_volume_type

TYPE: str | None | VariableType DEFAULT: None

ebs_volume_type

TYPE: str | None | VariableType DEFAULT: None


laktory.models.resources.databricks.instancepool.InstancePoolGcpAttributes ¤

Bases: BaseModel

PARAMETER DESCRIPTION
gcp_availability

Availability type used for all nodes. Valid values are PREEMPTIBLE_GCP, PREEMPTIBLE_WITH_FALLBACK_GCP and ON_DEMAND_GCP, default: ON_DEMAND_GCP. * local_ssd_count (Optional, Int) Number of local SSD disks (each is 375GB in size) that will be attached to each node of the cluster

TYPE: str | None | VariableType DEFAULT: None

local_ssd_count

TYPE: int | None | VariableType DEFAULT: None

zone_id

Identifier for the availability zone/datacenter in which the cluster resides. This string will be of a form like us-central1-a. The provided availability zone must be in the same region as the Databricks workspace

TYPE: str | None | VariableType DEFAULT: None


laktory.models.resources.databricks.instancepool.InstancePoolInstancePoolFleetAttributes ¤

Bases: BaseModel

PARAMETER DESCRIPTION
fleet_on_demand_option

TYPE: InstancePoolInstancePoolFleetAttributesFleetOnDemandOption | None | VariableType DEFAULT: None

fleet_spot_option

TYPE: InstancePoolInstancePoolFleetAttributesFleetSpotOption | None | VariableType DEFAULT: None

launch_template_override

TYPE: list[InstancePoolInstancePoolFleetAttributesLaunchTemplateOverride] | None | VariableType DEFAULT: None


laktory.models.resources.databricks.instancepool.InstancePoolInstancePoolFleetAttributesFleetOnDemandOption ¤

Bases: BaseModel

PARAMETER DESCRIPTION
allocation_strategy

TYPE: str | VariableType

instance_pools_to_use_count

TYPE: int | None | VariableType DEFAULT: None


laktory.models.resources.databricks.instancepool.InstancePoolInstancePoolFleetAttributesFleetSpotOption ¤

Bases: BaseModel

PARAMETER DESCRIPTION
allocation_strategy

TYPE: str | VariableType

instance_pools_to_use_count

TYPE: int | None | VariableType DEFAULT: None


laktory.models.resources.databricks.instancepool.InstancePoolInstancePoolFleetAttributesLaunchTemplateOverride ¤

Bases: BaseModel

PARAMETER DESCRIPTION
availability_zone

TYPE: str | VariableType

instance_type

TYPE: str | VariableType


laktory.models.resources.databricks.instancepool.InstancePoolNodeTypeFlexibility ¤

Bases: BaseModel

PARAMETER DESCRIPTION
alternate_node_type_ids

list of alternative node types that will be used if main node type isn't available. Follow the documentation for requirements on selection of alternative node types

TYPE: list[str] | VariableType


laktory.models.resources.databricks.instancepool.InstancePoolPreloadedDockerImage ¤

Bases: BaseModel

PARAMETER DESCRIPTION
basic_auth

basic_auth.username and basic_auth.password for Docker repository. Docker registry credentials are encrypted when they are stored in Databricks internal storage and when they are passed to a registry upon fetching Docker images at cluster launch. For better security, these credentials should be stored in the secret scope and referred using secret path syntax: {{secrets/scope/key}}, otherwise other users of the workspace may access them via UI/API

TYPE: InstancePoolPreloadedDockerImageBasicAuth | None | VariableType DEFAULT: None

url

URL for the Docker image

TYPE: str | VariableType


laktory.models.resources.databricks.instancepool.InstancePoolPreloadedDockerImageBasicAuth ¤

Bases: BaseModel

PARAMETER DESCRIPTION
password

TYPE: str | VariableType

username

TYPE: str | VariableType