Class CfnRuleGroup.CustomResponseProperty.Builder
java.lang.Object
software.amazon.awscdk.services.wafv2.CfnRuleGroup.CustomResponseProperty.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnRuleGroup.CustomResponseProperty>
- Enclosing interface:
CfnRuleGroup.CustomResponseProperty
@Stability(Stable)
public static final class CfnRuleGroup.CustomResponseProperty.Builder
extends Object
implements software.amazon.jsii.Builder<CfnRuleGroup.CustomResponseProperty>
A builder for
CfnRuleGroup.CustomResponseProperty
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.customResponseBodyKey
(String customResponseBodyKey) Sets the value ofCfnRuleGroup.CustomResponseProperty.getCustomResponseBodyKey()
responseCode
(Number responseCode) Sets the value ofCfnRuleGroup.CustomResponseProperty.getResponseCode()
responseHeaders
(List<? extends Object> responseHeaders) Sets the value ofCfnRuleGroup.CustomResponseProperty.getResponseHeaders()
responseHeaders
(IResolvable responseHeaders) Sets the value ofCfnRuleGroup.CustomResponseProperty.getResponseHeaders()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
responseCode
@Stability(Stable) public CfnRuleGroup.CustomResponseProperty.Builder responseCode(Number responseCode) Sets the value ofCfnRuleGroup.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 CfnRuleGroup.CustomResponseProperty.Builder customResponseBodyKey(String customResponseBodyKey) Sets the value ofCfnRuleGroup.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 CfnRuleGroup.CustomResponseProperty.Builder responseHeaders(IResolvable responseHeaders) Sets the value ofCfnRuleGroup.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 CfnRuleGroup.CustomResponseProperty.Builder responseHeaders(List<? extends Object> responseHeaders) Sets the value ofCfnRuleGroup.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<CfnRuleGroup.CustomResponseProperty>
- Returns:
- a new instance of
CfnRuleGroup.CustomResponseProperty
- Throws:
NullPointerException
- if any required attribute was not provided
-