Skip to content

Latest commit

 

History

History
112 lines (83 loc) · 4.94 KB

File metadata and controls

112 lines (83 loc) · 4.94 KB
page_title dbtcloud_connection_catalog_config Resource - dbtcloud
subcategory
description Manages catalog configuration filters for a dbt Cloud connection. This resource configures what database objects (databases, schemas, tables, views) are included or excluded when ingesting metadata from your data warehouse. It works in conjunction with platform metadata credentials to control what gets synchronized into dbt Cloud's catalog. Each filter type has an "allow" list (whitelist) and a "deny" list (blacklist): If an allow list is set, only matching objects are includedIf a deny list is set, matching objects are excludedDeny takes precedence over allowPatterns support wildcards (e.g., "temp_*") ~> Note: The connection_id cannot be changed after creation. To use a different connection, you must destroy and recreate the resource. ~> Note: This resource requires a platform metadata credential to be configured for the connection.

dbtcloud_connection_catalog_config (Resource)

Manages catalog configuration filters for a dbt Cloud connection.

This resource configures what database objects (databases, schemas, tables, views) are included or excluded when ingesting metadata from your data warehouse. It works in conjunction with platform metadata credentials to control what gets synchronized into dbt Cloud's catalog.

Each filter type has an "allow" list (whitelist) and a "deny" list (blacklist):

  • If an allow list is set, only matching objects are included
  • If a deny list is set, matching objects are excluded
  • Deny takes precedence over allow
  • Patterns support wildcards (e.g., "temp_*")

~> Note: The connection_id cannot be changed after creation. To use a different connection, you must destroy and recreate the resource.

~> Note: This resource requires a platform metadata credential to be configured for the connection.

Example Usage

# Example: Configure catalog filters for a Snowflake connection
resource "dbtcloud_connection_catalog_config" "snowflake_filters" {
  connection_id = dbtcloud_global_connection.snowflake.id

  # Only ingest from these databases
  database_allow = ["analytics", "reporting"]

  # Exclude staging schemas
  schema_deny = ["staging", "temp", "scratch"]

  # Exclude temporary tables
  table_deny = ["tmp_*", "temp_*"]

  # Exclude secret views
  view_deny = ["secret_*", "internal_*"]
}

# Example: Minimal configuration - just filter databases
resource "dbtcloud_connection_catalog_config" "minimal" {
  connection_id = dbtcloud_global_connection.snowflake.id

  database_allow = ["production"]
}

# Example: Full configuration with platform metadata credential
resource "dbtcloud_snowflake_platform_metadata_credential" "creds" {
  connection_id             = dbtcloud_global_connection.snowflake.id
  catalog_ingestion_enabled = true

  auth_type = "password"
  user      = var.snowflake_user
  password  = var.snowflake_password
  role      = var.snowflake_role
  warehouse = var.snowflake_warehouse
}

resource "dbtcloud_connection_catalog_config" "with_creds" {
  connection_id = dbtcloud_global_connection.snowflake.id

  database_allow = ["analytics", "reporting"]
  database_deny  = ["sandbox"]

  schema_allow = ["public", "dbt_*"]
  schema_deny  = ["information_schema", "pg_*"]

  table_deny = ["_tmp_*", "_staging_*"]
  view_deny  = ["_internal_*"]

  depends_on = [dbtcloud_snowflake_platform_metadata_credential.creds]
}

Schema

Required

  • connection_id (Number) The ID of the global connection this catalog config is associated with. Cannot be changed after creation.

Optional

  • database_allow (List of String) List of database names to include. Supports wildcards (e.g., 'analytics_*'). If set, only these databases are ingested.
  • database_deny (List of String) List of database names to exclude. Supports wildcards (e.g., 'staging_*'). Matching databases are not ingested.
  • resource_metadata (Dynamic) Metadata for tracking resource identity during account migrations. Stored in Terraform state only and not sent to the API.
  • schema_allow (List of String) List of schema names to include. Supports wildcards (e.g., 'public_*'). If set, only these schemas are ingested.
  • schema_deny (List of String) List of schema names to exclude. Supports wildcards (e.g., 'temp_*'). Matching schemas are not ingested.
  • table_allow (List of String) List of table names to include. Supports wildcards (e.g., 'fact_*'). If set, only these tables are ingested.
  • table_deny (List of String) List of table names to exclude. Supports wildcards (e.g., 'tmp_*'). Matching tables are not ingested.
  • view_allow (List of String) List of view names to include. Supports wildcards (e.g., 'v_*'). If set, only these views are ingested.
  • view_deny (List of String) List of view names to exclude. Supports wildcards (e.g., 'secret_*'). Matching views are not ingested.

Read-Only

  • id (String) The unique identifier for this resource (connection_id).