@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:38.342Z") @Stability(value=Stable) public class CfnTrafficMirrorSession extends CfnResource implements IInspectable
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();
| Modifier and Type | Class and Description |
|---|---|
static class |
CfnTrafficMirrorSession.Builder
A fluent builder for
CfnTrafficMirrorSession. |
software.amazon.jsii.JsiiObject.InitializationModeIInspectable.Jsii$Default, IInspectable.Jsii$Proxy| Modifier and Type | Field and Description |
|---|---|
static String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
| Modifier | Constructor and Description |
|---|---|
|
CfnTrafficMirrorSession(software.constructs.Construct scope,
String id,
CfnTrafficMirrorSessionProps props)
Create a new `AWS::EC2::TrafficMirrorSession`.
|
protected |
CfnTrafficMirrorSession(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnTrafficMirrorSession(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
protected Map<String,Object> |
getCfnProperties() |
String |
getDescription()
The description of the Traffic Mirror session.
|
String |
getNetworkInterfaceId()
The ID of the source network interface.
|
Number |
getPacketLength()
The number of bytes in each packet to mirror.
|
Number |
getSessionNumber()
The session number determines the order in which sessions are evaluated when an interface is used by multiple sessions.
|
TagManager |
getTags()
The tags to assign to a Traffic Mirror session.
|
String |
getTrafficMirrorFilterId()
The ID of the Traffic Mirror filter.
|
String |
getTrafficMirrorTargetId()
The ID of the Traffic Mirror target.
|
Number |
getVirtualNetworkId()
The VXLAN ID for the Traffic Mirror session.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected Map<String,Object> |
renderProperties(Map<String,Object> props) |
void |
setDescription(String value)
The description of the Traffic Mirror session.
|
void |
setNetworkInterfaceId(String value)
The ID of the source network interface.
|
void |
setPacketLength(Number value)
The number of bytes in each packet to mirror.
|
void |
setSessionNumber(Number value)
The session number determines the order in which sessions are evaluated when an interface is used by multiple sessions.
|
void |
setTrafficMirrorFilterId(String value)
The ID of the Traffic Mirror filter.
|
void |
setTrafficMirrorTargetId(String value)
The ID of the Traffic Mirror target.
|
void |
setVirtualNetworkId(Number value)
The VXLAN ID for the Traffic Mirror session.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, shouldSynthesize, toString, validatePropertiesgetRefgetCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet@Stability(value=Stable) public static final String CFN_RESOURCE_TYPE_NAME
protected CfnTrafficMirrorSession(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnTrafficMirrorSession(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public CfnTrafficMirrorSession(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@NotNull
CfnTrafficMirrorSessionProps props)
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.@Stability(value=Stable)
public void inspect(@NotNull
TreeInspector inspector)
inspect in interface IInspectableinspector - - tree inspector to collect and process attributes. This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
renderProperties in class CfnResourceprops - This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> getCfnProperties()
getCfnProperties in class CfnResource@Stability(value=Stable) @NotNull public TagManager getTags()
@Stability(value=Stable) @NotNull public String getNetworkInterfaceId()
@Stability(value=Stable)
public void setNetworkInterfaceId(@NotNull
String value)
@Stability(value=Stable) @NotNull public Number getSessionNumber()
The first session with a matching filter is the one that mirrors the packets.
Valid values are 1-32766.
@Stability(value=Stable)
public void setSessionNumber(@NotNull
Number value)
The first session with a matching filter is the one that mirrors the packets.
Valid values are 1-32766.
@Stability(value=Stable) @NotNull public String getTrafficMirrorFilterId()
@Stability(value=Stable)
public void setTrafficMirrorFilterId(@NotNull
String value)
@Stability(value=Stable) @NotNull public String getTrafficMirrorTargetId()
@Stability(value=Stable)
public void setTrafficMirrorTargetId(@NotNull
String value)
@Stability(value=Stable) @Nullable public String getDescription()
@Stability(value=Stable)
public void setDescription(@Nullable
String value)
@Stability(value=Stable) @Nullable public Number getPacketLength()
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.
@Stability(value=Stable)
public void setPacketLength(@Nullable
Number value)
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.
@Stability(value=Stable) @Nullable public Number getVirtualNetworkId()
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.
Copyright © 2022. All rights reserved.