databricks_current_config Data Source

Retrieves information about the currently configured provider to make a decision, for example, add a dynamic block based on the specific cloud.

Example Usage

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

Exported attributes

Data source exposes the following attributes:

The following resources are used in the same context: