Skip to content

Commit 54d956c

Browse files
committed
feat: Support 'association_config' argument
1 parent 2e18fff commit 54d956c

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

main.tf

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,44 @@ resource "aws_wafv2_web_acl" "this" {
1515
}
1616
}
1717

18+
dynamic "association_config" {
19+
for_each = var.association_config == null ? [] : [var.association_config]
20+
content {
21+
dynamic "request_body" {
22+
for_each = lookup(association_config.value, "request_body", null) == null ? [] : [lookup(association_config.value, "request_body")]
23+
content {
24+
dynamic "api_gateway" {
25+
for_each = lookup(request_body.value, "api_gateway", null) == null ? [] : [1]
26+
content {
27+
default_size_inspection_limit = request_body.value.api_gateway.default_size_inspection_limit
28+
}
29+
}
30+
31+
dynamic "app_runner_service" {
32+
for_each = lookup(request_body.value, "app_runner_service", null) == null ? [] : [1]
33+
content {
34+
default_size_inspection_limit = request_body.value.app_runner_service.default_size_inspection_limit
35+
}
36+
}
37+
38+
dynamic "cognito_user_pool" {
39+
for_each = lookup(request_body.value, "cognito_user_pool", null) == null ? [] : [1]
40+
content {
41+
default_size_inspection_limit = request_body.value.cognito_user_pool.default_size_inspection_limit
42+
}
43+
}
44+
45+
dynamic "verified_access_instance" {
46+
for_each = lookup(request_body.value, "verified_access_instance", null) == null ? [] : [1]
47+
content {
48+
default_size_inspection_limit = request_body.value.verified_access_instance.default_size_inspection_limit
49+
}
50+
}
51+
}
52+
}
53+
}
54+
}
55+
1856
dynamic "rule" {
1957
for_each = var.rule
2058
content {

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ variable "default_action" {
1919
type = string
2020
}
2121

22+
variable "association_config" {
23+
description = "(Optional) Customizes the request body that your protected resource forward to AWS WAF for inspection."
24+
type = map(any)
25+
default = null
26+
}
27+
2228
variable "visibility_config" {
2329
description = "(Required) Defines and enables Amazon CloudWatch metrics and web request sample collection."
2430
type = map(string)

0 commit comments

Comments
 (0)