Delete AWS Backup artifacts
AWS Backup is a great utility, but when you are cleaning up an account it takes a long time to remove all the backup artifacts by hand in the console. So instead I present this one-liner
Single Region
$ aws --region us-east-1 backup list-recovery-points-by-backup-vault --backup-vault-name default | jq '.RecoveryPoints' | jq -c -r '.[].RecoveryPointArn' | xargs --max-lines=1 aws --region us-east-1 backup delete-recovery-point --backup-vault-name default --recovery-point-arn
Multiple Regions
$ regions=us-east-1,us-west-2; for region in $regions; do aws --region ${region} backup list-recovery-points-by-backup-vault --backup-vault-name default | jq '.RecoveryPoints' | jq -c -r '.[].RecoveryPointArn' | xargs --max-lines=1 aws --region ${region} backup delete-recovery-point --backup-vault-name default --recovery-point-arn; done