Databricks v1.56.0 published on Tuesday, Nov 12, 2024 by Pulumi
databricks.getCurrentConfig
Explore with Pulumi AI
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:
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([{
"roleArn": cloud_credential_id,
} for entry in [{"key": k, "value": v} for k, v in {} if this.cloud_type == "aws" else {
"aws": True,
}]]),
azure_managed_identity=single_or_none([{
"accessConnectorId": cloud_credential_id,
} for entry in [{"key": k, "value": v} for k, v in {} if this.cloud_type == "azure" else {
"azure": True,
}]]),
databricks_gcp_service_account=single_or_none([{} for entry in [{"key": k, "value": v} for k, v in {} if this.cloud_type == "gcp" else {
"gcp": True,
}]]),
name="storage_cred",
comment="Managed by TF")
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",
});
});
Coming soon!
Coming soon!
Exported attributes
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 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)
// Output-based functions aren't available in Java yet
fn::invoke:
function: databricks:index/getCurrentConfig:getCurrentConfig
arguments:
# arguments dictionary
The 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
databricks
Terraform Provider.