Skip to main content

traffic_mirror_sessions

Creates, updates, deletes or gets a traffic_mirror_session resource or lists traffic_mirror_sessions in a region

Overview

Nametraffic_mirror_sessions
TypeResource
DescriptionResource schema for AWS::EC2::TrafficMirrorSession
Idawscc.ec2.traffic_mirror_sessions

Fields

NameDatatypeDescription
idstringThe ID of a Traffic Mirror session.
network_interface_idstringThe ID of the source network interface.
traffic_mirror_target_idstringThe ID of a Traffic Mirror target.
traffic_mirror_filter_idstringThe ID of a Traffic Mirror filter.
packet_lengthintegerThe number of bytes in each packet to mirror.
session_numberintegerThe session number determines the order in which sessions are evaluated when an interface is used by multiple sessions. The first session with a matching filter is the one that mirrors the packets.
virtual_network_idintegerThe VXLAN ID for the Traffic Mirror session.
descriptionstringThe description of the Traffic Mirror session.
owner_idstringThe ID of the account that owns the Traffic Mirror session.
tagsarrayThe tags assigned to the Traffic Mirror session.
regionstringAWS region.

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

Methods

NameResourceAccessible byRequired Params
create_resourcetraffic_mirror_sessionsINSERTNetworkInterfaceId, TrafficMirrorFilterId, SessionNumber, TrafficMirrorTargetId, region
delete_resourcetraffic_mirror_sessionsDELETEIdentifier, region
update_resourcetraffic_mirror_sessionsUPDATEIdentifier, PatchDocument, region
list_resourcestraffic_mirror_sessions_list_onlySELECTregion
get_resourcetraffic_mirror_sessionsSELECTIdentifier, region

SELECT examples

Gets all properties from an individual traffic_mirror_session.

SELECT
region,
id,
network_interface_id,
traffic_mirror_target_id,
traffic_mirror_filter_id,
packet_length,
session_number,
virtual_network_id,
description,
owner_id,
tags
FROM awscc.ec2.traffic_mirror_sessions
WHERE
region = '{{ region }}' AND
Identifier = '{{ id }}';

INSERT example

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

/*+ create */
INSERT INTO awscc.ec2.traffic_mirror_sessions (
NetworkInterfaceId,
TrafficMirrorTargetId,
TrafficMirrorFilterId,
SessionNumber,
region
)
SELECT
'{{ network_interface_id }}',
'{{ traffic_mirror_target_id }}',
'{{ traffic_mirror_filter_id }}',
'{{ session_number }}',
'{{ 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_session resource, using stack-deploy.

/*+ update */
UPDATE awscc.ec2.traffic_mirror_sessions
SET PatchDocument = string('{{ {
"NetworkInterfaceId": network_interface_id,
"TrafficMirrorTargetId": traffic_mirror_target_id,
"TrafficMirrorFilterId": traffic_mirror_filter_id,
"PacketLength": packet_length,
"SessionNumber": session_number,
"VirtualNetworkId": virtual_network_id,
"Description": description,
"OwnerId": owner_id,
"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_sessions
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_sessions resource, the following permissions are required:

ec2:CreateTrafficMirrorSession,
ec2:DescribeTrafficMirrorSessions,
ec2:CreateTags,
ec2:DescribeTags