Skip to content

Instantly share code, notes, and snippets.

@ojacques
Created January 11, 2023 13:42
Show Gist options
  • Save ojacques/578cce2b77c868e2775f4f64de77a23a to your computer and use it in GitHub Desktop.
Save ojacques/578cce2b77c868e2775f4f64de77a23a to your computer and use it in GitHub Desktop.
AWS delete backup recovery points earlier than a date
VAULT=<your vault here>
for ARN in $(aws backup list-recovery-points-by-backup-vault --backup-vault-name "$VAULT" --query 'RecoveryPoints[].RecoveryPointArn' --output text --region eu-west-1 --by-created-before 1672580151); do
echo "deleting $ARN"
aws backup delete-recovery-point --recovery-point-arn $ARN --region eu-west-1 --backup-vault-name "$VAULT"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment