"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.VolumeGroup = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * Manages an Elastic SAN Volume Group resource.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 *
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-rg",
 *     location: "West Europe",
 * });
 * const exampleElasticSan = new azure.elasticsan.ElasticSan("example", {
 *     name: "examplees-es",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     baseSizeInTib: 1,
 *     sku: {
 *         name: "Premium_LRS",
 *     },
 * });
 * const current = azure.core.getClientConfig({});
 * const exampleUserAssignedIdentity = new azure.authorization.UserAssignedIdentity("example", {
 *     name: "example-uai",
 *     location: example.location,
 *     resourceGroupName: example.name,
 * });
 * const exampleVirtualNetwork = new azure.network.VirtualNetwork("example", {
 *     name: "example-vnet",
 *     addressSpaces: ["10.0.0.0/16"],
 *     location: example.location,
 *     resourceGroupName: example.name,
 * });
 * const exampleSubnet = new azure.network.Subnet("example", {
 *     name: "example-subnet",
 *     resourceGroupName: example.name,
 *     virtualNetworkName: exampleVirtualNetwork.name,
 *     addressPrefixes: ["10.0.1.0/24"],
 *     serviceEndpoints: ["Microsoft.Storage.Global"],
 * });
 * const exampleKeyVault = new azure.keyvault.KeyVault("example", {
 *     name: "examplekv",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     enabledForDiskEncryption: true,
 *     tenantId: current.then(current => current.tenantId),
 *     softDeleteRetentionDays: 7,
 *     purgeProtectionEnabled: true,
 *     skuName: "standard",
 * });
 * const userAssignedIdentity = new azure.keyvault.AccessPolicy("userAssignedIdentity", {
 *     keyVaultId: exampleKeyVault.id,
 *     tenantId: current.then(current => current.tenantId),
 *     objectId: exampleUserAssignedIdentity.principalId,
 *     keyPermissions: [
 *         "Get",
 *         "UnwrapKey",
 *         "WrapKey",
 *     ],
 *     secretPermissions: ["Get"],
 * });
 * const client = new azure.keyvault.AccessPolicy("client", {
 *     keyVaultId: exampleKeyVault.id,
 *     tenantId: current.then(current => current.tenantId),
 *     objectId: current.then(current => current.objectId),
 *     keyPermissions: [
 *         "Get",
 *         "Create",
 *         "Delete",
 *         "List",
 *         "Restore",
 *         "Recover",
 *         "UnwrapKey",
 *         "WrapKey",
 *         "Purge",
 *         "Encrypt",
 *         "Decrypt",
 *         "Sign",
 *         "Verify",
 *         "GetRotationPolicy",
 *     ],
 *     secretPermissions: ["Get"],
 * });
 * const exampleKey = new azure.keyvault.Key("example", {
 *     name: "example-kvk",
 *     keyVaultId: exampleKeyVault.id,
 *     keyType: "RSA",
 *     keySize: 2048,
 *     keyOpts: [
 *         "decrypt",
 *         "encrypt",
 *         "sign",
 *         "unwrapKey",
 *         "verify",
 *         "wrapKey",
 *     ],
 * }, {
 *     dependsOn: [
 *         userAssignedIdentity,
 *         client,
 *     ],
 * });
 * const exampleVolumeGroup = new azure.elasticsan.VolumeGroup("example", {
 *     name: "example-esvg",
 *     elasticSanId: exampleElasticSan.id,
 *     encryptionType: "EncryptionAtRestWithCustomerManagedKey",
 *     encryption: {
 *         keyVaultKeyId: exampleKey.versionlessId,
 *         userAssignedIdentityId: exampleUserAssignedIdentity.id,
 *     },
 *     identity: {
 *         type: "UserAssigned",
 *         identityIds: [exampleUserAssignedIdentity.id],
 *     },
 *     networkRules: [{
 *         subnetId: exampleSubnet.id,
 *         action: "Allow",
 *     }],
 * });
 * ```
 *
 * ## API Providers
 *
 * <!-- This section is generated, changes will be overwritten -->
 * This resource uses the following Azure API Providers:
 *
 * * `Microsoft.ElasticSan` - 2023-01-01
 *
 * ## Import
 *
 * An existing Elastic SAN Volume Group can be imported into Pulumi using the `resource id`, e.g.
 *
 * ```sh
 * $ pulumi import azure:elasticsan/volumeGroup:VolumeGroup example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ElasticSan/elasticSans/esan1/volumeGroups/vg1
 * ```
 */
class VolumeGroup extends pulumi.CustomResource {
    /**
     * Get an existing VolumeGroup 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 VolumeGroup(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:elasticsan/volumeGroup:VolumeGroup';
    /**
     * Returns true if the given object is an instance of VolumeGroup.  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'] === VolumeGroup.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["elasticSanId"] = state?.elasticSanId;
            resourceInputs["encryption"] = state?.encryption;
            resourceInputs["encryptionType"] = state?.encryptionType;
            resourceInputs["identity"] = state?.identity;
            resourceInputs["name"] = state?.name;
            resourceInputs["networkRules"] = state?.networkRules;
            resourceInputs["protocolType"] = state?.protocolType;
        }
        else {
            const args = argsOrState;
            if (args?.elasticSanId === undefined && !opts.urn) {
                throw new Error("Missing required property 'elasticSanId'");
            }
            resourceInputs["elasticSanId"] = args?.elasticSanId;
            resourceInputs["encryption"] = args?.encryption;
            resourceInputs["encryptionType"] = args?.encryptionType;
            resourceInputs["identity"] = args?.identity;
            resourceInputs["name"] = args?.name;
            resourceInputs["networkRules"] = args?.networkRules;
            resourceInputs["protocolType"] = args?.protocolType;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(VolumeGroup.__pulumiType, name, resourceInputs, opts);
    }
}
exports.VolumeGroup = VolumeGroup;
//# sourceMappingURL=volumeGroup.js.map