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

WAF resources don't allow usage of non-alphanumeric characters in metric_name #8197

Closed
dvishniakov opened this issue Apr 4, 2019 · 3 comments
Labels
service/waf Issues and PRs that pertain to the waf service.

Comments

@dvishniakov
Copy link

dvishniakov commented Apr 4, 2019

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 "me too" comments, 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

Terraform Version

Reproduced on a few options:
Terraform v0.11.13

  • provider.aws v2.5.0

Terraform v0.11.7 (and 0.11.13)

  • provider.aws v1.60.0

Affected Resource(s)

  • aws_waf_rule
  • aws_waf_web_acl
  • aws_waf_rate_based_rule (possibly)
  • aws_waf_rule_group (possibly)

Terraform Configuration Files

resource "aws_waf_ipset" "ipset" {
  name = "tfIPSet"

  ip_set_descriptors {
    type  = "IPV4"
    value = "192.0.7.0/24"
  }
}

resource "aws_waf_rule" "wafrule" {
  depends_on  = ["aws_waf_ipset.ipset"]
  name        = "tfWAFRule"
  metric_name = "tfWAFRule-_"

  predicates {
    data_id = "${aws_waf_ipset.ipset.id}"
    negated = false
    type    = "IPMatch"
  }
}


resource "aws_waf_web_acl" "waf_acl" {
  depends_on  = ["aws_waf_ipset.ipset", "aws_waf_rule.wafrule"]
  name        = "tfWebACL"
  metric_name = "tfWebACL#+"

  default_action {
    type = "ALLOW"
  }

  rules {
    action {
      type = "BLOCK"
    }

    priority = 1
    rule_id  = "${aws_waf_rule.wafrule.id}"
    type     = "REGULAR"
  }
}

Expected Behavior

Successful plan and apply

Actual Behavior

Error: aws_waf_rule.wafrule: Only alphanumeric characters allowed in "metric_name": "tfWAFRule-_"
Error: aws_waf_web_acl.waf_acl: Only alphanumeric characters allowed in "metric_name": "tfWebACL#+"

Steps to Reproduce

Mostly copied from https://www.terraform.io/docs/providers/aws/r/waf_web_acl.html and modified metric_name to have some characters allowed by https://docs.aws.amazon.com/waf/latest/developerguide/web-acl-rules-creating.html

  1. terraform apply
@dvishniakov dvishniakov changed the title WAF resources don't allow use non-alphanumeric characters in metric_name WAF resources don't allow usage non-alphanumeric characters in metric_name Apr 4, 2019
@dvishniakov dvishniakov changed the title WAF resources don't allow usage non-alphanumeric characters in metric_name WAF resources don't allow usage of non-alphanumeric characters in metric_name Apr 4, 2019
@aeschright aeschright added the needs-triage Waiting for first response or review from a maintainer. label Jun 19, 2019
@aeschright aeschright added the service/waf Issues and PRs that pertain to the waf service. label Jul 2, 2019
@mungojam
Copy link
Contributor

Looks to me like it is doing the right thing. The AWS doc you included says:

The name can contain only alphanumeric characters (A-Z, a-z, 0-9)

So the special chars you have tried aren't supported by AWS

@dvishniakov
Copy link
Author

Seems like they've updated the page, because I found a ticket with AWS from Apr 09, when documentation was not yet corrected. So I'll close this.

@ghost
Copy link

ghost commented Mar 29, 2020

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 29, 2020
@breathingdust breathingdust removed the needs-triage Waiting for first response or review from a maintainer. label Sep 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/waf Issues and PRs that pertain to the waf service.
Projects
None yet
Development

No branches or pull requests

4 participants