-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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 WebACL resources missing support for using Rule Groups #4052
Comments
Thanks for reporting! It looks like the validation needs to be updated here: |
This commit adds rule type support so that Rate Limit rules could be use along with REGULAR rules. Closes hashicorp#4079 hashicorp#4174 hashicorp#4052
The |
It looks like the commit doesn't support Rule Groups which this issue is referring to. We need this to support the use of AWS Managed Ruleset Groups form the marketplace. |
Oh whoops you are correct, this is a separate issue, it was just linked in the PR. |
Will this be a part of v1.26.0 then? I guess my actual big question is thus: When can we expect this feature to be implemented in this provider plugin? Hello @erikpaasonen! |
It's not currently on my personal hit list and there are not currently any open WAF pull requests for the fix: https://github.com/terraform-providers/terraform-provider-aws/pulls?q=is%3Aopen+is%3Apr+label%3Aservice%2Fwaf If someone is willing to submit a fix, the maintainers will be happy to take a look. |
This should be fixed with #5053 which was just merged into master and will release with version 1.27.0 of the AWS provider, likely middle of this week. 👍 # Implementation is similar for aws_wafregional_web_acl resource
resource "aws_waf_web_acl" "example" {
# ... other configuration ...
rules {
# ... other configuration ...
override_action {
type = "NONE"
}
type = "GROUP"
rule_id = "${aws_waf_rule_group.example.id}"
}
} |
This has been released in version 1.27.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
Does anyone have a working example of using adding managed rules, using the above resource config I am getting an error. I am on the latest provider. 1 error(s) occurred:
|
Should be rule, not rules. Global is rules and regional is rule. |
I had tried that previously, its the same issue. |
priority is also a required argument looking at the documentation. And make sure you are requiring at least AWS provider 1.27. |
No luck! This is for a managed F5 rule that I wanted to add to the webacl, is it something related to this I am wondering? |
No I've done it successfully with the F5 managed rule. Make sure the rule_id is the correct one for the region you're targeting. Here's the exact config I've used resource "aws_wafregional_web_acl" "protected_web_acl" { rule { |
OK that works, thanks! |
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! |
Terraform Version
Affected Resource(s)
Terraform Configuration Files
This is copied and pasted straight from the examples for
aws_waf_rule_group
andaws_waf_web_acl
, just adapted to use the rule group.Debug Output
https://gist.github.com/erikpaasonen/83174454128c6ae05e6d0058d0b72a3a
Expected Behavior
Terraform should create the WAF WebACL using the new rule group resource.
Actual Behavior
Terraform aborts almost immediately because it is expecting a
type
of onlyREGULAR
orRATE_BASED
. It considersGROUP
as invalid input.Important Factoids
Our team currently has the insertion of a managed rule group working using the AWS CLI. The AWS CLI supports the
GROUP
type. Here's the syntax for a known-goodupdates
list entry for use with the AWS CLI:As mentioned in Issue #3172 , the
aws_waf_web_acl
andaws_wafregional_web_acl
resources are missing support forOverrideAction
. Once resolved, this issue is expected to resolve Issue #3172 at least for the hard-coded UUID use case.I'm filing this particular issue as a bug now that v1.13.0 is live. But I believe this was simply an integration oversight when the new
aws_waf_rule_group
andaws_wafregional_rule_group
resource types were recently introduced.References
PR #3898
Issue #424
Issue #3172
https://docs.aws.amazon.com/cli/latest/reference/waf/update-web-acl.html#options
The text was updated successfully, but these errors were encountered: