# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import copy
import warnings
import sys
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
if sys.version_info >= (3, 11):
    from typing import NotRequired, TypedDict, TypeAlias
else:
    from typing_extensions import NotRequired, TypedDict, TypeAlias
from .. import _utilities
from . import outputs
from ._inputs import *

__all__ = ['ScaleSetPacketCaptureArgs', 'ScaleSetPacketCapture']

@pulumi.input_type
class ScaleSetPacketCaptureArgs:
    def __init__(__self__, *,
                 network_watcher_id: pulumi.Input[str],
                 storage_location: pulumi.Input['ScaleSetPacketCaptureStorageLocationArgs'],
                 virtual_machine_scale_set_id: pulumi.Input[str],
                 filters: Optional[pulumi.Input[Sequence[pulumi.Input['ScaleSetPacketCaptureFilterArgs']]]] = None,
                 machine_scope: Optional[pulumi.Input['ScaleSetPacketCaptureMachineScopeArgs']] = None,
                 maximum_bytes_per_packet: Optional[pulumi.Input[int]] = None,
                 maximum_bytes_per_session: Optional[pulumi.Input[int]] = None,
                 maximum_capture_duration_in_seconds: Optional[pulumi.Input[int]] = None,
                 name: Optional[pulumi.Input[str]] = None):
        """
        The set of arguments for constructing a ScaleSetPacketCapture resource.
        :param pulumi.Input[str] network_watcher_id: The resource ID of the Network Watcher. Changing this forces a new resource to be created.
        :param pulumi.Input['ScaleSetPacketCaptureStorageLocationArgs'] storage_location: A `storage_location` block as defined below. Changing this forces a new resource to be created.
        :param pulumi.Input[str] virtual_machine_scale_set_id: The resource ID of the Virtual Machine Scale Set to capture packets from. Changing this forces a new resource to be created.
        :param pulumi.Input[Sequence[pulumi.Input['ScaleSetPacketCaptureFilterArgs']]] filters: One or more `filter` blocks as defined below. Changing this forces a new resource to be created.
        :param pulumi.Input['ScaleSetPacketCaptureMachineScopeArgs'] machine_scope: A `machine_scope` block as defined below. Changing this forces a new resource to be created.
        :param pulumi.Input[int] maximum_bytes_per_packet: 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.
        :param pulumi.Input[int] maximum_bytes_per_session: Maximum size of the capture in Bytes. Defaults to `1073741824` (1GB). Changing this forces a new resource to be created.
        :param pulumi.Input[int] maximum_capture_duration_in_seconds: The maximum duration of the capture session in seconds. Defaults to `18000` (5 hours). Changing this forces a new resource to be created.
        :param pulumi.Input[str] name: The name to use for this Network Packet Capture. Changing this forces a new resource to be created.
        """
        pulumi.set(__self__, "network_watcher_id", network_watcher_id)
        pulumi.set(__self__, "storage_location", storage_location)
        pulumi.set(__self__, "virtual_machine_scale_set_id", virtual_machine_scale_set_id)
        if filters is not None:
            pulumi.set(__self__, "filters", filters)
        if machine_scope is not None:
            pulumi.set(__self__, "machine_scope", machine_scope)
        if maximum_bytes_per_packet is not None:
            pulumi.set(__self__, "maximum_bytes_per_packet", maximum_bytes_per_packet)
        if maximum_bytes_per_session is not None:
            pulumi.set(__self__, "maximum_bytes_per_session", maximum_bytes_per_session)
        if maximum_capture_duration_in_seconds is not None:
            pulumi.set(__self__, "maximum_capture_duration_in_seconds", maximum_capture_duration_in_seconds)
        if name is not None:
            pulumi.set(__self__, "name", name)

    @property
    @pulumi.getter(name="networkWatcherId")
    def network_watcher_id(self) -> pulumi.Input[str]:
        """
        The resource ID of the Network Watcher. Changing this forces a new resource to be created.
        """
        return pulumi.get(self, "network_watcher_id")

    @network_watcher_id.setter
    def network_watcher_id(self, value: pulumi.Input[str]):
        pulumi.set(self, "network_watcher_id", value)

    @property
    @pulumi.getter(name="storageLocation")
    def storage_location(self) -> pulumi.Input['ScaleSetPacketCaptureStorageLocationArgs']:
        """
        A `storage_location` block as defined below. Changing this forces a new resource to be created.
        """
        return pulumi.get(self, "storage_location")

    @storage_location.setter
    def storage_location(self, value: pulumi.Input['ScaleSetPacketCaptureStorageLocationArgs']):
        pulumi.set(self, "storage_location", value)

    @property
    @pulumi.getter(name="virtualMachineScaleSetId")
    def virtual_machine_scale_set_id(self) -> pulumi.Input[str]:
        """
        The resource ID of the Virtual Machine Scale Set to capture packets from. Changing this forces a new resource to be created.
        """
        return pulumi.get(self, "virtual_machine_scale_set_id")

    @virtual_machine_scale_set_id.setter
    def virtual_machine_scale_set_id(self, value: pulumi.Input[str]):
        pulumi.set(self, "virtual_machine_scale_set_id", value)

    @property
    @pulumi.getter
    def filters(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['ScaleSetPacketCaptureFilterArgs']]]]:
        """
        One or more `filter` blocks as defined below. Changing this forces a new resource to be created.
        """
        return pulumi.get(self, "filters")

    @filters.setter
    def filters(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['ScaleSetPacketCaptureFilterArgs']]]]):
        pulumi.set(self, "filters", value)

    @property
    @pulumi.getter(name="machineScope")
    def machine_scope(self) -> Optional[pulumi.Input['ScaleSetPacketCaptureMachineScopeArgs']]:
        """
        A `machine_scope` block as defined below. Changing this forces a new resource to be created.
        """
        return pulumi.get(self, "machine_scope")

    @machine_scope.setter
    def machine_scope(self, value: Optional[pulumi.Input['ScaleSetPacketCaptureMachineScopeArgs']]):
        pulumi.set(self, "machine_scope", value)

    @property
    @pulumi.getter(name="maximumBytesPerPacket")
    def maximum_bytes_per_packet(self) -> Optional[pulumi.Input[int]]:
        """
        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.
        """
        return pulumi.get(self, "maximum_bytes_per_packet")

    @maximum_bytes_per_packet.setter
    def maximum_bytes_per_packet(self, value: Optional[pulumi.Input[int]]):
        pulumi.set(self, "maximum_bytes_per_packet", value)

    @property
    @pulumi.getter(name="maximumBytesPerSession")
    def maximum_bytes_per_session(self) -> Optional[pulumi.Input[int]]:
        """
        Maximum size of the capture in Bytes. Defaults to `1073741824` (1GB). Changing this forces a new resource to be created.
        """
        return pulumi.get(self, "maximum_bytes_per_session")

    @maximum_bytes_per_session.setter
    def maximum_bytes_per_session(self, value: Optional[pulumi.Input[int]]):
        pulumi.set(self, "maximum_bytes_per_session", value)

    @property
    @pulumi.getter(name="maximumCaptureDurationInSeconds")
    def maximum_capture_duration_in_seconds(self) -> Optional[pulumi.Input[int]]:
        """
        The maximum duration of the capture session in seconds. Defaults to `18000` (5 hours). Changing this forces a new resource to be created.
        """
        return pulumi.get(self, "maximum_capture_duration_in_seconds")

    @maximum_capture_duration_in_seconds.setter
    def maximum_capture_duration_in_seconds(self, value: Optional[pulumi.Input[int]]):
        pulumi.set(self, "maximum_capture_duration_in_seconds", value)

    @property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[str]]:
        """
        The name to use for this Network Packet Capture. Changing this forces a new resource to be created.
        """
        return pulumi.get(self, "name")

    @name.setter
    def name(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "name", value)


@pulumi.input_type
class _ScaleSetPacketCaptureState:
    def __init__(__self__, *,
                 filters: Optional[pulumi.Input[Sequence[pulumi.Input['ScaleSetPacketCaptureFilterArgs']]]] = None,
                 machine_scope: Optional[pulumi.Input['ScaleSetPacketCaptureMachineScopeArgs']] = None,
                 maximum_bytes_per_packet: Optional[pulumi.Input[int]] = None,
                 maximum_bytes_per_session: Optional[pulumi.Input[int]] = None,
                 maximum_capture_duration_in_seconds: Optional[pulumi.Input[int]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 network_watcher_id: Optional[pulumi.Input[str]] = None,
                 storage_location: Optional[pulumi.Input['ScaleSetPacketCaptureStorageLocationArgs']] = None,
                 virtual_machine_scale_set_id: Optional[pulumi.Input[str]] = None):
        """
        Input properties used for looking up and filtering ScaleSetPacketCapture resources.
        :param pulumi.Input[Sequence[pulumi.Input['ScaleSetPacketCaptureFilterArgs']]] filters: One or more `filter` blocks as defined below. Changing this forces a new resource to be created.
        :param pulumi.Input['ScaleSetPacketCaptureMachineScopeArgs'] machine_scope: A `machine_scope` block as defined below. Changing this forces a new resource to be created.
        :param pulumi.Input[int] maximum_bytes_per_packet: 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.
        :param pulumi.Input[int] maximum_bytes_per_session: Maximum size of the capture in Bytes. Defaults to `1073741824` (1GB). Changing this forces a new resource to be created.
        :param pulumi.Input[int] maximum_capture_duration_in_seconds: The maximum duration of the capture session in seconds. Defaults to `18000` (5 hours). Changing this forces a new resource to be created.
        :param pulumi.Input[str] name: The name to use for this Network Packet Capture. Changing this forces a new resource to be created.
        :param pulumi.Input[str] network_watcher_id: The resource ID of the Network Watcher. Changing this forces a new resource to be created.
        :param pulumi.Input['ScaleSetPacketCaptureStorageLocationArgs'] storage_location: A `storage_location` block as defined below. Changing this forces a new resource to be created.
        :param pulumi.Input[str] virtual_machine_scale_set_id: The resource ID of the Virtual Machine Scale Set to capture packets from. Changing this forces a new resource to be created.
        """
        if filters is not None:
            pulumi.set(__self__, "filters", filters)
        if machine_scope is not None:
            pulumi.set(__self__, "machine_scope", machine_scope)
        if maximum_bytes_per_packet is not None:
            pulumi.set(__self__, "maximum_bytes_per_packet", maximum_bytes_per_packet)
        if maximum_bytes_per_session is not None:
            pulumi.set(__self__, "maximum_bytes_per_session", maximum_bytes_per_session)
        if maximum_capture_duration_in_seconds is not None:
            pulumi.set(__self__, "maximum_capture_duration_in_seconds", maximum_capture_duration_in_seconds)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if network_watcher_id is not None:
            pulumi.set(__self__, "network_watcher_id", network_watcher_id)
        if storage_location is not None:
            pulumi.set(__self__, "storage_location", storage_location)
        if virtual_machine_scale_set_id is not None:
            pulumi.set(__self__, "virtual_machine_scale_set_id", virtual_machine_scale_set_id)

    @property
    @pulumi.getter
    def filters(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['ScaleSetPacketCaptureFilterArgs']]]]:
        """
        One or more `filter` blocks as defined below. Changing this forces a new resource to be created.
        """
        return pulumi.get(self, "filters")

    @filters.setter
    def filters(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['ScaleSetPacketCaptureFilterArgs']]]]):
        pulumi.set(self, "filters", value)

    @property
    @pulumi.getter(name="machineScope")
    def machine_scope(self) -> Optional[pulumi.Input['ScaleSetPacketCaptureMachineScopeArgs']]:
        """
        A `machine_scope` block as defined below. Changing this forces a new resource to be created.
        """
        return pulumi.get(self, "machine_scope")

    @machine_scope.setter
    def machine_scope(self, value: Optional[pulumi.Input['ScaleSetPacketCaptureMachineScopeArgs']]):
        pulumi.set(self, "machine_scope", value)

    @property
    @pulumi.getter(name="maximumBytesPerPacket")
    def maximum_bytes_per_packet(self) -> Optional[pulumi.Input[int]]:
        """
        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.
        """
        return pulumi.get(self, "maximum_bytes_per_packet")

    @maximum_bytes_per_packet.setter
    def maximum_bytes_per_packet(self, value: Optional[pulumi.Input[int]]):
        pulumi.set(self, "maximum_bytes_per_packet", value)

    @property
    @pulumi.getter(name="maximumBytesPerSession")
    def maximum_bytes_per_session(self) -> Optional[pulumi.Input[int]]:
        """
        Maximum size of the capture in Bytes. Defaults to `1073741824` (1GB). Changing this forces a new resource to be created.
        """
        return pulumi.get(self, "maximum_bytes_per_session")

    @maximum_bytes_per_session.setter
    def maximum_bytes_per_session(self, value: Optional[pulumi.Input[int]]):
        pulumi.set(self, "maximum_bytes_per_session", value)

    @property
    @pulumi.getter(name="maximumCaptureDurationInSeconds")
    def maximum_capture_duration_in_seconds(self) -> Optional[pulumi.Input[int]]:
        """
        The maximum duration of the capture session in seconds. Defaults to `18000` (5 hours). Changing this forces a new resource to be created.
        """
        return pulumi.get(self, "maximum_capture_duration_in_seconds")

    @maximum_capture_duration_in_seconds.setter
    def maximum_capture_duration_in_seconds(self, value: Optional[pulumi.Input[int]]):
        pulumi.set(self, "maximum_capture_duration_in_seconds", value)

    @property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[str]]:
        """
        The name to use for this Network Packet Capture. Changing this forces a new resource to be created.
        """
        return pulumi.get(self, "name")

    @name.setter
    def name(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "name", value)

    @property
    @pulumi.getter(name="networkWatcherId")
    def network_watcher_id(self) -> Optional[pulumi.Input[str]]:
        """
        The resource ID of the Network Watcher. Changing this forces a new resource to be created.
        """
        return pulumi.get(self, "network_watcher_id")

    @network_watcher_id.setter
    def network_watcher_id(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "network_watcher_id", value)

    @property
    @pulumi.getter(name="storageLocation")
    def storage_location(self) -> Optional[pulumi.Input['ScaleSetPacketCaptureStorageLocationArgs']]:
        """
        A `storage_location` block as defined below. Changing this forces a new resource to be created.
        """
        return pulumi.get(self, "storage_location")

    @storage_location.setter
    def storage_location(self, value: Optional[pulumi.Input['ScaleSetPacketCaptureStorageLocationArgs']]):
        pulumi.set(self, "storage_location", value)

    @property
    @pulumi.getter(name="virtualMachineScaleSetId")
    def virtual_machine_scale_set_id(self) -> Optional[pulumi.Input[str]]:
        """
        The resource ID of the Virtual Machine Scale Set to capture packets from. Changing this forces a new resource to be created.
        """
        return pulumi.get(self, "virtual_machine_scale_set_id")

    @virtual_machine_scale_set_id.setter
    def virtual_machine_scale_set_id(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "virtual_machine_scale_set_id", value)


class ScaleSetPacketCapture(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 filters: Optional[pulumi.Input[Sequence[pulumi.Input[Union['ScaleSetPacketCaptureFilterArgs', 'ScaleSetPacketCaptureFilterArgsDict']]]]] = None,
                 machine_scope: Optional[pulumi.Input[Union['ScaleSetPacketCaptureMachineScopeArgs', 'ScaleSetPacketCaptureMachineScopeArgsDict']]] = None,
                 maximum_bytes_per_packet: Optional[pulumi.Input[int]] = None,
                 maximum_bytes_per_session: Optional[pulumi.Input[int]] = None,
                 maximum_capture_duration_in_seconds: Optional[pulumi.Input[int]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 network_watcher_id: Optional[pulumi.Input[str]] = None,
                 storage_location: Optional[pulumi.Input[Union['ScaleSetPacketCaptureStorageLocationArgs', 'ScaleSetPacketCaptureStorageLocationArgsDict']]] = None,
                 virtual_machine_scale_set_id: Optional[pulumi.Input[str]] = None,
                 __props__=None):
        """
        Configures Network Packet Capturing against a Virtual Machine Scale Set using a Network Watcher.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_azure as azure

        example = azure.core.ResourceGroup("example",
            name="example-resources",
            location="West Europe")
        example_network_watcher = azure.network.NetworkWatcher("example",
            name="example-nw",
            location=example.location,
            resource_group_name=example.name)
        example_virtual_network = azure.network.VirtualNetwork("example",
            name="example-vn",
            address_spaces=["10.0.0.0/16"],
            location=example.location,
            resource_group_name=example.name)
        example_subnet = azure.network.Subnet("example",
            name="internal",
            resource_group_name=example.name,
            virtual_network_name=example_virtual_network.name,
            address_prefixes=["10.0.2.0/24"])
        example_linux_virtual_machine_scale_set = azure.compute.LinuxVirtualMachineScaleSet("example",
            name="example-vmss",
            resource_group_name=example.name,
            location=example.location,
            sku="Standard_F2",
            instances=4,
            admin_username="adminuser",
            admin_password="P@ssword1234!",
            computer_name_prefix="my-linux-computer-name-prefix",
            upgrade_mode="Automatic",
            disable_password_authentication=False,
            source_image_reference={
                "publisher": "Canonical",
                "offer": "0001-com-ubuntu-server-jammy",
                "sku": "22_04-lts",
                "version": "latest",
            },
            os_disk={
                "storage_account_type": "Standard_LRS",
                "caching": "ReadWrite",
            },
            network_interfaces=[{
                "name": "example",
                "primary": True,
                "ip_configurations": [{
                    "name": "internal",
                    "primary": True,
                    "subnet_id": example_subnet.id,
                }],
            }])
        example_virtual_machine_scale_set_extension = azure.compute.VirtualMachineScaleSetExtension("example",
            name="network-watcher",
            virtual_machine_scale_set_id=example_linux_virtual_machine_scale_set.id,
            publisher="Microsoft.Azure.NetworkWatcher",
            type="NetworkWatcherAgentLinux",
            type_handler_version="1.4",
            auto_upgrade_minor_version=True,
            automatic_upgrade_enabled=True)
        example_scale_set_packet_capture = azure.compute.ScaleSetPacketCapture("example",
            name="example-pc",
            network_watcher_id=example_network_watcher.id,
            virtual_machine_scale_set_id=example_linux_virtual_machine_scale_set.id,
            storage_location={
                "file_path": "/var/captures/packet.cap",
            },
            machine_scope={
                "include_instance_ids": ["0"],
                "exclude_instance_ids": ["1"],
            },
            opts = pulumi.ResourceOptions(depends_on=[example_virtual_machine_scale_set_extension]))
        ```

        > **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 `compute.VirtualMachineScaleSetExtension` resource.

        ## 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
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[Sequence[pulumi.Input[Union['ScaleSetPacketCaptureFilterArgs', 'ScaleSetPacketCaptureFilterArgsDict']]]] filters: One or more `filter` blocks as defined below. Changing this forces a new resource to be created.
        :param pulumi.Input[Union['ScaleSetPacketCaptureMachineScopeArgs', 'ScaleSetPacketCaptureMachineScopeArgsDict']] machine_scope: A `machine_scope` block as defined below. Changing this forces a new resource to be created.
        :param pulumi.Input[int] maximum_bytes_per_packet: 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.
        :param pulumi.Input[int] maximum_bytes_per_session: Maximum size of the capture in Bytes. Defaults to `1073741824` (1GB). Changing this forces a new resource to be created.
        :param pulumi.Input[int] maximum_capture_duration_in_seconds: The maximum duration of the capture session in seconds. Defaults to `18000` (5 hours). Changing this forces a new resource to be created.
        :param pulumi.Input[str] name: The name to use for this Network Packet Capture. Changing this forces a new resource to be created.
        :param pulumi.Input[str] network_watcher_id: The resource ID of the Network Watcher. Changing this forces a new resource to be created.
        :param pulumi.Input[Union['ScaleSetPacketCaptureStorageLocationArgs', 'ScaleSetPacketCaptureStorageLocationArgsDict']] storage_location: A `storage_location` block as defined below. Changing this forces a new resource to be created.
        :param pulumi.Input[str] virtual_machine_scale_set_id: The resource ID of the Virtual Machine Scale Set to capture packets from. Changing this forces a new resource to be created.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: ScaleSetPacketCaptureArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Configures Network Packet Capturing against a Virtual Machine Scale Set using a Network Watcher.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_azure as azure

        example = azure.core.ResourceGroup("example",
            name="example-resources",
            location="West Europe")
        example_network_watcher = azure.network.NetworkWatcher("example",
            name="example-nw",
            location=example.location,
            resource_group_name=example.name)
        example_virtual_network = azure.network.VirtualNetwork("example",
            name="example-vn",
            address_spaces=["10.0.0.0/16"],
            location=example.location,
            resource_group_name=example.name)
        example_subnet = azure.network.Subnet("example",
            name="internal",
            resource_group_name=example.name,
            virtual_network_name=example_virtual_network.name,
            address_prefixes=["10.0.2.0/24"])
        example_linux_virtual_machine_scale_set = azure.compute.LinuxVirtualMachineScaleSet("example",
            name="example-vmss",
            resource_group_name=example.name,
            location=example.location,
            sku="Standard_F2",
            instances=4,
            admin_username="adminuser",
            admin_password="P@ssword1234!",
            computer_name_prefix="my-linux-computer-name-prefix",
            upgrade_mode="Automatic",
            disable_password_authentication=False,
            source_image_reference={
                "publisher": "Canonical",
                "offer": "0001-com-ubuntu-server-jammy",
                "sku": "22_04-lts",
                "version": "latest",
            },
            os_disk={
                "storage_account_type": "Standard_LRS",
                "caching": "ReadWrite",
            },
            network_interfaces=[{
                "name": "example",
                "primary": True,
                "ip_configurations": [{
                    "name": "internal",
                    "primary": True,
                    "subnet_id": example_subnet.id,
                }],
            }])
        example_virtual_machine_scale_set_extension = azure.compute.VirtualMachineScaleSetExtension("example",
            name="network-watcher",
            virtual_machine_scale_set_id=example_linux_virtual_machine_scale_set.id,
            publisher="Microsoft.Azure.NetworkWatcher",
            type="NetworkWatcherAgentLinux",
            type_handler_version="1.4",
            auto_upgrade_minor_version=True,
            automatic_upgrade_enabled=True)
        example_scale_set_packet_capture = azure.compute.ScaleSetPacketCapture("example",
            name="example-pc",
            network_watcher_id=example_network_watcher.id,
            virtual_machine_scale_set_id=example_linux_virtual_machine_scale_set.id,
            storage_location={
                "file_path": "/var/captures/packet.cap",
            },
            machine_scope={
                "include_instance_ids": ["0"],
                "exclude_instance_ids": ["1"],
            },
            opts = pulumi.ResourceOptions(depends_on=[example_virtual_machine_scale_set_extension]))
        ```

        > **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 `compute.VirtualMachineScaleSetExtension` resource.

        ## 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
        ```

        :param str resource_name: The name of the resource.
        :param ScaleSetPacketCaptureArgs args: The arguments to use to populate this resource's properties.
        :param pulumi.ResourceOptions opts: Options for the resource.
        """
        ...
    def __init__(__self__, resource_name: str, *args, **kwargs):
        resource_args, opts = _utilities.get_resource_args_opts(ScaleSetPacketCaptureArgs, pulumi.ResourceOptions, *args, **kwargs)
        if resource_args is not None:
            __self__._internal_init(resource_name, opts, **resource_args.__dict__)
        else:
            __self__._internal_init(resource_name, *args, **kwargs)

    def _internal_init(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 filters: Optional[pulumi.Input[Sequence[pulumi.Input[Union['ScaleSetPacketCaptureFilterArgs', 'ScaleSetPacketCaptureFilterArgsDict']]]]] = None,
                 machine_scope: Optional[pulumi.Input[Union['ScaleSetPacketCaptureMachineScopeArgs', 'ScaleSetPacketCaptureMachineScopeArgsDict']]] = None,
                 maximum_bytes_per_packet: Optional[pulumi.Input[int]] = None,
                 maximum_bytes_per_session: Optional[pulumi.Input[int]] = None,
                 maximum_capture_duration_in_seconds: Optional[pulumi.Input[int]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 network_watcher_id: Optional[pulumi.Input[str]] = None,
                 storage_location: Optional[pulumi.Input[Union['ScaleSetPacketCaptureStorageLocationArgs', 'ScaleSetPacketCaptureStorageLocationArgsDict']]] = None,
                 virtual_machine_scale_set_id: Optional[pulumi.Input[str]] = None,
                 __props__=None):
        opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.id is None:
            if __props__ is not None:
                raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
            __props__ = ScaleSetPacketCaptureArgs.__new__(ScaleSetPacketCaptureArgs)

            __props__.__dict__["filters"] = filters
            __props__.__dict__["machine_scope"] = machine_scope
            __props__.__dict__["maximum_bytes_per_packet"] = maximum_bytes_per_packet
            __props__.__dict__["maximum_bytes_per_session"] = maximum_bytes_per_session
            __props__.__dict__["maximum_capture_duration_in_seconds"] = maximum_capture_duration_in_seconds
            __props__.__dict__["name"] = name
            if network_watcher_id is None and not opts.urn:
                raise TypeError("Missing required property 'network_watcher_id'")
            __props__.__dict__["network_watcher_id"] = network_watcher_id
            if storage_location is None and not opts.urn:
                raise TypeError("Missing required property 'storage_location'")
            __props__.__dict__["storage_location"] = storage_location
            if virtual_machine_scale_set_id is None and not opts.urn:
                raise TypeError("Missing required property 'virtual_machine_scale_set_id'")
            __props__.__dict__["virtual_machine_scale_set_id"] = virtual_machine_scale_set_id
        super(ScaleSetPacketCapture, __self__).__init__(
            'azure:compute/scaleSetPacketCapture:ScaleSetPacketCapture',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            filters: Optional[pulumi.Input[Sequence[pulumi.Input[Union['ScaleSetPacketCaptureFilterArgs', 'ScaleSetPacketCaptureFilterArgsDict']]]]] = None,
            machine_scope: Optional[pulumi.Input[Union['ScaleSetPacketCaptureMachineScopeArgs', 'ScaleSetPacketCaptureMachineScopeArgsDict']]] = None,
            maximum_bytes_per_packet: Optional[pulumi.Input[int]] = None,
            maximum_bytes_per_session: Optional[pulumi.Input[int]] = None,
            maximum_capture_duration_in_seconds: Optional[pulumi.Input[int]] = None,
            name: Optional[pulumi.Input[str]] = None,
            network_watcher_id: Optional[pulumi.Input[str]] = None,
            storage_location: Optional[pulumi.Input[Union['ScaleSetPacketCaptureStorageLocationArgs', 'ScaleSetPacketCaptureStorageLocationArgsDict']]] = None,
            virtual_machine_scale_set_id: Optional[pulumi.Input[str]] = None) -> 'ScaleSetPacketCapture':
        """
        Get an existing ScaleSetPacketCapture resource's state with the given name, id, and optional extra
        properties used to qualify the lookup.

        :param str resource_name: The unique name of the resulting resource.
        :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[Sequence[pulumi.Input[Union['ScaleSetPacketCaptureFilterArgs', 'ScaleSetPacketCaptureFilterArgsDict']]]] filters: One or more `filter` blocks as defined below. Changing this forces a new resource to be created.
        :param pulumi.Input[Union['ScaleSetPacketCaptureMachineScopeArgs', 'ScaleSetPacketCaptureMachineScopeArgsDict']] machine_scope: A `machine_scope` block as defined below. Changing this forces a new resource to be created.
        :param pulumi.Input[int] maximum_bytes_per_packet: 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.
        :param pulumi.Input[int] maximum_bytes_per_session: Maximum size of the capture in Bytes. Defaults to `1073741824` (1GB). Changing this forces a new resource to be created.
        :param pulumi.Input[int] maximum_capture_duration_in_seconds: The maximum duration of the capture session in seconds. Defaults to `18000` (5 hours). Changing this forces a new resource to be created.
        :param pulumi.Input[str] name: The name to use for this Network Packet Capture. Changing this forces a new resource to be created.
        :param pulumi.Input[str] network_watcher_id: The resource ID of the Network Watcher. Changing this forces a new resource to be created.
        :param pulumi.Input[Union['ScaleSetPacketCaptureStorageLocationArgs', 'ScaleSetPacketCaptureStorageLocationArgsDict']] storage_location: A `storage_location` block as defined below. Changing this forces a new resource to be created.
        :param pulumi.Input[str] virtual_machine_scale_set_id: The resource ID of the Virtual Machine Scale Set to capture packets from. Changing this forces a new resource to be created.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _ScaleSetPacketCaptureState.__new__(_ScaleSetPacketCaptureState)

        __props__.__dict__["filters"] = filters
        __props__.__dict__["machine_scope"] = machine_scope
        __props__.__dict__["maximum_bytes_per_packet"] = maximum_bytes_per_packet
        __props__.__dict__["maximum_bytes_per_session"] = maximum_bytes_per_session
        __props__.__dict__["maximum_capture_duration_in_seconds"] = maximum_capture_duration_in_seconds
        __props__.__dict__["name"] = name
        __props__.__dict__["network_watcher_id"] = network_watcher_id
        __props__.__dict__["storage_location"] = storage_location
        __props__.__dict__["virtual_machine_scale_set_id"] = virtual_machine_scale_set_id
        return ScaleSetPacketCapture(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter
    def filters(self) -> pulumi.Output[Optional[Sequence['outputs.ScaleSetPacketCaptureFilter']]]:
        """
        One or more `filter` blocks as defined below. Changing this forces a new resource to be created.
        """
        return pulumi.get(self, "filters")

    @property
    @pulumi.getter(name="machineScope")
    def machine_scope(self) -> pulumi.Output[Optional['outputs.ScaleSetPacketCaptureMachineScope']]:
        """
        A `machine_scope` block as defined below. Changing this forces a new resource to be created.
        """
        return pulumi.get(self, "machine_scope")

    @property
    @pulumi.getter(name="maximumBytesPerPacket")
    def maximum_bytes_per_packet(self) -> pulumi.Output[Optional[int]]:
        """
        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.
        """
        return pulumi.get(self, "maximum_bytes_per_packet")

    @property
    @pulumi.getter(name="maximumBytesPerSession")
    def maximum_bytes_per_session(self) -> pulumi.Output[Optional[int]]:
        """
        Maximum size of the capture in Bytes. Defaults to `1073741824` (1GB). Changing this forces a new resource to be created.
        """
        return pulumi.get(self, "maximum_bytes_per_session")

    @property
    @pulumi.getter(name="maximumCaptureDurationInSeconds")
    def maximum_capture_duration_in_seconds(self) -> pulumi.Output[Optional[int]]:
        """
        The maximum duration of the capture session in seconds. Defaults to `18000` (5 hours). Changing this forces a new resource to be created.
        """
        return pulumi.get(self, "maximum_capture_duration_in_seconds")

    @property
    @pulumi.getter
    def name(self) -> pulumi.Output[str]:
        """
        The name to use for this Network Packet Capture. Changing this forces a new resource to be created.
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter(name="networkWatcherId")
    def network_watcher_id(self) -> pulumi.Output[str]:
        """
        The resource ID of the Network Watcher. Changing this forces a new resource to be created.
        """
        return pulumi.get(self, "network_watcher_id")

    @property
    @pulumi.getter(name="storageLocation")
    def storage_location(self) -> pulumi.Output['outputs.ScaleSetPacketCaptureStorageLocation']:
        """
        A `storage_location` block as defined below. Changing this forces a new resource to be created.
        """
        return pulumi.get(self, "storage_location")

    @property
    @pulumi.getter(name="virtualMachineScaleSetId")
    def virtual_machine_scale_set_id(self) -> pulumi.Output[str]:
        """
        The resource ID of the Virtual Machine Scale Set to capture packets from. Changing this forces a new resource to be created.
        """
        return pulumi.get(self, "virtual_machine_scale_set_id")

