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

AWS WAFv2 doesn't support Scope-down statement for managed_rule_group_statements #19125

Closed
brandonpalmer opened this issue Apr 27, 2021 · 3 comments · Fixed by #19407
Closed
Assignees
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

@brandonpalmer
Copy link

brandonpalmer commented Apr 27, 2021

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

Terraform CLI and Terraform AWS Provider Version

Terraform v0.14.7 / 0.15.1

Affected Resource(s)

https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/wafv2_web_acl
For Managed Rules, the Scope-Down is not supported in Terraform. It IS supported in the AWS CLI / AWS SDK

This does work for other rule types (like rate_based_statement statement rules)

Terraform Configuration Files

resource "aws_wafv2_web_acl" "default_alb_rules" {
  name        = "default_alb_waf"
  description = "Default ALB WAF Rules"
  scope       = "REGIONAL"

  default_action {
    allow {}
  }

 rule {
    name     = "AWS-AWSManagedRulesAmazonIpReputationList"
    priority = 1

    override_action {
      count {}
    }
    statement {
      managed_rule_group_statement {
        name        = "AWSManagedRulesAmazonIpReputationList"
        vendor_name = "AWS"

        scope_down_statement {
          geo_match_statement {
            country_codes = ["US", "NL"]
          }
        }
      }
    }
    visibility_config {
      cloudwatch_metrics_enabled = true
      metric_name                = "AWS-AWSManagedRulesBotControlRuleSet"
      sampled_requests_enabled   = true
    }
  }
  visibility_config {
    cloudwatch_metrics_enabled = false
    metric_name                = "default_alb_waf"
    sampled_requests_enabled   = false
  }
}

Debug Output

https://gist.github.com/brandonpalmer/6ac46bc9c028fdca6faee038e67aaf56

Panic Output

Expected Behavior

Scope-down should have been applied to rule.

Throws error

  1. terraform apply

Important Factoids

References

  • #0000
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Apr 27, 2021
@brandonpalmer brandonpalmer changed the title AWS WAFv2 doesn AWS WAFv2 doesn't support Scope-down statement for managed_rule_group_statements Apr 27, 2021
@ghost ghost added the service/wafv2 Issues and PRs that pertain to the wafv2 service. label Apr 27, 2021
@gdavison gdavison added enhancement Requests to existing resources that expand the functionality or scope. and removed needs-triage Waiting for first response or review from a maintainer. labels Apr 27, 2021
@rajholla
Copy link
Contributor

There is open PR to address this: #19407

@github-actions
Copy link

This functionality has been released in v3.50.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

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 Aug 15, 2021
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.

4 participants