/AWS1/CL_WA2CUSTOMRESPONSE¶
A custom response to send to the client. You can define a custom response for rule actions and default web ACL actions that are set to BlockAction.
For information about customizing web requests and responses, see Customizing web requests and responses in WAF in the WAF Developer Guide.
CONSTRUCTOR
¶
IMPORTING¶
Required arguments:¶
iv_responsecode
TYPE /AWS1/WA2RESPONSESTATUSCODE
/AWS1/WA2RESPONSESTATUSCODE
¶
The HTTP status code to return to the client.
For a list of status codes that you can use in your custom responses, see Supported status codes for custom response in the WAF Developer Guide.
Optional arguments:¶
iv_customresponsebodykey
TYPE /AWS1/WA2ENTITYNAME
/AWS1/WA2ENTITYNAME
¶
References the response body that you want 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 the
CustomResponseBodies
setting for the WebACL or RuleGroup 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.
it_responseheaders
TYPE /AWS1/CL_WA2CUSTOMHTTPHEADER=>TT_CUSTOMHTTPHEADERS
TT_CUSTOMHTTPHEADERS
¶
The HTTP headers to use in the response. You can specify any header name except for
content-type
. Duplicate header names are not allowed.For information about the limits on count and size for custom request and response settings, see WAF quotas in the WAF Developer Guide.
Queryable Attributes¶
ResponseCode¶
The HTTP status code to return to the client.
For a list of status codes that you can use in your custom responses, see Supported status codes for custom response in the WAF Developer Guide.
Accessible with the following methods¶
Method | Description |
---|---|
GET_RESPONSECODE() |
Getter for RESPONSECODE, with configurable default |
ASK_RESPONSECODE() |
Getter for RESPONSECODE w/ exceptions if field has no value |
HAS_RESPONSECODE() |
Determine if RESPONSECODE has a value |
CustomResponseBodyKey¶
References the response body that you want 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 the
CustomResponseBodies
setting for the WebACL or RuleGroup 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.
Accessible with the following methods¶
Method | Description |
---|---|
GET_CUSTOMRESPONSEBODYKEY() |
Getter for CUSTOMRESPONSEBODYKEY, with configurable default |
ASK_CUSTOMRESPONSEBODYKEY() |
Getter for CUSTOMRESPONSEBODYKEY w/ exceptions if field has |
HAS_CUSTOMRESPONSEBODYKEY() |
Determine if CUSTOMRESPONSEBODYKEY has a value |
ResponseHeaders¶
The HTTP headers to use in the response. You can specify any header name except for
content-type
. Duplicate header names are not allowed.For information about the limits on count and size for custom request and response settings, see WAF quotas in the WAF Developer Guide.
Accessible with the following methods¶
Method | Description |
---|---|
GET_RESPONSEHEADERS() |
Getter for RESPONSEHEADERS, with configurable default |
ASK_RESPONSEHEADERS() |
Getter for RESPONSEHEADERS w/ exceptions if field has no val |
HAS_RESPONSEHEADERS() |
Determine if RESPONSEHEADERS has a value |