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

Cannot remove rules from aws_waf_web_acl #4786

Closed
BookOfGreg opened this issue Jun 8, 2018 · 3 comments · Fixed by #5380
Closed

Cannot remove rules from aws_waf_web_acl #4786

BookOfGreg opened this issue Jun 8, 2018 · 3 comments · Fixed by #5380
Labels
bug Addresses a defect in current functionality. service/waf Issues and PRs that pertain to the waf service.
Milestone

Comments

@BookOfGreg
Copy link
Contributor

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

Terraform v0.11.7

  • provider.aws v1.15.0

Affected Resource(s)

  • aws_waf_web_acl
  • aws_waf_rule

Terraform Configuration Files

Before

resource "aws_waf_web_acl" "global_waf_acl" {
  name        = "GlobalWAF"
  metric_name = "GlobalWAF"

  default_action { type = "ALLOW" }

  rules {
    action { type = "BLOCK" }
    priority = 1
    rule_id  = "${aws_waf_rate_based_rule.brute_force_rule.id}"
    type     = "RATE_BASED"
  }

  rules {
    action { type = "BLOCK" }
    priority = 2
    rule_id  = "${aws_waf_rule.auto_block_list_rule.id}"
    type     = "REGULAR"
  }
}

First attempt

resource "aws_waf_web_acl" "global_waf_acl" {
  name        = "GlobalWAF"
  metric_name = "GlobalWAF"

  default_action { type = "ALLOW" }

  rules {
    action { type = "BLOCK" }
    priority = 1
    rule_id  = "${aws_waf_rate_based_rule.brute_force_rule.id}"
    type     = "RATE_BASED"
  }

  rules {
    action { type = "BLOCK" }
    priority = 2
    rule_id  = "${aws_waf_rule.new_rule.id}"
    type     = "REGULAR"
  }

  rules {
    action { type = "BLOCK" }
    priority = 3
    rule_id  = "${aws_waf_rule.auto_block_list_rule.id}"
    type     = "REGULAR"
  }
}

* aws_waf_web_acl.global_waf_acl: Error Updating WAF ACL: Error Updating WAF ACL: ValidationException: Cannot allow rule <ID> with priority 2. Another rule already has this priority.

Second attempt

resource "aws_waf_web_acl" "global_waf_acl" {
  name        = "GlobalWAF"
  metric_name = "GlobalWAF"

  default_action { type = "ALLOW" }

  rules {
    action { type = "BLOCK" }
    priority = 1
    rule_id  = "${aws_waf_rate_based_rule.brute_force_rule.id}"
    type     = "RATE_BASED"
  }
}

aws_waf_web_acl.global_waf_acl: Modifications complete after 1s
All rules are still attached to WAF in AWS Console

Expected Behavior

I should be able to update rule priorities.

I should also be able to remove rules and have them removed from the WAF

Actual Behavior

Priority conflict.
Rules still present.

Steps to Reproduce

See above HCL

@radeksimko radeksimko added bug Addresses a defect in current functionality. service/waf Issues and PRs that pertain to the waf service. labels Jun 13, 2018
@bflad bflad added this to the v1.30.0 milestone Jul 31, 2018
@bflad
Copy link
Contributor

bflad commented Jul 31, 2018

The fix for this has been merged into master and will release with version 1.30.0 of the AWS provider, likely on Wednesday. 👍

@bflad
Copy link
Contributor

bflad commented Aug 2, 2018

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

@ghost
Copy link

ghost commented Apr 4, 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 Apr 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/waf Issues and PRs that pertain to the waf service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants