"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.VirtualMachineConfigurationAssignment = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * Applies a Guest Configuration Policy to a Virtual Machine.
 *
 * > **Note:** You can create Guest Configuration Policies without defining a `azure.compute.Extension` resource, however the policies will not be executed until a `azure.compute.Extension` has been provisioned to the virtual machine.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 *
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-gca",
 *     location: "West Europe",
 * });
 * const exampleVirtualNetwork = new azure.network.VirtualNetwork("example", {
 *     name: "example-vnet",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     addressSpaces: ["10.0.0.0/16"],
 * });
 * 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",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     ipConfigurations: [{
 *         name: "internal",
 *         subnetId: exampleSubnet.id,
 *         privateIpAddressAllocation: "Dynamic",
 *     }],
 * });
 * const exampleWindowsVirtualMachine = new azure.compute.WindowsVirtualMachine("example", {
 *     name: "examplevm",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     size: "Standard_F2",
 *     adminUsername: "adminuser",
 *     adminPassword: "P@$$w0rd1234!",
 *     networkInterfaceIds: [exampleNetworkInterface.id],
 *     identity: {
 *         type: "SystemAssigned",
 *     },
 *     osDisk: {
 *         caching: "ReadWrite",
 *         storageAccountType: "Standard_LRS",
 *     },
 *     sourceImageReference: {
 *         publisher: "MicrosoftWindowsServer",
 *         offer: "WindowsServer",
 *         sku: "2019-Datacenter",
 *         version: "latest",
 *     },
 * });
 * const exampleExtension = new azure.compute.Extension("example", {
 *     name: "AzurePolicyforWindows",
 *     virtualMachineId: exampleWindowsVirtualMachine.id,
 *     publisher: "Microsoft.GuestConfiguration",
 *     type: "ConfigurationforWindows",
 *     typeHandlerVersion: "1.29",
 *     autoUpgradeMinorVersion: true,
 * });
 * const exampleVirtualMachineConfigurationAssignment = new azure.policy.VirtualMachineConfigurationAssignment("example", {
 *     name: "AzureWindowsBaseline",
 *     location: exampleWindowsVirtualMachine.location,
 *     virtualMachineId: exampleWindowsVirtualMachine.id,
 *     configuration: {
 *         assignmentType: "ApplyAndMonitor",
 *         version: "1.*",
 *         parameters: [
 *             {
 *                 name: "Minimum Password Length;ExpectedValue",
 *                 value: "16",
 *             },
 *             {
 *                 name: "Minimum Password Age;ExpectedValue",
 *                 value: "0",
 *             },
 *             {
 *                 name: "Maximum Password Age;ExpectedValue",
 *                 value: "30,45",
 *             },
 *             {
 *                 name: "Enforce Password History;ExpectedValue",
 *                 value: "10",
 *             },
 *             {
 *                 name: "Password Must Meet Complexity Requirements;ExpectedValue",
 *                 value: "1",
 *             },
 *         ],
 *     },
 * });
 * ```
 *
 * ## API Providers
 *
 * <!-- This section is generated, changes will be overwritten -->
 * This resource uses the following Azure API Providers:
 *
 * * `Microsoft.Compute` - 2024-04-05
 *
 * ## Import
 *
 * Policy Virtual Machine Configuration Assignments can be imported using the `resource id`, e.g.
 *
 * ```sh
 * $ pulumi import azure:policy/virtualMachineConfigurationAssignment:VirtualMachineConfigurationAssignment example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/assignment1
 * ```
 */
class VirtualMachineConfigurationAssignment extends pulumi.CustomResource {
    /**
     * Get an existing VirtualMachineConfigurationAssignment 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 VirtualMachineConfigurationAssignment(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:policy/virtualMachineConfigurationAssignment:VirtualMachineConfigurationAssignment';
    /**
     * Returns true if the given object is an instance of VirtualMachineConfigurationAssignment.  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'] === VirtualMachineConfigurationAssignment.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["configuration"] = state?.configuration;
            resourceInputs["location"] = state?.location;
            resourceInputs["name"] = state?.name;
            resourceInputs["virtualMachineId"] = state?.virtualMachineId;
        }
        else {
            const args = argsOrState;
            if (args?.configuration === undefined && !opts.urn) {
                throw new Error("Missing required property 'configuration'");
            }
            if (args?.virtualMachineId === undefined && !opts.urn) {
                throw new Error("Missing required property 'virtualMachineId'");
            }
            resourceInputs["configuration"] = args?.configuration;
            resourceInputs["location"] = args?.location;
            resourceInputs["name"] = args?.name;
            resourceInputs["virtualMachineId"] = args?.virtualMachineId;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(VirtualMachineConfigurationAssignment.__pulumiType, name, resourceInputs, opts);
    }
}
exports.VirtualMachineConfigurationAssignment = VirtualMachineConfigurationAssignment;
//# sourceMappingURL=virtualMachineConfigurationAssignment.js.map