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

tests/resource/aws_waf_web_acl: Add sweeper #10323

Merged
merged 1 commit into from
Oct 2, 2019
Merged

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Oct 1, 2019

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" comments, they generate extra noise for pull request followers and do not help prioritize the request

Release note for CHANGELOG:

NONE

Prevent sweeper errors such as the following:

[02:06:51][Step 2/4] 2019/10/01 02:06:51 [ERR] error running (aws_waf_rule_group): Error deleting WAF Rule Group: WAFReferencedItemException: This entity is still referenced by other entities.

Output from sweeper in AWS Commercial:

$ go test ./aws -v -sweep=us-east-1,us-west-2 -sweep-run=aws_waf_web_acl -timeout 10h
...
2019/10/01 08:34:32 [INFO] Deleting WAF Regional Web ACL: 0a403434-d93a-4aab-a77e-eb4233d18782
2019/10/01 08:34:33 [INFO] Removing Rules from WAF Regional Web ACL: 0a403434-d93a-4aab-a77e-eb4233d18782
2019/10/01 08:34:33 [INFO] Deleting WAF Regional Web ACL: 0a403434-d93a-4aab-a77e-eb4233d18782
2019/10/01 08:34:34 [INFO] Deleting WAF Regional Web ACL: 5337406c-99fd-49dc-9ff5-0dfdf5c197c0
2019/10/01 08:34:34 [INFO] Deleting WAF Regional Web ACL: 544a93f3-7729-48ad-850a-a52e4b135c69
2019/10/01 08:34:35 [INFO] Removing Rules from WAF Regional Web ACL: 544a93f3-7729-48ad-850a-a52e4b135c69
2019/10/01 08:34:35 [INFO] Deleting WAF Regional Web ACL: 544a93f3-7729-48ad-850a-a52e4b135c69
2019/10/01 08:34:36 [INFO] Deleting WAF Regional Web ACL: 8029c8ef-ace5-43c6-ae41-83097c17a319
2019/10/01 08:34:36 [INFO] Deleting WAF Regional Web ACL: f5afc502-250b-4256-9b0c-585e399a124c
2019/10/01 08:34:37 Sweeper Tests ran:
	- aws_waf_web_acl

$ go test ./aws -v -sweep=us-east-1,us-west-2 -sweep-run=aws_waf_rule_group -timeout 10h
...
2019/10/01 08:36:47 [INFO] Deleting WAF Rule Group
2019/10/01 08:36:48 Sweeper Tests ran:
	- aws_waf_web_acl
	- aws_waf_rule_group

Output from sweeper in AWS GovCloud (US):

$ go test ./aws -v -sweep=us-gov-west-1 -sweep-run=aws_waf_web_acl -timeout 10h
...
2019/10/01 08:34:36 [WARN] Skipping WAF Regional Web ACL sweep for us-gov-west-1: RequestError: send request failed
caused by: Post https://waf.us-gov-west-1.amazonaws.com/: dial tcp: lookup waf.us-gov-west-1.amazonaws.com: no such host
2019/10/01 08:34:36 Sweeper Tests ran:
	- aws_waf_web_acl
ok  	github.com/terraform-providers/terraform-provider-aws/aws	4.366s

Prevent sweeper errors such as the following:

```
[02:06:51][Step 2/4] 2019/10/01 02:06:51 [ERR] error running (aws_waf_rule_group): Error deleting WAF Rule Group: WAFReferencedItemException: This entity is still referenced by other entities.
```

Output from sweeper in AWS Commercial:

```console
$ go test ./aws -v -sweep=us-east-1,us-west-2 -sweep-run=aws_waf_web_acl -timeout 10h
...
2019/10/01 08:34:32 [INFO] Deleting WAF Regional Web ACL: 0a403434-d93a-4aab-a77e-eb4233d18782
2019/10/01 08:34:33 [INFO] Removing Rules from WAF Regional Web ACL: 0a403434-d93a-4aab-a77e-eb4233d18782
2019/10/01 08:34:33 [INFO] Deleting WAF Regional Web ACL: 0a403434-d93a-4aab-a77e-eb4233d18782
2019/10/01 08:34:34 [INFO] Deleting WAF Regional Web ACL: 5337406c-99fd-49dc-9ff5-0dfdf5c197c0
2019/10/01 08:34:34 [INFO] Deleting WAF Regional Web ACL: 544a93f3-7729-48ad-850a-a52e4b135c69
2019/10/01 08:34:35 [INFO] Removing Rules from WAF Regional Web ACL: 544a93f3-7729-48ad-850a-a52e4b135c69
2019/10/01 08:34:35 [INFO] Deleting WAF Regional Web ACL: 544a93f3-7729-48ad-850a-a52e4b135c69
2019/10/01 08:34:36 [INFO] Deleting WAF Regional Web ACL: 8029c8ef-ace5-43c6-ae41-83097c17a319
2019/10/01 08:34:36 [INFO] Deleting WAF Regional Web ACL: f5afc502-250b-4256-9b0c-585e399a124c
2019/10/01 08:34:37 Sweeper Tests ran:
	- aws_waf_web_acl

$ go test ./aws -v -sweep=us-east-1,us-west-2 -sweep-run=aws_waf_rule_group -timeout 10h
...
2019/10/01 08:36:47 [INFO] Deleting WAF Rule Group
2019/10/01 08:36:48 Sweeper Tests ran:
	- aws_waf_web_acl
	- aws_waf_rule_group
```

Output from sweeper in AWS GovCloud (US):

```console
$ go test ./aws -v -sweep=us-gov-west-1 -sweep-run=aws_waf_web_acl -timeout 10h
...
2019/10/01 08:34:36 [WARN] Skipping WAF Regional Web ACL sweep for us-gov-west-1: RequestError: send request failed
caused by: Post https://waf.us-gov-west-1.amazonaws.com/: dial tcp: lookup waf.us-gov-west-1.amazonaws.com: no such host
2019/10/01 08:34:36 Sweeper Tests ran:
	- aws_waf_web_acl
ok  	github.com/terraform-providers/terraform-provider-aws/aws	4.366s
```
@bflad bflad requested a review from a team October 1, 2019 12:39
@ghost ghost added size/M Managed by automation to categorize the size of a PR. service/waf Issues and PRs that pertain to the waf service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Oct 1, 2019
Copy link
Contributor

@aeschright aeschright left a comment

Choose a reason for hiding this comment

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

👍

$ go test ./aws -v -sweep=us-east-1,us-west-2 -sweep-run=aws_waf_web_acl -timeout 10h

2019/10/01 18:36:13 Sweeper Tests ran:
	- aws_waf_web_acl

2019/10/01 18:36:15 Sweeper Tests ran:
	- aws_waf_web_acl
ok  	github.com/terraform-providers/terraform-provider-aws/aws	4.892s

@bflad bflad added this to the v2.31.0 milestone Oct 2, 2019
@bflad bflad merged commit ce20280 into master Oct 2, 2019
@bflad bflad deleted the t-aws_waf_web_acl-sweeper branch October 2, 2019 01:46
@ghost
Copy link

ghost commented Oct 3, 2019

This has been released in version 2.31.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 for triage. Thanks!

@ghost
Copy link

ghost commented Nov 1, 2019

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 Nov 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/waf Issues and PRs that pertain to the waf service. size/M Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants