databricks.getCurrentConfig
Retrieves information about the currently configured provider to make a decision, for example, add a dynamic block based on the specific cloud.
This data source can be used with an account or workspace-level provider.
Example Usage
Create cloud-specific databricks_storage_credential:
import * as pulumi from "@pulumi/pulumi";
import * as databricks from "@pulumi/databricks";
function singleOrNone<T>(elements: pulumi.Input<T>[]): pulumi.Input<T> {
    if (elements.length != 1) {
        throw new Error("singleOrNone expected input list to have a single element");
    }
    return elements[0];
}
const _this = databricks.getCurrentConfig({});
const external = new databricks.StorageCredential("external", {
    awsIamRole: singleOrNone(.map(entry => ({
        roleArn: cloudCredentialId,
    }))),
    azureManagedIdentity: singleOrNone(.map(entry => ({
        accessConnectorId: cloudCredentialId,
    }))),
    databricksGcpServiceAccount: singleOrNone(.map(entry => ({}))),
    name: "storage_cred",
    comment: "Managed by TF",
});
import pulumi
import pulumi_databricks as databricks
def single_or_none(elements):
    if len(elements) != 1:
        raise Exception("single_or_none expected input list to have a single element")
    return elements[0]
this = databricks.get_current_config()
external = databricks.StorageCredential("external",
    aws_iam_role=single_or_none([{"key": k, "value": v} for k, v in {} if this.cloud_type == "aws" else {
        "aws": True,
    }].apply(lambda entries: [{
        "roleArn": cloud_credential_id,
    } for entry in entries])),
    azure_managed_identity=single_or_none([{"key": k, "value": v} for k, v in {} if this.cloud_type == "azure" else {
        "azure": True,
    }].apply(lambda entries: [{
        "accessConnectorId": cloud_credential_id,
    } for entry in entries])),
    databricks_gcp_service_account=single_or_none([{"key": k, "value": v} for k, v in {} if this.cloud_type == "gcp" else {
        "gcp": True,
    }].apply(lambda entries: [{} for entry in entries])),
    name="storage_cred",
    comment="Managed by TF")
Example coming soon!
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Databricks = Pulumi.Databricks;
return await Deployment.RunAsync(() => 
{
    var @this = Databricks.GetCurrentConfig.Invoke();
    var external = new Databricks.StorageCredential("external", new()
    {
        AwsIamRole = Enumerable.Single(),
        AzureManagedIdentity = Enumerable.Single(),
        DatabricksGcpServiceAccount = Enumerable.Single(),
        Name = "storage_cred",
        Comment = "Managed by TF",
    });
});
Example coming soon!
Example coming soon!
Exported attributes
Data source exposes the following attributes:
- is_account- Whether the provider is configured at account-level
- account_id- Account Id if provider is configured at account-level
- host- Host of the Databricks workspace or account console
- cloud_type- Cloud type specified in the provider
- auth_type- Auth type used by the provider
Related Resources
The following resources are used in the same context:
- End to end workspace management guide
- databricks.Directory to manage directories in Databricks Workpace.
- databricks.Notebook to manage Databricks Notebooks.
- databricks.Repo to manage Databricks Repos.
Using getCurrentConfig
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getCurrentConfig(args: GetCurrentConfigArgs, opts?: InvokeOptions): Promise<GetCurrentConfigResult>
function getCurrentConfigOutput(args: GetCurrentConfigOutputArgs, opts?: InvokeOptions): Output<GetCurrentConfigResult>def get_current_config(account_id: Optional[str] = None,
                       auth_type: Optional[str] = None,
                       cloud_type: Optional[str] = None,
                       host: Optional[str] = None,
                       is_account: Optional[bool] = None,
                       opts: Optional[InvokeOptions] = None) -> GetCurrentConfigResult
def get_current_config_output(account_id: Optional[pulumi.Input[str]] = None,
                       auth_type: Optional[pulumi.Input[str]] = None,
                       cloud_type: Optional[pulumi.Input[str]] = None,
                       host: Optional[pulumi.Input[str]] = None,
                       is_account: Optional[pulumi.Input[bool]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetCurrentConfigResult]func GetCurrentConfig(ctx *Context, args *GetCurrentConfigArgs, opts ...InvokeOption) (*GetCurrentConfigResult, error)
func GetCurrentConfigOutput(ctx *Context, args *GetCurrentConfigOutputArgs, opts ...InvokeOption) GetCurrentConfigResultOutput> Note: This function is named GetCurrentConfig in the Go SDK.
public static class GetCurrentConfig 
{
    public static Task<GetCurrentConfigResult> InvokeAsync(GetCurrentConfigArgs args, InvokeOptions? opts = null)
    public static Output<GetCurrentConfigResult> Invoke(GetCurrentConfigInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetCurrentConfigResult> getCurrentConfig(GetCurrentConfigArgs args, InvokeOptions options)
public static Output<GetCurrentConfigResult> getCurrentConfig(GetCurrentConfigArgs args, InvokeOptions options)
fn::invoke:
  function: databricks:index/getCurrentConfig:getCurrentConfig
  arguments:
    # arguments dictionaryThe following arguments are supported:
- account_id str
- auth_type str
- cloud_type str
- host str
- is_account bool
getCurrentConfig Result
The following output properties are available:
- account_id str
- auth_type str
- cloud_type str
- host str
- id str
- The provider-assigned unique ID for this managed resource.
- is_account bool
Package Details
- Repository
- databricks pulumi/pulumi-databricks
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the databricksTerraform Provider.
