Class: Aws::WAFV2::Types::CustomResponse

Inherits:
Struct
  • Object
show all
Defined in:
gems/aws-sdk-wafv2/lib/aws-sdk-wafv2/types.rb

Overview

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.

Constant Summary collapse

SENSITIVE =
[]

Instance Attribute Summary collapse

Instance Attribute Details

#custom_response_body_keyString

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.

Returns:

  • (String)


1656
1657
1658
1659
1660
1661
1662
# File 'gems/aws-sdk-wafv2/lib/aws-sdk-wafv2/types.rb', line 1656

class CustomResponse < Struct.new(
  :response_code,
  :custom_response_body_key,
  :response_headers)
  SENSITIVE = []
  include Aws::Structure
end

#response_codeInteger

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.

Returns:

  • (Integer)


1656
1657
1658
1659
1660
1661
1662
# File 'gems/aws-sdk-wafv2/lib/aws-sdk-wafv2/types.rb', line 1656

class CustomResponse < Struct.new(
  :response_code,
  :custom_response_body_key,
  :response_headers)
  SENSITIVE = []
  include Aws::Structure
end

#response_headersArray<Types::CustomHTTPHeader>

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.

Returns:



1656
1657
1658
1659
1660
1661
1662
# File 'gems/aws-sdk-wafv2/lib/aws-sdk-wafv2/types.rb', line 1656

class CustomResponse < Struct.new(
  :response_code,
  :custom_response_body_key,
  :response_headers)
  SENSITIVE = []
  include Aws::Structure
end