Skip to content

PostgresEndpoint

laktory.models.resources.databricks.PostgresEndpoint ¤

Bases: PostgresEndpointBase

Lakebase Autoscaling (Postgres) Endpoint

Compute (read-write or read-only) serving a branch, with autoscaling limits and scale to zero. A read-write endpoint named primary is created implicitly with each branch: set replace_existing: true to manage it. Can also be declared in the endpoints of a PostgresBranch.

Lakebase Autoscaling resources don't detect changes made outside Terraform, and a value removed from spec is kept by the server.

Examples:

import io

from laktory import models

endpoint_yaml = '''
parent: projects/app/branches/production
endpoint_id: primary
replace_existing: true
spec:
  endpoint_type: ENDPOINT_TYPE_READ_WRITE
  autoscaling_limit_min_cu: 0.5
  autoscaling_limit_max_cu: 4.0
  suspend_timeout_duration: 600s
'''
endpoint = models.resources.databricks.PostgresEndpoint.model_validate_yaml(
    io.StringIO(endpoint_yaml)
)
References
BASE DESCRIPTION
endpoint_id

Part of the resource name

TYPE: str | VariableType

parent

Branch of the endpoint (projects/{project_id}/branches/{branch_id}). Set automatically when declared in the endpoints of a branch.

TYPE: str | VariableType DEFAULT: None

provider_config

Configure the provider for management through account provider

TYPE: PostgresEndpointProviderConfig | None | VariableType DEFAULT: None

replace_existing

If true, update the endpoint if it already exists instead of returning an error

TYPE: bool | None | VariableType DEFAULT: None

spec

The spec contains the compute endpoint configuration, including autoscaling limits, suspend timeout, and disabled state

TYPE: PostgresEndpointSpec | None | VariableType DEFAULT: None


laktory.models.resources.databricks.postgresendpoint.PostgresEndpointProviderConfig ¤

Bases: BaseModel

PARAMETER DESCRIPTION
workspace_id

Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with

TYPE: str | None | VariableType DEFAULT: None


laktory.models.resources.databricks.postgresendpoint.PostgresEndpointSpec ¤

Bases: BaseModel

PARAMETER DESCRIPTION
autoscaling_limit_max_cu

The maximum number of Compute Units. The maximum value is 64. The difference between the minimum and maximum Compute Units (max - min) must not exceed 16

TYPE: float | None | VariableType DEFAULT: None

autoscaling_limit_min_cu

The minimum number of Compute Units

TYPE: float | None | VariableType DEFAULT: None

disabled

Whether to restrict connections to the compute endpoint. Enabling this option schedules a suspend compute operation. A disabled compute endpoint cannot be enabled by a connection or console action

TYPE: bool | None | VariableType DEFAULT: None

endpoint_type

The endpoint type. A branch can only have one READ_WRITE endpoint. Possible values are: ENDPOINT_TYPE_READ_ONLY, ENDPOINT_TYPE_READ_WRITE

TYPE: str | VariableType

group

Details on the HA configuration of the endpoint

TYPE: PostgresEndpointSpecGroup | None | VariableType DEFAULT: None

no_suspension

When set to true, explicitly disables automatic suspension (never suspend). Should be set to true when provided. Mutually exclusive with suspend_timeout_duration * settings (EndpointSettings, optional)

TYPE: bool | None | VariableType DEFAULT: None

settings

TYPE: PostgresEndpointSpecSettings | None | VariableType DEFAULT: None

suspend_timeout_duration

Duration of inactivity after which the compute endpoint is automatically suspended

TYPE: str | None | VariableType DEFAULT: None


laktory.models.resources.databricks.postgresendpoint.PostgresEndpointSpecGroup ¤

Bases: BaseModel

PARAMETER DESCRIPTION
enable_readable_secondaries

Whether read-only connections to read-write endpoints are allowed. Only relevant if read replicas are configured by specifying size.max > 1

TYPE: bool | None | VariableType DEFAULT: None

max

The maximum number of computes in the endpoint group. Currently, this must be equal to min. Set to 1 for single compute endpoints, to disable HA. To manually suspend all computes in an endpoint group, set disabled to true on the EndpointSpec

TYPE: int | VariableType

min

The minimum number of computes in the endpoint group. Currently, this must be equal to max. This must be greater than or equal to 1

TYPE: int | VariableType


laktory.models.resources.databricks.postgresendpoint.PostgresEndpointSpecSettings ¤

Bases: BaseModel

PARAMETER DESCRIPTION
pg_settings

A raw representation of Postgres settings

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