published on Friday, May 1, 2026 by Pulumi
published on Friday, May 1, 2026 by Pulumi
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> | undefined {
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(entry2 => ({
accessConnectorId: cloudCredentialId,
}))),
databricksGcpServiceAccount: singleOrNone(.map(entry3 => ({}))),
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] if elements else None
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,
}.items()].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,
}.items()].apply(lambda entries: [{
"accessConnectorId": cloud_credential_id,
} for entry2 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,
}.items()].apply(lambda entries: [{} for entry3 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.Index.GetCurrentConfig.Invoke();
var external = new Databricks.Index.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:
isAccount- Whether the provider is configured at account-levelaccountId- Account Id if provider is configured at account-levelhost- Host of the Databricks workspace or account consolecloudType- Cloud type of the provider. Ifcloudargument is set, this will match that value. Otherwise, it is determined from the provider configuration.authType- 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,
api: Optional[str] = None,
auth_type: Optional[str] = None,
cloud: Optional[str] = None,
cloud_type: Optional[str] = None,
host: Optional[str] = None,
is_account: Optional[bool] = None,
provider_config: Optional[GetCurrentConfigProviderConfig] = None,
opts: Optional[InvokeOptions] = None) -> GetCurrentConfigResult
def get_current_config_output(account_id: pulumi.Input[Optional[str]] = None,
api: pulumi.Input[Optional[str]] = None,
auth_type: pulumi.Input[Optional[str]] = None,
cloud: pulumi.Input[Optional[str]] = None,
cloud_type: pulumi.Input[Optional[str]] = None,
host: pulumi.Input[Optional[str]] = None,
is_account: pulumi.Input[Optional[bool]] = None,
provider_config: pulumi.Input[Optional[GetCurrentConfigProviderConfigArgs]] = 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 string - Api string
- Auth
Type string - Cloud string
- Explicitly set the cloud type. Must be one of
aws,azure, orgcp. If not set, the cloud type is determined automatically from the provider configuration. It is recommended to set this explicitly to avoid relying on host-based detection. - Cloud
Type string - Host string
- Is
Account bool - Provider
Config GetCurrent Config Provider Config - Configure the provider for management through account provider. This block consists of the following fields:
- Account
Id string - Api string
- Auth
Type string - Cloud string
- Explicitly set the cloud type. Must be one of
aws,azure, orgcp. If not set, the cloud type is determined automatically from the provider configuration. It is recommended to set this explicitly to avoid relying on host-based detection. - Cloud
Type string - Host string
- Is
Account bool - Provider
Config GetCurrent Config Provider Config - Configure the provider for management through account provider. This block consists of the following fields:
- account
Id String - api String
- auth
Type String - cloud String
- Explicitly set the cloud type. Must be one of
aws,azure, orgcp. If not set, the cloud type is determined automatically from the provider configuration. It is recommended to set this explicitly to avoid relying on host-based detection. - cloud
Type String - host String
- is
Account Boolean - provider
Config GetCurrent Config Provider Config - Configure the provider for management through account provider. This block consists of the following fields:
- account
Id string - api string
- auth
Type string - cloud string
- Explicitly set the cloud type. Must be one of
aws,azure, orgcp. If not set, the cloud type is determined automatically from the provider configuration. It is recommended to set this explicitly to avoid relying on host-based detection. - cloud
Type string - host string
- is
Account boolean - provider
Config GetCurrent Config Provider Config - Configure the provider for management through account provider. This block consists of the following fields:
- account_
id str - api str
- auth_
type str - cloud str
- Explicitly set the cloud type. Must be one of
aws,azure, orgcp. If not set, the cloud type is determined automatically from the provider configuration. It is recommended to set this explicitly to avoid relying on host-based detection. - cloud_
type str - host str
- is_
account bool - provider_
config GetCurrent Config Provider Config - Configure the provider for management through account provider. This block consists of the following fields:
- account
Id String - api String
- auth
Type String - cloud String
- Explicitly set the cloud type. Must be one of
aws,azure, orgcp. If not set, the cloud type is determined automatically from the provider configuration. It is recommended to set this explicitly to avoid relying on host-based detection. - cloud
Type String - host String
- is
Account Boolean - provider
Config Property Map - Configure the provider for management through account provider. This block consists of the following fields:
getCurrentConfig Result
The following output properties are available:
- Account
Id string - Auth
Type string - Cloud
Type string - Host string
- Id string
- The provider-assigned unique ID for this managed resource.
- Is
Account bool - Api string
- Cloud string
- Provider
Config GetCurrent Config Provider Config
- Account
Id string - Auth
Type string - Cloud
Type string - Host string
- Id string
- The provider-assigned unique ID for this managed resource.
- Is
Account bool - Api string
- Cloud string
- Provider
Config GetCurrent Config Provider Config
- account
Id String - auth
Type String - cloud
Type String - host String
- id String
- The provider-assigned unique ID for this managed resource.
- is
Account Boolean - api String
- cloud String
- provider
Config GetCurrent Config Provider Config
- account
Id string - auth
Type string - cloud
Type string - host string
- id string
- The provider-assigned unique ID for this managed resource.
- is
Account boolean - api string
- cloud string
- provider
Config GetCurrent Config Provider Config
- 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 - api str
- cloud str
- provider_
config GetCurrent Config Provider Config
- account
Id String - auth
Type String - cloud
Type String - host String
- id String
- The provider-assigned unique ID for this managed resource.
- is
Account Boolean - api String
- cloud String
- provider
Config Property Map
Supporting Types
GetCurrentConfigProviderConfig
- Workspace
Id string - Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with.
- Workspace
Id string - Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with.
- workspace
Id String - Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with.
- workspace
Id string - Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with.
- workspace_
id str - Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with.
- workspace
Id String - Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with.
Package Details
- Repository
- databricks pulumi/pulumi-databricks
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
databricksTerraform Provider.
published on Friday, May 1, 2026 by Pulumi
