Skip to content

Latest commit

 

History

History
120 lines (97 loc) · 4.8 KB

File metadata and controls

120 lines (97 loc) · 4.8 KB
page_title dbtcloud_fabric_credential Resource - dbtcloud
subcategory
description Fabric credential resource

dbtcloud_fabric_credential (Resource)

Fabric credential resource

Example Usage

# Using the classic sensitive attributes (stored in state)

# when using AD authentication
resource "dbtcloud_fabric_credential" "my_fabric_cred_ad" {
  project_id           = dbtcloud_project.dbt_project.id
  schema               = "my_schema"
  user                 = "my_user"
  password             = "my_password"
  schema_authorization = "abcd"
}

# when using service principal authentication
resource "dbtcloud_fabric_credential" "my_fabric_cred_serv_princ" {
  project_id           = dbtcloud_project.dbt_project.id
  schema               = "my_schema"
  client_id            = "my_client_id"
  tenant_id            = "my_tenant_id"
  client_secret        = "my_secret"
  schema_authorization = "abcd"
}

// Using write-only attributes (not stored in state, requires Terraform >= 1.11)
//
// The password_wo and client_secret_wo values are never persisted in the Terraform state file.
// Use password_wo_version / client_secret_wo_version to trigger an update when the secret changes.
variable "fabric_password" {
  type      = string
  ephemeral = true
}

variable "fabric_client_secret" {
  type      = string
  ephemeral = true
}

# when using AD authentication with write-only password
resource "dbtcloud_fabric_credential" "my_fabric_cred_ad_wo" {
  project_id           = dbtcloud_project.dbt_project.id
  schema               = "my_schema"
  user                 = "my_user"
  password_wo          = var.fabric_password
  password_wo_version  = 1
  schema_authorization = "abcd"
}

# when using service principal authentication with write-only client secret
resource "dbtcloud_fabric_credential" "my_fabric_cred_serv_princ_wo" {
  project_id               = dbtcloud_project.dbt_project.id
  schema                   = "my_schema"
  client_id                = "my_client_id"
  tenant_id                = "my_tenant_id"
  client_secret_wo         = var.fabric_client_secret
  client_secret_wo_version = 1
  schema_authorization     = "abcd"
}

Schema

Required

  • adapter_type (String) The type of the adapter (fabric)
  • project_id (Number) Project ID to create the Fabric credential in
  • schema (String) The schema where to create the dbt models

Optional

  • client_id (String) The client ID of the Azure Active Directory service principal. This is only used when connecting to Azure SQL with an AAD service principal.
  • client_secret (String, Sensitive) The client secret of the Azure Active Directory service principal. This is only used when connecting to Azure SQL with an AAD service principal. Consider using client_secret_wo instead, which is not stored in state.
  • client_secret_wo (String) Write-only alternative to client_secret. The value is not stored in state. Requires client_secret_wo_version to trigger updates.
  • client_secret_wo_version (Number) Version number for client_secret_wo. Increment this value to trigger an update of the client secret when using client_secret_wo.
  • password (String, Sensitive) The password for the account to connect to. Only used when connection with AD user/pass. Consider using password_wo instead, which is not stored in state.
  • password_wo (String) Write-only alternative to password. The value is not stored in state. Requires password_wo_version to trigger updates.
  • password_wo_version (Number) Version number for password_wo. Increment this value to trigger an update of the password when using password_wo.
  • resource_metadata (Dynamic) Metadata for tracking resource identity during account migrations. Stored in Terraform state only and not sent to the API.
  • schema_authorization (String) Optionally set this to the principal who should own the schemas created by dbt
  • tenant_id (String) The tenant ID of the Azure Active Directory instance. This is only used when connecting to Azure SQL with a service principal.
  • user (String) The username of the Fabric account to connect to. Only used when connection with AD user/pass

Read-Only

  • credential_id (Number) The internal 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_fabric_credential.my_fabric_credential
  id = "project_id:credential_id"
}

import {
  to = dbtcloud_fabric_credential.my_fabric_credential
  id = "12345:6789"
}

# using the older import command
terraform import dbtcloud_fabric_credential.my_fabric_credential "project_id:credential_id"
terraform import dbtcloud_fabric_credential.my_fabric_credential 12345:6789