PostgresCatalog
laktory.models.resources.databricks.PostgresCatalog
¤
Bases: TagsMixin, PostgresCatalogBase
Lakebase Autoscaling (Postgres) Unity Catalog catalog
Registers a Postgres database of a branch as a Unity Catalog catalog, so
its tables can be queried from Databricks and used as the destination of
synced tables. Can also be declared in the catalogs of a
PostgresBranch, which sets spec.branch.
Examples:
import io
from laktory import models
catalog_yaml = '''
catalog_id: app_pg
spec:
branch: projects/app/branches/production
postgres_database: app_db
create_database_if_missing: true
tags:
domain: app
grants:
- principal: account users
privileges:
- USE_CATALOG
- SELECT
'''
catalog = models.resources.databricks.PostgresCatalog.model_validate_yaml(
io.StringIO(catalog_yaml)
)
| BASE | DESCRIPTION |
|---|---|
catalog_id
|
The part of the name, chosen by the user when the resource was created
TYPE:
|
provider_config
|
Configure the provider for management through account provider
TYPE:
|
spec
|
Catalog configuration: Postgres database and branch (set automatically when declared in the catalogs of a branch)
TYPE:
|
| LAKTORY | DESCRIPTION |
|---|---|
grant
|
Non-destructive grant for specific principal(s). Adds or updates privileges for the listed principal(s) and leaves
grants for all other principals untouched. Use when access is managed from multiple sources (Laktory, Databricks
UI, etc.). Mutually exclusive with
TYPE:
|
grants
|
Authoritative grant list for all principals. Replaces every existing grant on this Catalog - including those set
outside Laktory - with only the entries listed here. Use only when Laktory owns all access management for this
resource. Mutually exclusive with
TYPE:
|
tags
|
Tags assigned to the entity as
TYPE:
|
| METHOD | DESCRIPTION |
|---|---|
get_tags_additional_resources |
Tag assignment resources for |
| ATTRIBUTE | DESCRIPTION |
|---|---|
additional_core_resources |
TYPE:
|
additional_core_resources
property
¤
- catalog grants
- catalog tags
Unity Catalog objects are named after catalog_id (the Terraform id is the
Lakebase path catalogs/{catalog_id}), so they depend on the catalog explicitly.
get_tags_additional_resources(entity_type, entity, tags=None)
¤
Tag assignment resources for entity (a name or a resource reference).
Defaults to the tags of this resource.
Source code in laktory/models/resources/databricks/_tagsmixin.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | |
laktory.models.resources.databricks.postgrescatalog.PostgresCatalogProviderConfig
¤
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.postgrescatalog.PostgresCatalogSpec
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
branch
|
The resource path of the branch associated with the catalog
TYPE:
|
create_database_if_missing
|
If set to true, the specified postgres_database is created on behalf of the calling user if it does not already exist. In this case, the calling user has a role created for them in Postgres if they do not already have one
TYPE:
|
postgres_database
|
The name of the Postgres database associated with the catalog
TYPE:
|