Class CfnTrafficMirrorSession

java.lang.Object
software.amazon.jsii.JsiiObject
All Implemented Interfaces:
IConstruct, IDependable, IInspectable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:39.058Z") @Stability(Stable) public class CfnTrafficMirrorSession extends CfnResource implements IInspectable
A CloudFormation AWS::EC2::TrafficMirrorSession.

Creates a Traffic Mirror session.

A Traffic Mirror session actively copies packets from a Traffic Mirror source to a Traffic Mirror target. Create a filter, and then assign it to the session to define a subset of the traffic to mirror, for example all TCP traffic.

The Traffic Mirror source and the Traffic Mirror target (monitoring appliances) can be in the same VPC, or in a different VPC connected via VPC peering or a transit gateway.

By default, no traffic is mirrored. Use AWS::EC2::TrafficMirrorFilterRule to specify filter rules that specify the traffic to mirror.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.ec2.*;
 CfnTrafficMirrorSession cfnTrafficMirrorSession = CfnTrafficMirrorSession.Builder.create(this, "MyCfnTrafficMirrorSession")
         .networkInterfaceId("networkInterfaceId")
         .sessionNumber(123)
         .trafficMirrorFilterId("trafficMirrorFilterId")
         .trafficMirrorTargetId("trafficMirrorTargetId")
         // the properties below are optional
         .description("description")
         .packetLength(123)
         .tags(List.of(CfnTag.builder()
                 .key("key")
                 .value("value")
                 .build()))
         .virtualNetworkId(123)
         .build();
 
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnTrafficMirrorSession

      protected CfnTrafficMirrorSession(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnTrafficMirrorSession

      protected CfnTrafficMirrorSession(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnTrafficMirrorSession

      @Stability(Stable) public CfnTrafficMirrorSession(@NotNull Construct scope, @NotNull String id, @NotNull CfnTrafficMirrorSessionProps props)
      Create a new AWS::EC2::TrafficMirrorSession.

      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      This parameter is required.
      props -
      • resource properties.
      This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector -
      • tree inspector to collect and process attributes.
      This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getTags

      @Stability(Stable) @NotNull public TagManager getTags()
      The tags to assign to a Traffic Mirror session.
    • getNetworkInterfaceId

      @Stability(Stable) @NotNull public String getNetworkInterfaceId()
      The ID of the source network interface.
    • setNetworkInterfaceId

      @Stability(Stable) public void setNetworkInterfaceId(@NotNull String value)
      The ID of the source network interface.
    • getSessionNumber

      @Stability(Stable) @NotNull public Number getSessionNumber()
      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.

      Valid values are 1-32766.

    • setSessionNumber

      @Stability(Stable) public void setSessionNumber(@NotNull Number value)
      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.

      Valid values are 1-32766.

    • getTrafficMirrorFilterId

      @Stability(Stable) @NotNull public String getTrafficMirrorFilterId()
      The ID of the Traffic Mirror filter.
    • setTrafficMirrorFilterId

      @Stability(Stable) public void setTrafficMirrorFilterId(@NotNull String value)
      The ID of the Traffic Mirror filter.
    • getTrafficMirrorTargetId

      @Stability(Stable) @NotNull public String getTrafficMirrorTargetId()
      The ID of the Traffic Mirror target.
    • setTrafficMirrorTargetId

      @Stability(Stable) public void setTrafficMirrorTargetId(@NotNull String value)
      The ID of the Traffic Mirror target.
    • getDescription

      @Stability(Stable) @Nullable public String getDescription()
      The description of the Traffic Mirror session.
    • setDescription

      @Stability(Stable) public void setDescription(@Nullable String value)
      The description of the Traffic Mirror session.
    • getPacketLength

      @Stability(Stable) @Nullable public Number getPacketLength()
      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. For example, if you set this value to 100, then the first 100 bytes that meet the filter criteria are copied to the target.

      If you do not want to mirror the entire packet, use the PacketLength parameter to specify the number of bytes in each packet to mirror.

    • setPacketLength

      @Stability(Stable) public void setPacketLength(@Nullable Number value)
      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. For example, if you set this value to 100, then the first 100 bytes that meet the filter criteria are copied to the target.

      If you do not want to mirror the entire packet, use the PacketLength parameter to specify the number of bytes in each packet to mirror.

    • getVirtualNetworkId

      @Stability(Stable) @Nullable public Number getVirtualNetworkId()
      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.

    • setVirtualNetworkId

      @Stability(Stable) public void setVirtualNetworkId(@Nullable Number value)
      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.