amazonka-wafv2-2.0: Amazon WAFV2 SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.WAFV2.Types.CustomResponse

Description

 
Synopsis

Documentation

data CustomResponse Source #

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.

See: newCustomResponse smart constructor.

Constructors

CustomResponse' 

Fields

  • customResponseBodyKey :: Maybe Text

    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 action BlockAction setting, you reference the response body using this key.

  • responseHeaders :: Maybe (NonEmpty CustomHTTPHeader)

    The HTTP headers to use in the response. 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.

  • responseCode :: Natural

    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.

Instances

Instances details
FromJSON CustomResponse Source # 
Instance details

Defined in Amazonka.WAFV2.Types.CustomResponse

ToJSON CustomResponse Source # 
Instance details

Defined in Amazonka.WAFV2.Types.CustomResponse

Generic CustomResponse Source # 
Instance details

Defined in Amazonka.WAFV2.Types.CustomResponse

Associated Types

type Rep CustomResponse :: Type -> Type #

Read CustomResponse Source # 
Instance details

Defined in Amazonka.WAFV2.Types.CustomResponse

Show CustomResponse Source # 
Instance details

Defined in Amazonka.WAFV2.Types.CustomResponse

NFData CustomResponse Source # 
Instance details

Defined in Amazonka.WAFV2.Types.CustomResponse

Methods

rnf :: CustomResponse -> () #

Eq CustomResponse Source # 
Instance details

Defined in Amazonka.WAFV2.Types.CustomResponse

Hashable CustomResponse Source # 
Instance details

Defined in Amazonka.WAFV2.Types.CustomResponse

type Rep CustomResponse Source # 
Instance details

Defined in Amazonka.WAFV2.Types.CustomResponse

type Rep CustomResponse = D1 ('MetaData "CustomResponse" "Amazonka.WAFV2.Types.CustomResponse" "amazonka-wafv2-2.0-3v3WgpYn7RT5hSd6MsT5dN" 'False) (C1 ('MetaCons "CustomResponse'" 'PrefixI 'True) (S1 ('MetaSel ('Just "customResponseBodyKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "responseHeaders") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe (NonEmpty CustomHTTPHeader))) :*: S1 ('MetaSel ('Just "responseCode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Natural))))

newCustomResponse Source #

Create a value of CustomResponse with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:customResponseBodyKey:CustomResponse', customResponse_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 action BlockAction setting, you reference the response body using this key.

$sel:responseHeaders:CustomResponse', customResponse_responseHeaders - The HTTP headers to use in the response. 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.

$sel:responseCode:CustomResponse', customResponse_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.

customResponse_customResponseBodyKey :: Lens' CustomResponse (Maybe Text) Source #

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 action BlockAction setting, you reference the response body using this key.

customResponse_responseHeaders :: Lens' CustomResponse (Maybe (NonEmpty CustomHTTPHeader)) Source #

The HTTP headers to use in the response. 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.

customResponse_responseCode :: Lens' CustomResponse Natural Source #

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.