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_db_snapshot: Ensure sweeper runs after aws_db_instance and skips automated snapshots #13897

Merged
merged 1 commit into from
Jun 24, 2020

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Jun 23, 2020

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" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Closes #13800

Release note for CHANGELOG:

NONE

Looks like the aws_db_instance sweeper separately needs to be updated to handle API deletion protection.

Output from sweeper in AWS Commercial:

2020/06/23 09:05:56 [DEBUG] Running Sweepers for region (us-west-2):
2020/06/23 09:05:56 [DEBUG] Running Sweeper (aws_db_instance) in region (us-west-2)
...
2020/06/23 09:05:59 [INFO] Deleting DB instance: tf-acc-test-5943499196810915120
2020/06/23 09:06:00 [ERROR] Failed to delete DB instance tf-acc-test-5943499196810915120: InvalidParameterCombination: Cannot delete protected DB Instance, please disable deletion protection and try again.
	status code: 400, request id: 90caa3c3-9f82-4ad5-ad74-a68238240564
2020/06/23 09:06:00 [DEBUG] Running Sweeper (aws_db_snapshot) in region (us-west-2)
2020/06/23 09:06:00 Sweeper Tests ran successfully:
	- aws_db_instance
	- aws_db_snapshot
2020/06/23 09:06:00 [DEBUG] Running Sweepers for region (us-east-1):
2020/06/23 09:06:00 [DEBUG] Running Sweeper (aws_db_instance) in region (us-east-1)
...
2020/06/23 09:06:02 [DEBUG] Running Sweeper (aws_db_snapshot) in region (us-east-1)
2020/06/23 09:06:02 Sweeper Tests ran successfully:
	- aws_db_instance
	- aws_db_snapshot
ok  	github.com/terraform-providers/terraform-provider-aws/aws	6.798s

Output from sweeper in AWS GovCloud (US):

2020/06/23 09:06:15 [DEBUG] Running Sweepers for region (us-gov-west-1):
2020/06/23 09:06:15 [DEBUG] Running Sweeper (aws_db_instance) in region (us-gov-west-1)
...
2020/06/23 09:06:17 [DEBUG] Running Sweeper (aws_db_snapshot) in region (us-gov-west-1)
2020/06/23 09:06:18 Sweeper Tests ran successfully:
	- aws_db_instance
	- aws_db_snapshot
ok  	github.com/terraform-providers/terraform-provider-aws/aws	4.148s

…ance and skips automated snapshots

Reference: #13800

Looks like the `aws_db_instance` sweeper separately needs to be updated to handle API deletion protection.

Output from sweeper in AWS Commercial:

```
2020/06/23 09:05:56 [DEBUG] Running Sweepers for region (us-west-2):
2020/06/23 09:05:56 [DEBUG] Running Sweeper (aws_db_instance) in region (us-west-2)
...
2020/06/23 09:05:59 [INFO] Deleting DB instance: tf-acc-test-5943499196810915120
2020/06/23 09:06:00 [ERROR] Failed to delete DB instance tf-acc-test-5943499196810915120: InvalidParameterCombination: Cannot delete protected DB Instance, please disable deletion protection and try again.
	status code: 400, request id: 90caa3c3-9f82-4ad5-ad74-a68238240564
2020/06/23 09:06:00 [DEBUG] Running Sweeper (aws_db_snapshot) in region (us-west-2)
2020/06/23 09:06:00 Sweeper Tests ran successfully:
	- aws_db_instance
	- aws_db_snapshot
2020/06/23 09:06:00 [DEBUG] Running Sweepers for region (us-east-1):
2020/06/23 09:06:00 [DEBUG] Running Sweeper (aws_db_instance) in region (us-east-1)
...
2020/06/23 09:06:02 [DEBUG] Running Sweeper (aws_db_snapshot) in region (us-east-1)
2020/06/23 09:06:02 Sweeper Tests ran successfully:
	- aws_db_instance
	- aws_db_snapshot
ok  	github.com/terraform-providers/terraform-provider-aws/aws	6.798s
```

Output from sweeper in AWS GovCloud (US):

```
2020/06/23 09:06:15 [DEBUG] Running Sweepers for region (us-gov-west-1):
2020/06/23 09:06:15 [DEBUG] Running Sweeper (aws_db_instance) in region (us-gov-west-1)
...
2020/06/23 09:06:17 [DEBUG] Running Sweeper (aws_db_snapshot) in region (us-gov-west-1)
2020/06/23 09:06:18 Sweeper Tests ran successfully:
	- aws_db_instance
	- aws_db_snapshot
ok  	github.com/terraform-providers/terraform-provider-aws/aws	4.148s
```
@bflad bflad added tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. technical-debt Addresses areas of the codebase that need refactoring or redesign. labels Jun 23, 2020
@bflad bflad requested a review from a team June 23, 2020 13:09
@ghost ghost added size/XS Managed by automation to categorize the size of a PR. service/rds Issues and PRs that pertain to the rds service. labels Jun 23, 2020
@anGie44 anGie44 self-requested a review June 24, 2020 15:55
Copy link
Contributor

@anGie44 anGie44 left a comment

Choose a reason for hiding this comment

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

looks great @bflad 👍

@bflad bflad added this to the v2.68.0 milestone Jun 24, 2020
@bflad bflad merged commit 517a7e3 into master Jun 24, 2020
@bflad bflad deleted the t-aws_db_snapshot-automated-sweeping branch June 24, 2020 16:02
@ghost
Copy link

ghost commented Jun 26, 2020

This has been released in version 2.68.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 Jul 24, 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 Jul 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/rds Issues and PRs that pertain to the rds service. size/XS Managed by automation to categorize the size of a PR. technical-debt Addresses areas of the codebase that need refactoring or redesign. 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.

aws_db_snapshot Sweeper Attempts to Delete Automated Snapshots
2 participants