Skip to content

Instantly share code, notes, and snippets.

@hatchcanon
Created April 5, 2021 21:30
Show Gist options
  • Save hatchcanon/459ba4eaadbd6f8983581a92cdd9eaeb to your computer and use it in GitHub Desktop.
Save hatchcanon/459ba4eaadbd6f8983581a92cdd9eaeb to your computer and use it in GitHub Desktop.
bulk delete multiple AWS snapshots using AWS CLI
file="filewithsnapshotids.txt"
cat $file | tr -d '\r' | while read -r line;
do
aws ec2 delete-snapshot --snapshot-id $line
echo "Deleting snapshot $line"
done
@m0fugga
Copy link

m0fugga commented Dec 2, 2022

Thanks exactly what I needed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment