TrafficMirrorSession

class TrafficMirrorSession : KotlinCustomResource

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

Example Usage

To create a basic traffic mirror session

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(aws_lb.lb().arn())
.build());
var session = new TrafficMirrorSession("session", TrafficMirrorSessionArgs.builder()
.description("traffic mirror session - example")
.networkInterfaceId(aws_instance.test().primary_network_interface_id())
.sessionNumber(1)
.trafficMirrorFilterId(filter.id())
.trafficMirrorTargetId(target.id())
.build());
}
}

Import

Traffic mirror sessions can be imported using the id, e.g.,

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

Properties

Link copied to clipboard
val arn: Output<String>

The ARN of the traffic mirror session.

Link copied to clipboard
val description: Output<String>?

A description of the traffic mirror session.

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

ID of the source network interface. Not all network interfaces are eligible as mirror sources. On EC2 instances only nitro based instances support mirroring.

Link copied to clipboard
val ownerId: Output<String>

The AWS account ID of the session owner.

Link copied to clipboard
val packetLength: Output<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.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val sessionNumber: Output<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.

Link copied to clipboard
val tags: Output<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.

Link copied to clipboard
val tagsAll: Output<Map<String, String>>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Link copied to clipboard

ID of the traffic mirror filter to be used

Link copied to clipboard

ID of the traffic mirror target to be used

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val virtualNetworkId: Output<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.