DescribeTrafficMirrorTargetsCommand

Information about one or more Traffic Mirror targets.

Example Syntax

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

import { EC2Client, DescribeTrafficMirrorTargetsCommand } from "@aws-sdk/client-ec2"; // ES Modules import
// const { EC2Client, DescribeTrafficMirrorTargetsCommand } = require("@aws-sdk/client-ec2"); // CommonJS import
const client = new EC2Client(config);
const input = { // DescribeTrafficMirrorTargetsRequest
  TrafficMirrorTargetIds: [ // TrafficMirrorTargetIdList
    "STRING_VALUE",
  ],
  DryRun: true || false,
  Filters: [ // FilterList
    { // Filter
      Name: "STRING_VALUE",
      Values: [ // ValueStringList
        "STRING_VALUE",
      ],
    },
  ],
  MaxResults: Number("int"),
  NextToken: "STRING_VALUE",
};
const command = new DescribeTrafficMirrorTargetsCommand(input);
const response = await client.send(command);
// { // DescribeTrafficMirrorTargetsResult
//   TrafficMirrorTargets: [ // TrafficMirrorTargetSet
//     { // TrafficMirrorTarget
//       TrafficMirrorTargetId: "STRING_VALUE",
//       NetworkInterfaceId: "STRING_VALUE",
//       NetworkLoadBalancerArn: "STRING_VALUE",
//       Type: "network-interface" || "network-load-balancer" || "gateway-load-balancer-endpoint",
//       Description: "STRING_VALUE",
//       OwnerId: "STRING_VALUE",
//       Tags: [ // TagList
//         { // Tag
//           Key: "STRING_VALUE",
//           Value: "STRING_VALUE",
//         },
//       ],
//       GatewayLoadBalancerEndpointId: "STRING_VALUE",
//     },
//   ],
//   NextToken: "STRING_VALUE",
// };

DescribeTrafficMirrorTargetsCommand 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 target description.

  • network-interface-id: The ID of the Traffic Mirror session network interface.

  • network-load-balancer-arn: The Amazon Resource Name (ARN) of the Network Load Balancer that is associated with the session.

  • owner-id: The ID of the account that owns the Traffic Mirror session.

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

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.

TrafficMirrorTargetIds
string[] | undefined

The ID of the Traffic Mirror targets.

DescribeTrafficMirrorTargetsCommand 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.

TrafficMirrorTargets
TrafficMirrorTarget[] | undefined

Information about one or more Traffic Mirror targets.

Throws

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