Class CfnWebACL
- All Implemented Interfaces:
IConstruct
,IDependable
,IInspectable
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
AWS::WAF::WebACL
.
This is AWS WAF Classic documentation. For more information, see AWS WAF Classic in the developer guide.
For the latest version of AWS WAF , use the AWS WAF V2 API and see the AWS WAF Developer Guide . 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. You also associate the WebACL
with a Amazon 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.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import software.amazon.awscdk.services.waf.*; CfnWebACL cfnWebACL = CfnWebACL.Builder.create(this, "MyCfnWebACL") .defaultAction(WafActionProperty.builder() .type("type") .build()) .metricName("metricName") .name("name") // the properties below are optional .rules(List.of(ActivatedRuleProperty.builder() .priority(123) .ruleId("ruleId") // the properties below are optional .action(WafActionProperty.builder() .type("type") .build()) .build())) .build();
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
TheActivatedRule
object in anUpdateWebACL
request specifies aRule
that you want to insert or delete, the priority of theRule
in theWebACL
, and the action that you want AWS WAF to take when a web request matches theRule
(ALLOW
,BLOCK
, orCOUNT
).static final class
A fluent builder forCfnWebACL
.static interface
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The CloudFormation resource type name for this resource class. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionThe action to perform if none of theRules
contained in theWebACL
match.The name of the metrics for thisWebACL
.getName()
A friendly name or description of theWebACL
.getRules()
An array that contains the action for eachRule
in aWebACL
, the priority of theRule
, and the ID of theRule
.void
inspect
(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties
(Map<String, Object> props) void
setDefaultAction
(IResolvable value) The action to perform if none of theRules
contained in theWebACL
match.void
The action to perform if none of theRules
contained in theWebACL
match.void
setMetricName
(String value) The name of the metrics for thisWebACL
.void
A friendly name or description of theWebACL
.void
An array that contains the action for eachRule
in aWebACL
, the priority of theRule
, and the ID of theRule
.void
setRules
(IResolvable value) An array that contains the action for eachRule
in aWebACL
, the priority of theRule
, and the ID of theRule
.Methods inherited from class software.amazon.awscdk.core.CfnResource
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validateProperties
Methods inherited from class software.amazon.awscdk.core.CfnRefElement
getRef
Methods inherited from class software.amazon.awscdk.core.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
Methods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnWebACL
protected CfnWebACL(software.amazon.jsii.JsiiObjectRef objRef) -
CfnWebACL
protected CfnWebACL(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnWebACL
@Stability(Stable) public CfnWebACL(@NotNull Construct scope, @NotNull String id, @NotNull CfnWebACLProps props) Create a newAWS::WAF::WebACL
.- Parameters:
scope
-- scope in which this resource is defined.
id
-- scoped id of the resource.
props
-- resource properties.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspect
in interfaceIInspectable
- Parameters:
inspector
-- tree inspector to collect and process attributes.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderProperties
in classCfnResource
- Parameters:
props
- This parameter is required.
-
getCfnProperties
- Overrides:
getCfnProperties
in classCfnResource
-
getDefaultAction
The action to perform if none of theRules
contained in theWebACL
match.The action is specified by the
WafAction
object. -
setDefaultAction
The action to perform if none of theRules
contained in theWebACL
match.The action is specified by the
WafAction
object. -
setDefaultAction
The action to perform if none of theRules
contained in theWebACL
match.The action is specified by the
WafAction
object. -
getMetricName
The name of the metrics for thisWebACL
.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 theWebACL
. -
setMetricName
The name of the metrics for thisWebACL
.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 theWebACL
. -
getName
A friendly name or description of theWebACL
.You can't change the name of a
WebACL
after you create it. -
setName
A friendly name or description of theWebACL
.You can't change the name of a
WebACL
after you create it. -
getRules
An array that contains the action for eachRule
in aWebACL
, the priority of theRule
, and the ID of theRule
. -
setRules
An array that contains the action for eachRule
in aWebACL
, the priority of theRule
, and the ID of theRule
. -
setRules
An array that contains the action for eachRule
in aWebACL
, the priority of theRule
, and the ID of theRule
.
-