1. Packages
  2. Databricks
  3. API Docs
  4. getCurrentConfig
Databricks v1.38.0 published on Monday, Apr 29, 2024 by Pulumi

databricks.getCurrentConfig

Explore with Pulumi AI

databricks logo
Databricks v1.38.0 published on Monday, Apr 29, 2024 by Pulumi

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

    The following resources are used in the same context:

    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:

    AccountId string
    AuthType string
    CloudType string
    Host string
    IsAccount bool
    AccountId string
    AuthType string
    CloudType string
    Host string
    IsAccount bool
    accountId String
    authType String
    cloudType String
    host String
    isAccount Boolean
    accountId string
    authType string
    cloudType string
    host string
    isAccount boolean
    accountId String
    authType String
    cloudType String
    host String
    isAccount Boolean

    getCurrentConfig Result

    The following output properties are available:

    AccountId string
    AuthType string
    CloudType string
    Host string
    Id string
    The provider-assigned unique ID for this managed resource.
    IsAccount bool
    AccountId string
    AuthType string
    CloudType string
    Host string
    Id string
    The provider-assigned unique ID for this managed resource.
    IsAccount bool
    accountId String
    authType String
    cloudType String
    host String
    id String
    The provider-assigned unique ID for this managed resource.
    isAccount Boolean
    accountId string
    authType string
    cloudType string
    host string
    id string
    The provider-assigned unique ID for this managed resource.
    isAccount boolean
    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
    accountId String
    authType String
    cloudType String
    host String
    id String
    The provider-assigned unique ID for this managed resource.
    isAccount Boolean

    Package Details

    Repository
    databricks pulumi/pulumi-databricks
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the databricks Terraform Provider.
    databricks logo
    Databricks v1.38.0 published on Monday, Apr 29, 2024 by Pulumi