Skip to main content

traffic_mirror_filters

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

Overview

Nametraffic_mirror_filters
TypeResource
Idaws.ec2.traffic_mirror_filters

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
descriptionstringThe description of the Traffic Mirror filter.
egress_filter_rulesstringInformation about the egress rules that are associated with the Traffic Mirror filter.
ingress_filter_rulesstringInformation about the ingress rules that are associated with the Traffic Mirror filter.
network_servicesstringThe network service traffic that is associated with the Traffic Mirror filter.
tagsstringThe tags assigned to the Traffic Mirror filter.
traffic_mirror_filter_idstringThe ID of the Traffic Mirror filter.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_traffic_mirror_filtersselectregionTrafficMirrorFilterId, DryRun, Filter, MaxResults, NextTokenDescribes one or more Traffic Mirror filters.
create_traffic_mirror_filterinsertregionDescription, TagSpecification, DryRun, ClientTokenCreates a Traffic Mirror filter. A Traffic Mirror filter is a set of rules that defines the traffic to mirror. By default, no traffic is mirrored. To mirror traffic, use CreateTrafficMirrorFilterRule to add Traffic Mirror rules to the filter. The rules you add define what traffic gets mirrored. You can also use ModifyTrafficMirrorFilterNetworkServices to mirror supported network services.
modify_traffic_mirror_filter_network_servicesupdateTrafficMirrorFilterId, regionAddNetworkService, RemoveNetworkService, DryRunAllows or restricts mirroring network services. By default, Amazon DNS network services are not eligible for Traffic Mirror. Use AddNetworkServices to add network services to a Traffic Mirror filter. When a network service is added to the Traffic Mirror filter, all traffic related to that network service will be mirrored. When you no longer want to mirror network services, use RemoveNetworkServices to remove the network services from the Traffic Mirror filter.
delete_traffic_mirror_filterdeleteTrafficMirrorFilterId, regionDryRunDeletes the specified Traffic Mirror filter. You cannot delete a Traffic Mirror filter 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
TrafficMirrorFilterIdstringThe ID of the Traffic Mirror filter.
regionstringAWS region (default: us-east-1)
AddNetworkServicearrayThe network service, for example Amazon DNS, that you want to mirror.
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 filter.
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 filter description. traffic-mirror-filter-id: The ID of the Traffic Mirror filter.
MaxResultsintegerThe maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned nextToken value.
NextTokenstringThe token for the next page of results.
RemoveNetworkServicearrayThe network service, for example Amazon DNS, that you no longer want to mirror.
TagSpecificationarrayThe tags to assign to a Traffic Mirror filter.
TrafficMirrorFilterIdarrayThe ID of the Traffic Mirror filter.

SELECT examples

Describes one or more Traffic Mirror filters.

SELECT
description,
egress_filter_rules,
ingress_filter_rules,
network_services,
tags,
traffic_mirror_filter_id
FROM aws.ec2.traffic_mirror_filters
WHERE region = '{{ region }}' -- required
AND TrafficMirrorFilterId = '{{ TrafficMirrorFilterId }}'
AND DryRun = '{{ DryRun }}'
AND Filter = '{{ Filter }}'
AND MaxResults = '{{ MaxResults }}'
AND NextToken = '{{ NextToken }}'
;

INSERT examples

Creates a Traffic Mirror filter. A Traffic Mirror filter is a set of rules that defines the traffic to mirror. By default, no traffic is mirrored. To mirror traffic, use CreateTrafficMirrorFilterRule to add Traffic Mirror rules to the filter. The rules you add define what traffic gets mirrored. You can also use ModifyTrafficMirrorFilterNetworkServices to mirror supported network services.

INSERT INTO aws.ec2.traffic_mirror_filters (
region,
Description,
TagSpecification,
DryRun,
ClientToken
)
SELECT
'{{ region }}',
'{{ Description }}',
'{{ TagSpecification }}',
'{{ DryRun }}',
'{{ ClientToken }}'
RETURNING
description,
egress_filter_rules,
ingress_filter_rules,
network_services,
tags,
traffic_mirror_filter_id
;

UPDATE examples

Allows or restricts mirroring network services. By default, Amazon DNS network services are not eligible for Traffic Mirror. Use AddNetworkServices to add network services to a Traffic Mirror filter. When a network service is added to the Traffic Mirror filter, all traffic related to that network service will be mirrored. When you no longer want to mirror network services, use RemoveNetworkServices to remove the network services from the Traffic Mirror filter.

UPDATE aws.ec2.traffic_mirror_filters
SET
-- No updatable properties
WHERE
TrafficMirrorFilterId = '{{ TrafficMirrorFilterId }}' --required
AND region = '{{ region }}' --required
AND AddNetworkService = '{{ AddNetworkService}}'
AND RemoveNetworkService = '{{ RemoveNetworkService}}'
AND DryRun = {{ DryRun}}
RETURNING
description,
egress_filter_rules,
ingress_filter_rules,
network_services,
tags,
traffic_mirror_filter_id;

DELETE examples

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

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