Skip to main content

web_acls

Creates, updates, deletes or gets a web_acl resource or lists web_acls in a region

Overview

Nameweb_acls
TypeResource
DescriptionContains the Rules that identify the requests that you want to allow, block, or count. In a WebACL, you also specify a default action (ALLOW or BLOCK), and the action for each Rule that you add to a WebACL, for example, block requests from specified IP addresses or block requests from specified referrers. You also associate the WebACL with a CloudFront distribution to identify the requests that you want AWS WAF to filter. If you add more than one Rule to a WebACL, a request needs to match only one of the specifications to be allowed, blocked, or counted.
Idaws.wafv2.web_acls

Fields

NameDatatypeDescription
arnstring
capacityinteger
default_actionobjectDefault Action WebACL will take against ingress traffic when there is no matching Rule.
descriptionstringDescription of the entity.
namestringName of the WebACL.
idstringId of the WebACL
scopestringUse CLOUDFRONT for CloudFront WebACL, use REGIONAL for Application Load Balancer and API Gateway.
rulesarrayCollection of Rules.
visibility_configobjectVisibility Metric of the WebACL.
tagsarray
label_namespacestringName of the Label.
custom_response_bodiesobjectCustom response key and body map.
captcha_configobject
challenge_configobject
token_domainsarrayList of domains to accept in web request tokens, in addition to the domain of the protected resource.
association_configobjectAssociationConfig for body inspection
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTDefaultAction, Scope, VisibilityConfig, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all web_acls in a region.

SELECT
region,
arn,
capacity,
default_action,
description,
name,
id,
scope,
rules,
visibility_config,
tags,
label_namespace,
custom_response_bodies,
captcha_config,
challenge_config,
token_domains,
association_config
FROM aws.wafv2.web_acls
;

Gets all properties from an individual web_acl.

SELECT
region,
arn,
capacity,
default_action,
description,
name,
id,
scope,
rules,
visibility_config,
tags,
label_namespace,
custom_response_bodies,
captcha_config,
challenge_config,
token_domains,
association_config
FROM aws.wafv2.web_acls
WHERE data__Identifier = '<Name>|<Id>|<Scope>';

INSERT example

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

/*+ create */
INSERT INTO aws.wafv2.web_acls (
DefaultAction,
Scope,
VisibilityConfig,
region
)
SELECT
'{{ DefaultAction }}',
'{{ Scope }}',
'{{ VisibilityConfig }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.wafv2.web_acls
WHERE data__Identifier = '<Name|Id|Scope>'
AND region = 'us-east-1';

Permissions

To operate on the web_acls resource, the following permissions are required:

Create

wafv2:CreateWebACL,
wafv2:GetWebACL,
wafv2:ListTagsForResource

Delete

wafv2:DeleteWebACL,
wafv2:GetWebACL

Read

wafv2:GetWebACL,
wafv2:ListTagsForResource

Update

wafv2:UpdateWebACL,
wafv2:GetWebACL,
wafv2:ListTagsForResource

List

wafv2:listWebACLs