v1

latestOpenAPI 3.0.0Apache 2.0 License2026-07-171,1822,9897.4 MB

Creates a Traffic Mirror filter rule.

A Traffic Mirror rule defines the Traffic Mirror source traffic to mirror.

You need the Traffic Mirror filter ID when you create the rule.

get/#Action=CreateTrafficMirrorFilterRule

Query parameters

TrafficMirrorFilterIdstring required

The ID of the filter that this rule is associated with.

TrafficDirection'ingress' | 'egress' required

The type of traffic.

RuleNumberinteger required

The number of the Traffic Mirror rule. This number must be unique for each Traffic Mirror rule in a given direction. The rules are processed in ascending order by rule number.

RuleAction'accept' | 'reject' required

The action to take on the filtered traffic.

FromPortinteger

The first port in the Traffic Mirror port range. This applies to the TCP and UDP protocols.

ToPortinteger

The last port in the Traffic Mirror port range. This applies to the TCP and UDP protocols.

The destination port range.

FromPortinteger

The first port in the Traffic Mirror port range. This applies to the TCP and UDP protocols.

ToPortinteger

The last port in the Traffic Mirror port range. This applies to the TCP and UDP protocols.

The source port range.

Protocolinteger
<p>The protocol, for example UDP, to assign to the Traffic Mirror rule.</p> <p>For information about the protocol value, see <a href="https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml">Protocol Numbers</a> on the Internet Assigned Numbers Authority (IANA) website.</p>
DestinationCidrBlockstring required

The destination CIDR block to assign to the Traffic Mirror rule.

SourceCidrBlockstring required

The source CIDR block to assign to the Traffic Mirror rule.

Descriptionstring

The description of the Traffic Mirror rule.

DryRunboolean

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 <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.

ClientTokenstring

Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">How to ensure idempotency</a>.

Action'CreateTrafficMirrorFilterRule' required
Version'2016-11-15' required

Response

Success