Created
October 17, 2023 01:55
-
-
Save srkiNZ84/f4ad8bee7a0759bada85de7013373feb to your computer and use it in GitHub Desktop.
Bash script to delete all AWS backup recovery points in a 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 | |
# Run: | |
# aws backup list-recovery-points-by-backup-vault --backup-vault-name aft-controltower-backup-vault | jq --raw-output ".RecoveryPoints[].RecoveryPointArn" > /tmp/aft_recovery_point_arns.txt | |
# first to get the list of recovery points to delete. Then run this script with the filename as the argument | |
# e.g. | |
# aft_delete_recovery_points.sh /tmp/aft_recovery_point_arns.txt | |
while read -r line; do | |
echo "deleting recovery point: $line" | |
aws backup delete-recovery-point --backup-vault-name aft-controltower-backup-vault --recovery-point-arn "$line" | |
done < "$1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment