umotif-public / terraform-aws-waf-webaclv2

Terraform module to configure WAF V2 Web ACL with managed rules for Application Load Balancer
https://registry.terraform.io/modules/umotif-public/waf-webaclv2/aws
Other
137 stars 124 forks source link

Invalid value for "default" parameter: the default value must have the same │ type as the map elements #110

Closed vladpanainte closed 1 year ago

vladpanainte commented 1 year ago

What is the current behavior?

Module version 4.6.1 hashicorp/aws v4.67.0

aws_wafv2_ip_set.custom_ip_set[0]: Refreshing state... [id=12d7904a-99cd-4acb-b33a-173bee2adfa3] module.waf.aws_wafv2_web_acl.main[0]: Refreshing state... [id=ff000ab9-4de9-4646-96e2-44af93e1128d] ╷ │ Error: Invalid function argument │ │ on .terraform/modules/waf/main.tf line 2219, in resource "aws_wafv2_web_acl" "main": │ 2219: for_each = length(lookup(ip_set_reference_statement.value, "ip_set_forwarded_ip_config", {})) == 0 ? [] : [lookup(ip_set_reference_statement.value, "ip_set_forwarded_ip_config", {})] │ │ Invalid value for "default" parameter: the default value must have the same │ type as the map elements. ╵ ERRO[0046] 1 error occurred:

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

terraform plan or terraform apply

What is the expected behavior?

Run without getting this error

Software versions? Module version 4.6.1 hashicorp/aws v4.67.0

vladpanainte commented 1 year ago

Hello,

This is not a bug in my case I had to reference as an empty object

I will create a PR for this. Thanks

vladpanainte commented 1 year ago

I will raise a PR