DescribeTrafficMirrorFiltersCommand

Describes one or more Traffic Mirror filters.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { EC2Client, DescribeTrafficMirrorFiltersCommand } from "@aws-sdk/client-ec2"; // ES Modules import
// const { EC2Client, DescribeTrafficMirrorFiltersCommand } = require("@aws-sdk/client-ec2"); // CommonJS import
const client = new EC2Client(config);
const input = { // DescribeTrafficMirrorFiltersRequest
  TrafficMirrorFilterIds: [ // TrafficMirrorFilterIdList
    "STRING_VALUE",
  ],
  DryRun: true || false,
  Filters: [ // FilterList
    { // Filter
      Name: "STRING_VALUE",
      Values: [ // ValueStringList
        "STRING_VALUE",
      ],
    },
  ],
  MaxResults: Number("int"),
  NextToken: "STRING_VALUE",
};
const command = new DescribeTrafficMirrorFiltersCommand(input);
const response = await client.send(command);
// { // DescribeTrafficMirrorFiltersResult
//   TrafficMirrorFilters: [ // TrafficMirrorFilterSet
//     { // TrafficMirrorFilter
//       TrafficMirrorFilterId: "STRING_VALUE",
//       IngressFilterRules: [ // TrafficMirrorFilterRuleList
//         { // TrafficMirrorFilterRule
//           TrafficMirrorFilterRuleId: "STRING_VALUE",
//           TrafficMirrorFilterId: "STRING_VALUE",
//           TrafficDirection: "ingress" || "egress",
//           RuleNumber: Number("int"),
//           RuleAction: "accept" || "reject",
//           Protocol: Number("int"),
//           DestinationPortRange: { // TrafficMirrorPortRange
//             FromPort: Number("int"),
//             ToPort: Number("int"),
//           },
//           SourcePortRange: {
//             FromPort: Number("int"),
//             ToPort: Number("int"),
//           },
//           DestinationCidrBlock: "STRING_VALUE",
//           SourceCidrBlock: "STRING_VALUE",
//           Description: "STRING_VALUE",
//           Tags: [ // TagList
//             { // Tag
//               Key: "STRING_VALUE",
//               Value: "STRING_VALUE",
//             },
//           ],
//         },
//       ],
//       EgressFilterRules: [
//         {
//           TrafficMirrorFilterRuleId: "STRING_VALUE",
//           TrafficMirrorFilterId: "STRING_VALUE",
//           TrafficDirection: "ingress" || "egress",
//           RuleNumber: Number("int"),
//           RuleAction: "accept" || "reject",
//           Protocol: Number("int"),
//           DestinationPortRange: {
//             FromPort: Number("int"),
//             ToPort: Number("int"),
//           },
//           SourcePortRange: {
//             FromPort: Number("int"),
//             ToPort: Number("int"),
//           },
//           DestinationCidrBlock: "STRING_VALUE",
//           SourceCidrBlock: "STRING_VALUE",
//           Description: "STRING_VALUE",
//           Tags: [
//             {
//               Key: "STRING_VALUE",
//               Value: "STRING_VALUE",
//             },
//           ],
//         },
//       ],
//       NetworkServices: [ // TrafficMirrorNetworkServiceList
//         "amazon-dns",
//       ],
//       Description: "STRING_VALUE",
//       Tags: [
//         {
//           Key: "STRING_VALUE",
//           Value: "STRING_VALUE",
//         },
//       ],
//     },
//   ],
//   NextToken: "STRING_VALUE",
// };

DescribeTrafficMirrorFiltersCommand Input

Parameter
Type
Description
DryRun
boolean | undefined

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 is UnauthorizedOperation.

Filters
Filter[] | undefined

One or more filters. The possible values are:

  • description: The Traffic Mirror filter description.

  • traffic-mirror-filter-id: The ID of the Traffic Mirror filter.

MaxResults
number | undefined

The maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned nextToken value.

NextToken
string | undefined

The token for the next page of results.

TrafficMirrorFilterIds
string[] | undefined

The ID of the Traffic Mirror filter.

DescribeTrafficMirrorFiltersCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
NextToken
string | undefined

The token to use to retrieve the next page of results. The value is null when there are no more results to return.

TrafficMirrorFilters
TrafficMirrorFilter[] | undefined

Information about one or more Traffic Mirror filters.

Throws

Name
Fault
Details
EC2ServiceException
Base exception class for all service exceptions from EC2 service.