Skip to main content

rule_groups

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

Overview

Namerule_groups
TypeResource
Idaws.wafv2.rule_groups

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
next_markerstringWhen you request a list of objects with a Limit setting, if the number of objects that are still available for retrieval exceeds the limit, WAF returns a NextMarker value in the response. To retrieve the next batch of objects, provide the marker from the prior call in your next request. (pattern: <code>.\S.</code>)
rule_groupsarrayArray of rule groups. If you specified a Limit in your request, this might not be the full list.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_rule_groupsselectregionRetrieves an array of RuleGroupSummary objects for the rule groups that you manage.
get_rule_groupselectregionRetrieves the specified RuleGroup.
create_rule_groupinsertregion, Name, Scope, Capacity, VisibilityConfigCreates a RuleGroup per the specifications provided. A rule group defines a collection of rules to inspect and control web requests that you can use in a WebACL. When you create a rule group, you define an immutable capacity limit. If you update a rule group, you must stay within the capacity. This allows others to reuse the rule group with confidence in its capacity requirements.
update_rule_groupupdateregion, Name, Scope, Id, VisibilityConfig, LockTokenUpdates the specified RuleGroup. This operation completely replaces the mutable specifications that you already have for the rule group with the ones that you provide to this call. To modify a rule group, do the following: Retrieve it by calling GetRuleGroup Update its settings as needed Provide the complete rule group specification to this call A rule group defines a collection of rules to inspect and control web requests that you can use in a WebACL. When you create a rule group, you define an immutable capacity limit. If you update a rule group, you must stay within the capacity. This allows others to reuse the rule group with confidence in its capacity requirements. Temporary inconsistencies during updates When you create or change a web ACL or other WAF resources, the changes take a small amount of time to propagate to all areas where the resources are stored. The propagation time can be from a few seconds to a number of minutes. The following are examples of the temporary inconsistencies that you might notice during change propagation: After you create a web ACL, if you try to associate it with a resource, you might get an exception indicating that the web ACL is unavailable. After you add a rule group to a web ACL, the new rule group rules might be in effect in one area where the web ACL is used and not in another. After you change a rule action setting, you might see the old action in some places and the new action in others. After you add an IP address to an IP set that is in use in a blocking rule, the new address might be blocked in one area while still allowed in another.
delete_rule_groupdeleteregionDeletes the specified RuleGroup.
delete_firewall_manager_rule_groupsdeleteregionDeletes all rule groups that are managed by Firewall Manager from the specified WebACL. You can only use this if ManagedByFirewallManager and RetrofittedByFirewallManager are both false in the web ACL.

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

Retrieves an array of RuleGroupSummary objects for the rule groups that you manage.

SELECT
next_marker,
rule_groups
FROM aws.wafv2.rule_groups
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates a RuleGroup per the specifications provided. A rule group defines a collection of rules to inspect and control web requests that you can use in a WebACL. When you create a rule group, you define an immutable capacity limit. If you update a rule group, you must stay within the capacity. This allows others to reuse the rule group with confidence in its capacity requirements.

INSERT INTO aws.wafv2.rule_groups (
Name,
Scope,
Capacity,
Description,
Rules,
VisibilityConfig,
Tags,
CustomResponseBodies,
MonetizationConfig,
region
)
SELECT
'{{ Name }}' /* required */,
'{{ Scope }}' /* required */,
{{ Capacity }} /* required */,
'{{ Description }}',
'{{ Rules }}',
'{{ VisibilityConfig }}' /* required */,
'{{ Tags }}',
'{{ CustomResponseBodies }}',
'{{ MonetizationConfig }}',
'{{ region }}'
RETURNING
summary
;

UPDATE examples

Updates the specified RuleGroup. This operation completely replaces the mutable specifications that you already have for the rule group with the ones that you provide to this call. To modify a rule group, do the following: Retrieve it by calling GetRuleGroup Update its settings as needed Provide the complete rule group specification to this call A rule group defines a collection of rules to inspect and control web requests that you can use in a WebACL. When you create a rule group, you define an immutable capacity limit. If you update a rule group, you must stay within the capacity. This allows others to reuse the rule group with confidence in its capacity requirements. Temporary inconsistencies during updates When you create or change a web ACL or other WAF resources, the changes take a small amount of time to propagate to all areas where the resources are stored. The propagation time can be from a few seconds to a number of minutes. The following are examples of the temporary inconsistencies that you might notice during change propagation: After you create a web ACL, if you try to associate it with a resource, you might get an exception indicating that the web ACL is unavailable. After you add a rule group to a web ACL, the new rule group rules might be in effect in one area where the web ACL is used and not in another. After you change a rule action setting, you might see the old action in some places and the new action in others. After you add an IP address to an IP set that is in use in a blocking rule, the new address might be blocked in one area while still allowed in another.

UPDATE aws.wafv2.rule_groups
SET
Name = '{{ Name }}',
Scope = '{{ Scope }}',
Id = '{{ Id }}',
Description = '{{ Description }}',
Rules = '{{ Rules }}',
VisibilityConfig = '{{ VisibilityConfig }}',
LockToken = '{{ LockToken }}',
CustomResponseBodies = '{{ CustomResponseBodies }}',
MonetizationConfig = '{{ MonetizationConfig }}'
WHERE
region = '{{ region }}' --required
AND Name = '{{ Name }}' --required
AND Scope = '{{ Scope }}' --required
AND Id = '{{ Id }}' --required
AND VisibilityConfig = '{{ VisibilityConfig }}' --required
AND LockToken = '{{ LockToken }}' --required
RETURNING
next_lock_token;

DELETE examples

Deletes the specified RuleGroup.

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