create_traffic_mirror_session
¶
create_traffic_mirror_session(
*,
config_overrides: Optional[EC2ClientConfig] = 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/ec2.py
12943 12944 12945 12946 12947 12948 12949 12950 12951 12952 12953 12954 12955 12956 12957 12958 12959 12960 12961 12962 12963 12964 12965 12966 12967 12968 12969 12970 12971 12972 12973 12974 12975 12976 12977 12978 12979 12980 12981 12982 12983 12984 12985 12986 12987 12988 12989 12990 12991 12992 12993 12994 12995 12996 12997 12998 12999 13000 13001 13002 13003 13004 13005 13006 13007 13008 13009 13010 13011 13012 13013 13014 13015 13016 13017 13018 13019 13020 13021 13022 13023 13024 13025 13026 13027 13028 13029 13030 | |