Skip to content

Latest commit

 

History

History
81 lines (62 loc) · 2.69 KB

File metadata and controls

81 lines (62 loc) · 2.69 KB
page_title dbtcloud_databricks_credential Resource - dbtcloud
subcategory
description Databricks credential resource

dbtcloud_databricks_credential (Resource)

Databricks credential resource

Example Usage

// 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"
}

// 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"
}

Schema

Required

  • project_id (Number) Project ID to create the Databricks credential in

Optional

  • catalog (String) The catalog where to create models (only for the databricks adapter)
  • 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.
  • token (String, Sensitive) Token for Databricks user. 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

  • credential_id (Number) The system Databricks credential ID
  • id (String) The ID of this resource. Contains the project ID and the credential ID.

Import

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