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 WAF IPSet resources do not delete existing records correctly #10403

Closed
srikiraju opened this issue Nov 28, 2016 · 10 comments · Fixed by #13766
Closed

AWS WAF IPSet resources do not delete existing records correctly #10403

srikiraju opened this issue Nov 28, 2016 · 10 comments · Fixed by #13766
Assignees

Comments

@srikiraju
Copy link

Terraform Version

Terraform v0.7.13
Not fixed in latest

Affected Resource(s)

Please list the resources as a list, for example:

  • aws_waf_ipset

Terraform Configuration Files

resource "aws_waf_ipset" "my_ipset" {
  name = "my_ipset"
}

Debug Output

module.live.aws_waf_ipset.my_ipset: Modifying...
  ip_set_descriptors.#:                "1" => "0"
  ip_set_descriptors.1394369178.type:  "IPV4" => ""
  ip_set_descriptors.1394369178.value: "10.0.1.12/32" => ""
Error applying plan:

1 error(s) occurred:

* aws_waf_ipset.my_ipset: Error Updating WAF IPSet: Error Updating WAF IPSet: InvalidParameter: 1 validation error(s) found.
- missing required field, UpdateIPSetInput.Updates.

Expected Behavior

IP set should have reset to empty

Actual Behavior

Code does not produce "DELETE" updates correctly and errors out at validation step.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply
  2. Modify ipset manually - add a new ip to block
  3. terraform plan, terraform apply
@dstarr1
Copy link

dstarr1 commented Dec 1, 2016

I'm also having a similar issue with v0.7.13. I'm unable to successfully remove ip_set_descriptors from the aws_waf_ipset resource. I can successfully add them, but when I remove/comment out one, "terraform apply" executes successfully, but looking at AWS console the IP still exists in the waf-rule.

@josqu4red
Copy link

Same issue as @dstarr1, using Terraform v0.8.5.

@llavaud
Copy link

llavaud commented Mar 24, 2017

Issue still present using Terraform v0.8.8

@llavaud
Copy link

llavaud commented Mar 28, 2017

still present in v0.9.1

@s-nakka
Copy link

s-nakka commented May 10, 2017

I see it on Terraform v0.9.3. My use case is to create a empty IP set and then update it using lambda from third party reputation list. I see the error when applying the plan. Though it returns the error during the apply, it still creates the required resource. It shows the same error during the deletion but doesn't delete the resource.

resource "aws_waf_ipset" "spam_third_party_list_1" {
name = "spam_third_party_list_1"
}

  • aws_waf_ipset.spam_third_party_list_1 (destroy): 1 error(s) occurred:

  • aws_waf_ipset.spam_third_party_list_1: Error Removing IPSetDescriptors: Error Updating WAF IPSet: InvalidParameter: 1 validation error(s) found.

  • missing required field, UpdateIPSetInput.Updates.

@radeksimko
Copy link
Member

@SandyFox This patch was released in 0.9.4, can you try upgrading to that version, please?

Thanks.

@s-nakka
Copy link

s-nakka commented May 10, 2017

Upgraded to Terraform v0.9.4 and its working fine. Terraform plan/apply is taking too long to execute the results. At least few minutes.

@s-nakka
Copy link

s-nakka commented May 10, 2017

@radeksimko ^^^

@radeksimko
Copy link
Member

@SandyFox I think this is unrelated to the original PR, but to answer your question the most likely reason it takes a bit more time to update is because we can only perform a single change at a time for the whole WAF. To achieve this and avoid errors caused by parallel changes with stale tokens we have recently implemented mutex for all WAF resources which guarantees that there's only a single update operation happening at any given time. This is in line with the relevant API documentation and expectations set by AWS/WAF.

See #13656 fixing #10335 which was also shipped in 0.9.4

@ghost
Copy link

ghost commented Apr 12, 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 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.

@ghost ghost locked and limited conversation to collaborators Apr 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants