import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * 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 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 * ``` */ export declare 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: string, id: pulumi.Input, state?: ScaleSetPacketCaptureState, opts?: pulumi.CustomResourceOptions): 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: any): obj is ScaleSetPacketCapture; /** * One or more `filter` blocks as defined below. Changing this forces a new resource to be created. */ readonly filters: pulumi.Output; /** * A `machineScope` block as defined below. Changing this forces a new resource to be created. */ readonly machineScope: pulumi.Output; /** * The number of bytes captured per packet. The remaining bytes are truncated. Defaults to `0` (Entire Packet Captured). Changing this forces a new resource to be created. */ readonly maximumBytesPerPacket: pulumi.Output; /** * Maximum size of the capture in Bytes. Defaults to `1073741824` (1GB). Changing this forces a new resource to be created. */ readonly maximumBytesPerSession: pulumi.Output; /** * The maximum duration of the capture session in seconds. Defaults to `18000` (5 hours). Changing this forces a new resource to be created. */ readonly maximumCaptureDurationInSeconds: pulumi.Output; /** * The name to use for this Network Packet Capture. Changing this forces a new resource to be created. */ readonly name: pulumi.Output; /** * The resource ID of the Network Watcher. Changing this forces a new resource to be created. */ readonly networkWatcherId: pulumi.Output; /** * A `storageLocation` block as defined below. Changing this forces a new resource to be created. */ readonly storageLocation: pulumi.Output; /** * The resource ID of the Virtual Machine Scale Set to capture packets from. Changing this forces a new resource to be created. */ readonly virtualMachineScaleSetId: pulumi.Output; /** * Create a ScaleSetPacketCapture resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: ScaleSetPacketCaptureArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering ScaleSetPacketCapture resources. */ export interface ScaleSetPacketCaptureState { /** * One or more `filter` blocks as defined below. Changing this forces a new resource to be created. */ filters?: pulumi.Input[]>; /** * A `machineScope` block as defined below. Changing this forces a new resource to be created. */ machineScope?: pulumi.Input; /** * The number of bytes captured per packet. The remaining bytes are truncated. Defaults to `0` (Entire Packet Captured). Changing this forces a new resource to be created. */ maximumBytesPerPacket?: pulumi.Input; /** * Maximum size of the capture in Bytes. Defaults to `1073741824` (1GB). Changing this forces a new resource to be created. */ maximumBytesPerSession?: pulumi.Input; /** * The maximum duration of the capture session in seconds. Defaults to `18000` (5 hours). Changing this forces a new resource to be created. */ maximumCaptureDurationInSeconds?: pulumi.Input; /** * The name to use for this Network Packet Capture. Changing this forces a new resource to be created. */ name?: pulumi.Input; /** * The resource ID of the Network Watcher. Changing this forces a new resource to be created. */ networkWatcherId?: pulumi.Input; /** * A `storageLocation` block as defined below. Changing this forces a new resource to be created. */ storageLocation?: pulumi.Input; /** * The resource ID of the Virtual Machine Scale Set to capture packets from. Changing this forces a new resource to be created. */ virtualMachineScaleSetId?: pulumi.Input; } /** * The set of arguments for constructing a ScaleSetPacketCapture resource. */ export interface ScaleSetPacketCaptureArgs { /** * One or more `filter` blocks as defined below. Changing this forces a new resource to be created. */ filters?: pulumi.Input[]>; /** * A `machineScope` block as defined below. Changing this forces a new resource to be created. */ machineScope?: pulumi.Input; /** * The number of bytes captured per packet. The remaining bytes are truncated. Defaults to `0` (Entire Packet Captured). Changing this forces a new resource to be created. */ maximumBytesPerPacket?: pulumi.Input; /** * Maximum size of the capture in Bytes. Defaults to `1073741824` (1GB). Changing this forces a new resource to be created. */ maximumBytesPerSession?: pulumi.Input; /** * The maximum duration of the capture session in seconds. Defaults to `18000` (5 hours). Changing this forces a new resource to be created. */ maximumCaptureDurationInSeconds?: pulumi.Input; /** * The name to use for this Network Packet Capture. Changing this forces a new resource to be created. */ name?: pulumi.Input; /** * The resource ID of the Network Watcher. Changing this forces a new resource to be created. */ networkWatcherId: pulumi.Input; /** * A `storageLocation` block as defined below. Changing this forces a new resource to be created. */ storageLocation: pulumi.Input; /** * The resource ID of the Virtual Machine Scale Set to capture packets from. Changing this forces a new resource to be created. */ virtualMachineScaleSetId: pulumi.Input; }