create_traffic_mirror_session
async
¶
create_traffic_mirror_session(
*,
config_overrides: Optional[AsyncEC2ClientConfig] = None,
network_interface_id: Optional[NetworkInterfaceId] = None,
traffic_mirror_target_id: Optional[TrafficMirrorTargetId] = None,
traffic_mirror_filter_id: Optional[TrafficMirrorFilterId] = None,
packet_length: Optional[Integer] = None,
session_number: Optional[Integer] = None,
virtual_network_id: Optional[Integer] = None,
description: Optional[String] = None,
tag_specifications: Optional[TagSpecificationList] = None,
dry_run: Optional[Boolean] = None,
client_token: Optional[String] = None,
) -> CreateTrafficMirrorSessionResult
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 CreateTrafficMirrorFilter to create filter rules that specify the traffic to mirror.
Parameters:
-
network_interface_id(Optional[NetworkInterfaceId], default:None) –The ID of the source network interface.
-
traffic_mirror_target_id(Optional[TrafficMirrorTargetId], default:None) –The ID of the Traffic Mirror target.
-
traffic_mirror_filter_id(Optional[TrafficMirrorFilterId], default:None) –The ID of the Traffic Mirror filter.
-
packet_length(Optional[Integer], default:None) –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
PacketLengthparameter to specify the number of bytes in each packet to mirror.For sessions with Network Load Balancer (NLB) Traffic Mirror targets the default
PacketLengthwill be set to 8500. Valid values are 1-8500. Setting aPacketLengthgreater than 8500 will result in an error response. -
session_number(Optional[Integer], default:None) –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.
-
virtual_network_id(Optional[Integer], default:None) –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. -
description(Optional[String], default:None) –The description of the Traffic Mirror session.
-
tag_specifications(Optional[TagSpecificationList], default:None) –The tags to assign to a Traffic Mirror session.
-
dry_run(Optional[Boolean], default:None) –Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is
DryRunOperation. Otherwise, it isUnauthorizedOperation. -
client_token(Optional[String], default:None) –Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to ensure idempotency.
Raises:
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_ec2/_services/async_ec2.py
13099 13100 13101 13102 13103 13104 13105 13106 13107 13108 13109 13110 13111 13112 13113 13114 13115 13116 13117 13118 13119 13120 13121 13122 13123 13124 13125 13126 13127 13128 13129 13130 13131 13132 13133 13134 13135 13136 13137 13138 13139 13140 13141 13142 13143 13144 13145 13146 13147 13148 13149 13150 13151 13152 13153 13154 13155 13156 13157 13158 13159 13160 13161 13162 13163 13164 13165 13166 13167 13168 13169 13170 13171 13172 13173 13174 13175 13176 13177 13178 13179 13180 13181 13182 13183 13184 13185 13186 13187 | |