PacketCapture

Information about packet capture session. API Version: 2020-11-01.

Example Usage

Create packet capture

using System.Collections.Generic;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var packetCapture = new AzureNative.Network.PacketCapture("packetCapture", new()
{
BytesToCapturePerPacket = 10000,
Filters = new[]
{
new AzureNative.Network.Inputs.PacketCaptureFilterArgs
{
LocalIPAddress = "10.0.0.4",
LocalPort = "80",
Protocol = "TCP",
},
},
NetworkWatcherName = "nw1",
PacketCaptureName = "pc1",
ResourceGroupName = "rg1",
StorageLocation = new AzureNative.Network.Inputs.PacketCaptureStorageLocationArgs
{
FilePath = "D:\\capture\\pc1.cap",
StorageId = "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Storage/storageAccounts/pcstore",
StoragePath = "https://mytestaccountname.blob.core.windows.net/capture/pc1.cap",
},
Target = "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1",
TimeLimitInSeconds = 100,
TotalBytesPerSession = 100000,
});
});
package main
import (
network "github.com/pulumi/pulumi-azure-native/sdk/go/azure/network"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := network.NewPacketCapture(ctx, "packetCapture", &network.PacketCaptureArgs{
BytesToCapturePerPacket: pulumi.Float64(10000),
Filters: []network.PacketCaptureFilterArgs{
{
LocalIPAddress: pulumi.String("10.0.0.4"),
LocalPort: pulumi.String("80"),
Protocol: pulumi.String("TCP"),
},
},
NetworkWatcherName: pulumi.String("nw1"),
PacketCaptureName: pulumi.String("pc1"),
ResourceGroupName: pulumi.String("rg1"),
StorageLocation: &network.PacketCaptureStorageLocationArgs{
FilePath: pulumi.String("D:\\capture\\pc1.cap"),
StorageId: pulumi.String("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Storage/storageAccounts/pcstore"),
StoragePath: pulumi.String("https://mytestaccountname.blob.core.windows.net/capture/pc1.cap"),
},
Target: pulumi.String("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1"),
TimeLimitInSeconds: pulumi.Int(100),
TotalBytesPerSession: pulumi.Float64(100000),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.network.PacketCapture;
import com.pulumi.azurenative.network.PacketCaptureArgs;
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 packetCapture = new PacketCapture("packetCapture", PacketCaptureArgs.builder()
.bytesToCapturePerPacket(10000)
.filters(Map.ofEntries(
Map.entry("localIPAddress", "10.0.0.4"),
Map.entry("localPort", "80"),
Map.entry("protocol", "TCP")
))
.networkWatcherName("nw1")
.packetCaptureName("pc1")
.resourceGroupName("rg1")
.storageLocation(Map.ofEntries(
Map.entry("filePath", "D:\\capture\\pc1.cap"),
Map.entry("storageId", "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Storage/storageAccounts/pcstore"),
Map.entry("storagePath", "https://mytestaccountname.blob.core.windows.net/capture/pc1.cap")
))
.target("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1")
.timeLimitInSeconds(100)
.totalBytesPerSession(100000)
.build());
}
}

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:network:PacketCapture pc1 /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1/packetCaptures/pc1

Properties

Link copied to clipboard

Number of bytes captured per packet, the remaining bytes are truncated.

Link copied to clipboard
val etag: Output<String>

A unique read-only string that changes whenever the resource is updated.

Link copied to clipboard

A list of packet capture filters.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val name: Output<String>

Name of the packet capture session.

Link copied to clipboard

The provisioning state of the packet capture session.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The storage location for a packet capture session.

Link copied to clipboard
val target: Output<String>

The ID of the targeted resource, only VM is currently supported.

Link copied to clipboard
val timeLimitInSeconds: Output<Int>?

Maximum duration of the capture session in seconds.

Link copied to clipboard

Maximum size of the capture output.

Link copied to clipboard
val urn: Output<String>