Created
March 5, 2021 18:59
-
-
Save MohamedMohsenX2/21af5cd743d7074dea4bd5234a8ef855 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 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); do | |
echo "deleting ${ARN} ..." | |
aws backup delete-recovery-point --backup-vault-name "${VAULT_NAME}" --recovery-point-arn "${ARN}" | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment