1. Packages
  2. AWS
  3. API Docs
  4. ec2
  5. TrafficMirrorSession
AWS v6.77.0 published on Wednesday, Apr 9, 2025 by Pulumi

aws.ec2.TrafficMirrorSession

Explore with Pulumi AI

Provides an Traffic mirror session.
Read limits and considerations for traffic mirroring

Example Usage

To create a basic traffic mirror session

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const filter = new aws.ec2.TrafficMirrorFilter("filter", {
    description: "traffic mirror filter - example",
    networkServices: ["amazon-dns"],
});
const target = new aws.ec2.TrafficMirrorTarget("target", {networkLoadBalancerArn: lb.arn});
const session = new aws.ec2.TrafficMirrorSession("session", {
    description: "traffic mirror session - example",
    networkInterfaceId: test.primaryNetworkInterfaceId,
    sessionNumber: 1,
    trafficMirrorFilterId: filter.id,
    trafficMirrorTargetId: target.id,
});
Copy
import pulumi
import pulumi_aws as aws

filter = aws.ec2.TrafficMirrorFilter("filter",
    description="traffic mirror filter - example",
    network_services=["amazon-dns"])
target = aws.ec2.TrafficMirrorTarget("target", network_load_balancer_arn=lb["arn"])
session = aws.ec2.TrafficMirrorSession("session",
    description="traffic mirror session - example",
    network_interface_id=test["primaryNetworkInterfaceId"],
    session_number=1,
    traffic_mirror_filter_id=filter.id,
    traffic_mirror_target_id=target.id)
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		filter, err := ec2.NewTrafficMirrorFilter(ctx, "filter", &ec2.TrafficMirrorFilterArgs{
			Description: pulumi.String("traffic mirror filter - example"),
			NetworkServices: pulumi.StringArray{
				pulumi.String("amazon-dns"),
			},
		})
		if err != nil {
			return err
		}
		target, err := ec2.NewTrafficMirrorTarget(ctx, "target", &ec2.TrafficMirrorTargetArgs{
			NetworkLoadBalancerArn: pulumi.Any(lb.Arn),
		})
		if err != nil {
			return err
		}
		_, err = ec2.NewTrafficMirrorSession(ctx, "session", &ec2.TrafficMirrorSessionArgs{
			Description:           pulumi.String("traffic mirror session - example"),
			NetworkInterfaceId:    pulumi.Any(test.PrimaryNetworkInterfaceId),
			SessionNumber:         pulumi.Int(1),
			TrafficMirrorFilterId: filter.ID(),
			TrafficMirrorTargetId: target.ID(),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var filter = new Aws.Ec2.TrafficMirrorFilter("filter", new()
    {
        Description = "traffic mirror filter - example",
        NetworkServices = new[]
        {
            "amazon-dns",
        },
    });

    var target = new Aws.Ec2.TrafficMirrorTarget("target", new()
    {
        NetworkLoadBalancerArn = lb.Arn,
    });

    var session = new Aws.Ec2.TrafficMirrorSession("session", new()
    {
        Description = "traffic mirror session - example",
        NetworkInterfaceId = test.PrimaryNetworkInterfaceId,
        SessionNumber = 1,
        TrafficMirrorFilterId = filter.Id,
        TrafficMirrorTargetId = target.Id,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.TrafficMirrorFilter;
import com.pulumi.aws.ec2.TrafficMirrorFilterArgs;
import com.pulumi.aws.ec2.TrafficMirrorTarget;
import com.pulumi.aws.ec2.TrafficMirrorTargetArgs;
import com.pulumi.aws.ec2.TrafficMirrorSession;
import com.pulumi.aws.ec2.TrafficMirrorSessionArgs;
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 filter = new TrafficMirrorFilter("filter", TrafficMirrorFilterArgs.builder()
            .description("traffic mirror filter - example")
            .networkServices("amazon-dns")
            .build());

        var target = new TrafficMirrorTarget("target", TrafficMirrorTargetArgs.builder()
            .networkLoadBalancerArn(lb.arn())
            .build());

        var session = new TrafficMirrorSession("session", TrafficMirrorSessionArgs.builder()
            .description("traffic mirror session - example")
            .networkInterfaceId(test.primaryNetworkInterfaceId())
            .sessionNumber(1)
            .trafficMirrorFilterId(filter.id())
            .trafficMirrorTargetId(target.id())
            .build());

    }
}
Copy
resources:
  filter:
    type: aws:ec2:TrafficMirrorFilter
    properties:
      description: traffic mirror filter - example
      networkServices:
        - amazon-dns
  target:
    type: aws:ec2:TrafficMirrorTarget
    properties:
      networkLoadBalancerArn: ${lb.arn}
  session:
    type: aws:ec2:TrafficMirrorSession
    properties:
      description: traffic mirror session - example
      networkInterfaceId: ${test.primaryNetworkInterfaceId}
      sessionNumber: 1
      trafficMirrorFilterId: ${filter.id}
      trafficMirrorTargetId: ${target.id}
Copy

Create TrafficMirrorSession Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new TrafficMirrorSession(name: string, args: TrafficMirrorSessionArgs, opts?: CustomResourceOptions);
@overload
def TrafficMirrorSession(resource_name: str,
                         args: TrafficMirrorSessionArgs,
                         opts: Optional[ResourceOptions] = None)

@overload
def TrafficMirrorSession(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         network_interface_id: Optional[str] = None,
                         session_number: Optional[int] = None,
                         traffic_mirror_filter_id: Optional[str] = None,
                         traffic_mirror_target_id: Optional[str] = None,
                         description: Optional[str] = None,
                         packet_length: Optional[int] = None,
                         tags: Optional[Mapping[str, str]] = None,
                         virtual_network_id: Optional[int] = None)
func NewTrafficMirrorSession(ctx *Context, name string, args TrafficMirrorSessionArgs, opts ...ResourceOption) (*TrafficMirrorSession, error)
public TrafficMirrorSession(string name, TrafficMirrorSessionArgs args, CustomResourceOptions? opts = null)
public TrafficMirrorSession(String name, TrafficMirrorSessionArgs args)
public TrafficMirrorSession(String name, TrafficMirrorSessionArgs args, CustomResourceOptions options)
type: aws:ec2:TrafficMirrorSession
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. TrafficMirrorSessionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. TrafficMirrorSessionArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. TrafficMirrorSessionArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. TrafficMirrorSessionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. TrafficMirrorSessionArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var trafficMirrorSessionResource = new Aws.Ec2.TrafficMirrorSession("trafficMirrorSessionResource", new()
{
    NetworkInterfaceId = "string",
    SessionNumber = 0,
    TrafficMirrorFilterId = "string",
    TrafficMirrorTargetId = "string",
    Description = "string",
    PacketLength = 0,
    Tags = 
    {
        { "string", "string" },
    },
    VirtualNetworkId = 0,
});
Copy
example, err := ec2.NewTrafficMirrorSession(ctx, "trafficMirrorSessionResource", &ec2.TrafficMirrorSessionArgs{
	NetworkInterfaceId:    pulumi.String("string"),
	SessionNumber:         pulumi.Int(0),
	TrafficMirrorFilterId: pulumi.String("string"),
	TrafficMirrorTargetId: pulumi.String("string"),
	Description:           pulumi.String("string"),
	PacketLength:          pulumi.Int(0),
	Tags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	VirtualNetworkId: pulumi.Int(0),
})
Copy
var trafficMirrorSessionResource = new TrafficMirrorSession("trafficMirrorSessionResource", TrafficMirrorSessionArgs.builder()
    .networkInterfaceId("string")
    .sessionNumber(0)
    .trafficMirrorFilterId("string")
    .trafficMirrorTargetId("string")
    .description("string")
    .packetLength(0)
    .tags(Map.of("string", "string"))
    .virtualNetworkId(0)
    .build());
Copy
traffic_mirror_session_resource = aws.ec2.TrafficMirrorSession("trafficMirrorSessionResource",
    network_interface_id="string",
    session_number=0,
    traffic_mirror_filter_id="string",
    traffic_mirror_target_id="string",
    description="string",
    packet_length=0,
    tags={
        "string": "string",
    },
    virtual_network_id=0)
Copy
const trafficMirrorSessionResource = new aws.ec2.TrafficMirrorSession("trafficMirrorSessionResource", {
    networkInterfaceId: "string",
    sessionNumber: 0,
    trafficMirrorFilterId: "string",
    trafficMirrorTargetId: "string",
    description: "string",
    packetLength: 0,
    tags: {
        string: "string",
    },
    virtualNetworkId: 0,
});
Copy
type: aws:ec2:TrafficMirrorSession
properties:
    description: string
    networkInterfaceId: string
    packetLength: 0
    sessionNumber: 0
    tags:
        string: string
    trafficMirrorFilterId: string
    trafficMirrorTargetId: string
    virtualNetworkId: 0
Copy

TrafficMirrorSession Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The TrafficMirrorSession resource accepts the following input properties:

NetworkInterfaceId
This property is required.
Changes to this property will trigger replacement.
string
ID of the source network interface. Not all network interfaces are eligible as mirror sources. On EC2 instances only nitro based instances support mirroring.
SessionNumber This property is required. int
The session number determines the order in which sessions are evaluated when an interface is used by multiple sessions. The first session with a matching filter is the one that mirrors the packets.
TrafficMirrorFilterId This property is required. string
ID of the traffic mirror filter to be used
TrafficMirrorTargetId This property is required. string
ID of the traffic mirror target to be used
Description string
A description of the traffic mirror session.
PacketLength int
The number of bytes in each packet to mirror. These are bytes after the VXLAN header. Do not specify this parameter when you want to mirror the entire packet. To mirror a subset of the packet, set this to the length (in bytes) that you want to mirror.
Tags Dictionary<string, string>
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
VirtualNetworkId int
The VXLAN ID for the Traffic Mirror session. For more information about the VXLAN protocol, see RFC 7348. If you do not specify a VirtualNetworkId, an account-wide unique id is chosen at random.
NetworkInterfaceId
This property is required.
Changes to this property will trigger replacement.
string
ID of the source network interface. Not all network interfaces are eligible as mirror sources. On EC2 instances only nitro based instances support mirroring.
SessionNumber This property is required. int
The session number determines the order in which sessions are evaluated when an interface is used by multiple sessions. The first session with a matching filter is the one that mirrors the packets.
TrafficMirrorFilterId This property is required. string
ID of the traffic mirror filter to be used
TrafficMirrorTargetId This property is required. string
ID of the traffic mirror target to be used
Description string
A description of the traffic mirror session.
PacketLength int
The number of bytes in each packet to mirror. These are bytes after the VXLAN header. Do not specify this parameter when you want to mirror the entire packet. To mirror a subset of the packet, set this to the length (in bytes) that you want to mirror.
Tags map[string]string
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
VirtualNetworkId int
The VXLAN ID for the Traffic Mirror session. For more information about the VXLAN protocol, see RFC 7348. If you do not specify a VirtualNetworkId, an account-wide unique id is chosen at random.
networkInterfaceId
This property is required.
Changes to this property will trigger replacement.
String
ID of the source network interface. Not all network interfaces are eligible as mirror sources. On EC2 instances only nitro based instances support mirroring.
sessionNumber This property is required. Integer
The session number determines the order in which sessions are evaluated when an interface is used by multiple sessions. The first session with a matching filter is the one that mirrors the packets.
trafficMirrorFilterId This property is required. String
ID of the traffic mirror filter to be used
trafficMirrorTargetId This property is required. String
ID of the traffic mirror target to be used
description String
A description of the traffic mirror session.
packetLength Integer
The number of bytes in each packet to mirror. These are bytes after the VXLAN header. Do not specify this parameter when you want to mirror the entire packet. To mirror a subset of the packet, set this to the length (in bytes) that you want to mirror.
tags Map<String,String>
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
virtualNetworkId Integer
The VXLAN ID for the Traffic Mirror session. For more information about the VXLAN protocol, see RFC 7348. If you do not specify a VirtualNetworkId, an account-wide unique id is chosen at random.
networkInterfaceId
This property is required.
Changes to this property will trigger replacement.
string
ID of the source network interface. Not all network interfaces are eligible as mirror sources. On EC2 instances only nitro based instances support mirroring.
sessionNumber This property is required. number
The session number determines the order in which sessions are evaluated when an interface is used by multiple sessions. The first session with a matching filter is the one that mirrors the packets.
trafficMirrorFilterId This property is required. string
ID of the traffic mirror filter to be used
trafficMirrorTargetId This property is required. string
ID of the traffic mirror target to be used
description string
A description of the traffic mirror session.
packetLength number
The number of bytes in each packet to mirror. These are bytes after the VXLAN header. Do not specify this parameter when you want to mirror the entire packet. To mirror a subset of the packet, set this to the length (in bytes) that you want to mirror.
tags {[key: string]: string}
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
virtualNetworkId number
The VXLAN ID for the Traffic Mirror session. For more information about the VXLAN protocol, see RFC 7348. If you do not specify a VirtualNetworkId, an account-wide unique id is chosen at random.
network_interface_id
This property is required.
Changes to this property will trigger replacement.
str
ID of the source network interface. Not all network interfaces are eligible as mirror sources. On EC2 instances only nitro based instances support mirroring.
session_number This property is required. int
The session number determines the order in which sessions are evaluated when an interface is used by multiple sessions. The first session with a matching filter is the one that mirrors the packets.
traffic_mirror_filter_id This property is required. str
ID of the traffic mirror filter to be used
traffic_mirror_target_id This property is required. str
ID of the traffic mirror target to be used
description str
A description of the traffic mirror session.
packet_length int
The number of bytes in each packet to mirror. These are bytes after the VXLAN header. Do not specify this parameter when you want to mirror the entire packet. To mirror a subset of the packet, set this to the length (in bytes) that you want to mirror.
tags Mapping[str, str]
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
virtual_network_id int
The VXLAN ID for the Traffic Mirror session. For more information about the VXLAN protocol, see RFC 7348. If you do not specify a VirtualNetworkId, an account-wide unique id is chosen at random.
networkInterfaceId
This property is required.
Changes to this property will trigger replacement.
String
ID of the source network interface. Not all network interfaces are eligible as mirror sources. On EC2 instances only nitro based instances support mirroring.
sessionNumber This property is required. Number
The session number determines the order in which sessions are evaluated when an interface is used by multiple sessions. The first session with a matching filter is the one that mirrors the packets.
trafficMirrorFilterId This property is required. String
ID of the traffic mirror filter to be used
trafficMirrorTargetId This property is required. String
ID of the traffic mirror target to be used
description String
A description of the traffic mirror session.
packetLength Number
The number of bytes in each packet to mirror. These are bytes after the VXLAN header. Do not specify this parameter when you want to mirror the entire packet. To mirror a subset of the packet, set this to the length (in bytes) that you want to mirror.
tags Map<String>
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
virtualNetworkId Number
The VXLAN ID for the Traffic Mirror session. For more information about the VXLAN protocol, see RFC 7348. If you do not specify a VirtualNetworkId, an account-wide unique id is chosen at random.

Outputs

All input properties are implicitly available as output properties. Additionally, the TrafficMirrorSession resource produces the following output properties:

Arn string
The ARN of the traffic mirror session.
Id string
The provider-assigned unique ID for this managed resource.
OwnerId string
The AWS account ID of the session owner.
TagsAll Dictionary<string, string>
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

Arn string
The ARN of the traffic mirror session.
Id string
The provider-assigned unique ID for this managed resource.
OwnerId string
The AWS account ID of the session owner.
TagsAll map[string]string
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

arn String
The ARN of the traffic mirror session.
id String
The provider-assigned unique ID for this managed resource.
ownerId String
The AWS account ID of the session owner.
tagsAll Map<String,String>
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

arn string
The ARN of the traffic mirror session.
id string
The provider-assigned unique ID for this managed resource.
ownerId string
The AWS account ID of the session owner.
tagsAll {[key: string]: string}
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

arn str
The ARN of the traffic mirror session.
id str
The provider-assigned unique ID for this managed resource.
owner_id str
The AWS account ID of the session owner.
tags_all Mapping[str, str]
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

arn String
The ARN of the traffic mirror session.
id String
The provider-assigned unique ID for this managed resource.
ownerId String
The AWS account ID of the session owner.
tagsAll Map<String>
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

Look up Existing TrafficMirrorSession Resource

Get an existing TrafficMirrorSession resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: TrafficMirrorSessionState, opts?: CustomResourceOptions): TrafficMirrorSession
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        arn: Optional[str] = None,
        description: Optional[str] = None,
        network_interface_id: Optional[str] = None,
        owner_id: Optional[str] = None,
        packet_length: Optional[int] = None,
        session_number: Optional[int] = None,
        tags: Optional[Mapping[str, str]] = None,
        tags_all: Optional[Mapping[str, str]] = None,
        traffic_mirror_filter_id: Optional[str] = None,
        traffic_mirror_target_id: Optional[str] = None,
        virtual_network_id: Optional[int] = None) -> TrafficMirrorSession
func GetTrafficMirrorSession(ctx *Context, name string, id IDInput, state *TrafficMirrorSessionState, opts ...ResourceOption) (*TrafficMirrorSession, error)
public static TrafficMirrorSession Get(string name, Input<string> id, TrafficMirrorSessionState? state, CustomResourceOptions? opts = null)
public static TrafficMirrorSession get(String name, Output<String> id, TrafficMirrorSessionState state, CustomResourceOptions options)
resources:  _:    type: aws:ec2:TrafficMirrorSession    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Arn string
The ARN of the traffic mirror session.
Description string
A description of the traffic mirror session.
NetworkInterfaceId Changes to this property will trigger replacement. string
ID of the source network interface. Not all network interfaces are eligible as mirror sources. On EC2 instances only nitro based instances support mirroring.
OwnerId string
The AWS account ID of the session owner.
PacketLength int
The number of bytes in each packet to mirror. These are bytes after the VXLAN header. Do not specify this parameter when you want to mirror the entire packet. To mirror a subset of the packet, set this to the length (in bytes) that you want to mirror.
SessionNumber int
The session number determines the order in which sessions are evaluated when an interface is used by multiple sessions. The first session with a matching filter is the one that mirrors the packets.
Tags Dictionary<string, string>
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
TagsAll Dictionary<string, string>
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

TrafficMirrorFilterId string
ID of the traffic mirror filter to be used
TrafficMirrorTargetId string
ID of the traffic mirror target to be used
VirtualNetworkId int
The VXLAN ID for the Traffic Mirror session. For more information about the VXLAN protocol, see RFC 7348. If you do not specify a VirtualNetworkId, an account-wide unique id is chosen at random.
Arn string
The ARN of the traffic mirror session.
Description string
A description of the traffic mirror session.
NetworkInterfaceId Changes to this property will trigger replacement. string
ID of the source network interface. Not all network interfaces are eligible as mirror sources. On EC2 instances only nitro based instances support mirroring.
OwnerId string
The AWS account ID of the session owner.
PacketLength int
The number of bytes in each packet to mirror. These are bytes after the VXLAN header. Do not specify this parameter when you want to mirror the entire packet. To mirror a subset of the packet, set this to the length (in bytes) that you want to mirror.
SessionNumber int
The session number determines the order in which sessions are evaluated when an interface is used by multiple sessions. The first session with a matching filter is the one that mirrors the packets.
Tags map[string]string
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
TagsAll map[string]string
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

TrafficMirrorFilterId string
ID of the traffic mirror filter to be used
TrafficMirrorTargetId string
ID of the traffic mirror target to be used
VirtualNetworkId int
The VXLAN ID for the Traffic Mirror session. For more information about the VXLAN protocol, see RFC 7348. If you do not specify a VirtualNetworkId, an account-wide unique id is chosen at random.
arn String
The ARN of the traffic mirror session.
description String
A description of the traffic mirror session.
networkInterfaceId Changes to this property will trigger replacement. String
ID of the source network interface. Not all network interfaces are eligible as mirror sources. On EC2 instances only nitro based instances support mirroring.
ownerId String
The AWS account ID of the session owner.
packetLength Integer
The number of bytes in each packet to mirror. These are bytes after the VXLAN header. Do not specify this parameter when you want to mirror the entire packet. To mirror a subset of the packet, set this to the length (in bytes) that you want to mirror.
sessionNumber Integer
The session number determines the order in which sessions are evaluated when an interface is used by multiple sessions. The first session with a matching filter is the one that mirrors the packets.
tags Map<String,String>
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
tagsAll Map<String,String>
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

trafficMirrorFilterId String
ID of the traffic mirror filter to be used
trafficMirrorTargetId String
ID of the traffic mirror target to be used
virtualNetworkId Integer
The VXLAN ID for the Traffic Mirror session. For more information about the VXLAN protocol, see RFC 7348. If you do not specify a VirtualNetworkId, an account-wide unique id is chosen at random.
arn string
The ARN of the traffic mirror session.
description string
A description of the traffic mirror session.
networkInterfaceId Changes to this property will trigger replacement. string
ID of the source network interface. Not all network interfaces are eligible as mirror sources. On EC2 instances only nitro based instances support mirroring.
ownerId string
The AWS account ID of the session owner.
packetLength number
The number of bytes in each packet to mirror. These are bytes after the VXLAN header. Do not specify this parameter when you want to mirror the entire packet. To mirror a subset of the packet, set this to the length (in bytes) that you want to mirror.
sessionNumber number
The session number determines the order in which sessions are evaluated when an interface is used by multiple sessions. The first session with a matching filter is the one that mirrors the packets.
tags {[key: string]: string}
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
tagsAll {[key: string]: string}
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

trafficMirrorFilterId string
ID of the traffic mirror filter to be used
trafficMirrorTargetId string
ID of the traffic mirror target to be used
virtualNetworkId number
The VXLAN ID for the Traffic Mirror session. For more information about the VXLAN protocol, see RFC 7348. If you do not specify a VirtualNetworkId, an account-wide unique id is chosen at random.
arn str
The ARN of the traffic mirror session.
description str
A description of the traffic mirror session.
network_interface_id Changes to this property will trigger replacement. str
ID of the source network interface. Not all network interfaces are eligible as mirror sources. On EC2 instances only nitro based instances support mirroring.
owner_id str
The AWS account ID of the session owner.
packet_length int
The number of bytes in each packet to mirror. These are bytes after the VXLAN header. Do not specify this parameter when you want to mirror the entire packet. To mirror a subset of the packet, set this to the length (in bytes) that you want to mirror.
session_number int
The session number determines the order in which sessions are evaluated when an interface is used by multiple sessions. The first session with a matching filter is the one that mirrors the packets.
tags Mapping[str, str]
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
tags_all Mapping[str, str]
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

traffic_mirror_filter_id str
ID of the traffic mirror filter to be used
traffic_mirror_target_id str
ID of the traffic mirror target to be used
virtual_network_id int
The VXLAN ID for the Traffic Mirror session. For more information about the VXLAN protocol, see RFC 7348. If you do not specify a VirtualNetworkId, an account-wide unique id is chosen at random.
arn String
The ARN of the traffic mirror session.
description String
A description of the traffic mirror session.
networkInterfaceId Changes to this property will trigger replacement. String
ID of the source network interface. Not all network interfaces are eligible as mirror sources. On EC2 instances only nitro based instances support mirroring.
ownerId String
The AWS account ID of the session owner.
packetLength Number
The number of bytes in each packet to mirror. These are bytes after the VXLAN header. Do not specify this parameter when you want to mirror the entire packet. To mirror a subset of the packet, set this to the length (in bytes) that you want to mirror.
sessionNumber Number
The session number determines the order in which sessions are evaluated when an interface is used by multiple sessions. The first session with a matching filter is the one that mirrors the packets.
tags Map<String>
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
tagsAll Map<String>
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

trafficMirrorFilterId String
ID of the traffic mirror filter to be used
trafficMirrorTargetId String
ID of the traffic mirror target to be used
virtualNetworkId Number
The VXLAN ID for the Traffic Mirror session. For more information about the VXLAN protocol, see RFC 7348. If you do not specify a VirtualNetworkId, an account-wide unique id is chosen at random.

Import

Using pulumi import, import traffic mirror sessions using the id. For example:

$ pulumi import aws:ec2/trafficMirrorSession:TrafficMirrorSession session tms-0d8aa3ca35897b82e
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.