"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.Workspace = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * Manages a Azure Machine Learning Workspace
 *
 * > **Note:** For examples on how to set up the Azure Machine Learning workspace, together with compute and integrated services, see Terraform Quickstart
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 *
 * const current = azure.core.getClientConfig({});
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const exampleInsights = new azure.appinsights.Insights("example", {
 *     name: "workspace-example-ai",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     applicationType: "web",
 * });
 * const exampleKeyVault = new azure.keyvault.KeyVault("example", {
 *     name: "workspaceexamplekeyvault",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     tenantId: current.then(current => current.tenantId),
 *     skuName: "premium",
 * });
 * const exampleAccount = new azure.storage.Account("example", {
 *     name: "workspacestorageaccount",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     accountTier: "Standard",
 *     accountReplicationType: "GRS",
 * });
 * const exampleWorkspace = new azure.machinelearning.Workspace("example", {
 *     name: "example-workspace",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     applicationInsightsId: exampleInsights.id,
 *     keyVaultId: exampleKeyVault.id,
 *     storageAccountId: exampleAccount.id,
 *     identity: {
 *         type: "SystemAssigned",
 *     },
 * });
 * ```
 *
 * ### With Data Encryption
 *
 * > **Note:** The Key Vault must enable purge protection.
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 *
 * const current = azure.core.getClientConfig({});
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const exampleInsights = new azure.appinsights.Insights("example", {
 *     name: "workspace-example-ai",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     applicationType: "web",
 * });
 * const exampleKeyVault = new azure.keyvault.KeyVault("example", {
 *     name: "workspaceexamplekeyvault",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     tenantId: current.then(current => current.tenantId),
 *     skuName: "premium",
 *     purgeProtectionEnabled: true,
 * });
 * const exampleAccessPolicy = new azure.keyvault.AccessPolicy("example", {
 *     keyVaultId: exampleKeyVault.id,
 *     tenantId: current.then(current => current.tenantId),
 *     objectId: current.then(current => current.objectId),
 *     keyPermissions: [
 *         "Create",
 *         "Get",
 *         "Delete",
 *         "Purge",
 *         "GetRotationPolicy",
 *     ],
 * });
 * const exampleAccount = new azure.storage.Account("example", {
 *     name: "workspacestorageaccount",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     accountTier: "Standard",
 *     accountReplicationType: "GRS",
 * });
 * const exampleKey = new azure.keyvault.Key("example", {
 *     name: "workspaceexamplekeyvaultkey",
 *     keyVaultId: exampleKeyVault.id,
 *     keyType: "RSA",
 *     keySize: 2048,
 *     keyOpts: [
 *         "decrypt",
 *         "encrypt",
 *         "sign",
 *         "unwrapKey",
 *         "verify",
 *         "wrapKey",
 *     ],
 * }, {
 *     dependsOn: [
 *         exampleKeyVault,
 *         exampleAccessPolicy,
 *     ],
 * });
 * const exampleWorkspace = new azure.machinelearning.Workspace("example", {
 *     name: "example-workspace",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     applicationInsightsId: exampleInsights.id,
 *     keyVaultId: exampleKeyVault.id,
 *     storageAccountId: exampleAccount.id,
 *     identity: {
 *         type: "SystemAssigned",
 *     },
 *     encryption: {
 *         keyVaultId: exampleKeyVault.id,
 *         keyId: exampleKey.id,
 *     },
 * });
 * ```
 *
 * ## Import
 *
 * Machine Learning Workspace can be imported using the `resource id`, e.g.
 *
 * ```sh
 * $ pulumi import azure:machinelearning/workspace:Workspace example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.MachineLearningServices/workspaces/workspace1
 * ```
 */
class Workspace extends pulumi.CustomResource {
    /**
     * Get an existing Workspace 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 Workspace(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:machinelearning/workspace:Workspace';
    /**
     * Returns true if the given object is an instance of Workspace.  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'] === Workspace.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["applicationInsightsId"] = state?.applicationInsightsId;
            resourceInputs["containerRegistryId"] = state?.containerRegistryId;
            resourceInputs["description"] = state?.description;
            resourceInputs["discoveryUrl"] = state?.discoveryUrl;
            resourceInputs["encryption"] = state?.encryption;
            resourceInputs["featureStore"] = state?.featureStore;
            resourceInputs["friendlyName"] = state?.friendlyName;
            resourceInputs["highBusinessImpact"] = state?.highBusinessImpact;
            resourceInputs["identity"] = state?.identity;
            resourceInputs["imageBuildComputeName"] = state?.imageBuildComputeName;
            resourceInputs["keyVaultId"] = state?.keyVaultId;
            resourceInputs["kind"] = state?.kind;
            resourceInputs["location"] = state?.location;
            resourceInputs["managedNetwork"] = state?.managedNetwork;
            resourceInputs["name"] = state?.name;
            resourceInputs["primaryUserAssignedIdentity"] = state?.primaryUserAssignedIdentity;
            resourceInputs["publicNetworkAccessEnabled"] = state?.publicNetworkAccessEnabled;
            resourceInputs["resourceGroupName"] = state?.resourceGroupName;
            resourceInputs["serverlessCompute"] = state?.serverlessCompute;
            resourceInputs["serviceSideEncryptionEnabled"] = state?.serviceSideEncryptionEnabled;
            resourceInputs["skuName"] = state?.skuName;
            resourceInputs["storageAccountId"] = state?.storageAccountId;
            resourceInputs["tags"] = state?.tags;
            resourceInputs["v1LegacyModeEnabled"] = state?.v1LegacyModeEnabled;
            resourceInputs["workspaceId"] = state?.workspaceId;
        }
        else {
            const args = argsOrState;
            if (args?.applicationInsightsId === undefined && !opts.urn) {
                throw new Error("Missing required property 'applicationInsightsId'");
            }
            if (args?.identity === undefined && !opts.urn) {
                throw new Error("Missing required property 'identity'");
            }
            if (args?.keyVaultId === undefined && !opts.urn) {
                throw new Error("Missing required property 'keyVaultId'");
            }
            if (args?.resourceGroupName === undefined && !opts.urn) {
                throw new Error("Missing required property 'resourceGroupName'");
            }
            if (args?.storageAccountId === undefined && !opts.urn) {
                throw new Error("Missing required property 'storageAccountId'");
            }
            resourceInputs["applicationInsightsId"] = args?.applicationInsightsId;
            resourceInputs["containerRegistryId"] = args?.containerRegistryId;
            resourceInputs["description"] = args?.description;
            resourceInputs["encryption"] = args?.encryption;
            resourceInputs["featureStore"] = args?.featureStore;
            resourceInputs["friendlyName"] = args?.friendlyName;
            resourceInputs["highBusinessImpact"] = args?.highBusinessImpact;
            resourceInputs["identity"] = args?.identity;
            resourceInputs["imageBuildComputeName"] = args?.imageBuildComputeName;
            resourceInputs["keyVaultId"] = args?.keyVaultId;
            resourceInputs["kind"] = args?.kind;
            resourceInputs["location"] = args?.location;
            resourceInputs["managedNetwork"] = args?.managedNetwork;
            resourceInputs["name"] = args?.name;
            resourceInputs["primaryUserAssignedIdentity"] = args?.primaryUserAssignedIdentity;
            resourceInputs["publicNetworkAccessEnabled"] = args?.publicNetworkAccessEnabled;
            resourceInputs["resourceGroupName"] = args?.resourceGroupName;
            resourceInputs["serverlessCompute"] = args?.serverlessCompute;
            resourceInputs["serviceSideEncryptionEnabled"] = args?.serviceSideEncryptionEnabled;
            resourceInputs["skuName"] = args?.skuName;
            resourceInputs["storageAccountId"] = args?.storageAccountId;
            resourceInputs["tags"] = args?.tags;
            resourceInputs["v1LegacyModeEnabled"] = args?.v1LegacyModeEnabled;
            resourceInputs["discoveryUrl"] = undefined /*out*/;
            resourceInputs["workspaceId"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(Workspace.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Workspace = Workspace;
//# sourceMappingURL=workspace.js.map