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

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

Overview

Note:

When making an API call, you may pass CustomResponse data as a hash:

{
  response_code: 1, # required
  custom_response_body_key: "EntityName",
  response_headers: [
    {
      name: "CustomHTTPHeaderName", # required
      value: "CustomHTTPHeaderValue", # required
    },
  ],
}

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 AWS WAF in the AWS 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 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 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)


2308
2309
2310
2311
2312
2313
2314
# File 'gems/aws-sdk-wafv2/lib/aws-sdk-wafv2/types.rb', line 2308

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 reqponses, see Supported status codes for custom response in the AWS WAF Developer Guide.

Returns:

  • (Integer)


2308
2309
2310
2311
2312
2313
2314
# File 'gems/aws-sdk-wafv2/lib/aws-sdk-wafv2/types.rb', line 2308

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. 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:



2308
2309
2310
2311
2312
2313
2314
# File 'gems/aws-sdk-wafv2/lib/aws-sdk-wafv2/types.rb', line 2308

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