Skip to content

Latest commit

 

History

History
89 lines (67 loc) · 4.15 KB

File metadata and controls

89 lines (67 loc) · 4.15 KB
page_title dbtcloud_databricks_platform_metadata_credential Resource - dbtcloud
subcategory
description Manages Databricks platform metadata credentials for external metadata ingestion in dbt Cloud. This resource configures credentials that allow dbt Cloud to connect directly to your Databricks workspace to ingest metadata outside of normal dbt project runs. This enables features like: Catalog Ingestion: Ingest metadata about tables/views not defined in dbtCost Optimization: Query warehouse cost and performance dataCost Insights: Enhanced cost visibility and analysis ~> Note: At least one of catalog_ingestion_enabled, cost_optimization_enabled, or cost_insights_enabled must be enabled for the credential to be usable. ~> Note: The connection_id cannot be changed after creation. To use a different connection, you must destroy and recreate the resource.

dbtcloud_databricks_platform_metadata_credential (Resource)

Manages Databricks platform metadata credentials for external metadata ingestion in dbt Cloud.

This resource configures credentials that allow dbt Cloud to connect directly to your Databricks workspace to ingest metadata outside of normal dbt project runs. This enables features like:

  • Catalog Ingestion: Ingest metadata about tables/views not defined in dbt
  • Cost Optimization: Query warehouse cost and performance data
  • Cost Insights: Enhanced cost visibility and analysis

~> Note: At least one of catalog_ingestion_enabled, cost_optimization_enabled, or cost_insights_enabled must be enabled for the credential to be usable.

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

Example Usage

// Using the classic sensitive attribute (stored in state)
resource "dbtcloud_databricks_platform_metadata_credential" "example" {
  connection_id = dbtcloud_global_connection.databricks.id

  catalog_ingestion_enabled = true
  cost_optimization_enabled = false
  cost_insights_enabled     = false

  token   = var.databricks_token
  catalog = "main"
}

// Using write-only attributes (not stored in state, requires Terraform >= 1.11)
variable "databricks_metadata_token" {
  type      = string
  ephemeral = true
}

resource "dbtcloud_databricks_platform_metadata_credential" "example_wo" {
  connection_id = dbtcloud_global_connection.databricks.id

  catalog_ingestion_enabled = true
  cost_optimization_enabled = false
  cost_insights_enabled     = false

  token_wo         = var.databricks_metadata_token
  token_wo_version = 1
  catalog          = "main"
}

Schema

Required

  • catalog (String) The Unity Catalog name to use.
  • connection_id (Number) The ID of the global connection this credential is associated with. Cannot be changed after creation.

Optional

  • catalog_ingestion_enabled (Boolean) Whether catalog ingestion is enabled for this credential. When enabled, dbt Cloud will ingest metadata about tables, views, and other objects from your data warehouse.
  • cost_insights_enabled (Boolean) Whether cost insights is enabled for this credential.
  • cost_optimization_enabled (Boolean) Whether cost optimization data collection is enabled for this credential.
  • resource_metadata (Dynamic) Metadata for tracking resource identity during account migrations. Stored in Terraform state only and not sent to the API.
  • token (String, Sensitive) The Databricks personal access token. Consider using token_wo instead, which is not stored in state.
  • token_wo (String) Write-only alternative to token. The value is not stored in state. Requires token_wo_version to trigger updates.
  • token_wo_version (Number) Version number for token_wo. Increment this value to trigger an update of the token when using token_wo.

Read-Only

  • adapter_version (String) The adapter version derived from the connection (e.g., 'snowflake_v0', 'databricks_v0'). This is read-only and determined by the connection.
  • credential_id (Number) The ID of the platform metadata credential.
  • id (String) The unique identifier for this resource (account_id:credential_id).