All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azure.compute.kotlin.ScaleSetPacketCaptureArgs.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.compute.kotlin

import com.pulumi.azure.compute.ScaleSetPacketCaptureArgs.builder
import com.pulumi.azure.compute.kotlin.inputs.ScaleSetPacketCaptureFilterArgs
import com.pulumi.azure.compute.kotlin.inputs.ScaleSetPacketCaptureFilterArgsBuilder
import com.pulumi.azure.compute.kotlin.inputs.ScaleSetPacketCaptureMachineScopeArgs
import com.pulumi.azure.compute.kotlin.inputs.ScaleSetPacketCaptureMachineScopeArgsBuilder
import com.pulumi.azure.compute.kotlin.inputs.ScaleSetPacketCaptureStorageLocationArgs
import com.pulumi.azure.compute.kotlin.inputs.ScaleSetPacketCaptureStorageLocationArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * 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],
 * });
 * ```
 * ```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]))
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "example-resources",
 *         Location = "West Europe",
 *     });
 *     var exampleNetworkWatcher = new Azure.Network.NetworkWatcher("example", new()
 *     {
 *         Name = "example-nw",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *     });
 *     var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("example", new()
 *     {
 *         Name = "example-vn",
 *         AddressSpaces = new[]
 *         {
 *             "10.0.0.0/16",
 *         },
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *     });
 *     var exampleSubnet = new Azure.Network.Subnet("example", new()
 *     {
 *         Name = "internal",
 *         ResourceGroupName = example.Name,
 *         VirtualNetworkName = exampleVirtualNetwork.Name,
 *         AddressPrefixes = new[]
 *         {
 *             "10.0.2.0/24",
 *         },
 *     });
 *     var exampleLinuxVirtualMachineScaleSet = new Azure.Compute.LinuxVirtualMachineScaleSet("example", new()
 *     {
 *         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 = new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetSourceImageReferenceArgs
 *         {
 *             Publisher = "Canonical",
 *             Offer = "0001-com-ubuntu-server-jammy",
 *             Sku = "22_04-lts",
 *             Version = "latest",
 *         },
 *         OsDisk = new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetOsDiskArgs
 *         {
 *             StorageAccountType = "Standard_LRS",
 *             Caching = "ReadWrite",
 *         },
 *         NetworkInterfaces = new[]
 *         {
 *             new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetNetworkInterfaceArgs
 *             {
 *                 Name = "example",
 *                 Primary = true,
 *                 IpConfigurations = new[]
 *                 {
 *                     new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs
 *                     {
 *                         Name = "internal",
 *                         Primary = true,
 *                         SubnetId = exampleSubnet.Id,
 *                     },
 *                 },
 *             },
 *         },
 *     });
 *     var exampleVirtualMachineScaleSetExtension = new Azure.Compute.VirtualMachineScaleSetExtension("example", new()
 *     {
 *         Name = "network-watcher",
 *         VirtualMachineScaleSetId = exampleLinuxVirtualMachineScaleSet.Id,
 *         Publisher = "Microsoft.Azure.NetworkWatcher",
 *         Type = "NetworkWatcherAgentLinux",
 *         TypeHandlerVersion = "1.4",
 *         AutoUpgradeMinorVersion = true,
 *         AutomaticUpgradeEnabled = true,
 *     });
 *     var exampleScaleSetPacketCapture = new Azure.Compute.ScaleSetPacketCapture("example", new()
 *     {
 *         Name = "example-pc",
 *         NetworkWatcherId = exampleNetworkWatcher.Id,
 *         VirtualMachineScaleSetId = exampleLinuxVirtualMachineScaleSet.Id,
 *         StorageLocation = new Azure.Compute.Inputs.ScaleSetPacketCaptureStorageLocationArgs
 *         {
 *             FilePath = "/var/captures/packet.cap",
 *         },
 *         MachineScope = new Azure.Compute.Inputs.ScaleSetPacketCaptureMachineScopeArgs
 *         {
 *             IncludeInstanceIds = new[]
 *             {
 *                 "0",
 *             },
 *             ExcludeInstanceIds = new[]
 *             {
 *                 "1",
 *             },
 *         },
 *     }, new CustomResourceOptions
 *     {
 *         DependsOn =
 *         {
 *             exampleVirtualMachineScaleSetExtension,
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("example-resources"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleNetworkWatcher, err := network.NewNetworkWatcher(ctx, "example", &network.NetworkWatcherArgs{
 * 			Name:              pulumi.String("example-nw"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "example", &network.VirtualNetworkArgs{
 * 			Name: pulumi.String("example-vn"),
 * 			AddressSpaces: pulumi.StringArray{
 * 				pulumi.String("10.0.0.0/16"),
 * 			},
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleSubnet, err := network.NewSubnet(ctx, "example", &network.SubnetArgs{
 * 			Name:               pulumi.String("internal"),
 * 			ResourceGroupName:  example.Name,
 * 			VirtualNetworkName: exampleVirtualNetwork.Name,
 * 			AddressPrefixes: pulumi.StringArray{
 * 				pulumi.String("10.0.2.0/24"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleLinuxVirtualMachineScaleSet, err := compute.NewLinuxVirtualMachineScaleSet(ctx, "example", &compute.LinuxVirtualMachineScaleSetArgs{
 * 			Name:                          pulumi.String("example-vmss"),
 * 			ResourceGroupName:             example.Name,
 * 			Location:                      example.Location,
 * 			Sku:                           pulumi.String("Standard_F2"),
 * 			Instances:                     pulumi.Int(4),
 * 			AdminUsername:                 pulumi.String("adminuser"),
 * 			AdminPassword:                 pulumi.String("P@ssword1234!"),
 * 			ComputerNamePrefix:            pulumi.String("my-linux-computer-name-prefix"),
 * 			UpgradeMode:                   pulumi.String("Automatic"),
 * 			DisablePasswordAuthentication: pulumi.Bool(false),
 * 			SourceImageReference: &compute.LinuxVirtualMachineScaleSetSourceImageReferenceArgs{
 * 				Publisher: pulumi.String("Canonical"),
 * 				Offer:     pulumi.String("0001-com-ubuntu-server-jammy"),
 * 				Sku:       pulumi.String("22_04-lts"),
 * 				Version:   pulumi.String("latest"),
 * 			},
 * 			OsDisk: &compute.LinuxVirtualMachineScaleSetOsDiskArgs{
 * 				StorageAccountType: pulumi.String("Standard_LRS"),
 * 				Caching:            pulumi.String("ReadWrite"),
 * 			},
 * 			NetworkInterfaces: compute.LinuxVirtualMachineScaleSetNetworkInterfaceArray{
 * 				&compute.LinuxVirtualMachineScaleSetNetworkInterfaceArgs{
 * 					Name:    pulumi.String("example"),
 * 					Primary: pulumi.Bool(true),
 * 					IpConfigurations: compute.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArray{
 * 						&compute.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs{
 * 							Name:     pulumi.String("internal"),
 * 							Primary:  pulumi.Bool(true),
 * 							SubnetId: exampleSubnet.ID(),
 * 						},
 * 					},
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleVirtualMachineScaleSetExtension, err := compute.NewVirtualMachineScaleSetExtension(ctx, "example", &compute.VirtualMachineScaleSetExtensionArgs{
 * 			Name:                     pulumi.String("network-watcher"),
 * 			VirtualMachineScaleSetId: exampleLinuxVirtualMachineScaleSet.ID(),
 * 			Publisher:                pulumi.String("Microsoft.Azure.NetworkWatcher"),
 * 			Type:                     pulumi.String("NetworkWatcherAgentLinux"),
 * 			TypeHandlerVersion:       pulumi.String("1.4"),
 * 			AutoUpgradeMinorVersion:  pulumi.Bool(true),
 * 			AutomaticUpgradeEnabled:  pulumi.Bool(true),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = compute.NewScaleSetPacketCapture(ctx, "example", &compute.ScaleSetPacketCaptureArgs{
 * 			Name:                     pulumi.String("example-pc"),
 * 			NetworkWatcherId:         exampleNetworkWatcher.ID(),
 * 			VirtualMachineScaleSetId: exampleLinuxVirtualMachineScaleSet.ID(),
 * 			StorageLocation: &compute.ScaleSetPacketCaptureStorageLocationArgs{
 * 				FilePath: pulumi.String("/var/captures/packet.cap"),
 * 			},
 * 			MachineScope: &compute.ScaleSetPacketCaptureMachineScopeArgs{
 * 				IncludeInstanceIds: pulumi.StringArray{
 * 					pulumi.String("0"),
 * 				},
 * 				ExcludeInstanceIds: pulumi.StringArray{
 * 					pulumi.String("1"),
 * 				},
 * 			},
 * 		}, pulumi.DependsOn([]pulumi.Resource{
 * 			exampleVirtualMachineScaleSetExtension,
 * 		}))
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azure.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.network.NetworkWatcher;
 * import com.pulumi.azure.network.NetworkWatcherArgs;
 * import com.pulumi.azure.network.VirtualNetwork;
 * import com.pulumi.azure.network.VirtualNetworkArgs;
 * import com.pulumi.azure.network.Subnet;
 * import com.pulumi.azure.network.SubnetArgs;
 * import com.pulumi.azure.compute.LinuxVirtualMachineScaleSet;
 * import com.pulumi.azure.compute.LinuxVirtualMachineScaleSetArgs;
 * import com.pulumi.azure.compute.inputs.LinuxVirtualMachineScaleSetSourceImageReferenceArgs;
 * import com.pulumi.azure.compute.inputs.LinuxVirtualMachineScaleSetOsDiskArgs;
 * import com.pulumi.azure.compute.inputs.LinuxVirtualMachineScaleSetNetworkInterfaceArgs;
 * import com.pulumi.azure.compute.VirtualMachineScaleSetExtension;
 * import com.pulumi.azure.compute.VirtualMachineScaleSetExtensionArgs;
 * import com.pulumi.azure.compute.ScaleSetPacketCapture;
 * import com.pulumi.azure.compute.ScaleSetPacketCaptureArgs;
 * import com.pulumi.azure.compute.inputs.ScaleSetPacketCaptureStorageLocationArgs;
 * import com.pulumi.azure.compute.inputs.ScaleSetPacketCaptureMachineScopeArgs;
 * import com.pulumi.resources.CustomResourceOptions;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 *     public static void stack(Context ctx) {
 *         var example = new ResourceGroup("example", ResourceGroupArgs.builder()
 *             .name("example-resources")
 *             .location("West Europe")
 *             .build());
 *         var exampleNetworkWatcher = new NetworkWatcher("exampleNetworkWatcher", NetworkWatcherArgs.builder()
 *             .name("example-nw")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .build());
 *         var exampleVirtualNetwork = new VirtualNetwork("exampleVirtualNetwork", VirtualNetworkArgs.builder()
 *             .name("example-vn")
 *             .addressSpaces("10.0.0.0/16")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .build());
 *         var exampleSubnet = new Subnet("exampleSubnet", SubnetArgs.builder()
 *             .name("internal")
 *             .resourceGroupName(example.name())
 *             .virtualNetworkName(exampleVirtualNetwork.name())
 *             .addressPrefixes("10.0.2.0/24")
 *             .build());
 *         var exampleLinuxVirtualMachineScaleSet = new LinuxVirtualMachineScaleSet("exampleLinuxVirtualMachineScaleSet", LinuxVirtualMachineScaleSetArgs.builder()
 *             .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(LinuxVirtualMachineScaleSetSourceImageReferenceArgs.builder()
 *                 .publisher("Canonical")
 *                 .offer("0001-com-ubuntu-server-jammy")
 *                 .sku("22_04-lts")
 *                 .version("latest")
 *                 .build())
 *             .osDisk(LinuxVirtualMachineScaleSetOsDiskArgs.builder()
 *                 .storageAccountType("Standard_LRS")
 *                 .caching("ReadWrite")
 *                 .build())
 *             .networkInterfaces(LinuxVirtualMachineScaleSetNetworkInterfaceArgs.builder()
 *                 .name("example")
 *                 .primary(true)
 *                 .ipConfigurations(LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs.builder()
 *                     .name("internal")
 *                     .primary(true)
 *                     .subnetId(exampleSubnet.id())
 *                     .build())
 *                 .build())
 *             .build());
 *         var exampleVirtualMachineScaleSetExtension = new VirtualMachineScaleSetExtension("exampleVirtualMachineScaleSetExtension", VirtualMachineScaleSetExtensionArgs.builder()
 *             .name("network-watcher")
 *             .virtualMachineScaleSetId(exampleLinuxVirtualMachineScaleSet.id())
 *             .publisher("Microsoft.Azure.NetworkWatcher")
 *             .type("NetworkWatcherAgentLinux")
 *             .typeHandlerVersion("1.4")
 *             .autoUpgradeMinorVersion(true)
 *             .automaticUpgradeEnabled(true)
 *             .build());
 *         var exampleScaleSetPacketCapture = new ScaleSetPacketCapture("exampleScaleSetPacketCapture", ScaleSetPacketCaptureArgs.builder()
 *             .name("example-pc")
 *             .networkWatcherId(exampleNetworkWatcher.id())
 *             .virtualMachineScaleSetId(exampleLinuxVirtualMachineScaleSet.id())
 *             .storageLocation(ScaleSetPacketCaptureStorageLocationArgs.builder()
 *                 .filePath("/var/captures/packet.cap")
 *                 .build())
 *             .machineScope(ScaleSetPacketCaptureMachineScopeArgs.builder()
 *                 .includeInstanceIds("0")
 *                 .excludeInstanceIds("1")
 *                 .build())
 *             .build(), CustomResourceOptions.builder()
 *                 .dependsOn(exampleVirtualMachineScaleSetExtension)
 *                 .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleNetworkWatcher:
 *     type: azure:network:NetworkWatcher
 *     name: example
 *     properties:
 *       name: example-nw
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *   exampleVirtualNetwork:
 *     type: azure:network:VirtualNetwork
 *     name: example
 *     properties:
 *       name: example-vn
 *       addressSpaces:
 *         - 10.0.0.0/16
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *   exampleSubnet:
 *     type: azure:network:Subnet
 *     name: example
 *     properties:
 *       name: internal
 *       resourceGroupName: ${example.name}
 *       virtualNetworkName: ${exampleVirtualNetwork.name}
 *       addressPrefixes:
 *         - 10.0.2.0/24
 *   exampleLinuxVirtualMachineScaleSet:
 *     type: azure:compute:LinuxVirtualMachineScaleSet
 *     name: example
 *     properties:
 *       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}
 *   exampleVirtualMachineScaleSetExtension:
 *     type: azure:compute:VirtualMachineScaleSetExtension
 *     name: example
 *     properties:
 *       name: network-watcher
 *       virtualMachineScaleSetId: ${exampleLinuxVirtualMachineScaleSet.id}
 *       publisher: Microsoft.Azure.NetworkWatcher
 *       type: NetworkWatcherAgentLinux
 *       typeHandlerVersion: '1.4'
 *       autoUpgradeMinorVersion: true
 *       automaticUpgradeEnabled: true
 *   exampleScaleSetPacketCapture:
 *     type: azure:compute:ScaleSetPacketCapture
 *     name: example
 *     properties:
 *       name: example-pc
 *       networkWatcherId: ${exampleNetworkWatcher.id}
 *       virtualMachineScaleSetId: ${exampleLinuxVirtualMachineScaleSet.id}
 *       storageLocation:
 *         filePath: /var/captures/packet.cap
 *       machineScope:
 *         includeInstanceIds:
 *           - '0'
 *         excludeInstanceIds:
 *           - '1'
 *     options:
 *       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.
 * ## 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
 * ```
 * @property filters One or more `filter` blocks as defined below. Changing this forces a new resource to be created.
 * @property machineScope A `machine_scope` block as defined below. Changing this forces a new resource to be created.
 * @property maximumBytesPerPacket 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.
 * @property maximumBytesPerSession Maximum size of the capture in Bytes. Defaults to `1073741824` (1GB). Changing this forces a new resource to be created.
 * @property maximumCaptureDurationInSeconds The maximum duration of the capture session in seconds. Defaults to `18000` (5 hours). Changing this forces a new resource to be created.
 * @property name The name to use for this Network Packet Capture. Changing this forces a new resource to be created.
 * @property networkWatcherId The resource ID of the Network Watcher. Changing this forces a new resource to be created.
 * @property storageLocation A `storage_location` block as defined below. Changing this forces a new resource to be created.
 * @property virtualMachineScaleSetId The resource ID of the Virtual Machine Scale Set to capture packets from. Changing this forces a new resource to be created.
 */
public data class ScaleSetPacketCaptureArgs(
    public val filters: Output>? = null,
    public val machineScope: Output? = null,
    public val maximumBytesPerPacket: Output? = null,
    public val maximumBytesPerSession: Output? = null,
    public val maximumCaptureDurationInSeconds: Output? = null,
    public val name: Output? = null,
    public val networkWatcherId: Output? = null,
    public val storageLocation: Output? = null,
    public val virtualMachineScaleSetId: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.compute.ScaleSetPacketCaptureArgs =
        com.pulumi.azure.compute.ScaleSetPacketCaptureArgs.builder()
            .filters(
                filters?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .machineScope(machineScope?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .maximumBytesPerPacket(maximumBytesPerPacket?.applyValue({ args0 -> args0 }))
            .maximumBytesPerSession(maximumBytesPerSession?.applyValue({ args0 -> args0 }))
            .maximumCaptureDurationInSeconds(maximumCaptureDurationInSeconds?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .networkWatcherId(networkWatcherId?.applyValue({ args0 -> args0 }))
            .storageLocation(storageLocation?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .virtualMachineScaleSetId(virtualMachineScaleSetId?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [ScaleSetPacketCaptureArgs].
 */
@PulumiTagMarker
public class ScaleSetPacketCaptureArgsBuilder internal constructor() {
    private var filters: Output>? = null

    private var machineScope: Output? = null

    private var maximumBytesPerPacket: Output? = null

    private var maximumBytesPerSession: Output? = null

    private var maximumCaptureDurationInSeconds: Output? = null

    private var name: Output? = null

    private var networkWatcherId: Output? = null

    private var storageLocation: Output? = null

    private var virtualMachineScaleSetId: Output? = null

    /**
     * @param value One or more `filter` blocks as defined below. Changing this forces a new resource to be created.
     */
    @JvmName("yxcfwfngkiaojplr")
    public suspend fun filters(`value`: Output>) {
        this.filters = value
    }

    @JvmName("ovbasuqsbgxilsfb")
    public suspend fun filters(vararg values: Output) {
        this.filters = Output.all(values.asList())
    }

    /**
     * @param values One or more `filter` blocks as defined below. Changing this forces a new resource to be created.
     */
    @JvmName("qphxbsripbkcbwsx")
    public suspend fun filters(values: List>) {
        this.filters = Output.all(values)
    }

    /**
     * @param value A `machine_scope` block as defined below. Changing this forces a new resource to be created.
     */
    @JvmName("jdadxkhnwdlxbsft")
    public suspend fun machineScope(`value`: Output) {
        this.machineScope = value
    }

    /**
     * @param value 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.
     */
    @JvmName("gbekbikmwykgbaya")
    public suspend fun maximumBytesPerPacket(`value`: Output) {
        this.maximumBytesPerPacket = value
    }

    /**
     * @param value Maximum size of the capture in Bytes. Defaults to `1073741824` (1GB). Changing this forces a new resource to be created.
     */
    @JvmName("jdjgtbugimospqtx")
    public suspend fun maximumBytesPerSession(`value`: Output) {
        this.maximumBytesPerSession = value
    }

    /**
     * @param value The maximum duration of the capture session in seconds. Defaults to `18000` (5 hours). Changing this forces a new resource to be created.
     */
    @JvmName("cofkdjofftdwcmfy")
    public suspend fun maximumCaptureDurationInSeconds(`value`: Output) {
        this.maximumCaptureDurationInSeconds = value
    }

    /**
     * @param value The name to use for this Network Packet Capture. Changing this forces a new resource to be created.
     */
    @JvmName("hkffyqxdfbnrrfvr")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The resource ID of the Network Watcher. Changing this forces a new resource to be created.
     */
    @JvmName("yqcbwjgrnhbvkdmp")
    public suspend fun networkWatcherId(`value`: Output) {
        this.networkWatcherId = value
    }

    /**
     * @param value A `storage_location` block as defined below. Changing this forces a new resource to be created.
     */
    @JvmName("lbsgxtclklqjahhj")
    public suspend fun storageLocation(`value`: Output) {
        this.storageLocation = value
    }

    /**
     * @param value The resource ID of the Virtual Machine Scale Set to capture packets from. Changing this forces a new resource to be created.
     */
    @JvmName("djjpfoagecvsoqto")
    public suspend fun virtualMachineScaleSetId(`value`: Output) {
        this.virtualMachineScaleSetId = value
    }

    /**
     * @param value One or more `filter` blocks as defined below. Changing this forces a new resource to be created.
     */
    @JvmName("yvcqjoudceqqvkjs")
    public suspend fun filters(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.filters = mapped
    }

    /**
     * @param argument One or more `filter` blocks as defined below. Changing this forces a new resource to be created.
     */
    @JvmName("pbfyounntcweexcj")
    public suspend fun filters(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            ScaleSetPacketCaptureFilterArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.filters = mapped
    }

    /**
     * @param argument One or more `filter` blocks as defined below. Changing this forces a new resource to be created.
     */
    @JvmName("hywwgdhrlywknhga")
    public suspend fun filters(vararg argument: suspend ScaleSetPacketCaptureFilterArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            ScaleSetPacketCaptureFilterArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.filters = mapped
    }

    /**
     * @param argument One or more `filter` blocks as defined below. Changing this forces a new resource to be created.
     */
    @JvmName("ylqxslmdkfuiqfnm")
    public suspend fun filters(argument: suspend ScaleSetPacketCaptureFilterArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            ScaleSetPacketCaptureFilterArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.filters = mapped
    }

    /**
     * @param values One or more `filter` blocks as defined below. Changing this forces a new resource to be created.
     */
    @JvmName("osgnkotlnbhupbwr")
    public suspend fun filters(vararg values: ScaleSetPacketCaptureFilterArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.filters = mapped
    }

    /**
     * @param value A `machine_scope` block as defined below. Changing this forces a new resource to be created.
     */
    @JvmName("gabxdiwrqblcaxqy")
    public suspend fun machineScope(`value`: ScaleSetPacketCaptureMachineScopeArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.machineScope = mapped
    }

    /**
     * @param argument A `machine_scope` block as defined below. Changing this forces a new resource to be created.
     */
    @JvmName("xpldeautdvkderid")
    public suspend fun machineScope(argument: suspend ScaleSetPacketCaptureMachineScopeArgsBuilder.() -> Unit) {
        val toBeMapped = ScaleSetPacketCaptureMachineScopeArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.machineScope = mapped
    }

    /**
     * @param value 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.
     */
    @JvmName("dpweehhgcpvqlgfl")
    public suspend fun maximumBytesPerPacket(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.maximumBytesPerPacket = mapped
    }

    /**
     * @param value Maximum size of the capture in Bytes. Defaults to `1073741824` (1GB). Changing this forces a new resource to be created.
     */
    @JvmName("pweogfwtlqklkpit")
    public suspend fun maximumBytesPerSession(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.maximumBytesPerSession = mapped
    }

    /**
     * @param value The maximum duration of the capture session in seconds. Defaults to `18000` (5 hours). Changing this forces a new resource to be created.
     */
    @JvmName("ejjwnfqlwtwghhdx")
    public suspend fun maximumCaptureDurationInSeconds(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.maximumCaptureDurationInSeconds = mapped
    }

    /**
     * @param value The name to use for this Network Packet Capture. Changing this forces a new resource to be created.
     */
    @JvmName("ewtvhajqxmapuqhp")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The resource ID of the Network Watcher. Changing this forces a new resource to be created.
     */
    @JvmName("ylshmpsnnyjjbweb")
    public suspend fun networkWatcherId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.networkWatcherId = mapped
    }

    /**
     * @param value A `storage_location` block as defined below. Changing this forces a new resource to be created.
     */
    @JvmName("ixooxqaducqcecng")
    public suspend fun storageLocation(`value`: ScaleSetPacketCaptureStorageLocationArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.storageLocation = mapped
    }

    /**
     * @param argument A `storage_location` block as defined below. Changing this forces a new resource to be created.
     */
    @JvmName("bhstwyxgwrstsmof")
    public suspend fun storageLocation(argument: suspend ScaleSetPacketCaptureStorageLocationArgsBuilder.() -> Unit) {
        val toBeMapped = ScaleSetPacketCaptureStorageLocationArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.storageLocation = mapped
    }

    /**
     * @param value The resource ID of the Virtual Machine Scale Set to capture packets from. Changing this forces a new resource to be created.
     */
    @JvmName("slijomlnbjyethtw")
    public suspend fun virtualMachineScaleSetId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.virtualMachineScaleSetId = mapped
    }

    internal fun build(): ScaleSetPacketCaptureArgs = ScaleSetPacketCaptureArgs(
        filters = filters,
        machineScope = machineScope,
        maximumBytesPerPacket = maximumBytesPerPacket,
        maximumBytesPerSession = maximumBytesPerSession,
        maximumCaptureDurationInSeconds = maximumCaptureDurationInSeconds,
        name = name,
        networkWatcherId = networkWatcherId,
        storageLocation = storageLocation,
        virtualMachineScaleSetId = virtualMachineScaleSetId,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy