Class CfnTrafficMirrorSession

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

@Generated(value="jsii-pacmak/1.101.0 (build b95fe5d)", date="2024-07-12T19:34:00.757Z") @Stability(Stable) public class CfnTrafficMirrorSession extends CfnResource implements IInspectable, ITaggable
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();
 

See Also:
  • 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 software.constructs.Construct scope, @NotNull String id, @NotNull CfnTrafficMirrorSessionProps props)
      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). 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.
    • getAttrId

      @Stability(Stable) @NotNull public String getAttrId()
    • getCfnProperties

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

      @Stability(Stable) @NotNull public TagManager getTags()
      Tag Manager which manages the tags for this resource.
      Specified by:
      getTags in interface ITaggable
    • 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.
    • 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.
    • 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.
    • setPacketLength

      @Stability(Stable) public void setPacketLength(@Nullable Number value)
      The number of bytes in each packet to mirror.
    • getTagsRaw

      @Stability(Stable) @Nullable public List<CfnTag> getTagsRaw()
      The tags to assign to a Traffic Mirror session.
    • setTagsRaw

      @Stability(Stable) public void setTagsRaw(@Nullable List<CfnTag> value)
      The tags to assign to a Traffic Mirror session.
    • getVirtualNetworkId

      @Stability(Stable) @Nullable public Number getVirtualNetworkId()
      The VXLAN ID for the Traffic Mirror session.
    • setVirtualNetworkId

      @Stability(Stable) public void setVirtualNetworkId(@Nullable Number value)
      The VXLAN ID for the Traffic Mirror session.