-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
sweeper/backup_vault: add sweeper with concurrency #19886
Conversation
terraform-provider-aws/aws/resource_aws_backup_vault.go Lines 139 to 152 in 00c665d
I'd suggest changing the Delete handler code to input := &backup.DeleteBackupVaultInput{
BackupVaultName: aws.String(d.Id()),
} |
7acfb92
to
bc25be9
Compare
…s that can't be removed
@ewbankkit , also added in a condition to catch skip over backups created by EFS. or do you think there are acceptance tests related to EFS that could be adjusted to make sure their backups can be deleted later on? |
Support for automated EFS backups are requested in #14372. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀.
% TEST=./aws SWEEP=us-east-1,us-east-2,us-west-1,us-west-2 SWEEPARGS=-sweep-run=aws_backup_vault make sweep
WARNING: This will destroy infrastructure. Use only in development accounts.
go test ./aws -v -sweep=us-east-1,us-east-2,us-west-1,us-west-2 -sweep-run=aws_backup_vault -timeout 60m
2021/06/18 14:16:05 [DEBUG] Running Sweepers for region (us-east-1):
2021/06/18 14:16:05 [DEBUG] Running Sweeper (aws_backup_vault_notifications) in region (us-east-1)
2021/06/18 14:16:05 [INFO] AWS Auth provider used: "EnvProvider"
2021/06/18 14:16:05 [DEBUG] Trying to get account information via sts:GetCallerIdentity
2021/06/18 14:16:05 [DEBUG] Trying to get account information via sts:GetCallerIdentity
2021/06/18 14:16:06 [INFO] Deleting Backup Vault Notifications Default
2021/06/18 14:16:06 [DEBUG] Sweeper (aws_backup_vault) has dependency (aws_backup_vault_notifications), running..
2021/06/18 14:16:06 [DEBUG] Sweeper (aws_backup_vault_notifications) already ran in region (us-east-1)
2021/06/18 14:16:06 [DEBUG] Sweeper (aws_backup_vault) has dependency (aws_backup_vault_policy), running..
2021/06/18 14:16:06 [DEBUG] Running Sweeper (aws_backup_vault_policy) in region (us-east-1)
2021/06/18 14:16:06 [INFO] Deleting Backup Vault Policies Default
2021/06/18 14:16:06 [DEBUG] Running Sweeper (aws_backup_vault) in region (us-east-1)
2021/06/18 14:16:06 [INFO] Skipping Backup Vault: Default
2021/06/18 14:16:06 [DEBUG] Sweeper (aws_backup_vault_policy) already ran in region (us-east-1)
2021/06/18 14:16:06 Sweeper Tests ran successfully:
- aws_backup_vault_notifications
- aws_backup_vault_policy
- aws_backup_vault
2021/06/18 14:16:06 [DEBUG] Running Sweepers for region (us-east-2):
2021/06/18 14:16:06 [DEBUG] Running Sweeper (aws_backup_vault_policy) in region (us-east-2)
2021/06/18 14:16:06 [INFO] AWS Auth provider used: "EnvProvider"
2021/06/18 14:16:06 [DEBUG] Trying to get account information via sts:GetCallerIdentity
2021/06/18 14:16:06 [DEBUG] Trying to get account information via sts:GetCallerIdentity
2021/06/18 14:16:08 [DEBUG] No Backup Vault Policies to sweep
2021/06/18 14:16:08 [DEBUG] Running Sweeper (aws_backup_vault_notifications) in region (us-east-2)
2021/06/18 14:16:08 [DEBUG] No Backup Vault Notifications to sweep
2021/06/18 14:16:08 [DEBUG] Sweeper (aws_backup_vault) has dependency (aws_backup_vault_notifications), running..
2021/06/18 14:16:08 [DEBUG] Sweeper (aws_backup_vault_notifications) already ran in region (us-east-2)
2021/06/18 14:16:08 [DEBUG] Sweeper (aws_backup_vault) has dependency (aws_backup_vault_policy), running..
2021/06/18 14:16:08 [DEBUG] Sweeper (aws_backup_vault_policy) already ran in region (us-east-2)
2021/06/18 14:16:08 [DEBUG] Running Sweeper (aws_backup_vault) in region (us-east-2)
2021/06/18 14:16:08 Sweeper Tests ran successfully:
- aws_backup_vault_policy
- aws_backup_vault_notifications
- aws_backup_vault
2021/06/18 14:16:08 [DEBUG] Running Sweepers for region (us-west-1):
2021/06/18 14:16:08 [DEBUG] Running Sweeper (aws_backup_vault_policy) in region (us-west-1)
2021/06/18 14:16:08 [INFO] AWS Auth provider used: "EnvProvider"
2021/06/18 14:16:08 [DEBUG] Trying to get account information via sts:GetCallerIdentity
2021/06/18 14:16:08 [DEBUG] Trying to get account information via sts:GetCallerIdentity
2021/06/18 14:16:09 [DEBUG] No Backup Vault Policies to sweep
2021/06/18 14:16:09 [DEBUG] Running Sweeper (aws_backup_vault_notifications) in region (us-west-1)
2021/06/18 14:16:10 [DEBUG] No Backup Vault Notifications to sweep
2021/06/18 14:16:10 [DEBUG] Sweeper (aws_backup_vault) has dependency (aws_backup_vault_notifications), running..
2021/06/18 14:16:10 [DEBUG] Sweeper (aws_backup_vault_notifications) already ran in region (us-west-1)
2021/06/18 14:16:10 [DEBUG] Sweeper (aws_backup_vault) has dependency (aws_backup_vault_policy), running..
2021/06/18 14:16:10 [DEBUG] Sweeper (aws_backup_vault_policy) already ran in region (us-west-1)
2021/06/18 14:16:10 [DEBUG] Running Sweeper (aws_backup_vault) in region (us-west-1)
2021/06/18 14:16:10 Sweeper Tests ran successfully:
- aws_backup_vault_policy
- aws_backup_vault_notifications
- aws_backup_vault
2021/06/18 14:16:10 [DEBUG] Running Sweepers for region (us-west-2):
2021/06/18 14:16:10 [DEBUG] Running Sweeper (aws_backup_vault_policy) in region (us-west-2)
2021/06/18 14:16:10 [INFO] AWS Auth provider used: "EnvProvider"
2021/06/18 14:16:10 [DEBUG] Trying to get account information via sts:GetCallerIdentity
2021/06/18 14:16:10 [DEBUG] Trying to get account information via sts:GetCallerIdentity
2021/06/18 14:16:12 [INFO] Deleting Backup Vault Policies Default
2021/06/18 14:16:12 [INFO] Deleting Backup Vault Policies aws/efs/automatic-backup-vault
2021/06/18 14:16:13 [DEBUG] Running Sweeper (aws_backup_vault_notifications) in region (us-west-2)
2021/06/18 14:16:13 [INFO] Deleting Backup Vault Notifications Default
2021/06/18 14:16:14 [INFO] Deleting Backup Vault Notifications aws/efs/automatic-backup-vault
2021/06/18 14:16:14 [DEBUG] Sweeper (aws_backup_vault) has dependency (aws_backup_vault_notifications), running..
2021/06/18 14:16:14 [DEBUG] Sweeper (aws_backup_vault_notifications) already ran in region (us-west-2)
2021/06/18 14:16:14 [DEBUG] Sweeper (aws_backup_vault) has dependency (aws_backup_vault_policy), running..
2021/06/18 14:16:14 [DEBUG] Sweeper (aws_backup_vault_policy) already ran in region (us-west-2)
2021/06/18 14:16:14 [DEBUG] Running Sweeper (aws_backup_vault) in region (us-west-2)
2021/06/18 14:16:14 [INFO] Skipping Backup Vault: Default
2021/06/18 14:16:14 [INFO] Skipping Backup Vault: aws/efs/automatic-backup-vault
2021/06/18 14:16:14 Sweeper Tests ran successfully:
- aws_backup_vault
- aws_backup_vault_policy
- aws_backup_vault_notifications
ok github.com/terraform-providers/terraform-provider-aws/aws 13.916s
This functionality has been released in v3.47.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! |
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. |
Community Note
Closes #19847
Relates #15334
Output from acceptance testing: