Skip to content

Commit

Permalink
Added custom_request_handling and custom_response sections to the…
Browse files Browse the repository at this point in the history
… docs for `wafv2_web_acl` and `wafv2_rule_group` resources.
  • Loading branch information
andyalm committed May 24, 2021
1 parent 7542f4b commit 17f52dd
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 10 deletions.
46 changes: 42 additions & 4 deletions website/docs/r/wafv2_rule_group.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -307,11 +307,49 @@ Each `rule` supports the following arguments:

The `action` block supports the following arguments:

~> **NOTE:** One of `allow`, `block`, or `count`, expressed as an empty configuration block `{}`, is required when specifying an `action`
~> **NOTE:** One of `allow`, `block`, or `count`, is required when specifying an `action`.

* `allow` - (Optional) Instructs AWS WAF to allow the web request.
* `block` - (Optional) Instructs AWS WAF to block the web request.
* `count` - (Optional) Instructs AWS WAF to count the web request and allow it.
* `allow` - (Optional) Instructs AWS WAF to allow the web request. See [Allow](#action) below for details.
* `block` - (Optional) Instructs AWS WAF to block the web request. See [Block](#block) below for details.
* `count` - (Optional) Instructs AWS WAF to count the web request and allow it. See [Count](#count) below for details.

### Allow

The `allow` block supports the following arguments:

* `custom_request_handling` - (Optional) Defines custom handling for the web request. See [Custom Request Handling](#custom-request-handling) below for details.

### Block

The `block` block supports the following arguments:

* `custom_response` - (Optional) Defines a custom response for the web request. See [Custom Response](#custom-response) below for details.

### Count

The `count` block supports the following arguments:

* `custom_request_handling` - (Optional) Defines custom handling for the web request. See [Custom Request Handling](#custom-request-handling) below for details.

### Custom Request Handling

The `custom_request_handling` block supports the following arguments:

* `insert_header` - (Required) The `insert_header` blocks used to define HTTP headers added to the request. See [Custom HTTP Header](#custom-http-header) below for details.

### Custom Response

The `custom_response` block supports the following arguments:

* `response_code` - (Optional) The HTTP status code to return to the client.
* `response_header` - (Optional) The `response_header` blocks used to define the HTTP response headers added to the response. See [Custom HTTP Header](#custom-http-header) below for details.

### Custom HTTP Header

Each block supports the following arguments. Duplicate header names are not allowed:

* `name` - The name of the custom header. For custom request header insertion, when AWS WAF inserts the header into the request, it prefixes this name `x-amzn-waf-`, to avoid confusion with the headers that are already in the request. For example, for the header name `sample`, AWS WAF inserts the header `x-amzn-waf-sample`.
* `value` - The value of the custom header.

### Statement

Expand Down
50 changes: 44 additions & 6 deletions website/docs/r/wafv2_web_acl.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,8 @@ The `default_action` block supports the following arguments:

~> **NOTE:** One of `allow` or `block`, expressed as an empty configuration block `{}`, is required when specifying a `default_action`

* `allow` - (Optional) Specifies that AWS WAF should allow requests by default.
* `block` - (Optional) Specifies that AWS WAF should block requests by default.
* `allow` - (Optional) Specifies that AWS WAF should allow requests by default. See [Allow](#action) below for details.
* `block` - (Optional) Specifies that AWS WAF should block requests by default. See [Block](#block) below for details.

### Rules

Expand All @@ -289,11 +289,11 @@ Each `rule` supports the following arguments:

The `action` block supports the following arguments:

~> **NOTE:** One of `allow`, `block`, or `count`, expressed as an empty configuration block `{}`, is required when specifying an `action`
~> **NOTE:** One of `allow`, `block`, or `count`, is required when specifying an `action`.

* `allow` - (Optional) Instructs AWS WAF to allow the web request. Configure as an empty block `{}`.
* `block` - (Optional) Instructs AWS WAF to block the web request. Configure as an empty block `{}`.
* `count` - (Optional) Instructs AWS WAF to count the web request and allow it. Configure as an empty block `{}`.
* `allow` - (Optional) Instructs AWS WAF to allow the web request. See [Allow](#action) below for details.
* `block` - (Optional) Instructs AWS WAF to block the web request. See [Block](#block) below for details.
* `count` - (Optional) Instructs AWS WAF to count the web request and allow it. See [Count](#count) below for details.

### Override Action

Expand All @@ -304,6 +304,44 @@ The `override_action` block supports the following arguments:
* `count` - (Optional) Override the rule action setting to count (i.e. only count matches). Configured as an empty block `{}`.
* `none` - (Optional) Don't override the rule action setting. Configured as an empty block `{}`.

### Allow

The `allow` block supports the following arguments:

* `custom_request_handling` - (Optional) Defines custom handling for the web request. See [Custom Request Handling](#custom-request-handling) below for details.

### Block

The `block` block supports the following arguments:

* `custom_response` - (Optional) Defines a custom response for the web request. See [Custom Response](#custom-response) below for details.

### Count

The `count` block supports the following arguments:

* `custom_request_handling` - (Optional) Defines custom handling for the web request. See [Custom Request Handling](#custom-request-handling) below for details.

### Custom Request Handling

The `custom_request_handling` block supports the following arguments:

* `insert_header` - (Required) The `insert_header` blocks used to define HTTP headers added to the request. See [Custom HTTP Header](#custom-http-header) below for details.

### Custom Response

The `custom_response` block supports the following arguments:

* `response_code` - (Optional) The HTTP status code to return to the client.
* `response_header` - (Optional) The `response_header` blocks used to define the HTTP response headers added to the response. See [Custom HTTP Header](#custom-http-header) below for details.

### Custom HTTP Header

Each block supports the following arguments. Duplicate header names are not allowed:

* `name` - The name of the custom header. For custom request header insertion, when AWS WAF inserts the header into the request, it prefixes this name `x-amzn-waf-`, to avoid confusion with the headers that are already in the request. For example, for the header name `sample`, AWS WAF inserts the header `x-amzn-waf-sample`.
* `value` - The value of the custom header.

### Statement

The processing guidance for a Rule, used by AWS WAF to determine whether a web request matches the rule. See the [documentation](https://docs.aws.amazon.com/waf/latest/developerguide/waf-rule-statements-list.html) for more information.
Expand Down

0 comments on commit 17f52dd

Please sign in to comment.