traffic_mirror_filter_rules
Creates, updates, deletes, gets or lists a traffic_mirror_filter_rules resource.
Overview
| Name | traffic_mirror_filter_rules |
| Type | Resource |
| Id | aws.ec2.traffic_mirror_filter_rules |
Fields
The following fields are returned by SELECT queries:
- describe_traffic_mirror_filter_rules
| Name | Datatype | Description |
|---|---|---|
description | string | The description of the Traffic Mirror rule. |
destination_cidr_block | string | The destination CIDR block assigned to the Traffic Mirror rule. |
destination_port_range | string | The destination port range assigned to the Traffic Mirror rule. |
protocol | integer | The protocol assigned to the Traffic Mirror rule. |
rule_action | string | The action assigned to the Traffic Mirror rule. |
rule_number | integer | The rule number of the Traffic Mirror rule. |
source_cidr_block | string | The source CIDR block assigned to the Traffic Mirror rule. |
source_port_range | string | The source port range assigned to the Traffic Mirror rule. |
tags | string | Tags on Traffic Mirroring filter rules. |
traffic_direction | string | The traffic direction assigned to the Traffic Mirror rule. |
traffic_mirror_filter_id | string | The ID of the Traffic Mirror filter that the rule is associated with. |
traffic_mirror_filter_rule_id | string | The ID of the Traffic Mirror rule. |
Methods
The following methods are available for this resource:
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.
| Name | Datatype | Description |
|---|---|---|
DestinationCidrBlock | string | The destination CIDR block to assign to the Traffic Mirror rule. |
RuleAction | string | The action to take on the filtered traffic. |
RuleNumber | integer | The 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. |
SourceCidrBlock | string | The source CIDR block to assign to the Traffic Mirror rule. |
TrafficDirection | string | The type of traffic. |
TrafficMirrorFilterId | string | The ID of the filter that this rule is associated with. |
TrafficMirrorFilterRuleId | string | The ID of the Traffic Mirror rule. |
region | string | AWS region (default: us-east-1) |
ClientToken | string | Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to ensure idempotency. |
Description | string | The description to assign to the Traffic Mirror rule. |
DestinationCidrBlock | string | The destination CIDR block to assign to the Traffic Mirror rule. |
DestinationPortRange | object | The destination ports that are associated with the Traffic Mirror rule. |
DryRun | boolean | Checks 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. |
Filter | array | Traffic 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. |
MaxResults | integer | The maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned nextToken value. |
NextToken | string | The token for the next page of results. |
Protocol | integer | The protocol, for example TCP, to assign to the Traffic Mirror rule. |
RemoveField | array | The 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. |
RuleAction | string | The action to assign to the rule. |
RuleNumber | integer | The 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. |
SourceCidrBlock | string | The source CIDR block to assign to the Traffic Mirror rule. |
SourcePortRange | object | The port range to assign to the Traffic Mirror rule. |
TagSpecification | array | Traffic Mirroring tags specifications. |
TrafficDirection | string | The type of traffic to assign to the rule. |
TrafficMirrorFilterId | string | Traffic filter ID. |
TrafficMirrorFilterRuleId | array | Traffic filter rule IDs. |
SELECT examples
- describe_traffic_mirror_filter_rules
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
- create_traffic_mirror_filter_rule
- Manifest
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
;
# Description fields are for documentation purposes
- name: traffic_mirror_filter_rules
props:
- name: TrafficMirrorFilterId
value: "{{ TrafficMirrorFilterId }}"
description: Required parameter for the traffic_mirror_filter_rules resource.
- name: TrafficDirection
value: "{{ TrafficDirection }}"
description: Required parameter for the traffic_mirror_filter_rules resource.
- name: RuleNumber
value: {{ RuleNumber }}
description: Required parameter for the traffic_mirror_filter_rules resource.
- name: RuleAction
value: "{{ RuleAction }}"
description: Required parameter for the traffic_mirror_filter_rules resource.
- name: DestinationCidrBlock
value: "{{ DestinationCidrBlock }}"
description: Required parameter for the traffic_mirror_filter_rules resource.
- name: SourceCidrBlock
value: "{{ SourceCidrBlock }}"
description: Required parameter for the traffic_mirror_filter_rules resource.
- name: region
value: "{{ region }}"
description: Required parameter for the traffic_mirror_filter_rules resource.
- name: DestinationPortRange
value: "{{ DestinationPortRange }}"
description: The destination port range.
description: The destination port range.
- name: SourcePortRange
value: "{{ SourcePortRange }}"
description: The source port range.
description: The source port range.
- name: Protocol
value: {{ Protocol }}
description: The protocol, for example UDP, to assign to the Traffic Mirror rule. For information about the protocol value, see Protocol Numbers on the Internet Assigned Numbers Authority (IANA) website.
description: The protocol, for example UDP, to assign to the Traffic Mirror rule. For information about the protocol value, see Protocol Numbers on the Internet Assigned Numbers Authority (IANA) website.
- name: Description
value: "{{ Description }}"
description: The description of the Traffic Mirror rule.
description: The description of the Traffic Mirror rule.
- name: DryRun
value: {{ DryRun }}
description: Checks 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.
description: Checks 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.
- name: ClientToken
value: "{{ ClientToken }}"
description: Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to ensure idempotency.
description: Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to ensure idempotency.
- name: TagSpecification
value: "{{ TagSpecification }}"
description: Traffic Mirroring tags specifications.
description: Traffic Mirroring tags specifications.
UPDATE examples
- modify_traffic_mirror_filter_rule
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
- delete_traffic_mirror_filter_rule
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 }}'
;