"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.Module = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * Manages a Dedicated Hardware Security Module.
 *
 * > **Note:** Before using this resource, it's required to submit the request of registering the providers and features with Azure CLI `az provider register --namespace Microsoft.HardwareSecurityModules && az feature register --namespace Microsoft.HardwareSecurityModules --name AzureDedicatedHSM && az provider register --namespace Microsoft.Network && az feature register --namespace Microsoft.Network --name AllowBaremetalServers` and ask service team (hsmrequest@microsoft.com) to approve. See more details from <https://docs.microsoft.com/azure/dedicated-hsm/tutorial-deploy-hsm-cli#prerequisites>.
 *
 * > **Note:** If the quota is not enough in some region, please submit the quota request to service team.
 *
 * ## 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 exampleVirtualNetwork = new azure.network.VirtualNetwork("example", {
 *     name: "example-vnet",
 *     addressSpaces: ["10.2.0.0/16"],
 *     location: example.location,
 *     resourceGroupName: example.name,
 * });
 * const exampleSubnet = new azure.network.Subnet("example", {
 *     name: "example-compute",
 *     resourceGroupName: example.name,
 *     virtualNetworkName: exampleVirtualNetwork.name,
 *     addressPrefixes: ["10.2.0.0/24"],
 * });
 * const example2 = new azure.network.Subnet("example2", {
 *     name: "example-hsmsubnet",
 *     resourceGroupName: example.name,
 *     virtualNetworkName: exampleVirtualNetwork.name,
 *     addressPrefixes: ["10.2.1.0/24"],
 *     delegations: [{
 *         name: "first",
 *         serviceDelegation: {
 *             name: "Microsoft.HardwareSecurityModules/dedicatedHSMs",
 *             actions: [
 *                 "Microsoft.Network/networkinterfaces/*",
 *                 "Microsoft.Network/virtualNetworks/subnets/join/action",
 *             ],
 *         },
 *     }],
 * });
 * const example3 = new azure.network.Subnet("example3", {
 *     name: "gatewaysubnet",
 *     resourceGroupName: example.name,
 *     virtualNetworkName: exampleVirtualNetwork.name,
 *     addressPrefixes: ["10.2.255.0/26"],
 * });
 * const examplePublicIp = new azure.network.PublicIp("example", {
 *     name: "example-pip",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     allocationMethod: "Static",
 * });
 * const exampleVirtualNetworkGateway = new azure.network.VirtualNetworkGateway("example", {
 *     name: "example-vnetgateway",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     type: "ExpressRoute",
 *     vpnType: "PolicyBased",
 *     sku: "Standard",
 *     ipConfigurations: [{
 *         publicIpAddressId: examplePublicIp.id,
 *         privateIpAddressAllocation: "Dynamic",
 *         subnetId: example3.id,
 *     }],
 * });
 * const exampleModule = new azure.hsm.Module("example", {
 *     name: "example-hsm",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     skuName: "payShield10K_LMK1_CPS60",
 *     managementNetworkProfile: {
 *         networkInterfacePrivateIpAddresses: ["10.2.1.7"],
 *         subnetId: example2.id,
 *     },
 *     networkProfile: {
 *         networkInterfacePrivateIpAddresses: ["10.2.1.8"],
 *         subnetId: example2.id,
 *     },
 *     stampId: "stamp2",
 *     tags: {
 *         env: "Test",
 *     },
 * }, {
 *     dependsOn: [exampleVirtualNetworkGateway],
 * });
 * ```
 *
 * ## API Providers
 *
 * <!-- This section is generated, changes will be overwritten -->
 * This resource uses the following Azure API Providers:
 *
 * * `Microsoft.HardwareSecurityModules` - 2021-11-30
 *
 * ## Import
 *
 * Dedicated Hardware Security Module can be imported using the `resource id`, e.g.
 *
 * ```sh
 * $ pulumi import azure:hsm/module:Module example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/hsm1
 * ```
 */
class Module extends pulumi.CustomResource {
    /**
     * Get an existing Module 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 Module(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:hsm/module:Module';
    /**
     * Returns true if the given object is an instance of Module.  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'] === Module.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["location"] = state?.location;
            resourceInputs["managementNetworkProfile"] = state?.managementNetworkProfile;
            resourceInputs["name"] = state?.name;
            resourceInputs["networkProfile"] = state?.networkProfile;
            resourceInputs["resourceGroupName"] = state?.resourceGroupName;
            resourceInputs["skuName"] = state?.skuName;
            resourceInputs["stampId"] = state?.stampId;
            resourceInputs["tags"] = state?.tags;
            resourceInputs["zones"] = state?.zones;
        }
        else {
            const args = argsOrState;
            if (args?.networkProfile === undefined && !opts.urn) {
                throw new Error("Missing required property 'networkProfile'");
            }
            if (args?.resourceGroupName === undefined && !opts.urn) {
                throw new Error("Missing required property 'resourceGroupName'");
            }
            if (args?.skuName === undefined && !opts.urn) {
                throw new Error("Missing required property 'skuName'");
            }
            resourceInputs["location"] = args?.location;
            resourceInputs["managementNetworkProfile"] = args?.managementNetworkProfile;
            resourceInputs["name"] = args?.name;
            resourceInputs["networkProfile"] = args?.networkProfile;
            resourceInputs["resourceGroupName"] = args?.resourceGroupName;
            resourceInputs["skuName"] = args?.skuName;
            resourceInputs["stampId"] = args?.stampId;
            resourceInputs["tags"] = args?.tags;
            resourceInputs["zones"] = args?.zones;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(Module.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Module = Module;
//# sourceMappingURL=module.js.map