AWS Fundamentals Logo
AWS Fundamentals
L1 ConstructAWS::WAFRegional::WebACL

CfnWebACL

> This is *AWS WAF Classic* documentation. For more information, see [AWS WAF Classic](https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html) in the developer guide. > > *For the latest version of AWS WAF* , use the AWS WAF V2 API and see the [AWS WAF Developer Guide](https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html) . With the latest version, AWS WAF has a single set of endpoints for regional and global use. Contains 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. 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. To identify the requests that you want AWS WAF to filter, you associate the `WebACL` with an API Gateway API or an Application Load Balancer.

Import

import { CfnWebACL } from 'aws-cdk-lib/aws-wafregional';

Or use the module namespace:

import * as wafregional from 'aws-cdk-lib/aws-wafregional';
// wafregional.CfnWebACL

Properties

Configuration passed to the constructor as CfnWebACLProps.

defaultActionRequired
IResolvable | ActionProperty

The action to perform if none of the `Rules` contained in the `WebACL` match. The action is specified by the `WafAction` object.

metricNameRequired
string

A name for the metrics for this `WebACL` . The name can contain only alphanumeric characters (A-Z, a-z, 0-9), with maximum length 128 and minimum length one. It can't contain whitespace or metric names reserved for AWS WAF, including "All" and "Default_Action." You can't change `MetricName` after you create the `WebACL` .

nameRequired
string

A friendly name or description of the `WebACL` . You can't change the name of a `WebACL` after you create it.

rulesOptional
IResolvable | IResolvable | RuleProperty[]

An array that contains the action for each `Rule` in a `WebACL` , the priority of the `Rule` , and the ID of the `Rule` .

CloudFormation Resource

This L1 construct maps directly to the following CloudFormation resource type.

Learn AWS the Practical Way

Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.

Subscribe to Newsletter

Quick Facts

LevelL1 (CloudFormation)
Moduleaws-wafregional
CFN TypeAWS::WAFRegional::WebACL
Properties4

External Links