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 = '{{ region }}' 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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.wafv2.web_acls
WHERE
Identifier = '{{ name }}|{{ id }}|{{ scope }}' 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 web_acls resource, the following permissions are required:

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