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.
Idawscc.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.
data_protection_configobjectCollection of dataProtects.
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
on_source_ddo_sprotection_configobjectConfigures the options for on-source DDoS protection provided by supported resource type.
regionstringAWS region.

For more information, see AWS::WAFv2::WebACL.

Methods

NameResourceAccessible byRequired Params
create_resourceweb_aclsINSERTDefaultAction, Scope, VisibilityConfig, region
delete_resourceweb_aclsDELETEIdentifier, region
update_resourceweb_aclsUPDATEIdentifier, PatchDocument, region
list_resourcesweb_acls_list_onlySELECTregion
get_resourceweb_aclsSELECTIdentifier, region

SELECT examples

Gets all properties from an individual web_acl.

SELECT
region,
arn,
capacity,
default_action,
description,
name,
id,
scope,
rules,
visibility_config,
data_protection_config,
tags,
label_namespace,
custom_response_bodies,
captcha_config,
challenge_config,
token_domains,
association_config,
on_source_ddo_sprotection_config
FROM awscc.wafv2.web_acls
WHERE
region = 'us-east-1' AND
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 awscc.wafv2.web_acls (
DefaultAction,
Scope,
VisibilityConfig,
region
)
SELECT
'{{ default_action }}',
'{{ scope }}',
'{{ visibility_config }}',
'{{ region }}';

UPDATE example

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

/*+ update */
UPDATE awscc.wafv2.web_acls
SET PatchDocument = string('{{ {
"DefaultAction": default_action,
"Description": description,
"Rules": rules,
"VisibilityConfig": visibility_config,
"DataProtectionConfig": data_protection_config,
"Tags": tags,
"CustomResponseBodies": custom_response_bodies,
"CaptchaConfig": captcha_config,
"ChallengeConfig": challenge_config,
"TokenDomains": token_domains,
"AssociationConfig": association_config,
"OnSourceDDoSProtectionConfig": on_source_ddo_sprotection_config
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ name }}|{{ id }}|{{ scope }}';

DELETE example

/*+ delete */
DELETE FROM awscc.wafv2.web_acls
WHERE
Identifier = '{{ name }}|{{ id }}|{{ scope }}' AND
region = 'us-east-1';

Permissions

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

wafv2:CreateWebACL,
wafv2:GetWebACL,
wafv2:ListTagsForResource,
wafv2:TagResource,
wafv2:UntagResource