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

resource/aws_waf(regional)_ipset: Properly handle updates and deletions over 1000 IP set descriptors #5588

Merged
merged 1 commit into from
Aug 20, 2018

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Aug 17, 2018

Fixes #833

Previously:

--- FAIL: TestAccAWSWafIPSet_IpSetDescriptors_1000UpdateLimit (8.02s)
	testing.go:527: Step 0 error: Error applying: 1 error occurred:
			* aws_waf_ipset.ipset: 1 error occurred:
			* aws_waf_ipset.ipset: Error Updating WAF IPSet: Error Updating WAF IPSet: WAFLimitsExceededException: Operation would result in exceeding resource limits.
--- FAIL: TestAccAWSWafRegionalIPSet_IpSetDescriptors_1000UpdateLimit (10.55s)
	testing.go:527: Step 0 error: Error applying: 1 error occurred:
			* aws_wafregional_ipset.ipset: 1 error occurred:
			* aws_wafregional_ipset.ipset: Error Updating WAF IPSet: Error Updating WAF IPSet: WAFLimitsExceededException: Operation would result in exceeding resource limits.

Changes proposed in this pull request:

  • Perform batching of 1000 Updates with UpdateIPSet

Output from acceptance testing:

$ make testacc TEST=./aws TESTARGS='-run=TestAccAWSWaf\(Regional\)\?IPSet_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -run=TestAccAWSWaf\(Regional\)\?IPSet_ -timeout 120m
=== RUN   TestAccAWSWafIPSet_basic
--- PASS: TestAccAWSWafIPSet_basic (11.79s)
=== RUN   TestAccAWSWafIPSet_disappears
--- PASS: TestAccAWSWafIPSet_disappears (7.02s)
=== RUN   TestAccAWSWafIPSet_changeNameForceNew
--- PASS: TestAccAWSWafIPSet_changeNameForceNew (18.54s)
=== RUN   TestAccAWSWafIPSet_changeDescriptors
--- PASS: TestAccAWSWafIPSet_changeDescriptors (15.31s)
=== RUN   TestAccAWSWafIPSet_noDescriptors
--- PASS: TestAccAWSWafIPSet_noDescriptors (8.89s)
=== RUN   TestAccAWSWafIPSet_IpSetDescriptors_1000UpdateLimit
--- PASS: TestAccAWSWafIPSet_IpSetDescriptors_1000UpdateLimit (26.55s)
=== RUN   TestAccAWSWafRegionalIPSet_basic
--- PASS: TestAccAWSWafRegionalIPSet_basic (13.73s)
=== RUN   TestAccAWSWafRegionalIPSet_disappears
--- PASS: TestAccAWSWafRegionalIPSet_disappears (13.02s)
=== RUN   TestAccAWSWafRegionalIPSet_changeNameForceNew
--- PASS: TestAccAWSWafRegionalIPSet_changeNameForceNew (26.81s)
=== RUN   TestAccAWSWafRegionalIPSet_changeDescriptors
--- PASS: TestAccAWSWafRegionalIPSet_changeDescriptors (22.95s)
=== RUN   TestAccAWSWafRegionalIPSet_IpSetDescriptors_1000UpdateLimit
--- PASS: TestAccAWSWafRegionalIPSet_IpSetDescriptors_1000UpdateLimit (33.62s)
=== RUN   TestAccAWSWafRegionalIPSet_noDescriptors
--- PASS: TestAccAWSWafRegionalIPSet_noDescriptors (10.92s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	209.782s

@bflad bflad added bug Addresses a defect in current functionality. service/waf Issues and PRs that pertain to the waf service. labels Aug 17, 2018
@bflad bflad requested a review from a team August 17, 2018 07:08
@ghost ghost added the size/L Managed by automation to categorize the size of a PR. label Aug 17, 2018
…ns over 1000 IP set descriptors

* Perform batching of 1000 Updates with UpdateIPSet

Previously:

--- FAIL: TestAccAWSWafIPSet_IpSetDescriptors_1000UpdateLimit (8.02s)
	testing.go:527: Step 0 error: Error applying: 1 error occurred:
			* aws_waf_ipset.ipset: 1 error occurred:
			* aws_waf_ipset.ipset: Error Updating WAF IPSet: Error Updating WAF IPSet: WAFLimitsExceededException: Operation would result in exceeding resource limits.
--- FAIL: TestAccAWSWafRegionalIPSet_IpSetDescriptors_1000UpdateLimit (10.55s)
	testing.go:527: Step 0 error: Error applying: 1 error occurred:
			* aws_wafregional_ipset.ipset: 1 error occurred:
			* aws_wafregional_ipset.ipset: Error Updating WAF IPSet: Error Updating WAF IPSet: WAFLimitsExceededException: Operation would result in exceeding resource limits.

Now passes:

make testacc TEST=./aws TESTARGS='-run=TestAccAWSWaf\(Regional\)\?IPSet_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -run=TestAccAWSWaf\(Regional\)\?IPSet_ -timeout 120m
=== RUN   TestAccAWSWafIPSet_basic
--- PASS: TestAccAWSWafIPSet_basic (11.79s)
=== RUN   TestAccAWSWafIPSet_disappears
--- PASS: TestAccAWSWafIPSet_disappears (7.02s)
=== RUN   TestAccAWSWafIPSet_changeNameForceNew
--- PASS: TestAccAWSWafIPSet_changeNameForceNew (18.54s)
=== RUN   TestAccAWSWafIPSet_changeDescriptors
--- PASS: TestAccAWSWafIPSet_changeDescriptors (15.31s)
=== RUN   TestAccAWSWafIPSet_noDescriptors
--- PASS: TestAccAWSWafIPSet_noDescriptors (8.89s)
=== RUN   TestAccAWSWafIPSet_IpSetDescriptors_1000UpdateLimit
--- PASS: TestAccAWSWafIPSet_IpSetDescriptors_1000UpdateLimit (26.55s)
=== RUN   TestAccAWSWafRegionalIPSet_basic
--- PASS: TestAccAWSWafRegionalIPSet_basic (13.73s)
=== RUN   TestAccAWSWafRegionalIPSet_disappears
--- PASS: TestAccAWSWafRegionalIPSet_disappears (13.02s)
=== RUN   TestAccAWSWafRegionalIPSet_changeNameForceNew
--- PASS: TestAccAWSWafRegionalIPSet_changeNameForceNew (26.81s)
=== RUN   TestAccAWSWafRegionalIPSet_changeDescriptors
--- PASS: TestAccAWSWafRegionalIPSet_changeDescriptors (22.95s)
=== RUN   TestAccAWSWafRegionalIPSet_IpSetDescriptors_1000UpdateLimit
--- PASS: TestAccAWSWafRegionalIPSet_IpSetDescriptors_1000UpdateLimit (33.62s)
=== RUN   TestAccAWSWafRegionalIPSet_noDescriptors
--- PASS: TestAccAWSWafRegionalIPSet_noDescriptors (10.92s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	209.782s
@bflad bflad force-pushed the b-aws_waf_ipset-1000-batches branch from fe8f004 to 0a3549b Compare August 17, 2018 18:26
@ghost ghost added the size/L Managed by automation to categorize the size of a PR. label Aug 17, 2018
Copy link
Member

@mbfrahry mbfrahry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bflad bflad added this to the v1.33.0 milestone Aug 20, 2018
@bflad bflad merged commit ede83e8 into master Aug 20, 2018
@bflad bflad deleted the b-aws_waf_ipset-1000-batches branch August 20, 2018 20:03
bflad added a commit that referenced this pull request Aug 20, 2018
@bflad
Copy link
Contributor Author

bflad commented Aug 22, 2018

This has been released in version 1.33.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 3, 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 3, 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. size/L Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Large aws_waf_ipset resources cannot be deleted
2 participants