Skip to content

Instantly share code, notes, and snippets.

@MohamedMohsenX2
Created March 5, 2021 18:59
Show Gist options
  • Save MohamedMohsenX2/21af5cd743d7074dea4bd5234a8ef855 to your computer and use it in GitHub Desktop.
Save MohamedMohsenX2/21af5cd743d7074dea4bd5234a8ef855 to your computer and use it in GitHub Desktop.
Removes all backups (aka recovery points) inside a AWS Backup vault
#!/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