PostgresProject
laktory.models.resources.databricks.PostgresProject
¤
Bases: PostgresProjectBase
Lakebase Autoscaling (Postgres) Project
Top-level container of a managed, autoscaling Postgres: branches, each
with endpoints (compute), databases and roles. A production branch with
a primary read-write endpoint, a databricks-postgres database and an
owner role is created implicitly with the project; declare them with
replace_existing: true to manage them.
Lakebase Autoscaling resources follow specific Terraform semantics:
changes made outside Terraform are not detected (no drift detection), a
value removed from spec is kept by the server, and the Terraform state
should be shared (remote backend) when several users manage the same
project.
Examples:
import io
from laktory import models
project_yaml = '''
project_id: app
spec:
pg_version: 17
display_name: App backend
default_endpoint_settings:
autoscaling_limit_min_cu: 0.5
autoscaling_limit_max_cu: 4.0
branches:
- branch_id: production
replace_existing: true
spec:
no_expiry: true
- branch_id: dev
spec:
source_branch: projects/app/branches/production
ttl: 604800s
'''
project = models.resources.databricks.PostgresProject.model_validate_yaml(
io.StringIO(project_yaml)
)
| BASE | DESCRIPTION |
|---|---|
initial_branch_spec
|
Configuration for the initial default branch created as part of project creation. Allows overriding branch protection. These settings only apply at creation time and do not affect resources created after project creation
TYPE:
|
initial_endpoint_spec
|
Configuration settings for the initial Read/Write endpoint created inside the initial branch for a newly created project. If omitted, the initial endpoint created will have default settings, without high availability configured. This field does not apply to any endpoints created after project creation. Use spec.default_endpoint_settings to configure default settings for endpoints created after project creation
TYPE:
|
project_id
|
Part of the resource name
TYPE:
|
provider_config
|
Configure the provider for management through account provider
TYPE:
|
purge_on_delete
|
If true, permanently deletes the project (hard delete). If false or unset, performs a soft delete
TYPE:
|
spec
|
The spec contains the project configuration, including display_name, pg_version (Postgres version), history_retention_duration, and default_endpoint_settings
TYPE:
|
| LAKTORY | DESCRIPTION |
|---|---|
branches
|
Branches of the project. Their
TYPE:
|
| METHOD | DESCRIPTION |
|---|---|
assign_parents |
Set the project path on nested branches and their resources |
| ATTRIBUTE | DESCRIPTION |
|---|---|
additional_core_resources |
TYPE:
|
path |
Lakebase resource path
TYPE:
|
additional_core_resources
property
¤
- branches
A branch forked from a sibling (spec.source_branch) is created after it.
path
property
¤
Lakebase resource path projects/{project_id}
assign_parents()
¤
Set the project path on nested branches and their resources
Source code in laktory/models/resources/databricks/postgresproject.py
69 70 71 72 73 74 75 76 | |
laktory.models.resources.databricks.postgresproject.PostgresProjectInitialBranchSpec
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
is_protected
|
Whether the initial default branch should be protected from deletion
TYPE:
|
laktory.models.resources.databricks.postgresproject.PostgresProjectInitialEndpointSpec
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
autoscaling_limit_max_cu
|
The maximum number of Compute Units. Minimum value is 0.5
TYPE:
|
autoscaling_limit_min_cu
|
The minimum number of Compute Units. Minimum value is 0.5
TYPE:
|
group
|
Settings for HA configuration of the endpoint
TYPE:
|
no_suspension
|
When set to true, explicitly disables automatic suspension (never suspend). Should be set to true when provided. Mutually exclusive with
TYPE:
|
suspend_timeout_duration
|
Duration of inactivity after which the compute endpoint is automatically suspended. If specified should be between 60s and 604800s (1 minute to 1 week). Mutually exclusive with
TYPE:
|
laktory.models.resources.databricks.postgresproject.PostgresProjectInitialEndpointSpecGroup
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
enable_readable_secondaries
|
Whether to allow read-only connections to read-write endpoints. Only relevant for read-write endpoints where size.max > 1
TYPE:
|
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:
|
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:
|
laktory.models.resources.databricks.postgresproject.PostgresProjectProviderConfig
¤
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:
|
laktory.models.resources.databricks.postgresproject.PostgresProjectSpec
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
budget_policy_id
|
The budget policy that is applied to the project
TYPE:
|
custom_tags
|
The effective custom tags associated with the project
TYPE:
|
default_branch
|
The full resource path of the default branch of the project
TYPE:
|
default_endpoint_settings
|
The effective default endpoint settings
TYPE:
|
display_name
|
The effective human-readable project name
TYPE:
|
enable_pg_native_login
|
Whether to enable PG native password login on all endpoints in this project
TYPE:
|
history_retention_duration
|
The effective number of seconds to retain the shared history for point in time recovery
TYPE:
|
pg_version
|
The effective major Postgres version number
TYPE:
|
laktory.models.resources.databricks.postgresproject.PostgresProjectSpecCustomTags
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
key
|
The key of the custom tag
TYPE:
|
value
|
The value of the custom tag
TYPE:
|
laktory.models.resources.databricks.postgresproject.PostgresProjectSpecDefaultEndpointSettings
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
autoscaling_limit_max_cu
|
The maximum number of Compute Units. Minimum value is 0.5
TYPE:
|
autoscaling_limit_min_cu
|
The minimum number of Compute Units. Minimum value is 0.5
TYPE:
|
no_suspension
|
When set to true, explicitly disables automatic suspension (never suspend). Should be set to true when provided. Mutually exclusive with
TYPE:
|
pg_settings
|
A raw representation of Postgres settings
TYPE:
|
suspend_timeout_duration
|
Duration of inactivity after which the compute endpoint is automatically suspended. If specified should be between 60s and 604800s (1 minute to 1 week). Mutually exclusive with
TYPE:
|