Retrieves information about the currently configured provider to make a decision, for example, add a dynamic block based on the specific cloud.
Create cloud-specific databricks_storage_credential:
data "databricks_current_config" "this" {}
resource "databricks_storage_credential" "external" {
name = "storage_cred"
dynamic "aws_iam_role" {
# map for a conditional block
for_each = data.databricks_current_config.this.cloud_type == "aws" ? {} : { aws = true }
content {
role_arn = var.cloud_credential_id
}
}
dynamic "azure_managed_identity" {
# map for a conditional block
for_each = data.databricks_current_config.this.cloud_type == "azure" ? {} : { azure = true }
content {
access_connector_id = var.cloud_credential_id
}
}
dynamic "databricks_gcp_service_account" {
# map for a conditional block
for_each = data.databricks_current_config.this.cloud_type == "gcp" ? {} : { gcp = true }
content {}
}
comment = "Managed by TF"
}
Data source exposes the following attributes:
is_account
- Whether the provider is configured at account-levelaccount_id
- Account Id if provider is configured at account-levelhost
- Host of the Databricks workspace or account consolecloud_type
- Cloud type specified in the providerauth_type
- Auth type used by the providerThe following resources are used in the same context: