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

r/aws_efs_file_system: Fix sweeper crash #28234

Merged
merged 2 commits into from
Dec 7, 2022
Merged

Conversation

ewbankkit
Copy link
Contributor

@ewbankkit ewbankkit commented Dec 7, 2022

Description

Fixes the aws_efs_file_system sweeper crash by replacing a direct call to the resource's Delete handler with the sweep.SweepOrchestrator mechanism.

Relations

Closes #28222.
Relates #28054.

Output from Acceptance Testing

%  make sweep SWEEPARGS=-sweep-run=aws_efs_file_system
# make sweep SWEEPARGS=-sweep-run=aws_example_thing
# set SWEEPARGS=-sweep-allow-failures to continue after first failure
WARNING: This will destroy infrastructure. Use only in development accounts.
go test ./internal/sweep -v -tags=sweep -sweep=us-west-2,us-east-1,us-east-2 -sweep-run=aws_efs_file_system -timeout 60m
2022/12/07 09:00:50 [DEBUG] Running Sweepers for region (us-west-2):
2022/12/07 09:00:50 [DEBUG] Sweeper (aws_efs_file_system) has dependency (aws_efs_mount_target), running..
2022/12/07 09:00:50 [DEBUG] Running Sweeper (aws_efs_mount_target) in region (us-west-2)
2022/12/07 09:00:50 [INFO] Retrieved credentials from "EnvConfigCredentials"
2022/12/07 09:00:50 [DEBUG] Trying to get account information via sts:GetCallerIdentity
2022/12/07 09:00:50 [DEBUG] Trying to get account information via sts:GetCallerIdentity
2022/12/07 09:00:52 [DEBUG] Completed Sweeper (aws_efs_mount_target) in region (us-west-2) in 1.867983886s
2022/12/07 09:00:52 [DEBUG] Sweeper (aws_efs_file_system) has dependency (aws_efs_access_point), running..
2022/12/07 09:00:52 [DEBUG] Running Sweeper (aws_efs_access_point) in region (us-west-2)
2022/12/07 09:00:53 [DEBUG] Completed Sweeper (aws_efs_access_point) in region (us-west-2) in 792.736597ms
2022/12/07 09:00:53 [DEBUG] Running Sweeper (aws_efs_file_system) in region (us-west-2)
2022/12/07 09:00:53 [DEBUG] Waiting for state to become: [success]
2022/12/07 09:00:53 [DEBUG] Waiting for state to become: [success]
2022/12/07 09:00:53 [DEBUG] Waiting for state to become: [success]
2022/12/07 09:00:53 [DEBUG] Waiting for state to become: [success]
2022/12/07 09:00:53 [DEBUG] Deleting EFS file system: fs-073dd19e55a051c09
2022/12/07 09:00:53 [DEBUG] Deleting EFS file system: fs-09e2aea617fd23f12
2022/12/07 09:00:53 [DEBUG] Waiting for state to become: [success]
2022/12/07 09:00:53 [DEBUG] Deleting EFS file system: fs-041e199759ff23f15
2022/12/07 09:00:53 [DEBUG] Deleting EFS file system: fs-04c378ed4c210bfbc
2022/12/07 09:00:53 [DEBUG] Deleting EFS file system: fs-0d82a2fb2231b6507
2022/12/07 09:00:53 [DEBUG] Waiting for state to become: [success]
2022/12/07 09:00:53 [DEBUG] Deleting EFS file system: fs-05c167e812e6d4388
2022/12/07 09:00:53 [DEBUG] Waiting for state to become: []
2022/12/07 09:00:53 [DEBUG] Waiting for state to become: []
2022/12/07 09:00:53 [DEBUG] Waiting for state to become: []
2022/12/07 09:00:53 [DEBUG] Waiting for state to become: []
2022/12/07 09:00:53 [DEBUG] Waiting for state to become: []
2022/12/07 09:00:53 [DEBUG] Waiting for state to become: []
2022/12/07 09:00:55 [DEBUG] Completed Sweeper (aws_efs_file_system) in region (us-west-2) in 2.66379168s
2022/12/07 09:00:55 [DEBUG] Sweeper (aws_efs_mount_target) already ran in region (us-west-2)
2022/12/07 09:00:55 [DEBUG] Sweeper (aws_efs_access_point) already ran in region (us-west-2)
2022/12/07 09:00:55 Completed Sweepers for region (us-west-2) in 5.32497365s
2022/12/07 09:00:55 Sweeper Tests for region (us-west-2) ran successfully:
	- aws_efs_mount_target
	- aws_efs_access_point
	- aws_efs_file_system
2022/12/07 09:00:55 [DEBUG] Running Sweepers for region (us-east-1):
2022/12/07 09:00:55 [DEBUG] Sweeper (aws_efs_file_system) has dependency (aws_efs_mount_target), running..
2022/12/07 09:00:55 [DEBUG] Running Sweeper (aws_efs_mount_target) in region (us-east-1)
2022/12/07 09:00:55 [INFO] Retrieved credentials from "EnvConfigCredentials"
2022/12/07 09:00:55 [DEBUG] Trying to get account information via sts:GetCallerIdentity
2022/12/07 09:00:55 [DEBUG] Trying to get account information via sts:GetCallerIdentity
2022/12/07 09:00:56 [DEBUG] Completed Sweeper (aws_efs_mount_target) in region (us-east-1) in 605.180075ms
2022/12/07 09:00:56 [DEBUG] Sweeper (aws_efs_file_system) has dependency (aws_efs_access_point), running..
2022/12/07 09:00:56 [DEBUG] Running Sweeper (aws_efs_access_point) in region (us-east-1)
2022/12/07 09:00:56 [DEBUG] Completed Sweeper (aws_efs_access_point) in region (us-east-1) in 180.629965ms
2022/12/07 09:00:56 [DEBUG] Running Sweeper (aws_efs_file_system) in region (us-east-1)
2022/12/07 09:00:56 [DEBUG] Waiting for state to become: [success]
2022/12/07 09:00:56 [DEBUG] Waiting for state to become: [success]
2022/12/07 09:00:56 [DEBUG] Deleting EFS file system: fs-0f636aa34055fb5d7
2022/12/07 09:00:56 [DEBUG] Deleting EFS file system: fs-035226665d6177b09
2022/12/07 09:00:56 [DEBUG] Waiting for state to become: [success]
2022/12/07 09:00:56 [DEBUG] Deleting EFS file system: fs-0fc6ccbe73078a1bd
2022/12/07 09:00:56 [DEBUG] Waiting for state to become: []
2022/12/07 09:00:56 [DEBUG] Waiting for state to become: []
2022/12/07 09:00:56 [DEBUG] Waiting for state to become: []
2022/12/07 09:00:58 [DEBUG] Completed Sweeper (aws_efs_file_system) in region (us-east-1) in 2.285737839s
2022/12/07 09:00:58 [DEBUG] Sweeper (aws_efs_mount_target) already ran in region (us-east-1)
2022/12/07 09:00:58 [DEBUG] Sweeper (aws_efs_access_point) already ran in region (us-east-1)
2022/12/07 09:00:58 Completed Sweepers for region (us-east-1) in 3.071800966s
2022/12/07 09:00:58 Sweeper Tests for region (us-east-1) ran successfully:
	- aws_efs_mount_target
	- aws_efs_access_point
	- aws_efs_file_system
2022/12/07 09:00:58 [DEBUG] Running Sweepers for region (us-east-2):
2022/12/07 09:00:58 [DEBUG] Sweeper (aws_efs_file_system) has dependency (aws_efs_mount_target), running..
2022/12/07 09:00:58 [DEBUG] Running Sweeper (aws_efs_mount_target) in region (us-east-2)
2022/12/07 09:00:58 [INFO] Retrieved credentials from "EnvConfigCredentials"
2022/12/07 09:00:58 [DEBUG] Trying to get account information via sts:GetCallerIdentity
2022/12/07 09:00:59 [DEBUG] Trying to get account information via sts:GetCallerIdentity
2022/12/07 09:00:59 [DEBUG] Completed Sweeper (aws_efs_mount_target) in region (us-east-2) in 419.305891ms
2022/12/07 09:00:59 [DEBUG] Sweeper (aws_efs_file_system) has dependency (aws_efs_access_point), running..
2022/12/07 09:00:59 [DEBUG] Running Sweeper (aws_efs_access_point) in region (us-east-2)
2022/12/07 09:00:59 [DEBUG] Completed Sweeper (aws_efs_access_point) in region (us-east-2) in 35.650542ms
2022/12/07 09:00:59 [DEBUG] Running Sweeper (aws_efs_file_system) in region (us-east-2)
2022/12/07 09:00:59 [DEBUG] Completed Sweeper (aws_efs_file_system) in region (us-east-2) in 38.064851ms
2022/12/07 09:00:59 [DEBUG] Sweeper (aws_efs_mount_target) already ran in region (us-east-2)
2022/12/07 09:00:59 [DEBUG] Sweeper (aws_efs_access_point) already ran in region (us-east-2)
2022/12/07 09:00:59 Completed Sweepers for region (us-east-2) in 493.335806ms
2022/12/07 09:00:59 Sweeper Tests for region (us-east-2) ran successfully:
	- aws_efs_mount_target
	- aws_efs_access_point
	- aws_efs_file_system
ok  	github.com/hashicorp/terraform-provider-aws/internal/sweep	13.365s

@github-actions
Copy link

github-actions bot commented Dec 7, 2022

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added generators Relates to code generators. service/efs Issues and PRs that pertain to the efs service. sweeper Pertains to changes to or issues with the sweeper. size/XL Managed by automation to categorize the size of a PR. labels Dec 7, 2022
@ewbankkit ewbankkit merged commit b97800c into main Dec 7, 2022
@ewbankkit ewbankkit deleted the s-aws_efs_file_system-crash branch December 7, 2022 14:40
@github-actions github-actions bot added this to the v4.46.0 milestone Dec 7, 2022
github-actions bot pushed a commit that referenced this pull request Dec 7, 2022
@github-actions
Copy link

github-actions bot commented Dec 8, 2022

This functionality has been released in v4.46.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. Thank you!

@github-actions
Copy link

github-actions bot commented Jan 8, 2023

I'm going to lock this pull request 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 related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
generators Relates to code generators. service/efs Issues and PRs that pertain to the efs service. size/XL Managed by automation to categorize the size of a PR. sweeper Pertains to changes to or issues with the sweeper.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

r/aws_efs_file_system: Sweeper crash
1 participant