"use strict";
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.LinkedServiceAzureDatabricks = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * Manages a Linked Service (connection) between Azure Databricks and Azure Data Factory.
 *
 * ## Example Usage
 *
 * ### With Managed Identity & New Cluster
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 *
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example",
 *     location: "East US",
 * });
 * //Create a Linked Service using managed identity and new cluster config
 * const exampleFactory = new azure.datafactory.Factory("example", {
 *     name: "TestDtaFactory92783401247",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     identity: {
 *         type: "SystemAssigned",
 *     },
 * });
 * //Create a databricks instance
 * const exampleWorkspace = new azure.databricks.Workspace("example", {
 *     name: "databricks-test",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     sku: "standard",
 * });
 * const msiLinked = new azure.datafactory.LinkedServiceAzureDatabricks("msi_linked", {
 *     name: "ADBLinkedServiceViaMSI",
 *     dataFactoryId: exampleFactory.id,
 *     description: "ADB Linked Service via MSI",
 *     adbDomain: pulumi.interpolate`https://${exampleWorkspace.workspaceUrl}`,
 *     msiWorkspaceId: exampleWorkspace.id,
 *     newClusterConfig: {
 *         nodeType: "Standard_NC12",
 *         clusterVersion: "5.5.x-gpu-scala2.11",
 *         minNumberOfWorkers: 1,
 *         maxNumberOfWorkers: 5,
 *         driverNodeType: "Standard_NC12",
 *         logDestination: "dbfs:/logs",
 *         customTags: {
 *             custom_tag1: "sct_value_1",
 *             custom_tag2: "sct_value_2",
 *         },
 *         sparkConfig: {
 *             config1: "value1",
 *             config2: "value2",
 *         },
 *         sparkEnvironmentVariables: {
 *             envVar1: "value1",
 *             envVar2: "value2",
 *         },
 *         initScripts: [
 *             "init.sh",
 *             "init2.sh",
 *         ],
 *     },
 * });
 * ```
 *
 * ### With Access Token & Existing Cluster
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 *
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example",
 *     location: "East US",
 * });
 * //Link to an existing cluster via access token
 * const exampleFactory = new azure.datafactory.Factory("example", {
 *     name: "TestDtaFactory92783401247",
 *     location: example.location,
 *     resourceGroupName: example.name,
 * });
 * //Create a databricks instance
 * const exampleWorkspace = new azure.databricks.Workspace("example", {
 *     name: "databricks-test",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     sku: "standard",
 * });
 * const atLinked = new azure.datafactory.LinkedServiceAzureDatabricks("at_linked", {
 *     name: "ADBLinkedServiceViaAccessToken",
 *     dataFactoryId: exampleFactory.id,
 *     description: "ADB Linked Service via Access Token",
 *     existingClusterId: "0308-201146-sly615",
 *     accessToken: "SomeDatabricksAccessToken",
 *     adbDomain: pulumi.interpolate`https://${exampleWorkspace.workspaceUrl}`,
 * });
 * ```
 *
 * ## Import
 *
 * Data Factory Linked Services can be imported using the `resource id`, e.g.
 *
 * ```sh
 * $ pulumi import azure:datafactory/linkedServiceAzureDatabricks:LinkedServiceAzureDatabricks example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example/providers/Microsoft.DataFactory/factories/example/linkedservices/example
 * ```
 */
class LinkedServiceAzureDatabricks extends pulumi.CustomResource {
    /**
     * Get an existing LinkedServiceAzureDatabricks resource's state with the given name, ID, and optional extra
     * properties used to qualify the lookup.
     *
     * @param name The _unique_ name of the resulting resource.
     * @param id The _unique_ provider ID of the resource to lookup.
     * @param state Any extra arguments used during the lookup.
     * @param opts Optional settings to control the behavior of the CustomResource.
     */
    static get(name, id, state, opts) {
        return new LinkedServiceAzureDatabricks(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:datafactory/linkedServiceAzureDatabricks:LinkedServiceAzureDatabricks';
    /**
     * Returns true if the given object is an instance of LinkedServiceAzureDatabricks.  This is designed to work even
     * when multiple copies of the Pulumi SDK have been loaded into the same process.
     */
    static isInstance(obj) {
        if (obj === undefined || obj === null) {
            return false;
        }
        return obj['__pulumiType'] === LinkedServiceAzureDatabricks.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["accessToken"] = state?.accessToken;
            resourceInputs["adbDomain"] = state?.adbDomain;
            resourceInputs["additionalProperties"] = state?.additionalProperties;
            resourceInputs["annotations"] = state?.annotations;
            resourceInputs["dataFactoryId"] = state?.dataFactoryId;
            resourceInputs["description"] = state?.description;
            resourceInputs["existingClusterId"] = state?.existingClusterId;
            resourceInputs["instancePool"] = state?.instancePool;
            resourceInputs["integrationRuntimeName"] = state?.integrationRuntimeName;
            resourceInputs["keyVaultPassword"] = state?.keyVaultPassword;
            resourceInputs["msiWorkSpaceResourceId"] = state?.msiWorkSpaceResourceId;
            resourceInputs["msiWorkspaceId"] = state?.msiWorkspaceId;
            resourceInputs["name"] = state?.name;
            resourceInputs["newClusterConfig"] = state?.newClusterConfig;
            resourceInputs["parameters"] = state?.parameters;
        }
        else {
            const args = argsOrState;
            if (args?.adbDomain === undefined && !opts.urn) {
                throw new Error("Missing required property 'adbDomain'");
            }
            if (args?.dataFactoryId === undefined && !opts.urn) {
                throw new Error("Missing required property 'dataFactoryId'");
            }
            resourceInputs["accessToken"] = args?.accessToken ? pulumi.secret(args.accessToken) : undefined;
            resourceInputs["adbDomain"] = args?.adbDomain;
            resourceInputs["additionalProperties"] = args?.additionalProperties;
            resourceInputs["annotations"] = args?.annotations;
            resourceInputs["dataFactoryId"] = args?.dataFactoryId;
            resourceInputs["description"] = args?.description;
            resourceInputs["existingClusterId"] = args?.existingClusterId;
            resourceInputs["instancePool"] = args?.instancePool;
            resourceInputs["integrationRuntimeName"] = args?.integrationRuntimeName;
            resourceInputs["keyVaultPassword"] = args?.keyVaultPassword;
            resourceInputs["msiWorkSpaceResourceId"] = args?.msiWorkSpaceResourceId;
            resourceInputs["msiWorkspaceId"] = args?.msiWorkspaceId;
            resourceInputs["name"] = args?.name;
            resourceInputs["newClusterConfig"] = args?.newClusterConfig;
            resourceInputs["parameters"] = args?.parameters;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const secretOpts = { additionalSecretOutputs: ["accessToken"] };
        opts = pulumi.mergeOptions(opts, secretOpts);
        super(LinkedServiceAzureDatabricks.__pulumiType, name, resourceInputs, opts);
    }
}
exports.LinkedServiceAzureDatabricks = LinkedServiceAzureDatabricks;
//# sourceMappingURL=linkedServiceAzureDatabricks.js.map