Skip to main content

onehouse_catalog

Configures an external catalog. Onehouse syncs table metadata to the catalog so external query engines (Spark, Trino, Athena, etc.) can discover and read Onehouse tables.

Canonical reference

This page documents Terraform-specific behavior (HCL syntax, types, mutability, drift, import). For full parameter semantics, valid values, and defaults, see CREATE CATALOG and DELETE CATALOG.

Example Usage

AWS Glue catalog

resource "onehouse_catalog" "glue" {
name = "prod-glue"
type = "GLUE"
glue {
region = "us-west-2"
}
}

Hive Metastore catalog

resource "onehouse_catalog" "hive" {
name = "internal-hive"
type = "HIVE"
hive {
metastore_servers = [
"thrift://hms.internal.example.com:9083",
]
}
}

Unity Catalog (with secret-managed token)

resource "onehouse_catalog" "unity" {
name = "prod-unity"
type = "UNITY"
unity {
databricks_host = "https://dbc-91697e55-175d.cloud.databricks.com"
http_path = "sql/protocolv1/o/4044103294663248/0923-070957-cgil4gk"
catalog_name = "production_data"
credential_type = "SECRET_MANAGER"
auth_token_reference = "arn:aws:secretsmanager:us-west-2:111122223333:secret:databricks-token-AbCdEf"
}
}
warning

With credential_type = "ONEHOUSE", the auth_token is stored in Terraform state in plain text. Use credential_type = "SECRET_MANAGER" in production and reference a cloud-provider secret manager ARN/ID via auth_token_reference.

OneTable catalog

resource "onehouse_catalog" "onetable" {
name = "onetable-prod"
type = "ONETABLE"
onetable {
target_formats = ["iceberg", "delta"]
}
}

DataHub catalog

resource "onehouse_catalog" "datahub" {
name = "datahub-prod"
type = "DATAHUB"
datahub {
server_url = "https://datahub.internal.example.com"
credential_type = "SECRET_MANAGER"
auth_token_reference = "arn:aws:secretsmanager:us-west-2:111122223333:secret:datahub-AbCdEf"
}
}

Argument Reference

Top-level

ArgumentTypeRequiredMutabilityDescription
namestringImmutableCatalog name.
typestringImmutableOne of GLUE, HIVE, UNITY, ONETABLE, DATAHUB. → details below

Exactly one of glue {}, hive {}, unity {}, onetable {}, or datahub {} must be set, matching the type value.

type — when to pick each value

ValueUse when
GLUEYou want AWS Glue Data Catalog discovery for Athena, EMR, Redshift Spectrum. → details
HIVEYou have a Hive Metastore (e.g., internal Spark/Hive deployments). → details
UNITYYou use Databricks Unity Catalog. → details
ONETABLECross-format table interop via OneTable (Hudi / Iceberg / Delta interop). → details
DATAHUBYou use DataHub for data discovery and lineage. → details

glue {} block

ArgumentTypeRequiredDescription
regionstringAWS region of the Glue Data Catalog. Defaults to the project region when omitted.
arnstringGlue catalog ARN. Required for cross-account access; omit for same-account.

hive {} block

ArgumentTypeRequiredDescription
metastore_serverslist(string)One or more Thrift URIs (thrift://host:port). Server tries to connect on CREATE, so URIs must be reachable from the Onehouse control plane. → details

unity {} block

ArgumentTypeRequiredDescription
databricks_hoststringDatabricks workspace URL (e.g. https://dbc-xxx.cloud.databricks.com).
http_pathstringDatabricks SQL warehouse HTTP path. → details
catalog_namestringName of the catalog inside Unity.
credential_typestringONEHOUSE (token stored in state — testing only) or SECRET_MANAGER (cloud-secret-manager reference). → details
auth_tokenstringwhen credential_type = "ONEHOUSE"Databricks personal access token. Sensitive.
auth_token_referencestringwhen credential_type = "SECRET_MANAGER"Cloud secret ARN/ID containing the PAT.

onetable {} block

ArgumentTypeRequiredDescription
target_formatsset(string)Target table formats. Subset of delta, iceberg. → details

datahub {} block

ArgumentTypeRequiredDescription
server_urlstringDataHub server URL.
data_platform_namestringIdentifier for the Hudi platform in DataHub.
dataset_environmentstringDataHub environment (e.g. prod, dev).
credential_typestringONEHOUSE (default) or SECRET_MANAGER. → details
auth_tokenstringwhen credential_type = "ONEHOUSE"DataHub auth token. Sensitive.
auth_token_referencestringwhen credential_type = "SECRET_MANAGER"Cloud secret ARN/ID.

Attribute Reference

AttributeTypeDescription
idstringCatalog UUID assigned by Onehouse.
created_atstringCreation time in RFC3339.
created_bystringIdentity that created the catalog.

Import

terraform import onehouse_catalog.glue prod-glue

After import, the server does not return sensitive fields (unity.auth_token, datahub.auth_token, etc.). Re-supply them in your .tf file before the next terraform apply to avoid a forced replacement.

Data Source

data "onehouse_catalog" "lookup" {
name = "prod-glue"
}

output "catalog_type" {
value = data.onehouse_catalog.lookup.type
}

Limitations

  • No Update. The API has no ALTER CATALOG — any field change forces destroy + recreate.
  • BIGQUERY and DATAPROC catalog types are tracked under ENG-41407 and not yet supported by the provider.