hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.81k stars 9.16k forks source link

tests/resource/aws_wafv2_regex_pattern_set: Implement Sweeper #15857

Closed bflad closed 3 years ago

bflad commented 3 years ago

Community Note

Description

The acceptance testing can leave lingering resources on failed runs (e.g. via coding issues during development or panics). These lingering resources can cause quota limits to be reached, extraneous money to be spent, or in some worst cases leave open security risks in the testing account.

We do not require sweeper implementation during initial resource implementation at this time, but this may change in the future when the process can be simplified and documented better.

We are currently hitting quota limits on this resource in our testing account:

=== CONT  TestAccAwsWafv2RegexPatternSet_Minimal
TestAccAwsWafv2RegexPatternSet_Minimal: resource_aws_wafv2_regex_pattern_set_test.go:102: Step 1/1 error: Error running apply: 2020/10/26 16:06:34 [DEBUG] Using modified User-Agent: Terraform/0.12.29 HashiCorp-terraform-exec/0.10.0
Error: Error creating WAFv2 RegexPatternSet: WAFLimitsExceededException: AWS WAF couldn’t perform the operation because you exceeded your resource limit.
--- FAIL: TestAccAwsWafv2RegexPatternSet_Minimal (24.66s)

Definition of Done

$  aws wafv2 list-regex-pattern-sets --scope REGIONAL | jq '.RegexPatternSets | length'
0

References

ghost commented 3 years ago

This has been released in version 3.13.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 commented 3 years ago

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!