Class CfnWebACL.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnWebACL>
- Enclosing class:
- CfnWebACL
CfnWebACL
.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
captchaConfig
(IResolvable captchaConfig) Specifies how AWS WAF should handleCAPTCHA
evaluations for rules that don't have their ownCaptchaConfig
settings.captchaConfig
(CfnWebACL.CaptchaConfigProperty captchaConfig) Specifies how AWS WAF should handleCAPTCHA
evaluations for rules that don't have their ownCaptchaConfig
settings.challengeConfig
(IResolvable challengeConfig) Specifies how AWS WAF should handle challenge evaluations for rules that don't have their ownChallengeConfig
settings.challengeConfig
(CfnWebACL.ChallengeConfigProperty challengeConfig) Specifies how AWS WAF should handle challenge evaluations for rules that don't have their ownChallengeConfig
settings.static CfnWebACL.Builder
customResponseBodies
(Map<String, ? extends Object> customResponseBodies) A map of custom response keys and content bodies.customResponseBodies
(IResolvable customResponseBodies) A map of custom response keys and content bodies.defaultAction
(IResolvable defaultAction) The action to perform if none of theRules
contained in theWebACL
match.defaultAction
(CfnWebACL.DefaultActionProperty defaultAction) The action to perform if none of theRules
contained in theWebACL
match.description
(String description) A description of the web ACL that helps with identification.The name of the web ACL.The rule statements used to identify the web requests that you want to allow, block, or count.rules
(IResolvable rules) The rule statements used to identify the web requests that you want to allow, block, or count.Specifies whether this is for an Amazon CloudFront distribution or for a regional application.Key:value pairs associated with an AWS resource.tokenDomains
(List<String> tokenDomains) Specifies the domains that AWS WAF should accept in a web request token.visibilityConfig
(IResolvable visibilityConfig) Defines and enables Amazon CloudWatch metrics and web request sample collection.visibilityConfig
(CfnWebACL.VisibilityConfigProperty visibilityConfig) Defines and enables Amazon CloudWatch metrics and web request sample collection.
-
Method Details
-
create
- Parameters:
scope
-- scope in which this resource is defined.
id
-- scoped id of the resource.
- Returns:
- a new instance of
CfnWebACL.Builder
.
-
defaultAction
The action to perform if none of theRules
contained in theWebACL
match.- Parameters:
defaultAction
- The action to perform if none of theRules
contained in theWebACL
match. This parameter is required.- Returns:
this
-
defaultAction
@Stability(Stable) public CfnWebACL.Builder defaultAction(CfnWebACL.DefaultActionProperty defaultAction) The action to perform if none of theRules
contained in theWebACL
match.- Parameters:
defaultAction
- The action to perform if none of theRules
contained in theWebACL
match. This parameter is required.- Returns:
this
-
scope
Specifies whether this is for an Amazon CloudFront distribution or for a regional application.A regional application can be an Application Load Balancer (ALB), an Amazon API Gateway REST API, an AWS AppSync GraphQL API, an Amazon Cognito user pool, or an AWS App Runner service. Valid Values are
CLOUDFRONT
andREGIONAL
.For
CLOUDFRONT
, you must create your WAFv2 resources in the US East (N. Virginia) Region,us-east-1
.For information about how to define the association of the web ACL with your resource, see
WebACLAssociation
.- Parameters:
scope
- Specifies whether this is for an Amazon CloudFront distribution or for a regional application. This parameter is required.- Returns:
this
-
visibilityConfig
Defines and enables Amazon CloudWatch metrics and web request sample collection.- Parameters:
visibilityConfig
- Defines and enables Amazon CloudWatch metrics and web request sample collection. This parameter is required.- Returns:
this
-
visibilityConfig
@Stability(Stable) public CfnWebACL.Builder visibilityConfig(CfnWebACL.VisibilityConfigProperty visibilityConfig) Defines and enables Amazon CloudWatch metrics and web request sample collection.- Parameters:
visibilityConfig
- Defines and enables Amazon CloudWatch metrics and web request sample collection. This parameter is required.- Returns:
this
-
captchaConfig
Specifies how AWS WAF should handleCAPTCHA
evaluations for rules that don't have their ownCaptchaConfig
settings.If you don't specify this, AWS WAF uses its default settings for
CaptchaConfig
.- Parameters:
captchaConfig
- Specifies how AWS WAF should handleCAPTCHA
evaluations for rules that don't have their ownCaptchaConfig
settings. This parameter is required.- Returns:
this
-
captchaConfig
@Stability(Stable) public CfnWebACL.Builder captchaConfig(CfnWebACL.CaptchaConfigProperty captchaConfig) Specifies how AWS WAF should handleCAPTCHA
evaluations for rules that don't have their ownCaptchaConfig
settings.If you don't specify this, AWS WAF uses its default settings for
CaptchaConfig
.- Parameters:
captchaConfig
- Specifies how AWS WAF should handleCAPTCHA
evaluations for rules that don't have their ownCaptchaConfig
settings. This parameter is required.- Returns:
this
-
challengeConfig
Specifies how AWS WAF should handle challenge evaluations for rules that don't have their ownChallengeConfig
settings.If you don't specify this, AWS WAF uses its default settings for
ChallengeConfig
.- Parameters:
challengeConfig
- Specifies how AWS WAF should handle challenge evaluations for rules that don't have their ownChallengeConfig
settings. This parameter is required.- Returns:
this
-
challengeConfig
@Stability(Stable) public CfnWebACL.Builder challengeConfig(CfnWebACL.ChallengeConfigProperty challengeConfig) Specifies how AWS WAF should handle challenge evaluations for rules that don't have their ownChallengeConfig
settings.If you don't specify this, AWS WAF uses its default settings for
ChallengeConfig
.- Parameters:
challengeConfig
- Specifies how AWS WAF should handle challenge evaluations for rules that don't have their ownChallengeConfig
settings. This parameter is required.- Returns:
this
-
customResponseBodies
A map of custom response keys and content bodies.When you create a rule with a block action, you can send a custom response to the web request. You define these for the web ACL, and then use them in the rules and default actions that you define in the web ACL.
For information about customizing web requests and responses, see Customizing web requests and responses in AWS WAF in the AWS WAF Developer Guide .
For information about the limits on count and size for custom request and response settings, see AWS WAF quotas in the AWS WAF Developer Guide .
- Parameters:
customResponseBodies
- A map of custom response keys and content bodies. This parameter is required.- Returns:
this
-
customResponseBodies
@Stability(Stable) public CfnWebACL.Builder customResponseBodies(Map<String, ? extends Object> customResponseBodies) A map of custom response keys and content bodies.When you create a rule with a block action, you can send a custom response to the web request. You define these for the web ACL, and then use them in the rules and default actions that you define in the web ACL.
For information about customizing web requests and responses, see Customizing web requests and responses in AWS WAF in the AWS WAF Developer Guide .
For information about the limits on count and size for custom request and response settings, see AWS WAF quotas in the AWS WAF Developer Guide .
- Parameters:
customResponseBodies
- A map of custom response keys and content bodies. This parameter is required.- Returns:
this
-
description
A description of the web ACL that helps with identification.- Parameters:
description
- A description of the web ACL that helps with identification. This parameter is required.- Returns:
this
-
name
The name of the web ACL.You cannot change the name of a web ACL after you create it.
- Parameters:
name
- The name of the web ACL. This parameter is required.- Returns:
this
-
rules
The rule statements used to identify the web requests that you want to allow, block, or count.Each rule includes one top-level statement that AWS WAF uses to identify matching web requests, and parameters that govern how AWS WAF handles them.
- Parameters:
rules
- The rule statements used to identify the web requests that you want to allow, block, or count. This parameter is required.- Returns:
this
-
rules
The rule statements used to identify the web requests that you want to allow, block, or count.Each rule includes one top-level statement that AWS WAF uses to identify matching web requests, and parameters that govern how AWS WAF handles them.
- Parameters:
rules
- The rule statements used to identify the web requests that you want to allow, block, or count. This parameter is required.- Returns:
this
-
tags
Key:value pairs associated with an AWS resource.The key:value pair can be anything you define. Typically, the tag key represents a category (such as "environment") and the tag value represents a specific value within that category (such as "test," "development," or "production"). You can add up to 50 tags to each AWS resource.
To modify tags on existing resources, use the AWS WAF APIs or command line interface. With AWS CloudFormation , you can only add tags to AWS WAF resources during resource creation.
- Parameters:
tags
- Key:value pairs associated with an AWS resource. This parameter is required.- Returns:
this
-
tokenDomains
Specifies the domains that AWS WAF should accept in a web request token.This enables the use of tokens across multiple protected websites. When AWS WAF provides a token, it uses the domain of the AWS resource that the web ACL is protecting. If you don't specify a list of token domains, AWS WAF accepts tokens only for the domain of the protected resource. With a token domain list, AWS WAF accepts the resource's host domain plus all domains in the token domain list, including their prefixed subdomains.
- Parameters:
tokenDomains
- Specifies the domains that AWS WAF should accept in a web request token. This parameter is required.- Returns:
this
-
build
-