"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.SparkCluster = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * Manages a HDInsight Spark Cluster.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 *
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const exampleAccount = new azure.storage.Account("example", {
 *     name: "hdinsightstor",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     accountTier: "Standard",
 *     accountReplicationType: "LRS",
 * });
 * const exampleContainer = new azure.storage.Container("example", {
 *     name: "hdinsight",
 *     storageAccountName: exampleAccount.name,
 *     containerAccessType: "private",
 * });
 * const exampleSparkCluster = new azure.hdinsight.SparkCluster("example", {
 *     name: "example-hdicluster",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     clusterVersion: "3.6",
 *     tier: "Standard",
 *     componentVersion: {
 *         spark: "2.3",
 *     },
 *     gateway: {
 *         username: "acctestusrgw",
 *         password: "Password123!",
 *     },
 *     storageAccounts: [{
 *         storageContainerId: exampleContainer.id,
 *         storageAccountKey: exampleAccount.primaryAccessKey,
 *         isDefault: true,
 *     }],
 *     roles: {
 *         headNode: {
 *             vmSize: "Standard_A3",
 *             username: "acctestusrvm",
 *             password: "AccTestvdSC4daf986!",
 *         },
 *         workerNode: {
 *             vmSize: "Standard_A3",
 *             username: "acctestusrvm",
 *             password: "AccTestvdSC4daf986!",
 *             targetInstanceCount: 3,
 *         },
 *         zookeeperNode: {
 *             vmSize: "Medium",
 *             username: "acctestusrvm",
 *             password: "AccTestvdSC4daf986!",
 *         },
 *     },
 * });
 * ```
 *
 * ## API Providers
 *
 * <!-- This section is generated, changes will be overwritten -->
 * This resource uses the following Azure API Providers:
 *
 * * `Microsoft.HDInsight` - 2021-06-01
 *
 * ## Import
 *
 * HDInsight Spark Clusters can be imported using the `resource id`, e.g.
 *
 * ```sh
 * $ pulumi import azure:hdinsight/sparkCluster:SparkCluster example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.HDInsight/clusters/cluster1
 * ```
 */
class SparkCluster extends pulumi.CustomResource {
    /**
     * Get an existing SparkCluster 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 SparkCluster(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:hdinsight/sparkCluster:SparkCluster';
    /**
     * Returns true if the given object is an instance of SparkCluster.  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'] === SparkCluster.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["clusterVersion"] = state?.clusterVersion;
            resourceInputs["componentVersion"] = state?.componentVersion;
            resourceInputs["computeIsolation"] = state?.computeIsolation;
            resourceInputs["diskEncryptions"] = state?.diskEncryptions;
            resourceInputs["encryptionInTransitEnabled"] = state?.encryptionInTransitEnabled;
            resourceInputs["extension"] = state?.extension;
            resourceInputs["gateway"] = state?.gateway;
            resourceInputs["httpsEndpoint"] = state?.httpsEndpoint;
            resourceInputs["location"] = state?.location;
            resourceInputs["metastores"] = state?.metastores;
            resourceInputs["monitor"] = state?.monitor;
            resourceInputs["name"] = state?.name;
            resourceInputs["network"] = state?.network;
            resourceInputs["privateLinkConfiguration"] = state?.privateLinkConfiguration;
            resourceInputs["resourceGroupName"] = state?.resourceGroupName;
            resourceInputs["roles"] = state?.roles;
            resourceInputs["securityProfile"] = state?.securityProfile;
            resourceInputs["sshEndpoint"] = state?.sshEndpoint;
            resourceInputs["storageAccountGen2"] = state?.storageAccountGen2;
            resourceInputs["storageAccounts"] = state?.storageAccounts;
            resourceInputs["tags"] = state?.tags;
            resourceInputs["tier"] = state?.tier;
            resourceInputs["tlsMinVersion"] = state?.tlsMinVersion;
            resourceInputs["zones"] = state?.zones;
        }
        else {
            const args = argsOrState;
            if (args?.clusterVersion === undefined && !opts.urn) {
                throw new Error("Missing required property 'clusterVersion'");
            }
            if (args?.componentVersion === undefined && !opts.urn) {
                throw new Error("Missing required property 'componentVersion'");
            }
            if (args?.gateway === undefined && !opts.urn) {
                throw new Error("Missing required property 'gateway'");
            }
            if (args?.resourceGroupName === undefined && !opts.urn) {
                throw new Error("Missing required property 'resourceGroupName'");
            }
            if (args?.roles === undefined && !opts.urn) {
                throw new Error("Missing required property 'roles'");
            }
            if (args?.tier === undefined && !opts.urn) {
                throw new Error("Missing required property 'tier'");
            }
            resourceInputs["clusterVersion"] = args?.clusterVersion;
            resourceInputs["componentVersion"] = args?.componentVersion;
            resourceInputs["computeIsolation"] = args?.computeIsolation;
            resourceInputs["diskEncryptions"] = args?.diskEncryptions;
            resourceInputs["encryptionInTransitEnabled"] = args?.encryptionInTransitEnabled;
            resourceInputs["extension"] = args?.extension;
            resourceInputs["gateway"] = args?.gateway;
            resourceInputs["location"] = args?.location;
            resourceInputs["metastores"] = args?.metastores;
            resourceInputs["monitor"] = args?.monitor;
            resourceInputs["name"] = args?.name;
            resourceInputs["network"] = args?.network;
            resourceInputs["privateLinkConfiguration"] = args?.privateLinkConfiguration;
            resourceInputs["resourceGroupName"] = args?.resourceGroupName;
            resourceInputs["roles"] = args?.roles;
            resourceInputs["securityProfile"] = args?.securityProfile;
            resourceInputs["storageAccountGen2"] = args?.storageAccountGen2;
            resourceInputs["storageAccounts"] = args?.storageAccounts;
            resourceInputs["tags"] = args?.tags;
            resourceInputs["tier"] = args?.tier;
            resourceInputs["tlsMinVersion"] = args?.tlsMinVersion;
            resourceInputs["zones"] = args?.zones;
            resourceInputs["httpsEndpoint"] = undefined /*out*/;
            resourceInputs["sshEndpoint"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(SparkCluster.__pulumiType, name, resourceInputs, opts);
    }
}
exports.SparkCluster = SparkCluster;
//# sourceMappingURL=sparkCluster.js.map