Class CfnWebACL.CustomResponseProperty.Builder
java.lang.Object
software.amazon.awscdk.services.wafv2.CfnWebACL.CustomResponseProperty.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnWebACL.CustomResponseProperty>
- Enclosing interface:
CfnWebACL.CustomResponseProperty
@Stability(Stable)
public static final class CfnWebACL.CustomResponseProperty.Builder
extends Object
implements software.amazon.jsii.Builder<CfnWebACL.CustomResponseProperty>
A builder for
CfnWebACL.CustomResponseProperty
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.customResponseBodyKey
(String customResponseBodyKey) Sets the value ofCfnWebACL.CustomResponseProperty.getCustomResponseBodyKey()
responseCode
(Number responseCode) Sets the value ofCfnWebACL.CustomResponseProperty.getResponseCode()
responseHeaders
(List<? extends Object> responseHeaders) Sets the value ofCfnWebACL.CustomResponseProperty.getResponseHeaders()
responseHeaders
(IResolvable responseHeaders) Sets the value ofCfnWebACL.CustomResponseProperty.getResponseHeaders()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
responseCode
@Stability(Stable) public CfnWebACL.CustomResponseProperty.Builder responseCode(Number responseCode) Sets the value ofCfnWebACL.CustomResponseProperty.getResponseCode()
- Parameters:
responseCode
- The HTTP status code to return to the client. This parameter is required. For a list of status codes that you can use in your custom responses, see Supported status codes for custom response in the AWS WAF Developer Guide .- Returns:
this
-
customResponseBodyKey
@Stability(Stable) public CfnWebACL.CustomResponseProperty.Builder customResponseBodyKey(String customResponseBodyKey) Sets the value ofCfnWebACL.CustomResponseProperty.getCustomResponseBodyKey()
- Parameters:
customResponseBodyKey
- References the response body that you want AWS WAF to return to the web request client. You can define a custom response for a rule action or a default web ACL action that is set to block. To do this, you first define the response body key and value in theCustomResponseBodies
setting for theWebACL
orRuleGroup
where you want to use it. Then, in the rule action or web ACL default actionBlockAction
setting, you reference the response body using this key.- Returns:
this
-
responseHeaders
@Stability(Stable) public CfnWebACL.CustomResponseProperty.Builder responseHeaders(IResolvable responseHeaders) Sets the value ofCfnWebACL.CustomResponseProperty.getResponseHeaders()
- Parameters:
responseHeaders
- The HTTP headers to use in the response. You can specify any header name except forcontent-type
. Duplicate header names are not allowed.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 .
- Returns:
this
-
responseHeaders
@Stability(Stable) public CfnWebACL.CustomResponseProperty.Builder responseHeaders(List<? extends Object> responseHeaders) Sets the value ofCfnWebACL.CustomResponseProperty.getResponseHeaders()
- Parameters:
responseHeaders
- The HTTP headers to use in the response. You can specify any header name except forcontent-type
. Duplicate header names are not allowed.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 .
- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<CfnWebACL.CustomResponseProperty>
- Returns:
- a new instance of
CfnWebACL.CustomResponseProperty
- Throws:
NullPointerException
- if any required attribute was not provided
-