Skip to content

Grants

laktory.models.resources.databricks.Grants ¤

Bases: GrantsBase

Databricks Grants

Full grant replacement. Sets the complete list of grants for a securable and removes every existing grant not listed here - including those set outside Laktory.

Use this standalone resource when you need authoritative grant management on a securable that Laktory does not create. For resources that Laktory creates, prefer the embedded grants field on the resource itself (e.g., Catalog.grants, Schema.grants) - it generates the same Terraform resource but keeps the grant definition co-located with the resource.

Warning: because this resource replaces all grants, any access granted through the Databricks UI or another tool will be removed on the next Terraform apply.

Examples:

import io

from laktory import models

grants_yaml = '''
catalog: dev
grants:
- principal: metastore-admins
  privileges:
  - CREATE_SCHEMA
- principal: account users
  privileges:
  - USE_CATALOG
  - USE_SCHEMA
'''
grants = models.resources.databricks.Grants.model_validate_yaml(
    io.StringIO(grants_yaml)
)
References
BASE DESCRIPTION
catalog

TYPE: str | None | VariableType DEFAULT: None

credential

TYPE: str | None | VariableType DEFAULT: None

external_location

TYPE: str | None | VariableType DEFAULT: None

foreign_connection

TYPE: str | None | VariableType DEFAULT: None

function

TYPE: str | None | VariableType DEFAULT: None

grant

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

metastore

TYPE: str | None | VariableType DEFAULT: None

model

TYPE: str | None | VariableType DEFAULT: None

pipeline

TYPE: str | None | VariableType DEFAULT: None

recipient

TYPE: str | None | VariableType DEFAULT: None

schema_

TYPE: str | None | VariableType DEFAULT: None

share

TYPE: str | None | VariableType DEFAULT: None

storage_credential

TYPE: str | None | VariableType DEFAULT: None

table

TYPE: str | None | VariableType DEFAULT: None

volume

TYPE: str | None | VariableType DEFAULT: None


laktory.models.resources.databricks.grants.GrantsGrant ¤

Bases: BaseModel

PARAMETER DESCRIPTION
principal

TYPE: str | VariableType

privileges

TYPE: list[str] | VariableType