Skip to main content

traffic_mirror_targets

Creates, updates, deletes, gets or lists a traffic_mirror_targets resource.

Overview

Nametraffic_mirror_targets
TypeResource
Idaws.ec2.traffic_mirror_targets

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
descriptionstringInformation about the Traffic Mirror target.
gateway_load_balancer_endpoint_idstringThe ID of the Gateway Load Balancer endpoint.
network_interface_idstringThe network interface ID that is attached to the target.
network_load_balancer_arnstringThe Amazon Resource Name (ARN) of the Network Load Balancer.
owner_idstringThe ID of the account that owns the Traffic Mirror target.
tagsstringThe tags assigned to the Traffic Mirror target.
traffic_mirror_target_idstringThe ID of the Traffic Mirror target.
typestringThe type of Traffic Mirror target.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_traffic_mirror_targetsselectregionTrafficMirrorTargetId, DryRun, Filter, MaxResults, NextTokenInformation about one or more Traffic Mirror targets.
create_traffic_mirror_targetinsertregionNetworkInterfaceId, NetworkLoadBalancerArn, Description, TagSpecification, DryRun, ClientToken, GatewayLoadBalancerEndpointIdCreates a target for your Traffic Mirror session. A Traffic Mirror target is the destination for mirrored traffic. The Traffic Mirror source and the Traffic Mirror target (monitoring appliances) can be in the same VPC, or in different VPCs connected via VPC peering or a transit gateway. A Traffic Mirror target can be a network interface, a Network Load Balancer, or a Gateway Load Balancer endpoint. To use the target in a Traffic Mirror session, use CreateTrafficMirrorSession.
delete_traffic_mirror_targetdeleteTrafficMirrorTargetId, regionDryRunDeletes the specified Traffic Mirror target. You cannot delete a Traffic Mirror target that is in use by a Traffic Mirror session.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
TrafficMirrorTargetIdstringThe ID of the Traffic Mirror target.
regionstringAWS region (default: us-east-1)
ClientTokenstringUnique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to ensure idempotency.
DescriptionstringThe description of the Traffic Mirror target.
DryRunbooleanChecks 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.
FilterarrayOne 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.
GatewayLoadBalancerEndpointIdstringThe ID of the Gateway Load Balancer endpoint.
MaxResultsintegerThe maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned nextToken value.
NetworkInterfaceIdstringThe network interface ID that is associated with the target.
NetworkLoadBalancerArnstringThe Amazon Resource Name (ARN) of the Network Load Balancer that is associated with the target.
NextTokenstringThe token for the next page of results.
TagSpecificationarrayThe tags to assign to the Traffic Mirror target.
TrafficMirrorTargetIdarrayThe ID of the Traffic Mirror targets.

SELECT examples

Information about one or more Traffic Mirror targets.

SELECT
description,
gateway_load_balancer_endpoint_id,
network_interface_id,
network_load_balancer_arn,
owner_id,
tags,
traffic_mirror_target_id,
type
FROM aws.ec2.traffic_mirror_targets
WHERE region = '{{ region }}' -- required
AND TrafficMirrorTargetId = '{{ TrafficMirrorTargetId }}'
AND DryRun = '{{ DryRun }}'
AND Filter = '{{ Filter }}'
AND MaxResults = '{{ MaxResults }}'
AND NextToken = '{{ NextToken }}'
;

INSERT examples

Creates a target for your Traffic Mirror session. A Traffic Mirror target is the destination for mirrored traffic. The Traffic Mirror source and the Traffic Mirror target (monitoring appliances) can be in the same VPC, or in different VPCs connected via VPC peering or a transit gateway. A Traffic Mirror target can be a network interface, a Network Load Balancer, or a Gateway Load Balancer endpoint. To use the target in a Traffic Mirror session, use CreateTrafficMirrorSession.

INSERT INTO aws.ec2.traffic_mirror_targets (
region,
NetworkInterfaceId,
NetworkLoadBalancerArn,
Description,
TagSpecification,
DryRun,
ClientToken,
GatewayLoadBalancerEndpointId
)
SELECT
'{{ region }}',
'{{ NetworkInterfaceId }}',
'{{ NetworkLoadBalancerArn }}',
'{{ Description }}',
'{{ TagSpecification }}',
'{{ DryRun }}',
'{{ ClientToken }}',
'{{ GatewayLoadBalancerEndpointId }}'
RETURNING
description,
gateway_load_balancer_endpoint_id,
network_interface_id,
network_load_balancer_arn,
owner_id,
tags,
traffic_mirror_target_id,
type
;

DELETE examples

Deletes the specified Traffic Mirror target. You cannot delete a Traffic Mirror target that is in use by a Traffic Mirror session.

DELETE FROM aws.ec2.traffic_mirror_targets
WHERE TrafficMirrorTargetId = '{{ TrafficMirrorTargetId }}' --required
AND region = '{{ region }}' --required
AND DryRun = '{{ DryRun }}'
;