Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Oversize_Handling to AWS WAF v2 Web ACL #25589

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/25589.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/aws_wafv2_web_acl: Add `oversize_handling` attribute as part of `field_to_match` its `body` attribute.
```
19 changes: 16 additions & 3 deletions internal/service/wafv2/schemas.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,22 @@ func fieldToMatchBaseSchema() *schema.Resource {
return &schema.Resource{
Schema: map[string]*schema.Schema{
"all_query_arguments": emptySchema(),
"body": emptySchema(),
"method": emptySchema(),
"query_string": emptySchema(),
"body": {
Type: schema.TypeList,
Optional: true,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"oversize_handling": {
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.StringInSlice(wafv2.OversizeHandling_Values(), false),
},
},
},
},
"method": emptySchema(),
"query_string": emptySchema(),
"single_header": {
Type: schema.TypeList,
Optional: true,
Expand Down
11 changes: 10 additions & 1 deletion website/docs/r/wafv2_web_acl.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ The `field_to_match` block supports the following arguments:
An empty configuration block `{}` should be used when specifying `all_query_arguments`, `body`, `method`, or `query_string` attributes.

* `all_query_arguments` - (Optional) Inspect all query arguments.
* `body` - (Optional) Inspect the request body, which immediately follows the request headers.
* `body` - (Optional) Inspect the request body, which immediately follows the request headers. See [Body](#body) below for details.
* `method` - (Optional) Inspect the HTTP method. The method indicates the type of operation that the request is asking the origin to perform.
* `query_string` - (Optional) Inspect the query string. This is the part of a URL that appears after a `?` character, if any.
* `single_header` - (Optional) Inspect a single header. See [Single Header](#single-header) below for details.
Expand Down Expand Up @@ -570,6 +570,15 @@ The `ip_set_forwarded_ip_config` block supports the following arguments:
* `header_name` - (Required) - Name of the HTTP header to use for the IP address.
* `position` - (Required) - Position in the header to search for the IP address. Valid values include: `FIRST`, `LAST`, or `ANY`. If `ANY` is specified and the header contains more than 10 IP addresses, AWS WAFv2 inspects the last 10.


### Body

Inspect the body of the web request. The body immediately follows the request headers.

The `body` block supports the following arguments:

* `oversize_handling` - (Required) Oversize handling tells AWS WAF what to do with a web request when the request component that the rule inspects is over the limits. Valid values include the following: `CONTINUE`, `MATCH`, `NO_MATCH`. See the AWS [documentation](https://docs.aws.amazon.com/waf/latest/developerguide/waf-rule-statement-oversize-handling.html) for more information.

### Single Header

Inspect a single header. Provide the name of the header to inspect, for example, `User-Agent` or `Referer` (provided as lowercase strings).
Expand Down