"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.WindowsVirtualMachine = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * Manages a Windows Virtual Machine.
 *
 * ## Disclaimers
 *
 * > **Note** This provider will automatically remove the OS Disk by default - this behaviour can be configured using the `features` setting within the Provider block.
 *
 * > **Note** All arguments including the administrator login and password will be stored in the raw state as plain-text.
 *
 * > **Note** This resource does not support Unmanaged Disks. If you need to use Unmanaged Disks you can continue to use the `azure.compute.VirtualMachine` resource instead.
 *
 * > **Note** This resource does not support attaching existing OS Disks. You can instead capture an image of the OS Disk or continue to use the `azure.compute.VirtualMachine` resource instead.
 *
 * > In this release there's a known issue where the `publicIpAddress` and `publicIpAddresses` fields may not be fully populated for Dynamic Public IP's.
 *
 * ## Example Usage
 *
 * This example provisions a basic Windows Virtual Machine on an internal network.
 *
 * ```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-network",
 *     addressSpaces: ["10.0.0.0/16"],
 *     location: example.location,
 *     resourceGroupName: example.name,
 * });
 * const exampleSubnet = new azure.network.Subnet("example", {
 *     name: "internal",
 *     resourceGroupName: example.name,
 *     virtualNetworkName: exampleVirtualNetwork.name,
 *     addressPrefixes: ["10.0.2.0/24"],
 * });
 * const exampleNetworkInterface = new azure.network.NetworkInterface("example", {
 *     name: "example-nic",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     ipConfigurations: [{
 *         name: "internal",
 *         subnetId: exampleSubnet.id,
 *         privateIpAddressAllocation: "Dynamic",
 *     }],
 * });
 * const exampleWindowsVirtualMachine = new azure.compute.WindowsVirtualMachine("example", {
 *     name: "example-machine",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     size: "Standard_F2",
 *     adminUsername: "adminuser",
 *     adminPassword: "P@$$w0rd1234!",
 *     networkInterfaceIds: [exampleNetworkInterface.id],
 *     osDisk: {
 *         caching: "ReadWrite",
 *         storageAccountType: "Standard_LRS",
 *     },
 *     sourceImageReference: {
 *         publisher: "MicrosoftWindowsServer",
 *         offer: "WindowsServer",
 *         sku: "2016-Datacenter",
 *         version: "latest",
 *     },
 * });
 * ```
 *
 * ## API Providers
 *
 * <!-- This section is generated, changes will be overwritten -->
 * This resource uses the following Azure API Providers:
 *
 * * `Microsoft.Compute` - 2024-03-01, 2023-04-02
 *
 * ## Import
 *
 * Windows Virtual Machines can be imported using the `resource id`, e.g.
 *
 * ```sh
 * $ pulumi import azure:compute/windowsVirtualMachine:WindowsVirtualMachine example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Compute/virtualMachines/machine1
 * ```
 */
class WindowsVirtualMachine extends pulumi.CustomResource {
    /**
     * Get an existing WindowsVirtualMachine 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 WindowsVirtualMachine(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:compute/windowsVirtualMachine:WindowsVirtualMachine';
    /**
     * Returns true if the given object is an instance of WindowsVirtualMachine.  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'] === WindowsVirtualMachine.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["additionalCapabilities"] = state?.additionalCapabilities;
            resourceInputs["additionalUnattendContents"] = state?.additionalUnattendContents;
            resourceInputs["adminPassword"] = state?.adminPassword;
            resourceInputs["adminUsername"] = state?.adminUsername;
            resourceInputs["allowExtensionOperations"] = state?.allowExtensionOperations;
            resourceInputs["automaticUpdatesEnabled"] = state?.automaticUpdatesEnabled;
            resourceInputs["availabilitySetId"] = state?.availabilitySetId;
            resourceInputs["bootDiagnostics"] = state?.bootDiagnostics;
            resourceInputs["bypassPlatformSafetyChecksOnUserScheduleEnabled"] = state?.bypassPlatformSafetyChecksOnUserScheduleEnabled;
            resourceInputs["capacityReservationGroupId"] = state?.capacityReservationGroupId;
            resourceInputs["computerName"] = state?.computerName;
            resourceInputs["customData"] = state?.customData;
            resourceInputs["dedicatedHostGroupId"] = state?.dedicatedHostGroupId;
            resourceInputs["dedicatedHostId"] = state?.dedicatedHostId;
            resourceInputs["diskControllerType"] = state?.diskControllerType;
            resourceInputs["edgeZone"] = state?.edgeZone;
            resourceInputs["enableAutomaticUpdates"] = state?.enableAutomaticUpdates;
            resourceInputs["encryptionAtHostEnabled"] = state?.encryptionAtHostEnabled;
            resourceInputs["evictionPolicy"] = state?.evictionPolicy;
            resourceInputs["extensionsTimeBudget"] = state?.extensionsTimeBudget;
            resourceInputs["galleryApplications"] = state?.galleryApplications;
            resourceInputs["hotpatchingEnabled"] = state?.hotpatchingEnabled;
            resourceInputs["identity"] = state?.identity;
            resourceInputs["licenseType"] = state?.licenseType;
            resourceInputs["location"] = state?.location;
            resourceInputs["maxBidPrice"] = state?.maxBidPrice;
            resourceInputs["name"] = state?.name;
            resourceInputs["networkInterfaceIds"] = state?.networkInterfaceIds;
            resourceInputs["osDisk"] = state?.osDisk;
            resourceInputs["osImageNotification"] = state?.osImageNotification;
            resourceInputs["osManagedDiskId"] = state?.osManagedDiskId;
            resourceInputs["patchAssessmentMode"] = state?.patchAssessmentMode;
            resourceInputs["patchMode"] = state?.patchMode;
            resourceInputs["plan"] = state?.plan;
            resourceInputs["platformFaultDomain"] = state?.platformFaultDomain;
            resourceInputs["priority"] = state?.priority;
            resourceInputs["privateIpAddress"] = state?.privateIpAddress;
            resourceInputs["privateIpAddresses"] = state?.privateIpAddresses;
            resourceInputs["provisionVmAgent"] = state?.provisionVmAgent;
            resourceInputs["proximityPlacementGroupId"] = state?.proximityPlacementGroupId;
            resourceInputs["publicIpAddress"] = state?.publicIpAddress;
            resourceInputs["publicIpAddresses"] = state?.publicIpAddresses;
            resourceInputs["rebootSetting"] = state?.rebootSetting;
            resourceInputs["resourceGroupName"] = state?.resourceGroupName;
            resourceInputs["secrets"] = state?.secrets;
            resourceInputs["secureBootEnabled"] = state?.secureBootEnabled;
            resourceInputs["size"] = state?.size;
            resourceInputs["sourceImageId"] = state?.sourceImageId;
            resourceInputs["sourceImageReference"] = state?.sourceImageReference;
            resourceInputs["tags"] = state?.tags;
            resourceInputs["terminationNotification"] = state?.terminationNotification;
            resourceInputs["timezone"] = state?.timezone;
            resourceInputs["userData"] = state?.userData;
            resourceInputs["virtualMachineId"] = state?.virtualMachineId;
            resourceInputs["virtualMachineScaleSetId"] = state?.virtualMachineScaleSetId;
            resourceInputs["vmAgentPlatformUpdatesEnabled"] = state?.vmAgentPlatformUpdatesEnabled;
            resourceInputs["vtpmEnabled"] = state?.vtpmEnabled;
            resourceInputs["winrmListeners"] = state?.winrmListeners;
            resourceInputs["zone"] = state?.zone;
        }
        else {
            const args = argsOrState;
            if (args?.networkInterfaceIds === undefined && !opts.urn) {
                throw new Error("Missing required property 'networkInterfaceIds'");
            }
            if (args?.osDisk === undefined && !opts.urn) {
                throw new Error("Missing required property 'osDisk'");
            }
            if (args?.resourceGroupName === undefined && !opts.urn) {
                throw new Error("Missing required property 'resourceGroupName'");
            }
            if (args?.size === undefined && !opts.urn) {
                throw new Error("Missing required property 'size'");
            }
            resourceInputs["additionalCapabilities"] = args?.additionalCapabilities;
            resourceInputs["additionalUnattendContents"] = args?.additionalUnattendContents;
            resourceInputs["adminPassword"] = args?.adminPassword ? pulumi.secret(args.adminPassword) : undefined;
            resourceInputs["adminUsername"] = args?.adminUsername;
            resourceInputs["allowExtensionOperations"] = args?.allowExtensionOperations;
            resourceInputs["automaticUpdatesEnabled"] = args?.automaticUpdatesEnabled;
            resourceInputs["availabilitySetId"] = args?.availabilitySetId;
            resourceInputs["bootDiagnostics"] = args?.bootDiagnostics;
            resourceInputs["bypassPlatformSafetyChecksOnUserScheduleEnabled"] = args?.bypassPlatformSafetyChecksOnUserScheduleEnabled;
            resourceInputs["capacityReservationGroupId"] = args?.capacityReservationGroupId;
            resourceInputs["computerName"] = args?.computerName;
            resourceInputs["customData"] = args?.customData ? pulumi.secret(args.customData) : undefined;
            resourceInputs["dedicatedHostGroupId"] = args?.dedicatedHostGroupId;
            resourceInputs["dedicatedHostId"] = args?.dedicatedHostId;
            resourceInputs["diskControllerType"] = args?.diskControllerType;
            resourceInputs["edgeZone"] = args?.edgeZone;
            resourceInputs["enableAutomaticUpdates"] = args?.enableAutomaticUpdates;
            resourceInputs["encryptionAtHostEnabled"] = args?.encryptionAtHostEnabled;
            resourceInputs["evictionPolicy"] = args?.evictionPolicy;
            resourceInputs["extensionsTimeBudget"] = args?.extensionsTimeBudget;
            resourceInputs["galleryApplications"] = args?.galleryApplications;
            resourceInputs["hotpatchingEnabled"] = args?.hotpatchingEnabled;
            resourceInputs["identity"] = args?.identity;
            resourceInputs["licenseType"] = args?.licenseType;
            resourceInputs["location"] = args?.location;
            resourceInputs["maxBidPrice"] = args?.maxBidPrice;
            resourceInputs["name"] = args?.name;
            resourceInputs["networkInterfaceIds"] = args?.networkInterfaceIds;
            resourceInputs["osDisk"] = args?.osDisk;
            resourceInputs["osImageNotification"] = args?.osImageNotification;
            resourceInputs["osManagedDiskId"] = args?.osManagedDiskId;
            resourceInputs["patchAssessmentMode"] = args?.patchAssessmentMode;
            resourceInputs["patchMode"] = args?.patchMode;
            resourceInputs["plan"] = args?.plan;
            resourceInputs["platformFaultDomain"] = args?.platformFaultDomain;
            resourceInputs["priority"] = args?.priority;
            resourceInputs["provisionVmAgent"] = args?.provisionVmAgent;
            resourceInputs["proximityPlacementGroupId"] = args?.proximityPlacementGroupId;
            resourceInputs["rebootSetting"] = args?.rebootSetting;
            resourceInputs["resourceGroupName"] = args?.resourceGroupName;
            resourceInputs["secrets"] = args?.secrets;
            resourceInputs["secureBootEnabled"] = args?.secureBootEnabled;
            resourceInputs["size"] = args?.size;
            resourceInputs["sourceImageId"] = args?.sourceImageId;
            resourceInputs["sourceImageReference"] = args?.sourceImageReference;
            resourceInputs["tags"] = args?.tags;
            resourceInputs["terminationNotification"] = args?.terminationNotification;
            resourceInputs["timezone"] = args?.timezone;
            resourceInputs["userData"] = args?.userData;
            resourceInputs["virtualMachineScaleSetId"] = args?.virtualMachineScaleSetId;
            resourceInputs["vmAgentPlatformUpdatesEnabled"] = args?.vmAgentPlatformUpdatesEnabled;
            resourceInputs["vtpmEnabled"] = args?.vtpmEnabled;
            resourceInputs["winrmListeners"] = args?.winrmListeners;
            resourceInputs["zone"] = args?.zone;
            resourceInputs["privateIpAddress"] = undefined /*out*/;
            resourceInputs["privateIpAddresses"] = undefined /*out*/;
            resourceInputs["publicIpAddress"] = undefined /*out*/;
            resourceInputs["publicIpAddresses"] = undefined /*out*/;
            resourceInputs["virtualMachineId"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const secretOpts = { additionalSecretOutputs: ["adminPassword", "customData"] };
        opts = pulumi.mergeOptions(opts, secretOpts);
        super(WindowsVirtualMachine.__pulumiType, name, resourceInputs, opts);
    }
}
exports.WindowsVirtualMachine = WindowsVirtualMachine;
//# sourceMappingURL=windowsVirtualMachine.js.map