traffic_mirror_sessions
Creates, updates, deletes or gets a traffic_mirror_session resource or lists traffic_mirror_sessions in a region
Overview
| Name | traffic_mirror_sessions |
| Type | Resource |
| Description | Resource schema for AWS::EC2::TrafficMirrorSession |
| Id | awscc.ec2.traffic_mirror_sessions |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
id | string | The ID of a Traffic Mirror session. |
network_interface_id | string | The ID of the source network interface. |
traffic_mirror_target_id | string | The ID of a Traffic Mirror target. |
traffic_mirror_filter_id | string | The ID of a Traffic Mirror filter. |
packet_length | integer | The number of bytes in each packet to mirror. |
session_number | integer | The 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_id | integer | The VXLAN ID for the Traffic Mirror session. |
description | string | The description of the Traffic Mirror session. |
owner_id | string | The ID of the account that owns the Traffic Mirror session. |
tags | array | The tags assigned to the Traffic Mirror session. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
id | string | The ID of a Traffic Mirror session. |
region | string | AWS region. |
For more information, see AWS::EC2::TrafficMirrorSession.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | traffic_mirror_sessions | INSERT | NetworkInterfaceId, TrafficMirrorFilterId, SessionNumber, TrafficMirrorTargetId, region |
delete_resource | traffic_mirror_sessions | DELETE | Identifier, region |
update_resource | traffic_mirror_sessions | UPDATE | Identifier, PatchDocument, region |
list_resources | traffic_mirror_sessions_list_only | SELECT | region |
get_resource | traffic_mirror_sessions | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
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 = 'us-east-1' AND
Identifier = '{{ id }}';
Lists all traffic_mirror_sessions in a region.
SELECT
region,
id
FROM awscc.ec2.traffic_mirror_sessions_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new traffic_mirror_session resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ 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 }}';
/*+ create */
INSERT INTO awscc.ec2.traffic_mirror_sessions (
NetworkInterfaceId,
TrafficMirrorTargetId,
TrafficMirrorFilterId,
PacketLength,
SessionNumber,
VirtualNetworkId,
Description,
OwnerId,
Tags,
region
)
SELECT
'{{ network_interface_id }}',
'{{ traffic_mirror_target_id }}',
'{{ traffic_mirror_filter_id }}',
'{{ packet_length }}',
'{{ session_number }}',
'{{ virtual_network_id }}',
'{{ description }}',
'{{ owner_id }}',
'{{ tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: traffic_mirror_session
props:
- name: network_interface_id
value: '{{ network_interface_id }}'
- name: traffic_mirror_target_id
value: '{{ traffic_mirror_target_id }}'
- name: traffic_mirror_filter_id
value: '{{ traffic_mirror_filter_id }}'
- name: packet_length
value: '{{ packet_length }}'
- name: session_number
value: '{{ session_number }}'
- name: virtual_network_id
value: '{{ virtual_network_id }}'
- name: description
value: '{{ description }}'
- name: owner_id
value: '{{ owner_id }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
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 }}';
DELETE example
/*+ delete */
DELETE FROM awscc.ec2.traffic_mirror_sessions
WHERE
Identifier = '{{ id }}' AND
region = 'us-east-1';
Permissions
To operate on the traffic_mirror_sessions resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
ec2:CreateTrafficMirrorSession,
ec2:DescribeTrafficMirrorSessions,
ec2:CreateTags,
ec2:DescribeTags
ec2:DescribeTrafficMirrorSessions,
ec2:DescribeTags
ec2:ModifyTrafficMirrorSession,
ec2:CreateTags,
ec2:DeleteTags,
ec2:DescribeTrafficMirrorSessions,
ec2:DescribeTags
ec2:DeleteTrafficMirrorSession,
ec2:DeleteTags
ec2:DescribeTrafficMirrorSessions,
ec2:DescribeTags