subcategory |
---|
Unity Catalog |
-> Note This resource could be only used with workspace-level provider!
Within a metastore, Unity Catalog provides a 3-level namespace for organizing data: Catalogs, Databases (also called Schemas), and Tables / Views.
A databricks_schema
is contained within databricks_catalog and can contain tables & views.
resource "databricks_catalog" "sandbox" {
name = "sandbox"
comment = "this catalog is managed by terraform"
properties = {
purpose = "testing"
}
}
resource "databricks_schema" "things" {
catalog_name = databricks_catalog.sandbox.id
name = "things"
comment = "this database is managed by terraform"
properties = {
kind = "various"
}
}
The following arguments are required:
name
- Name of Schema relative to parent catalog. Change forces creation of a new resource.catalog_name
- Name of parent catalog. Change forces creation of a new resource.storage_root
- (Optional) Managed location of the schema. Location in cloud storage where data for managed tables will be stored. If not specified, the location will default to the catalog root location. Change forces creation of a new resource.owner
- (Optional) Username/groupname/sp application_id of the schema owner.comment
- (Optional) User-supplied free-form text.properties
- (Optional) Extensible Schema properties.force_destroy
- (Optional) Delete schema regardless of its contents.
In addition to all arguments above, the following attributes are exported:
id
- ID of this schema in form of<catalog_name>.<name>
.
This resource can be imported by its full name:
terraform import databricks_schema.this <catalog_name>.<name>
The following resources are used in the same context:
- databricks_tables data to list tables within Unity Catalog.
- databricks_schemas data to list schemas within Unity Catalog.
- databricks_catalogs data to list catalogs within Unity Catalog.