Skip to main content

traffic_mirror_targets

Creates, updates, deletes or gets a traffic_mirror_target resource or lists traffic_mirror_targets in a region

Overview

Nametraffic_mirror_targets
TypeResource
DescriptionThe description of the Traffic Mirror target.
Idawscc.ec2.traffic_mirror_targets

Fields

NameDatatypeDescription
network_load_balancer_arnstringThe Amazon Resource Name (ARN) of the Network Load Balancer that is associated with the target.
descriptionstringThe description of the Traffic Mirror target.
idstring
network_interface_idstringThe network interface ID that is associated with the target.
gateway_load_balancer_endpoint_idstringThe ID of the Gateway Load Balancer endpoint.
tagsarrayThe tags to assign to the Traffic Mirror target.
regionstringAWS region.

For more information, see AWS::EC2::TrafficMirrorTarget.

Methods

NameResourceAccessible byRequired Params
create_resourcetraffic_mirror_targetsINSERTregion
delete_resourcetraffic_mirror_targetsDELETEIdentifier, region
update_resourcetraffic_mirror_targetsUPDATEIdentifier, PatchDocument, region
list_resourcestraffic_mirror_targets_list_onlySELECTregion
get_resourcetraffic_mirror_targetsSELECTIdentifier, region

SELECT examples

Gets all properties from an individual traffic_mirror_target.

SELECT
region,
network_load_balancer_arn,
description,
id,
network_interface_id,
gateway_load_balancer_endpoint_id,
tags
FROM awscc.ec2.traffic_mirror_targets
WHERE
region = '{{ region }}' AND
Identifier = '{{ id }}';

INSERT example

Use the following StackQL query and manifest file to create a new traffic_mirror_target resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.ec2.traffic_mirror_targets (
NetworkLoadBalancerArn,
Description,
NetworkInterfaceId,
GatewayLoadBalancerEndpointId,
Tags,
region
)
SELECT
'{{ network_load_balancer_arn }}',
'{{ description }}',
'{{ network_interface_id }}',
'{{ gateway_load_balancer_endpoint_id }}',
'{{ tags }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

UPDATE example

Use the following StackQL query and manifest file to update a traffic_mirror_target resource, using stack-deploy.

/*+ update */
UPDATE awscc.ec2.traffic_mirror_targets
SET PatchDocument = string('{{ {
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ id }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.ec2.traffic_mirror_targets
WHERE
Identifier = '{{ id }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

Additional Parameters

Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:

ParameterDescription
ClientToken
A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.
A client token is valid for 36 hours once used.
After that, a resource request with the same client token is treated as a new request.
If you do not specify a client token, one is generated for inclusion in the request.
RoleArn
The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.
If you do not specify a role, a temporary session is created using your AWS user credentials.
TypeVersionId
For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used.

Permissions

To operate on the traffic_mirror_targets resource, the following permissions are required:

ec2:CreateTrafficMirrorTarget,
ec2:CreateTags