Skip to main content

rule_groups

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

Overview

Namerule_groups
TypeResource
Idaws.network_firewall.rule_groups

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
rule_groupobjectThe object that defines the rules in a rule group. This, along with RuleGroupResponse, define the rule group. You can retrieve all objects for a rule group by calling DescribeRuleGroup. Network Firewall uses a rule group to inspect and control network traffic. You define stateless rule groups to inspect individual packets and you define stateful rule groups to inspect packets in the context of their traffic flow. To use a rule group, you include it by reference in an Network Firewall firewall policy, then you use the policy in a firewall. You can reference a rule group from more than one firewall policy, and you can use a firewall policy in more than one firewall.
rule_group_responseobjectThe high-level properties of a rule group. This, along with the RuleGroup, define the rule group. You can retrieve all objects for a rule group by calling DescribeRuleGroup.
update_tokenstringA token used for optimistic locking. Network Firewall returns a token to your requests that access the rule group. The token marks the state of the rule group resource at the time of the request. To make changes to the rule group, you provide the token in your request. Network Firewall uses the token to ensure that the rule group hasn't changed since you last retrieved it. If it has changed, the operation fails with an InvalidTokenException. If this happens, retrieve the rule group again to get a current copy of it with a current token. Reapply your changes as needed, then try the operation again using the new token. (pattern: <code>^([0-9a-f]{8})-([0-9a-f]{4}-){3}([0-9a-f]{12})$</code>)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_rule_groupselectregionReturns the data objects for the specified rule group.
list_rule_groupsselectregionRetrieves the metadata for the rule groups that you have defined. Depending on your setting for max results and the number of rule groups, a single call might not return the full list.
create_rule_groupinsertregion, RuleGroupName, Type, CapacityCreates the specified stateless or stateful rule group, which includes the rules for network traffic inspection, a capacity setting, and tags. You provide your rule group specification in your request using either RuleGroup or Rules.
update_rule_groupupdateregion, UpdateTokenUpdates the rule settings for the specified rule group. You use a rule group by reference in one or more firewall policies. When you modify a rule group, you modify all firewall policies that use the rule group. To update a rule group, first call DescribeRuleGroup to retrieve the current RuleGroup object, update the object as needed, and then provide the updated object to this call.
delete_rule_groupdeleteregionDeletes the specified RuleGroup.

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
regionstringAWS region (default: us-east-1)

SELECT examples

Returns the data objects for the specified rule group.

SELECT
rule_group,
rule_group_response,
update_token
FROM aws.network_firewall.rule_groups
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates the specified stateless or stateful rule group, which includes the rules for network traffic inspection, a capacity setting, and tags. You provide your rule group specification in your request using either RuleGroup or Rules.

INSERT INTO aws.network_firewall.rule_groups (
RuleGroupName,
RuleGroup,
Rules,
Type,
Description,
Capacity,
Tags,
DryRun,
EncryptionConfiguration,
SourceMetadata,
AnalyzeRuleGroup,
SummaryConfiguration,
region
)
SELECT
'{{ RuleGroupName }}' /* required */,
'{{ RuleGroup }}',
'{{ Rules }}',
'{{ Type }}' /* required */,
'{{ Description }}',
{{ Capacity }} /* required */,
'{{ Tags }}',
{{ DryRun }},
'{{ EncryptionConfiguration }}',
'{{ SourceMetadata }}',
{{ AnalyzeRuleGroup }},
'{{ SummaryConfiguration }}',
'{{ region }}'
RETURNING
rule_group_response,
update_token
;

UPDATE examples

Updates the rule settings for the specified rule group. You use a rule group by reference in one or more firewall policies. When you modify a rule group, you modify all firewall policies that use the rule group. To update a rule group, first call DescribeRuleGroup to retrieve the current RuleGroup object, update the object as needed, and then provide the updated object to this call.

UPDATE aws.network_firewall.rule_groups
SET
UpdateToken = '{{ UpdateToken }}',
RuleGroupArn = '{{ RuleGroupArn }}',
RuleGroupName = '{{ RuleGroupName }}',
RuleGroup = '{{ RuleGroup }}',
Rules = '{{ Rules }}',
Type = '{{ Type }}',
Description = '{{ Description }}',
DryRun = {{ DryRun }},
EncryptionConfiguration = '{{ EncryptionConfiguration }}',
SourceMetadata = '{{ SourceMetadata }}',
AnalyzeRuleGroup = {{ AnalyzeRuleGroup }},
SummaryConfiguration = '{{ SummaryConfiguration }}'
WHERE
region = '{{ region }}' --required
AND UpdateToken = '{{ UpdateToken }}' --required
RETURNING
rule_group_response,
update_token;

DELETE examples

Deletes the specified RuleGroup.

DELETE FROM aws.network_firewall.rule_groups
WHERE region = '{{ region }}' --required
;