"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.ScaleSetPacketCapture = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * Configures Network Packet Capturing against a Virtual Machine Scale Set using a Network Watcher.
 *
 * ## 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 exampleNetworkWatcher = new azure.network.NetworkWatcher("example", {
 *     name: "example-nw",
 *     location: example.location,
 *     resourceGroupName: example.name,
 * });
 * const exampleVirtualNetwork = new azure.network.VirtualNetwork("example", {
 *     name: "example-vn",
 *     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 exampleLinuxVirtualMachineScaleSet = new azure.compute.LinuxVirtualMachineScaleSet("example", {
 *     name: "example-vmss",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     sku: "Standard_F2",
 *     instances: 4,
 *     adminUsername: "adminuser",
 *     adminPassword: "P@ssword1234!",
 *     computerNamePrefix: "my-linux-computer-name-prefix",
 *     upgradeMode: "Automatic",
 *     disablePasswordAuthentication: false,
 *     sourceImageReference: {
 *         publisher: "Canonical",
 *         offer: "0001-com-ubuntu-server-jammy",
 *         sku: "22_04-lts",
 *         version: "latest",
 *     },
 *     osDisk: {
 *         storageAccountType: "Standard_LRS",
 *         caching: "ReadWrite",
 *     },
 *     networkInterfaces: [{
 *         name: "example",
 *         primary: true,
 *         ipConfigurations: [{
 *             name: "internal",
 *             primary: true,
 *             subnetId: exampleSubnet.id,
 *         }],
 *     }],
 * });
 * const exampleVirtualMachineScaleSetExtension = new azure.compute.VirtualMachineScaleSetExtension("example", {
 *     name: "network-watcher",
 *     virtualMachineScaleSetId: exampleLinuxVirtualMachineScaleSet.id,
 *     publisher: "Microsoft.Azure.NetworkWatcher",
 *     type: "NetworkWatcherAgentLinux",
 *     typeHandlerVersion: "1.4",
 *     autoUpgradeMinorVersion: true,
 *     automaticUpgradeEnabled: true,
 * });
 * const exampleScaleSetPacketCapture = new azure.compute.ScaleSetPacketCapture("example", {
 *     name: "example-pc",
 *     networkWatcherId: exampleNetworkWatcher.id,
 *     virtualMachineScaleSetId: exampleLinuxVirtualMachineScaleSet.id,
 *     storageLocation: {
 *         filePath: "/var/captures/packet.cap",
 *     },
 *     machineScope: {
 *         includeInstanceIds: ["0"],
 *         excludeInstanceIds: ["1"],
 *     },
 * }, {
 *     dependsOn: [exampleVirtualMachineScaleSetExtension],
 * });
 * ```
 *
 * > **Note:** This Resource requires that [the Network Watcher Extension](https://docs.microsoft.com/azure/network-watcher/network-watcher-packet-capture-manage-portal#before-you-begin) is installed on the Virtual Machine Scale Set before capturing can be enabled which can be installed via the `azure.compute.VirtualMachineScaleSetExtension` resource.
 *
 * ## API Providers
 *
 * <!-- This section is generated, changes will be overwritten -->
 * This resource uses the following Azure API Providers:
 *
 * * `Microsoft.Network` - 2025-01-01
 *
 * ## Import
 *
 * Virtual Machine Scale Set Packet Captures can be imported using the `resource id`, e.g.
 *
 * ```sh
 * $ pulumi import azure:compute/scaleSetPacketCapture:ScaleSetPacketCapture capture1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Network/networkWatchers/watcher1/packetCaptures/capture1
 * ```
 */
class ScaleSetPacketCapture extends pulumi.CustomResource {
    /**
     * Get an existing ScaleSetPacketCapture 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 ScaleSetPacketCapture(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:compute/scaleSetPacketCapture:ScaleSetPacketCapture';
    /**
     * Returns true if the given object is an instance of ScaleSetPacketCapture.  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'] === ScaleSetPacketCapture.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["filters"] = state?.filters;
            resourceInputs["machineScope"] = state?.machineScope;
            resourceInputs["maximumBytesPerPacket"] = state?.maximumBytesPerPacket;
            resourceInputs["maximumBytesPerSession"] = state?.maximumBytesPerSession;
            resourceInputs["maximumCaptureDurationInSeconds"] = state?.maximumCaptureDurationInSeconds;
            resourceInputs["name"] = state?.name;
            resourceInputs["networkWatcherId"] = state?.networkWatcherId;
            resourceInputs["storageLocation"] = state?.storageLocation;
            resourceInputs["virtualMachineScaleSetId"] = state?.virtualMachineScaleSetId;
        }
        else {
            const args = argsOrState;
            if (args?.networkWatcherId === undefined && !opts.urn) {
                throw new Error("Missing required property 'networkWatcherId'");
            }
            if (args?.storageLocation === undefined && !opts.urn) {
                throw new Error("Missing required property 'storageLocation'");
            }
            if (args?.virtualMachineScaleSetId === undefined && !opts.urn) {
                throw new Error("Missing required property 'virtualMachineScaleSetId'");
            }
            resourceInputs["filters"] = args?.filters;
            resourceInputs["machineScope"] = args?.machineScope;
            resourceInputs["maximumBytesPerPacket"] = args?.maximumBytesPerPacket;
            resourceInputs["maximumBytesPerSession"] = args?.maximumBytesPerSession;
            resourceInputs["maximumCaptureDurationInSeconds"] = args?.maximumCaptureDurationInSeconds;
            resourceInputs["name"] = args?.name;
            resourceInputs["networkWatcherId"] = args?.networkWatcherId;
            resourceInputs["storageLocation"] = args?.storageLocation;
            resourceInputs["virtualMachineScaleSetId"] = args?.virtualMachineScaleSetId;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(ScaleSetPacketCapture.__pulumiType, name, resourceInputs, opts);
    }
}
exports.ScaleSetPacketCapture = ScaleSetPacketCapture;
//# sourceMappingURL=scaleSetPacketCapture.js.map