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

single_query_argument not supported #132

Open mbsimonovic opened 6 months ago

mbsimonovic commented 6 months ago

What is the current behavior? single_query_argument does not seem to be supported. For the list of all field_to_match arguments see https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/wafv2_rule_group#field-to-match

                  byte_match_statement = {
                    field_to_match = {
                      single_query_argument = {
                        name = "version"
                      }
                    }
                    positional_constraint = "EXACTLY"
                    search_string         = "latest"
                    type                  = "NONE"
                    priority              = 0
                  }

produces tf plan:

                                      + byte_match_statement {
                                          + positional_constraint = "EXACTLY"
                                          + search_string         = "version"

                                          + field_to_match {
                                                         #### IT'S EMPTY !!
                                            }

                                          + text_transformation {
                                              + priority = 0
                                              + type     = "NONE"
                                            }
                                        }
                                    }

What is the expected behavior?

                                      + byte_match_statement {
                                          + positional_constraint = "EXACTLY"
                                          + search_string         = "version"

                                          + field_to_match {

                   +   single_query_argument  {
                   +     name = "version"
                        }

                                            }

                                          + text_transformation {
                                              + priority = 0
                                              + type     = "NONE"
                                            }
                                        }
                                    }

Software versions?

Happens both with 4.x and 5.x, AWS 5.45, terraform 1.3.7.