Skip to main content

traffic_mirror_filter_rules

Creates, updates, deletes or gets a traffic_mirror_filter_rule resource or lists traffic_mirror_filter_rules in a region

Overview

Nametraffic_mirror_filter_rules
TypeResource
DescriptionResource Type definition for for AWS::EC2::TrafficMirrorFilterRule
Idawscc.ec2.traffic_mirror_filter_rules

Fields

NameDatatypeDescription
destination_port_rangeobjectThe destination port range.
descriptionstringThe description of the Traffic Mirror Filter rule.
rule_actionstringThe action to take on the filtered traffic (accept/reject).
source_cidr_blockstringThe source CIDR block to assign to the Traffic Mirror Filter rule.
rule_numberintegerThe number of the Traffic Mirror rule.
destination_cidr_blockstringThe destination CIDR block to assign to the Traffic Mirror rule.
traffic_mirror_filter_rule_idstringThe ID of the Traffic Mirror Filter rule.
traffic_mirror_filter_idstringThe ID of the filter that this rule is associated with.
traffic_directionstringThe direction of traffic (ingress/egress).
protocolintegerThe number of protocol, for example 17 (UDP), to assign to the Traffic Mirror rule.
tagsarrayAny tags assigned to the Traffic Mirror Filter rule.
regionstringAWS region.

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

Methods

NameResourceAccessible byRequired Params
create_resourcetraffic_mirror_filter_rulesINSERTRuleAction, SourceCidrBlock, RuleNumber, DestinationCidrBlock, TrafficMirrorFilterId, TrafficDirection, region
delete_resourcetraffic_mirror_filter_rulesDELETEIdentifier, region
update_resourcetraffic_mirror_filter_rulesUPDATEIdentifier, PatchDocument, region
list_resourcestraffic_mirror_filter_rules_list_onlySELECTregion
get_resourcetraffic_mirror_filter_rulesSELECTIdentifier, region

SELECT examples

Gets all properties from an individual traffic_mirror_filter_rule.

SELECT
region,
destination_port_range,
description,
source_port_range,
rule_action,
source_cidr_block,
rule_number,
destination_cidr_block,
traffic_mirror_filter_rule_id,
traffic_mirror_filter_id,
traffic_direction,
protocol,
tags
FROM awscc.ec2.traffic_mirror_filter_rules
WHERE
region = '{{ region }}' AND
Identifier = '{{ traffic_mirror_filter_rule_id }}';

INSERT example

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

/*+ create */
INSERT INTO awscc.ec2.traffic_mirror_filter_rules (
RuleAction,
SourceCidrBlock,
RuleNumber,
DestinationCidrBlock,
TrafficMirrorFilterId,
TrafficDirection,
region
)
SELECT
'{{ rule_action }}',
'{{ source_cidr_block }}',
'{{ rule_number }}',
'{{ destination_cidr_block }}',
'{{ traffic_mirror_filter_id }}',
'{{ traffic_direction }}',
'{{ 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_filter_rule resource, using stack-deploy.

/*+ update */
UPDATE awscc.ec2.traffic_mirror_filter_rules
SET PatchDocument = string('{{ {
"DestinationPortRange": destination_port_range,
"Description": description,
"SourcePortRange": source_port_range,
"RuleAction": rule_action,
"SourceCidrBlock": source_cidr_block,
"RuleNumber": rule_number,
"DestinationCidrBlock": destination_cidr_block,
"TrafficDirection": traffic_direction,
"Protocol": protocol,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ traffic_mirror_filter_rule_id }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.ec2.traffic_mirror_filter_rules
WHERE
Identifier = '{{ traffic_mirror_filter_rule_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_filter_rules resource, the following permissions are required:

ec2:CreateTrafficMirrorFilterRule,
ec2:CreateTags,
ec2:DescribeTrafficMirrorFilterRules