| page_title | dbtcloud_databricks_credential Resource - dbtcloud |
|---|---|
| subcategory | |
| description | Databricks credential resource |
Databricks credential resource
// Using the classic sensitive attribute (stored in state)
resource "dbtcloud_databricks_credential" "my_databricks_cred" {
project_id = dbtcloud_project.dbt_project.id
token = "abcdefgh"
schema = "my_schema"
adapter_type = "databricks"
}
// Using write-only attributes (not stored in state, requires Terraform >= 1.11)
//
// The token_wo value is never persisted in the Terraform state file.
// Use token_wo_version to trigger an update when the token changes.
variable "databricks_token" {
type = string
ephemeral = true
}
resource "dbtcloud_databricks_credential" "my_databricks_cred_wo" {
project_id = dbtcloud_project.dbt_project.id
token_wo = var.databricks_token
token_wo_version = 1
schema = "my_schema"
adapter_type = "databricks"
}project_id(Number) Project ID to create the Databricks credential in
adapter_type(String, Deprecated) The type of the adapter. 'spark' is deprecated, but still supported for backwards compatibility. For Spark, please use the spark_credential resource. Optional only when semantic_layer_credential is set to true; otherwise, this field is required.catalog(String) The catalog where to create models (only for the databricks adapter)resource_metadata(Dynamic) Metadata for tracking resource identity during account migrations. Stored in Terraform state only and not sent to the API.schema(String) The schema where to create models. Optional only when semantic_layer_credential is set to true; otherwise, this field is required.semantic_layer_credential(Boolean) This field indicates that the credential is used as part of the Semantic Layer configuration. It is used to create a Databricks credential for the Semantic Layer.target_name(String, Deprecated) Target nametoken(String, Sensitive) Token for Databricks user. Consider usingtoken_woinstead, which is not stored in state.token_wo(String) Write-only alternative totoken. The value is not stored in state. Requirestoken_wo_versionto trigger updates.token_wo_version(Number) Version number fortoken_wo. Increment this value to trigger an update of the token when usingtoken_wo.
credential_id(Number) The system Databricks credential IDid(String) The ID of this resource. Contains the project ID and the credential ID.
Import is supported using the following syntax:
# using import blocks (requires Terraform >= 1.5)
import {
to = dbtcloud_databricks_credential.my_databricks_credential
id = "project_id:credential_id"
}
import {
to = dbtcloud_databricks_credential.my_databricks_credential
id = "12345:6789"
}
# using the older import command
terraform import dbtcloud_databricks_credential.my_databricks_credential "project_id:credential_id"
terraform import dbtcloud_databricks_credential.my_databricks_credential 12345:6789