Skip to main content

traffic_mirror_filter_rules

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

Overview

Nametraffic_mirror_filter_rules
TypeResource
Idaws.ec2.traffic_mirror_filter_rules

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
descriptionstringThe description of the Traffic Mirror rule.
destination_cidr_blockstringThe destination CIDR block assigned to the Traffic Mirror rule.
destination_port_rangestringThe destination port range assigned to the Traffic Mirror rule.
protocolintegerThe protocol assigned to the Traffic Mirror rule.
rule_actionstringThe action assigned to the Traffic Mirror rule.
rule_numberintegerThe rule number of the Traffic Mirror rule.
source_cidr_blockstringThe source CIDR block assigned to the Traffic Mirror rule.
source_port_rangestringThe source port range assigned to the Traffic Mirror rule.
tagsstringTags on Traffic Mirroring filter rules.
traffic_directionstringThe traffic direction assigned to the Traffic Mirror rule.
traffic_mirror_filter_idstringThe ID of the Traffic Mirror filter that the rule is associated with.
traffic_mirror_filter_rule_idstringThe ID of the Traffic Mirror rule.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_traffic_mirror_filter_rulesselectregionTrafficMirrorFilterRuleId, TrafficMirrorFilterId, DryRun, Filter, MaxResults, NextTokenDescribe traffic mirror filters that determine the traffic that is mirrored.
create_traffic_mirror_filter_ruleinsertTrafficMirrorFilterId, TrafficDirection, RuleNumber, RuleAction, DestinationCidrBlock, SourceCidrBlock, regionDestinationPortRange, SourcePortRange, Protocol, Description, DryRun, ClientToken, TagSpecificationCreates a Traffic Mirror filter rule. A Traffic Mirror rule defines the Traffic Mirror source traffic to mirror. You need the Traffic Mirror filter ID when you create the rule.
modify_traffic_mirror_filter_ruleupdateTrafficMirrorFilterRuleId, regionTrafficDirection, RuleNumber, RuleAction, DestinationPortRange, SourcePortRange, Protocol, DestinationCidrBlock, SourceCidrBlock, Description, RemoveField, DryRunModifies the specified Traffic Mirror rule. DestinationCidrBlock and SourceCidrBlock must both be an IPv4 range or an IPv6 range.
delete_traffic_mirror_filter_ruledeleteTrafficMirrorFilterRuleId, regionDryRunDeletes the specified Traffic Mirror rule.

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
DestinationCidrBlockstringThe destination CIDR block to assign to the Traffic Mirror rule.
RuleActionstringThe action to take on the filtered traffic.
RuleNumberintegerThe number of the Traffic Mirror rule. This number must be unique for each Traffic Mirror rule in a given direction. The rules are processed in ascending order by rule number.
SourceCidrBlockstringThe source CIDR block to assign to the Traffic Mirror rule.
TrafficDirectionstringThe type of traffic.
TrafficMirrorFilterIdstringThe ID of the filter that this rule is associated with.
TrafficMirrorFilterRuleIdstringThe ID of the Traffic Mirror rule.
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 to assign to the Traffic Mirror rule.
DestinationCidrBlockstringThe destination CIDR block to assign to the Traffic Mirror rule.
DestinationPortRangeobjectThe destination ports that are associated with the Traffic Mirror rule.
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.
FilterarrayTraffic mirror filters. traffic-mirror-filter-rule-id: The ID of the Traffic Mirror rule. traffic-mirror-filter-id: The ID of the filter that this rule is associated with. rule-number: The number of the Traffic Mirror rule. rule-action: The action taken on the filtered traffic. Possible actions are accept and reject. traffic-direction: The traffic direction. Possible directions are ingress and egress. protocol: The protocol, for example UDP, assigned to the Traffic Mirror rule. source-cidr-block: The source CIDR block assigned to the Traffic Mirror rule. destination-cidr-block: The destination CIDR block assigned to the Traffic Mirror rule. description: The description of the Traffic Mirror rule.
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.
ProtocolintegerThe protocol, for example TCP, to assign to the Traffic Mirror rule.
RemoveFieldarrayThe properties that you want to remove from the Traffic Mirror filter rule. When you remove a property from a Traffic Mirror filter rule, the property is set to the default.
RuleActionstringThe action to assign to the rule.
RuleNumberintegerThe number of the Traffic Mirror rule. This number must be unique for each Traffic Mirror rule in a given direction. The rules are processed in ascending order by rule number.
SourceCidrBlockstringThe source CIDR block to assign to the Traffic Mirror rule.
SourcePortRangeobjectThe port range to assign to the Traffic Mirror rule.
TagSpecificationarrayTraffic Mirroring tags specifications.
TrafficDirectionstringThe type of traffic to assign to the rule.
TrafficMirrorFilterIdstringTraffic filter ID.
TrafficMirrorFilterRuleIdarrayTraffic filter rule IDs.

SELECT examples

Describe traffic mirror filters that determine the traffic that is mirrored.

SELECT
description,
destination_cidr_block,
destination_port_range,
protocol,
rule_action,
rule_number,
source_cidr_block,
source_port_range,
tags,
traffic_direction,
traffic_mirror_filter_id,
traffic_mirror_filter_rule_id
FROM aws.ec2.traffic_mirror_filter_rules
WHERE region = '{{ region }}' -- required
AND TrafficMirrorFilterRuleId = '{{ TrafficMirrorFilterRuleId }}'
AND TrafficMirrorFilterId = '{{ TrafficMirrorFilterId }}'
AND DryRun = '{{ DryRun }}'
AND Filter = '{{ Filter }}'
AND MaxResults = '{{ MaxResults }}'
AND NextToken = '{{ NextToken }}'
;

INSERT examples

Creates a Traffic Mirror filter rule. A Traffic Mirror rule defines the Traffic Mirror source traffic to mirror. You need the Traffic Mirror filter ID when you create the rule.

INSERT INTO aws.ec2.traffic_mirror_filter_rules (
TrafficMirrorFilterId,
TrafficDirection,
RuleNumber,
RuleAction,
DestinationCidrBlock,
SourceCidrBlock,
region,
DestinationPortRange,
SourcePortRange,
Protocol,
Description,
DryRun,
ClientToken,
TagSpecification
)
SELECT
'{{ TrafficMirrorFilterId }}',
'{{ TrafficDirection }}',
'{{ RuleNumber }}',
'{{ RuleAction }}',
'{{ DestinationCidrBlock }}',
'{{ SourceCidrBlock }}',
'{{ region }}',
'{{ DestinationPortRange }}',
'{{ SourcePortRange }}',
'{{ Protocol }}',
'{{ Description }}',
'{{ DryRun }}',
'{{ ClientToken }}',
'{{ TagSpecification }}'
RETURNING
description,
destination_cidr_block,
destination_port_range,
protocol,
rule_action,
rule_number,
source_cidr_block,
source_port_range,
tags,
traffic_direction,
traffic_mirror_filter_id,
traffic_mirror_filter_rule_id
;

UPDATE examples

Modifies the specified Traffic Mirror rule. DestinationCidrBlock and SourceCidrBlock must both be an IPv4 range or an IPv6 range.

UPDATE aws.ec2.traffic_mirror_filter_rules
SET
-- No updatable properties
WHERE
TrafficMirrorFilterRuleId = '{{ TrafficMirrorFilterRuleId }}' --required
AND region = '{{ region }}' --required
AND TrafficDirection = '{{ TrafficDirection}}'
AND RuleNumber = '{{ RuleNumber}}'
AND RuleAction = '{{ RuleAction}}'
AND DestinationPortRange = '{{ DestinationPortRange}}'
AND SourcePortRange = '{{ SourcePortRange}}'
AND Protocol = '{{ Protocol}}'
AND DestinationCidrBlock = '{{ DestinationCidrBlock}}'
AND SourceCidrBlock = '{{ SourceCidrBlock}}'
AND Description = '{{ Description}}'
AND RemoveField = '{{ RemoveField}}'
AND DryRun = {{ DryRun}}
RETURNING
description,
destination_cidr_block,
destination_port_range,
protocol,
rule_action,
rule_number,
source_cidr_block,
source_port_range,
tags,
traffic_direction,
traffic_mirror_filter_id,
traffic_mirror_filter_rule_id;

DELETE examples

Deletes the specified Traffic Mirror rule.

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