| page_title | dbtcloud_fabric_credential Resource - dbtcloud |
|---|---|
| subcategory | |
| description | Fabric credential resource |
Fabric credential resource
# 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"
}adapter_type(String) The type of the adapter (fabric)project_id(Number) Project ID to create the Fabric credential inschema(String) The schema where to create the dbt models
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 usingclient_secret_woinstead, which is not stored in state.client_secret_wo(String) Write-only alternative toclient_secret. The value is not stored in state. Requiresclient_secret_wo_versionto trigger updates.client_secret_wo_version(Number) Version number forclient_secret_wo. Increment this value to trigger an update of the client secret when usingclient_secret_wo.password(String, Sensitive) The password for the account to connect to. Only used when connection with AD user/pass. Consider usingpassword_woinstead, which is not stored in state.password_wo(String) Write-only alternative topassword. The value is not stored in state. Requirespassword_wo_versionto trigger updates.password_wo_version(Number) Version number forpassword_wo. Increment this value to trigger an update of the password when usingpassword_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 dbttenant_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
credential_id(Number) The internal 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_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