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

RegexMatchStatement not supported for AWS WAFv2 #21492

Closed
diasjorge opened this issue Oct 26, 2021 · 3 comments · Fixed by #22452
Closed

RegexMatchStatement not supported for AWS WAFv2 #21492

diasjorge opened this issue Oct 26, 2021 · 3 comments · Fixed by #22452
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/wafv2 Issues and PRs that pertain to the wafv2 service.
Milestone

Comments

@diasjorge
Copy link

diasjorge commented Oct 26, 2021

According to AWS documentation we can match part of the request to a regex. https://docs.aws.amazon.com/waf/latest/APIReference/API_RegexMatchStatement.html

This is currently unsupported in the current provider.

Note that forcing the usage of a patternset is much more expensive in capacity units

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

Please implement a way to have AWS WAFV2 rules matching a regex as it is possible to do from the console

New or Affected Resource(s)

Potential Terraform Configuration

resource "aws_wafv2_rule_group" "main" {
# ....
  regex_match_statement {
    field_to_match {
      uri_path {}
    }
    regex_string = "(\.php|\.cgi)$"
    text_transformations {}
  }
}

References

  • #0000
@diasjorge diasjorge added the enhancement Requests to existing resources that expand the functionality or scope. label Oct 26, 2021
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Oct 26, 2021
@justinretzolk justinretzolk added service/wafv2 Issues and PRs that pertain to the wafv2 service. and removed needs-triage Waiting for first response or review from a maintainer. labels Oct 26, 2021
wilkmaia added a commit to wilkmaia/terraform-provider-aws that referenced this issue Jan 6, 2022
`RegexMatchStatement` is a valid kind statement, as described in AWS' API
documentation (see
https://docs.aws.amazon.com/waf/latest/APIReference/API_RegexMatchStatement.html).

This statement can be used in both `CreateRuleGroup` and `CreateWebACL`
API calls. For reference:

- https://docs.aws.amazon.com/waf/latest/APIReference/API_CreateRuleGroup.html
- https://docs.aws.amazon.com/waf/latest/APIReference/API_CreateWebACL.html

This solves hashicorp#21492.
@wilkmaia
Copy link
Contributor

wilkmaia commented Jan 7, 2022

If you're interested in this feature, please 👍 this PR :)

#22452

@github-actions github-actions bot added this to the v4.34.0 milestone Oct 4, 2022
@github-actions
Copy link

github-actions bot commented Oct 6, 2022

This functionality has been released in v4.34.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

github-actions bot commented Nov 6, 2022

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/wafv2 Issues and PRs that pertain to the wafv2 service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants