Last active
November 5, 2020 23:51
-
-
Save ap1kenobi/d2d7986d39f0ca1ff177bba154984b83 to your computer and use it in GitHub Desktop.
Removes all backups (aka recovery points) inside a AWS Backup vault
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
echo "Enter the region of the vault where all backups should be deleted" | |
read REGION | |
echo "Enter the name of the vault where all backups should be deleted" | |
read VAULT_NAME | |
for ARN in $(aws backup list-recovery-points-by-backup-vault --backup-vault-name "${VAULT_NAME}" --query 'RecoveryPoints[].RecoveryPointArn' --output text --region "${REGION}"); do | |
echo "deleting ${ARN} ..." | |
aws backup delete-recovery-point --backup-vault-name "${VAULT_NAME}" --recovery-point-arn "${ARN}" --region "${REGION} | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment